Skip to content

BUG: Require Feature Ids in the geometry's Cell Attribute Matrix for filters that modify it - #1829

Merged
imikejackson merged 16 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/strict_featureids_cell_data
Oct 21, 2026
Merged

imikejackson merged 16 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/strict_featureids_cell_data

Conversation

@imikejackson

@imikejackson imikejackson commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

These filters take Cell Feature Ids and an Image Geometry (QuickSurfaceMesh also accepts a Rectilinear Grid). They modify Feature Ids, the other arrays in the same Attribute Matrix, or the Feature Attribute Matrix. Their algorithms are spatial: they use the geometry's dimensions or cell neighbors. Before this change, any Feature Ids DataArray was accepted, and each filter found the arrays to modify through featureIds.getParent(). If Feature Ids lived in a different Attribute Matrix, the filter modified the wrong arrays and left the geometry's Cell Attribute Matrix out of sync. Preflight gave no error.

New rule for these filters:

  1. Cell Feature Ids must be a child of the selected geometry's Cell Attribute Matrix (the matrix the geometry points to, not any matrix with the same number of tuples).
  2. Preflight and execute take the arrays to modify from the geometry's Cell Attribute Matrix.
  3. Every other Cell array that the filter modifies, and every entry in an "arrays to ignore" list, must be in that same Attribute Matrix. An ignore list is checked only when the filter uses it (for example, only when Fill is on).
  4. Removal filters: the Feature Attribute Matrix (the parent of the ranking, flagged, Number of Neighbors or Num. Cells array) must be an Attribute Matrix directly under the geometry, and must not be its Cell Attribute Matrix.

Arrays that a filter only reads keep the existing rule: their number of tuples must match, and any Attribute Matrix is allowed.

The checks use new helpers in DataArrayUtilities (ValidateArrayInGeometryCellData, ValidateArraysInGeometryCellData, ValidateFeatureAttributeMatrixInGeometry). The helpers compare objects, not path strings. An Attribute Matrix that can be reached by more than one DataPath (for example, a geometry inside a montage) is therefore accepted. The filters then rewrite the selected paths to the geometry's Cell Attribute Matrix path, so an ignored array that was selected through the other path is still ignored.

Each filter has its own commit, regression tests that fail on develop, and a short paragraph in its documentation. No test data archive is added or changed.

Behavior changes (new preflight errors)

Filter Feature Ids Other Cell arrays Feature Attribute Matrix
ErodeDilateBadData −14605 Attribute Arrays to Ignore −14604 —
ErodeDilateCoordinationNumber −16801 Attribute Arrays to Ignore −16802 —
FillBadData −16501 Cell Phases (when Store Defects as New Phase is on) −16502; Attribute Arrays to Ignore −16503 —
KeepRemoveRankedFeatures −78125 Attribute Arrays to Ignore (Fill on) −78126 −78127 (replaces −78100)
RemoveFlaggedFeatures −9893 (all operations) Attribute Arrays to Ignore (removing with Fill on) −9894 −9895 (replaces −9892)
RequireMinNumNeighbors −55575; the existing tuple-count check −55571 is kept, because Cell Attribute Matrix membership does not guarantee one tuple per cell Cell Arrays to Ignore −55573 −55574
RequireMinimumSizeFeatures −5562 — −5563 (replaces −5557)
QuickSurfaceMesh Both modes: number of tuples must equal the geometry's number of cells, −76533 (no check before). Fix Problem Voxels on: also −76532, and preflight now reports Feature Ids as modified. — —

FillBadData also had an inconsistency: preflight reported the arrays under Feature Ids' parent as modified, while execute modified the geometry's Cell Attribute Matrix. Both now use the geometry's Cell Attribute Matrix.

Review fixes (commits after 01f0d25)

  • RequireMinNumNeighbors keeps the -55571 tuple-count check after the new membership check. The algorithm iterates the geometry's cell count over the Feature Ids store, so the check is still needed.
  • QuickSurfaceMesh runs the -76533 tuple-count check in both modes, then the -76532 membership check only when fixing problem voxels.
  • ValidateFeatureAttributeMatrixInGeometry now decides "directly under the geometry" with geometry->contains(attributeMatrix) instead of resolving the selected path's parent, so it compares objects like the two Cell helpers.
  • The two ErodeDilate algorithms no longer rebuild the Feature Ids path; executeImpl is the single normalization point.
  • Test include blocks restored; ErodeDilateBadData and FillBadData V&V reports list the new preflight paths and tests.

