test(glcm,convex-hull): precise vetted-comment wording; pin convex-hull oracle to offset_coordinates=False#364
Open
sameeul wants to merge 1 commit into
Conversation
…ll oracle to skimage offset_coordinates=False Follow-up to the PR PolusAI#356 / PolusAI#357 reviews (both merged). test_glcm.h (PolusAI#356 follow-up): correct the vetted-map comment, no value changes. SUMENTROPY is the dimensionless entropy of the SUM distribution p_{x+y}, not a difference-based feature; and the vetted keys are invariant to a level RELABELING (origin shift), not to level scaling -- they coincide with the symmetric-matrix oracle only because this phantom's binning relabels without rescaling. test_shape_morphology_2d.h (PolusAI#357 follow-up): vet CONVEX_HULL_AREA / SOLIDITY against skimage convex_hull_image(offset_coordinates=False) (27 / 0.9629630), which Nyxus's pixel-centre hull reproduces exactly, instead of the regionprops default (28 / 0.9286). Tighten the tolerance 10% -> 1% (frac_tolerance 10 -> 100); the hull area is a provably-exact integer lattice count, so 1% is float slack and now catches a >=1 px regression. Test-only; the new goldens equal Nyxus's actual output for these fixtures.
darkclad
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the reviews on #356 and #357 (both merged). Test-only.
#356 comment precision (
tests/test_glcm.h)Two wording corrections in the vetted-map comment, no value changes:
|i−j|". It doesn't — it's the dimensionless entropy of the SUM distributionp_{x+y}. It's still correctly vetted (a dimensionless entropy is level-value-invariant), but the stated reason didn't apply to it.#357 tighter convex-hull oracle (
tests/test_shape_morphology_2d.h)The merged test vets
CONVEX_HULL_AREA/SOLIDITYagainst skimage regionprops' default (28/0.9286) at a 10% tolerance. Since Nyxus hulls through pixel centres, it reproduces skimageconvex_hull_image(offset_coordinates=False)== 27 exactly (SOLIDITY26/27). This PR pins to that convention and tightens the tolerance 10% → 1% (frac_tolerance10 → 100).Rationale: the hull area is a provably-exact integer lattice count, so 1% is float/platform slack rather than a convention fudge, and the check now catches a ≥1 px regression (the old 10% band accepted ±2.8 px). The +1 px regionprops-default (
offset_coordinates=Truecorner expansion → 28) is documented in the comment as the reason we pin theoffset_coordinates=Falsevalue instead.The new goldens equal Nyxus's actual output for these fixtures (they were the pre-#357 regression-snapshot values), so no runtime behavior changes and both C++ tests pass unchanged.