Repository navigation
BUG: Check that grid-geometry cell inputs have one tuple per cell - #1840
imikejackson merged 50 commits into
Conversation
43b3000 to
98bc23e
Compare
There was a problem hiding this comment.
Reviewed all 108 changed files at commit 020358f0e80e103140096a475dae97cad897aae4.
Findings
-
Critical — Windows test-build failure. WriteINLFileTest.cpp:257 passes a
StringLiteraldirectly tofs::path. MSVC rejects this with C2440, blockingOrientationAnalysisUnitTest. Use the existing portable convention:fs::path(unit_test::k_BinaryTestOutputDir.view()). -
Should-fix — qualify the external-array documentation. ReplaceElementAttributesWithNeighborValuesFilter.md:83 says the comparison array can be in any Attribute Matrix. With Loop Until Gone enabled, execution updates only the geometry's Cell Data arrays. For a two-cell image, an external comparison array
[0,1], and a less-than threshold of0.5, the comparison remains unchanged. The loop repeats until cancellation. This runtime limitation predates this PR. The new documentation needs this condition:When Loop Until Gone is enabled, select a comparison array in the geometry's Cell Data Attribute Matrix. Otherwise, another Attribute Matrix is allowed.
No other material introduced correctness, CPU, or memory findings emerged. The shared helper checks metadata without reading array values. Synthetic fixtures independently test the cell-count contract and valid alternate parents and shapes.
Validation and limits
- All 73 changed C/C++ files passed clang-format 19.1.1 using the repository-root style. The diff whitespace check passed.
- Scoped clang-tidy checks of the added helper lines passed. The changed-line comment audit found no diagnostics. These are scoped results, not a full-project static-analysis pass.
- 248 focused SimplnxCore tests passed after four stale plugin binaries were temporarily quarantined. The original test run failed during plugin loading. All four binaries were restored, with their SHA-256 hashes verified.
- The Windows Release aggregate build failed at the reported compile error. It also reported an additional, unattributed
NXVtkLibduplicate-symbol link error. - OrientationAnalysis runtime tests remain blocked by the compile error. No disk-backed execution was run for this review. GitHub platform builds were still in progress at the final review check.
Verdict: REQUEST CHANGES.
|
Addressing @jmarquisbq's review (fixed in cbb9f1d):
|
There was a problem hiding this comment.
Reviewed simplnx #1840 at 99f454c9be11cf58a5d2b366fa66b82751cf89dc. All 107 changed files are accounted for, with unchanged content verified against the previous full review. Both earlier findings are fixed: the INL test uses .view() for the filesystem path, and the Loop Until Gone documentation limits external comparison arrays.
Finding
-
Should-fix — verify the split-matrix repair contract. The matching case in NeighborOrientationCorrelationTest.cpp:1175 puts Confidence Index, Phases, and Quaternions in separate Attribute Matrices and checks only preflight. Execution copies replacements only within the Confidence Index parent matrix. Thus, confidence can be repaired while an external quaternion remains unchanged. This existing execution limitation conflicts with the newly documented repair guarantee in NeighborOrientationCorrelationFilter.md:29.
Clarify the copy boundary and add an execution assertion for the supported layout. Suggested documentation replacement:
Each selected input must have one tuple per geometry cell. Replacement copies affect arrays in the Attribute Matrix that contains Confidence Index, except ignored arrays. Keep Cell Phases and Cell Quaternions in that matrix when they must also be repaired.
This finding is based on source inspection. The added split-matrix test checks only preflight and does not establish the documented execution behavior.
Confirmed correct
The shared validation uses tuple-count metadata without reading array values or adding cell-sized buffers. Synthetic fixtures independently test the cell-count contract. No additional correctness, efficiency, ownership, design, or defensive-handling findings were found.
Validation and limits
- All 73 changed C++ files passed clang-format 19.1.1 with the repository-root style. The diff whitespace check passed.
- Scoped clang-tidy 19.1.5 passed for changed lines in the shared helper, Partition Geometry, and INL test. Changed-line comment checks passed. These results do not establish a clean full-project static-analysis or full-file comment-audit run.
- Exact-head Windows, GCC, Clang, and macOS CI passed with 3,382 tests each.
- No new local build or disk-backed OOC run was performed.
Verdict: REQUEST CHANGES — correct the repair contract and its positive test.
99f454c to
fe9091e
Compare
|
Addressing @jmarquisbq's review at 99f454c:
Rebase: the branch is rebased onto the current
#1829 requires Feature Ids in the geometry's Cell Attribute Matrix, so two fixtures had to move. 4ffce70 moves them to allowed locations, and the tests still check the same tuple-count and error-order behavior. The affected unit tests pass locally (358/358, macOS arm64 Release). |
jmarquisbq
left a comment
There was a problem hiding this comment.
The only other thing the review found at this point was the V&V updates which we agreed would be handled separately all at once before releases so I am approving this.
ValidateArrayTupleCountMatchesGeometryCells compares each selected DataArray's tuple count with the grid geometry's number of cells and returns an error naming the parameter, the DataArray, both counts and the geometry. Tuple counts are read through IArray, so a StringArray or NeighborList cannot throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preflight did not compare Boundary Euclidean Distances with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -76238 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e tuple per cell Preflight did not compare the Mask Array with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -68071 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le per cell Preflight did not compare the Attribute Array to Compute Statistics with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -59204 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le per cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -12803 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le per cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -12701 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le per cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -24501 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -74771 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… one tuple per cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -5834 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tuple per cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -5835 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cell Preflight did not compare Cell Feature Ids, Cell Euler Angles and Cell Phases with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -73461 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cell Preflight did not compare Cell Feature Ids with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -77453 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tuple per cell Preflight did not compare Cell Quaternions, Cell Phases and the Cell Mask Array (when used) with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -68072 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one tuple per cell Preflight did not compare Cell Quaternions, Cell Phases and the Cell Mask Array (when used) with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -3543 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… one tuple per cell Preflight did not compare Cell Quaternions, Cell Phases and the Cell Mask Array with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -6810 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… inputs have one tuple per cell Preflight did not compare Cell Feature Ids, Cell Phases and Cell Quaternions with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -9805 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… one tuple per cell Preflight did not compare Cell Feature Ids, Cell Phases and Cell Quaternions with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -67205 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one tuple per cell Preflight did not compare the Confidence Index, Cell Phases and Cell Quaternions with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -580098 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preflight did not compare Cell Feature Ids, Cell Phases and Cell Euler Angles with the number of cells of the selected geometry. The algorithm indexes it by cell, so a shorter DataArray read past its end and a longer one was silently truncated. Preflight now returns -78431 when the tuple count differs. The DataArray may be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le per cell
Preflight still rejected a selected DataArray whose tuple shape had a
different rank from the geometry, even with one tuple per cell. The
algorithm indexes tuples by a flat index computed from the geometry
dimensions, so only the tuple count matters. The rank check (-5560) is
removed; arrays shaped {12}, {3,4} and {1,1,12} on a 3x4x1 geometry
are now accepted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ComputeFeatureSizes: the four invalid-dimension tests kept 125 Feature Ids tuples while the geometry shrank, so they hit the new tuple-count error. The fixture is resized so they again reach -74770. - OrientationAnalysis tuple-count tests now check that the message names the short DataArray and its tuple count, not only the error code. - ComputeShapes' test lives in OrientationAnalysis and is tagged so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pointer locals in the new tests use the Ptr suffix, error references the Ref suffix and filter aliases the Type suffix. Added includes sit in the file's existing include groups. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c errors The tuple-count sentence now reads the same way in all 33 filter docs, with parameter names in bold, and sits in Required Input Sources where the doc has that section. Corrections found during review, each checked against the code: - ComputeFeatureNeighbors: Shared Surface Area is an area in squared length units that uses the cell spacing, not a face count. - AlignSectionsFeatureCentroid: removed the Linear Background Subtraction section; the filter has no such parameter. - AddBadData: at least one noise mode must be enabled (preflight -76234). - InitializeImageGeomCellData: the arrays can be in any Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt checks PR BlueQuartzSoftware#1817 added ValidateCellTupleCount to DataArrayUtilities while this branch added ValidateArrayTupleCountMatchesGeometryCells for the same check. The branch helper is removed. A ValidateCellTupleCount overload that takes a DataStructure and several DataPaths (tuple counts read through IArray) serves filters with more than one cell input, and all call sites use it. ComputeSurfaceAreaToVolume now uses -12803 and -12804 on develop, so ComputeEuclideanDistMap moves to -12805 and ComputeShapes to -12806. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the shared count-only check in RequireMinNumNeighbors, WriteOnScaleTableFile, and PartitionGeometry. Preserve error codes and validation order while reporting the actual selected paths. Cover linked selections, separate data storage, unequal counts, and equal counts with different tuple shapes. Signed-off-by: Jessica Marquis <jessica.marquis@bluequartz.net>
State that the selected geometry and data paths identify the inputs, so the shared count diagnostic does not add a filter-name prefix. Signed-off-by: Jessica Marquis <jessica.marquis@bluequartz.net>
Replace the unused standard span header with the direct nonstd span dependency used by the test fixtures. Signed-off-by: Jessica Marquis <jessica.marquis@bluequartz.net>
Reuse a local metadata check at both vertex-count validation sites. Report selected paths, actual and expected counts, and corrective action with error -3043. Preserve cell and partition-count error meanings. Test linked selections, all four modes, and independent eight-vertex counts, including separation from the Z partition-count error. Signed-off-by: Jessica Marquis <jessica.marquis@bluequartz.net>
Reject unsupported array kinds before typed access in PartitionGeometry, RequireMinNumNeighbors, and WriteOnScaleTableFile. Keep optional inputs, supported integer types, and existing validation order unchanged. Track the temporary guards with issue BlueQuartzSoftware#1833. Test exact diagnostics, unchanged data, inactive inputs, and error precedence. Preserve each NeighborList fixture's AttributeMatrix shape. Correct configured include, naming, and initialization findings on the migrated lines. Signed-off-by: Jessica Marquis <jessica.marquis@bluequartz.net>
The Image Geometry Existing Partitioning Scheme check used -3043, which the node-geometry vertex tuple check from BlueQuartzSoftware#1826 also uses. It now uses ValidateCellTupleCount, like the other PartitionGeometry tuple checks, and returns -3045. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-55573, -55574 and -55575 are also used by another open change to this filter, so the Feature Ids tuple-count and type checks move to their own range: -55571 -> -59571, -55574 -> -59574, -55575 -> -59575, -55576 -> -59576. Docs, tests and the V&V tables are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test runs through ${Python3_EXECUTABLE}, which is not set in builds
without Python, so ctest reports it as Not Run. Its registration is
commented out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment Construct the WriteINLFile test output path from k_BinaryTestOutputDir.view() so MSVC accepts it. Document that Loop Until Gone requires the comparison array to live in the geometry's Cell Data Attribute Matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 020358f. PR BlueQuartzSoftware#1834 now owns the citation test registration and limits it to Linux, so this PR leaves that file unchanged from develop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…undary State which inputs need one tuple per cell and that replacement copies affect only the Attribute Matrix that contains Confidence Index. Run the filter in the tuple-count test with the inputs in one external matrix and in separate matrices, and check the repaired and unchanged values.
…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.
4ffce70 to
6579fcc
Compare
Summary
These filters read Cell-level DataArrays of an Image Geometry (or another grid geometry) by cell index, using indices computed from the geometry's dimensions. Preflight never checked that the DataArray has one tuple per cell. A shorter DataArray was read past its end during execute, which crashed or produced garbage. A longer one was silently truncated. Preflight now compares each such input's tuple count with the geometry's number of cells.
These filters only read the inputs, so the DataArray may be in any Attribute Matrix. Only its tuple count must match. Each filter's test checks both directions: a short DataArray is rejected, and a correctly sized DataArray in another Attribute Matrix is still accepted.
The checks use
ValidateCellTupleCountinDataArrayUtilities, which #1817 added, plus one new overload that takes a DataStructure and several DataPaths. It reads tuple counts throughIArray, so a StringArray or NeighborList cannot throwstd::bad_cast. Each filter has its own commit, a regression test that fails ondevelop, and one sentence in its documentation. No test data archive is added or changed.Behavior changes (new preflight errors)
SimplnxCore
OrientationAnalysis
Included from #1826 (Jessica Marquis)
#1826 is closed and its five commits are included here with their authorship. They move three filters' existing tuple-count checks onto
ValidateCellTupleCountand add type checks for selections the parameters do not yet restrict (#1833):Not in this PR
ComputeSurfaceAreaToVolume already has this check on
develop(BUG: Correct surface-area and sphericity calculations #1817).ComputeFeatureRect has no geometry parameter. It takes its dimensions from the Feature Ids tuple shape and assumes that shape has three dimensions. That needs a different fix.
Filters that modify Feature Ids or its sibling arrays use the stricter Cell Attribute Matrix rule in BUG: Require Feature Ids in the geometry's Cell Attribute Matrix for filters that modify it #1829.
Triangle, Edge and Vertex geometry filters with the same kind of gap will be handled separately.
Other changes
Test plan
developbecause preflight accepts a DataArray whose tuple count differs from the cell count.