Not in this PR

Crop Geometry (Image) and Resample Data (Image Geometry) with Renumber Features need the same Feature Ids rule. Execute builds the renumbered Feature Ids path from the Cell Attribute Matrix name, so a Feature Ids array that lives elsewhere causes a null dereference in SamplingUtils.hpp. Those two filters are being reworked on topic/correct_feature_am_updates, so their check will go there, to avoid conflicts.

Note for reviewers

topic/correct_feature_am_updates also edits the end of preflightImpl in the four removal filters, plus ErodeDilateBadDataTest, FillBadDataTest, RemoveFlaggedFeaturesTest, two docs and vv/RemoveFlaggedFeaturesFilter.md. New code in this PR is placed away from those lines where possible. The remaining conflicts should be small.

Test plan

  • Each new regression test passes. Each one fails on develop because preflight accepts the misplaced array.
  • RemoveFlaggedFeatures and FillBadData tests pass for both algorithm scenarios.
  • The full test suite passes (3223 of 3224 locally on macOS; the test not run needs Python, which the local build does not include).
  • The 15 uses of these filters in the shipped pipelines (simplnx, DREAM3D-NX, plugins) already follow the rule. Preflighting every simplnx example pipeline shows no new errors.
  • CI passes on all supported platforms.

@imikejackson
imikejackson force-pushed the topic/strict_featureids_cell_data branch from 7749cd5 to 01f0d25 Compare October 19, 2026 17:26
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 19, 2026
…bjects

Review fixes for PR BlueQuartzSoftware#1829.

- RequireMinNumNeighbors: restore the -55571 check (Feature Ids tuples ==
  Image Geometry cells). Membership in the Cell Attribute Matrix does not
  imply the tuple count matches the geometry, and the algorithm iterates the
  geometry's cell count over the Feature Ids store with no guard. The -55575
  membership check stays; -55571 runs right after it. Test, doc bullet, and
  V&V rows restored.
- QuickSurfaceMesh: run the -76533 tuple-count check in both modes, then the
  -76532 membership check only when Fix Problem Voxels is on. The mesher has
  the same overrun with the option on.
- ValidateFeatureAttributeMatrixInGeometry: decide "directly under the
  geometry" with geometry->contains(attributeMatrix) instead of resolving the
  selected path's parent, so an Attribute Matrix reachable through more than
  one DataPath is accepted, the same as the two Cell helpers. DataArrayTest
  covers the alias case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 19, 2026
…lude blocks

Review fixes for PR BlueQuartzSoftware#1829.

- ErodeDilateBadData and ErodeDilateCoordinationNumber algorithms rebuilt the
  Feature Ids path from the geometry's Cell Attribute Matrix, duplicating the
  rewrite their filters' executeImpl already perform. Revert the algorithm
  files so executeImpl is the single normalization point, as in the other six
  filters.
- Put the new simplnx/DataStructure includes in the simplnx include block of
  each test file instead of above catch2 or inside the SimplnxCore block, and
  move back the includes that had been pulled out of their block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 19, 2026
…lBadData V&V reports

Review fix for PR BlueQuartzSoftware#1829. Adds the -14604/-14605 and -16501..-16503 preflight
paths and the Strict Feature Ids / Cell AM Alias test cases to the path and
test-inventory tables, matching the updates already made for
RemoveFlaggedFeatures and RequireMinNumNeighbors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@imikejackson imikejackson left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a review.

imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 20, 2026
…bjects

Review fixes for PR BlueQuartzSoftware#1829.

- RequireMinNumNeighbors: restore the -55571 check (Feature Ids tuples ==
  Image Geometry cells). Membership in the Cell Attribute Matrix does not
  imply the tuple count matches the geometry, and the algorithm iterates the
  geometry's cell count over the Feature Ids store with no guard. The -55575
  membership check stays; -55571 runs right after it. Test, doc bullet, and
  V&V rows restored.
