ENH: Hoist adjustValidNeighbors into NeighborUtilities - #1717
Open
imikejackson wants to merge 2 commits into
Open
ENH: Hoist adjustValidNeighbors into NeighborUtilities#1717imikejackson wants to merge 2 commits into
imikejackson wants to merge 2 commits into
Conversation
Summary: - Found and fixed 2 bugs, both port omissions of behaviour DREAM3D 6.5.171 already had: (1) the X/Y/Z Direction parameters were declared, converted from SIMPL, and copied into InputValues but never read by Algorithms/ErodeDilateMask.cpp, so all six face neighbours were always visited (6.5.171 honoured them at ErodeDilateMask.cpp:227-247, making this a port regression with no deviation entry, same defect class as ErodeDilateBadDataFilter-D1 and fixed with that PR's adjustValidNeighbors pattern); (2) NumIterations <= 0 was accepted silently and no-op'd, where 6.5.171 rejected it in dataCheck with error -5555; - resolved the 1 documented deviation from DREAM3D 6.5.171 (ErodeDilateMaskFilter-D1, NumIterations <= 0) by restoring the legacy guard per the requester's 2026-08-19 product decision to match legacy — ErodeDilateMaskFilter::preflightImpl now errors with code -14701 (SIMPLNX code space, adjacent to the sibling ErodeDilateBadDataFilter's -146xx block; legacy's -5555 is already taken elsewhere in SIMPLNX) and a message carrying the offending value; no parameter keys change, so parametersVersion stays at 1 and the deviation entry is kept with Status: retired as a record of the historical difference; - added 1 negative test (Invalid Number of Iterations) written and confirmed failing before the guard existed, preflighting NumIterations of 0 and -2 and asserting an invalid result and error code -14701; - retired 2 tests (the 6.6-derived exemplar consumers for Dilate and Erode — both exemplars were generated with all three directions on, so neither could discriminate direction gating and both passed with the regression present); - unit tests replaced with 7 inlined *Class 1 (Analytical)* test fixtures, each expected index set hand-derived from the face-neighbour contract before the filter was run; - added 2 V&V source-tree deliverables (report, deviations) — no provenance file, because no exemplar archive is consumed any more: the oracle is inlined in the test and the 6.6 archive stays in test/CMakeLists.txt only for the sibling erode/dilate tests. All 9 test cases pass (315 assertions) in NX-Com-Qt69-Vtk96-Rel. Status is READY FOR REVIEW rather than COMPLETE: sign-off on the oracle design is delegated to the PR reviewer (requester decision 2026-08-19). Out-of-core build runs were waived by the requester on 2026-08-19. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
The direction-flag gating helper existed as byte-identical file-local copies in the ErodeDilateBadData and ErodeDilateMask algorithms; its axis-to-face mapping has been re-derived incorrectly once before (ErodeDilateBadDataFilter-D1 branch-history note), so a single canonical copy removes the drift risk before a third erode/dilate-family filter needs it. No behavior change; the Mask direction-flag oracle tests pin the mapping empirically. Historical line citations in the ErodeDilateBadData V&V documents refer to the pre-hoist file layout. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
imikejackson
force-pushed
the
refactor/adjust-valid-neighbors-hoist
branch
from
August 24, 2026 14:13
8d2b080 to
81472d6
Compare
nyoungbq
approved these changes
Aug 25, 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.
Summary
De-duplicates the direction-flag gating helper used by the erode/dilate filter family.
adjustValidNeighborsexisted as byte-identical file-local copies in theErodeDilateBadDataandErodeDilateMaskalgorithms. Its axis-to-face mapping has been re-derived incorrectly once before (ErodeDilateBadDataFilter-D1branch-history note), so a single canonical copy inNeighborUtilities.hppremoves the drift risk before a third family filter needs it.Stacked on #1713 — this branch contains the
ErodeDilateMaskV&V commit, so the diff shows both commits until #1713 merges. Merge after #1713; the hoist commit itself touches only three files (NeighborUtilities.hppand the two algorithm.cppfiles).Test Plan
ctest -R "SimplnxCore::ErodeDilate"— 18/18 pass, including the three Mask direction-flag oracles that discriminate axis-mapping errors