- QuickSurfaceMesh: run the -76533 tuple-count check in both modes, then the
  -76532 membership check only when Fix Problem Voxels is on. The mesher has
  the same overrun with the option on.
- ValidateFeatureAttributeMatrixInGeometry: decide "directly under the
  geometry" with geometry->contains(attributeMatrix) instead of resolving the
  selected path's parent, so an Attribute Matrix reachable through more than
  one DataPath is accepted, the same as the two Cell helpers. DataArrayTest
  covers the alias case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 20, 2026
…lude blocks

Review fixes for PR BlueQuartzSoftware#1829.

- ErodeDilateBadData and ErodeDilateCoordinationNumber algorithms rebuilt the
  Feature Ids path from the geometry's Cell Attribute Matrix, duplicating the
  rewrite their filters' executeImpl already perform. Revert the algorithm
  files so executeImpl is the single normalization point, as in the other six
  filters.
- Put the new simplnx/DataStructure includes in the simplnx include block of
  each test file instead of above catch2 or inside the SimplnxCore block, and
  move back the includes that had been pulled out of their block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 20, 2026
…lBadData V&V reports

Review fix for PR BlueQuartzSoftware#1829. Adds the -14604/-14605 and -16501..-16503 preflight
paths and the Strict Feature Ids / Cell AM Alias test cases to the path and
test-inventory tables, matching the updates already made for
RemoveFlaggedFeatures and RequireMinNumNeighbors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@imikejackson
imikejackson force-pushed the topic/strict_featureids_cell_data branch from 02e48cc to 4488feb Compare October 20, 2026 23:05
@imikejackson

Copy link
Copy Markdown
Contributor Author

@joeykleingers All 4 comments are addressed in 4488feb. Each thread has a reply and is resolved. The branch is also rebased onto the current develop (#1817). The only conflict was the include block in test/DataArrayTest.cpp. Please review again.

Comment thread test/DataArrayTest.cpp Resolved
imikejackson and others added 12 commits October 21, 2026 08:11
…tions

ValidateArrayInGeometryCellData and ValidateArraysInGeometryCellData check
that DataArrays are children of a grid geometry's Cell Attribute Matrix
(by object identity, so a shared Attribute Matrix reached through another
path is accepted). ValidateFeatureAttributeMatrixInGeometry checks that a
Feature Attribute Matrix is directly under the geometry and is not its
Cell Attribute Matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ttribute Matrix

The filter modifies Feature Ids and its sibling Cell arrays, so Cell
Feature Ids must be a child of the selected Image Geometry's Cell
Attribute Matrix, not any Attribute Matrix with a matching tuple count.
Every Attribute Array to Ignore must also be in that Attribute Matrix.
Preflight and execute now take the modified arrays from the
geometry's Cell Attribute Matrix. New errors: -14605 (Feature Ids), -14604 (Attribute Arrays to Ignore).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry's Cell Attribute Matrix

The filter modifies Feature Ids and its sibling Cell arrays, so Cell
Feature Ids must be a child of the selected Image Geometry's Cell
Attribute Matrix, not any Attribute Matrix with a matching tuple count.
Every Attribute Array to Ignore must also be in that Attribute Matrix.
Preflight and execute now take the modified arrays from the
geometry's Cell Attribute Matrix. New errors: -16801 (Feature Ids), -16802 (Attribute Arrays to Ignore).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Matrix

The filter modifies Feature Ids and its sibling Cell arrays, so Cell
Feature Ids must be a child of the selected Image Geometry's Cell
Attribute Matrix, not any Attribute Matrix with a matching tuple count.
Every Attribute Array to Ignore, and Cell Phases when Store Defects as New
Phase is on, must also be in that Attribute Matrix. Preflight reported
the arrays under Feature Ids' parent while execute modified the
geometry's Cell Attribute Matrix; both now use the latter.
Preflight and execute now take the modified arrays from the
geometry's Cell Attribute Matrix. New errors: -16501 (Feature Ids), -16502 (Cell Phases), -16503 (Attribute Arrays to Ignore).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Cell Attribute Matrix

The filter renumbers Feature Ids, compacts the Feature Attribute Matrix and,
with Fill-in Removed Features on, fills sibling Cell arrays. Cell Feature
Ids must now be in the selected Image Geometry's Cell Attribute Matrix
(-78125), Attribute Arrays to Ignore must be in it when Fill is on
(-78126), and the parent of the Feature Ranking Array must be an
Attribute Matrix directly under the geometry that is not its Cell
Attribute Matrix (-78127, replaces -78100).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l Attribute Matrix

Cell Feature Ids must now be in the selected Image Geometry's Cell
Attribute Matrix for every operation (-9893). When features are removed
with Fill-in Removed Features on, Attribute Arrays to Ignore must be in
it too (-9894). The parent of Flagged Features must be an Attribute
Matrix directly under the geometry that is not its Cell Attribute Matrix
(-9895, replaces -9892).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll Attribute Matrix

Cell Feature Ids must now be in the selected Image Geometry's Cell
Attribute Matrix (-55575). This replaces the tuple-count check -55571,
which it makes redundant. Cell Arrays to Ignore must be in the same
Attribute Matrix (-55573), and the parent of Number of Neighbors must be
an Attribute Matrix directly under the geometry that is not its Cell
Attribute Matrix (-55574).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s Cell Attribute Matrix

Cell Feature Ids must now be in the selected Image Geometry's Cell
Attribute Matrix (-5562). The parent of Feature Num. Cells must be an
Attribute Matrix directly under the geometry that is not its Cell
Attribute Matrix (-5563, replaces the parent check -5557).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Attempt to Fix Problem Voxels on, the filter rewrites Cell Feature
Ids in place, so Feature Ids must be in the selected grid geometry's
Cell Attribute Matrix (-76532), and preflight now reports Feature Ids as
modified. With the option off, Feature Ids is only read, so any Attribute
Matrix is allowed, but its tuple count must equal the geometry's cell
count (-76533). Before, preflight did not check Feature Ids at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bjects

Review fixes for PR BlueQuartzSoftware#1829.

- RequireMinNumNeighbors: restore the -55571 check (Feature Ids tuples ==
  Image Geometry cells). Membership in the Cell Attribute Matrix does not
  imply the tuple count matches the geometry, and the algorithm iterates the
  geometry's cell count over the Feature Ids store with no guard. The -55575
  membership check stays; -55571 runs right after it. Test, doc bullet, and
  V&V rows restored.
- QuickSurfaceMesh: run the -76533 tuple-count check in both modes, then the
  -76532 membership check only when Fix Problem Voxels is on. The mesher has
  the same overrun with the option on.
- ValidateFeatureAttributeMatrixInGeometry: decide "directly under the
  geometry" with geometry->contains(attributeMatrix) instead of resolving the
  selected path's parent, so an Attribute Matrix reachable through more than
  one DataPath is accepted, the same as the two Cell helpers. DataArrayTest
  covers the alias case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lude blocks

Review fixes for PR BlueQuartzSoftware#1829.

- ErodeDilateBadData and ErodeDilateCoordinationNumber algorithms rebuilt the
  Feature Ids path from the geometry's Cell Attribute Matrix, duplicating the
  rewrite their filters' executeImpl already perform. Revert the algorithm
  files so executeImpl is the single normalization point, as in the other six
  filters.
- Put the new simplnx/DataStructure includes in the simplnx include block of
  each test file instead of above catch2 or inside the SimplnxCore block, and
  move back the includes that had been pulled out of their block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lBadData V&V reports

Review fix for PR BlueQuartzSoftware#1829. Adds the -14604/-14605 and -16501..-16503 preflight
paths and the Strict Feature Ids / Cell AM Alias test cases to the path and
test-inventory tables, matching the updates already made for
RemoveFlaggedFeatures and RequireMinNumNeighbors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add MapToGeometryCellDataPath to DataArrayUtilities. Seven filters and
  QuickSurfaceMesh use it in place of copied path-rewrite blocks.
* Replace the path-rewrite comments with text that says why the rewrite
  is necessary.
* Compare RemoveFlaggedFeatures operation types against the
  Functionality enum.
* RequireMinNumNeighbors V&V report: retire paths 4, 15, and 16 (their
  checks are not in the code), add the -55573 and -55574 preflight
  paths, add two tests to the inventory, and correct the test count
  to 14.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Check that the single-path overload maps a path in another Attribute
  Matrix, and a path that is already correct, to the Cell Attribute
  Matrix path.
* Check that the vector overload keeps the input order.
* Check that the vector overload returns an empty vector for empty
  input.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@imikejackson
imikejackson force-pushed the topic/strict_featureids_cell_data branch from c4b3b2b to 4b6edda Compare October 21, 2026 12:11

@joeykleingers joeykleingers left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft from the automated pr-review run at c4b3b2b466. Edit freely before submitting.

Findings not attached to a changed line

  • [Low] src/Plugins/SimplnxCore/vv/RemoveFlaggedFeaturesFilter.md:164 RemoveFlaggedFeatures V&V report still has no rows for -9893/-9894 or the two new tests, and one test description is wrong

src/Plugins/SimplnxCore/vv/RemoveFlaggedFeaturesFilter.md:164 RemoveFlaggedFeatures V&V report still has no rows for -9893/-9894 or the two new tests, and one test description is wrong

[Low] RemoveFlaggedFeatures V&V report still has no rows for -9893/-9894 or the two new tests, and one test description is wrong

This PR adds two preflight errors to the filter:

  • -9893: Feature Ids is outside the Cell Attribute Matrix (all operations).
  • -9894: the ignore list is outside the Cell Attribute Matrix (Remove or Extract-then-Remove with Fill on).

Neither code has a row in the path table; only row 1 (line 106) was renamed to -9895. The inventory leaves out RemoveFlaggedFeaturesFilter: Strict Feature Ids and RemoveFlaggedFeaturesFilter: Shared Cell Paths and Selected Feature Matrix, so the "18 active TEST_CASEs" count at line 164 is stale.

Inventory row 149 still describes the -45437 test as "A 4-tuple Feature Ids array outside the 10-cell geometry". Preflight now rejects that setup with -9893, and the test now grows the geometry's X dimension instead.

Fix:

  • Add path rows for -9893 and -9894, following ErodeDilateBadData rows 12–14 and FillBadData rows 18–21.
  • Add the two inventory rows and recount line 164.
  • Change row 149 to: "Geometry X dimension is increased by one so that Feature Ids no longer has one tuple per cell; asserts the code and that the array is unmodified."

PR 1829 Code Review

Source: review of commit c4b3b2b (BlueQuartzSoftware/simplnx topic/strict_featureids_cell_data → develop @ 01809c2), author imikejackson. Coverage: all 31 changed files. That is 8 filter docs, 8 filters, 8 plugin tests, 4 V&V reports, DataArrayUtilities.{hpp,cpp} and test/DataArrayTest.cpp. This is a re-review after Joey's review was requested again. The previous automated review covered 4488feb.

Since the last review

What changed since 4488feb

  • The base did not move. It is still 01809c2, and the same 31 files are changed.
  • Direct tests for MapToGeometryCellDataPath. DataArrayUtilities::Geometry attribute matrix validation (test/DataArrayTest.cpp:193–198) now checks both overloads:
    • a path from an unrelated parent and a path from a sibling Attribute Matrix both map to the geometry's Cell path;
    • a path that is already correct is returned unchanged;
    • a two-element vector keeps its order;
    • an empty vector returns an empty vector.
  • No other change found. The filter code, the docs and the other V&V reports in the head diff match what the previous report described.

Earlier findings

# Earlier finding Status
1 [Low] RemoveFlaggedFeatures V&V has no -9893/-9894 rows or new tests, has a stale count, and row 149 is now wrong Remains. At head, the path table still has only the -9895 rename (row 1, line 106). Inventory line 149 still says "A 4-tuple Feature Ids array outside the 10-cell geometry". Line 164 still says "18 active TEST_CASEs".
2 [Nit] MapToGeometryCellDataPath has no direct unit test Resolved. The five CHECKs at test/DataArrayTest.cpp:193–198 cover every case the earlier finding suggested.

Findings

  • [Low] RemoveFlaggedFeatures V&V report still has no rows for the new -9893/-9894 paths or the two new tests, and one test description is wrong
    File: src/Plugins/SimplnxCore/vv/RemoveFlaggedFeaturesFilter.md:164 (also :106, :149)
    This PR adds these preflight errors to the filter (RemoveFlaggedFeaturesFilter.cpp:492, :501):

    • -9893: Feature Ids is outside the Cell Attribute Matrix (all operations).
    • -9894: the ignore list is outside the Cell Attribute Matrix (Remove or Extract-then-Remove with Fill on).

    Neither code has a row in the path table. The inventory leaves out two new tests, so the "18 active TEST_CASEs" count at line 164 is stale:

    • RemoveFlaggedFeaturesFilter: Strict Feature Ids (RemoveFlaggedFeaturesTest.cpp:1390);
    • RemoveFlaggedFeaturesFilter: Shared Cell Paths and Selected Feature Matrix (:1496).

    This PR also rewrote the -45437 test (RemoveFlaggedFeaturesTest.cpp:662–680). The test now makes the mismatch by growing the geometry's X dimension. Inventory row 149 still says "A 4-tuple Feature Ids array outside the 10-cell geometry", but preflight now rejects that setup with -9893. A V&V reader would expect a setup that this PR forbids.

    Fix:

    • Add path rows for -9893 and -9894, following ErodeDilateBadData rows 12–14 and FillBadData rows 18–21.
    • Optionally extend row 1 to say the Strict Feature Ids sections also cover -9895.
    • Add the two inventory rows and recount line 164.
    • Change row 149 to: "Geometry X dimension is increased by one so that Feature Ids no longer has one tuple per cell; asserts the code and that the array is unmodified."
  • [Nit] A bool flag array gets an integer literal next to false/true
    File: src/Plugins/SimplnxCore/test/RemoveFlaggedFeaturesTest.cpp:1549 (Shared Cell Paths and Selected Feature Matrix)
    featureValues is created with CreateTestDataArray<bool>. The next two lines assign false and true, but this line assigns 0. The code works, but the mixed literals read like a copy from the int32 version of the test in the other filters. Fix: (*featureValues)[0] = false;.

Correctness / Robustness

No issues found. Checked:

  • Validation runs before the helper is used. All 8 filters call MapToGeometryCellDataPath (or getCellDataPath()) only after the membership validators. Those validators return an error when the geometry has no Cell Attribute Matrix, so getDataRefAs<ImageGeom>(…).getCellDataPath() cannot throw in preflight. Execute runs only after a valid preflight.
  • Unvalidated ignore lists are harmless. KeepRemoveRanked with Fill off, and RemoveFlagged in Extract mode or with Fill off, skip ignore-list validation. Execute still maps those lists by target name, so a misplaced ignored array could map onto an unrelated Cell array with the same name. This is harmless because the algorithms read IgnoredDataArrayPaths only when Fill is on and the operation is not Extract.
  • QuickSurfaceMesh order. The -76533 tuple-count check runs in both modes, before the -76532 membership check. The modification notice reports the geometry's Cell Attribute Matrix path even when Feature Ids is selected through an alias, and the alias test section checks this.
  • RequireMinNumNeighbors order. The checks run in this order: -55575, -55571, -55573, -55574. This matches the user doc's failure list.
  • Null checks. KeepRemoveRanked and RemoveFlagged still rely on ValidateFeatureAttributeMatrixInGeometry to guarantee that featureAmPtr and cellFeatureAmPtr are non-null. This still holds.

C++ checks

No other issues found. No new heap ownership. The helpers take const& and return by value. No threading changes. <string_view> is included for the new parameters. Errors use the existing Result<>/MakeErrorResult pattern.

Documentation

No issues found in the Doxygen or the user docs. Both MapToGeometryCellDataPath overloads and the three validators have @brief, every @param and a @return, and match their signatures. The 8 filter docs match the code, including the conditional rules (Fill on, Store as New Phase, Fix Problem Voxels). The only V&V gap is the RemoveFlaggedFeatures report covered above.

Formatting

clang-format.txt: "Every changed C/C++ file is formatted." No findings.

Tests

Every new preflight error has a test that checks the exact code and the paths in the message. The tests also cover:

  • the conditional checks: Fill off, Extract only, Store as New Phase off;
  • selection through an alias path, including execute-time checks that ignored arrays stay unchanged and that only the selected Feature Attribute Matrix is compacted;
  • read-only arrays in another Attribute Matrix, which still pass.

DataArrayTest.cpp now covers both mapping overloads and all three validators, on both Image and Rectilinear Grid geometries, including the case where the geometry has no Cell Attribute Matrix.

Missing or failed evidence

  • I did not build or run any tests (read-only review, no shell). All test-plan checkboxes in the PR are unchecked. The author reports 3223/3224 tests passing locally on macOS. CI status was not in the evidence bundle.
  • I could not check the claim that the 15 shipped pipeline uses already follow the rule. Pipelines from other repositories were not available.
  • I had no 4488feb..c4b3b2b interdiff. I worked out "since the last review" by comparing the previous report with the full head diff. A small change that the previous report did not describe could be missed.

Confirmed correct

  • Membership compares objects, not path strings. IsChildOfAttributeMatrix compares parent ids. ValidateFeatureAttributeMatrixInGeometry uses geometry->contains(...) plus an id check against Cell Data. Both accept an Attribute Matrix reached through a second parent, and DataArrayTest.cpp:2720–2721 (diff numbering) proves this.
  • One mapping point. Every rewritten path comes from the geometry's getCellDataPath(), the same path the algorithms use. Path-equality checks and getParent() lookups in FillBadData, RemoveFlaggedFeatures and the shared fill utilities therefore match.
  • Removed error codes (-78100, -9892, and -5557 in RequireMinimumSizeFeatures) have no remaining references in those filters' code, tests or docs.

Verdict

APPROVE: I found no correctness, lifetime or behavior defects. The earlier unit-test nit is fixed. What remains is a stale RemoveFlaggedFeatures V&V report and a one-character test nit, and the author can fix both in a follow-up commit.

…lse in a bool test array

- Add code-path rows 29-31 for the -9893 and -9894 preflight errors and the shared Cell Attribute Matrix paths, and list the Strict Feature Ids sections under row 1 (-9895).
- Add the two new Strict Feature Ids tests to the inventory, and the five tests from BlueQuartzSoftware#1568, BlueQuartzSoftware#1748 and BlueQuartzSoftware#1760 that were never listed.
- Mark the three older algorithm tests as kept, since they are still in the test file, and recount to 28 active TEST_CASEs.
- Describe the rewritten -45437 test, which now grows the geometry X dimension.
- Assign false instead of 0 to the bool flag array in the Shared Cell Paths test.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@imikejackson

Copy link
Copy Markdown
Contributor Author

@joeykleingers The two items from your last review are fixed in 00066ec.

This commit fixes the findings from the re-review of the strict Feature Ids
change. One test now runs each algorithm, three V&V reports and one filter
page match the code and tests, and names added by this change follow the
Ptr/Ref naming rule. 17 files changed, +440 / -431 lines.

**1. FillBadData alias test runs each algorithm**

- `src/Plugins/SimplnxCore/test/FillBadDataTest.cpp`

The `Ignored Array Cell AM Alias` test now calls `scope.executeFilter()`.
Before, it called `filter.execute()` directly, so both scenarios ran the
in-core algorithm and the other algorithm was never checked.

**2. V&V reports and filter docs**

- `src/Plugins/SimplnxCore/vv/RemoveFlaggedFeaturesFilter.md`
- `src/Plugins/SimplnxCore/vv/ErodeDilateBadDataFilter.md`
- `src/Plugins/SimplnxCore/vv/FillBadDataFilter.md`
- `src/Plugins/SimplnxCore/docs/ErodeDilateBadDataFilter.md`

The summary counts match the path tables and the test files:
RemoveFlaggedFeatures 28 test cases and 25 of 34 paths, ErodeDilateBadData
10 test cases and 13 of 14 paths, FillBadData 18 registered plus 2 hidden
test cases and 20 of 21 paths. Each inventory lists every TEST_CASE. Earlier
test results are labeled as results of the earlier V&V cycle. The
ErodeDilateBadData page lists the new -14605 and -14604 preflight errors in
the order preflight checks them.

**3. Comments and API documentation**

- `src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.cpp`
- `src/simplnx/Utilities/DataArrayUtilities.hpp`

The FillBadData execute comment says that both algorithms find the Cell
arrays through the geometry's Cell Attribute Matrix path. Both Cell Attribute
Matrix validators note that they check only the parent, so the caller must
validate the selected arrays.

**4. Pointer and reference names**

- `src/simplnx/Utilities/DataArrayUtilities.cpp`
- `src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.cpp`
- `test/DataArrayTest.cpp` and the eight SimplnxCore filter tests

Raw pointers declared by this change end in `Ptr`, and local references end
in `Ref`. Names that existed before this change are unchanged.

Verification: simplnx-Rel (macOS arm64) builds with no warnings. The 107
affected tests (the eight filters and DataArrayUtilities, with
SIMPLNX_TEST_ALGORITHM_PATH=0 so both algorithm paths run) pass. clang-format
19.1.1 reports no changes.

@joeykleingers joeykleingers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at d7f56e1b5. I pushed that commit to fix the last review findings:

  • The FillBadData Ignored Array Cell AM Alias test now runs through scope.executeFilter(), so each algorithm scenario is forced and checked.
  • The RemoveFlaggedFeatures, ErodeDilateBadData and FillBadData V&V summaries and inventories now match the test files and path tables. The ErodeDilateBadData docs list -14605 and -14604.
  • The FillBadData execute comment, the @note on both Cell Attribute Matrix validators, and the Ptr/Ref names on new pointers and references.

Verified locally on macOS arm64 (simplnx-Rel): the build has no warnings, and the 107 affected tests pass with both algorithm paths.

Problems that existed before this PR are not fixed here:

  • #1843: QuickSurfaceMesh preflight crashes when the grid geometry has no Cell Attribute Matrix.
  • FillBadData::AllBadData_TerminatesWithoutHang uses threshold 1, so it never reaches the no-progress check that V&V path row 16 says it covers.
  • Several algorithm descriptions in the ErodeDilateBadData, FillBadData and RemoveFlaggedFeatures V&V reports describe older implementations.

@imikejackson
imikejackson enabled auto-merge (squash) October 21, 2026 15:30
@imikejackson
imikejackson merged commit 419f9db into BlueQuartzSoftware:develop Oct 21, 2026
5 checks passed
@imikejackson
imikejackson deleted the topic/strict_featureids_cell_data branch October 21, 2026 19:31
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 22, 2026
…1748 preflight tests

BlueQuartzSoftware#1829 brought V&V reports that still describe the BlueQuartzSoftware#1748 versions of
three preflight tests. Fill Bad Data and Erode/Dilate Bad Data no longer
assert the absence of a Stale Arrays value. Remove Flagged Features now
lists this branch's Preflight Stale Arrays test in place of the BlueQuartzSoftware#1748
test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 23, 2026
…t Feature Ids checks allow them

After the rebase onto develop, BlueQuartzSoftware#1829 requires Cell Feature Ids in the
geometry's Cell Attribute Matrix and the Number of Neighbors parent in an
Attribute Matrix under the geometry. Move the two tuple-count fixtures into
those locations so they still reach the tuple-count and array-kind checks.
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Oct 23, 2026
…t Feature Ids checks allow them

After the rebase onto develop, BlueQuartzSoftware#1829 requires Cell Feature Ids in the
geometry's Cell Attribute Matrix and the Number of Neighbors parent in an
Attribute Matrix under the geometry. Move the two tuple-count fixtures into
those locations so they still reach the tuple-count and array-kind checks.
imikejackson added a commit that referenced this pull request Oct 23, 2026
)

* Check in preflight that grid-geometry cell inputs have one tuple per
  cell in 32 SimplnxCore and OrientationAnalysis filters. A short array
  was read past its end in execute; a long one was silently truncated.
  Read-only inputs may be in any Attribute Matrix if the count matches.
* Add a ValidateCellTupleCount overload that checks several DataPaths
  through IArray, so StringArray and NeighborList selections do not throw.
* Move the existing tuple checks in RequireMinNumNeighbors,
  PartitionGeometry and WriteOnScaleTableFile onto the shared helper and
  add array-kind checks (from #1826). RequireMinNumNeighbors codes move
  to -5957x to stay clear of #1829.
* Add a regression test and one documentation sentence per filter.
  NeighborOrientationCorrelation's test now runs the filter and checks
  which Attribute Matrix its repair copies affect.

Co-authored-by: Jessica Marquis <jessica.marquis@bluequartz.net>
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants