VV/BUG: Compute Feature Sizes Full V&V + precision and 2D area fixes#1638
VV/BUG: Compute Feature Sizes Full V&V + precision and 2D area fixes#1638nyoungbq wants to merge 8 commits into
Conversation
aa689d3 to
0db062f
Compare
Review — Actionable ItemsThe Kahan post-reduction fix in Must address before sign-off
Clarifications needed
Lower priority
|
A/B verification run — deviation report updated (D1 split into D1 + D2)Followed up on the earlier question about whether What was runThe exact
Result
Why the report needed updatingThe published deviation file documented only D1 (float64 + Kahan summation →
Only when both changes were applied to legacy did all arrays match SIMPLNX bit-for-bit — so both are required to fully explain the difference. The same Changes prepared
|
|
Pushed a review-fix commit to this branch (
All 10 One open item for you: the PR title "Thread Summation Patch" implies a concurrency race, but the changed code is the serial |
- Compute Feature Sizes Deviations - Compute Feature Sizes V&V report
…cation A direct A/B run (stock 6.5.171 vs DREAM3D-NX vs a 6.5.172 proof-patch build) on the exact RectGrid fixture showed the legacy-vs-SIMPLNX difference has two independent precision sources, not one: * D1 (Volumes): float64 + Kahan summation vs legacy naive float32 accumulation. Patching only this made Volumes bit-identical to SIMPLNX. * D2 (EquivalentDiameters): float64 std::cbrt on the float64 volume vs legacy powf on the float32-rounded volume. A second, independent source — even with identical Volumes, ESD still differed by ~1 ULP until this was also patched. Both changes together make legacy reproduce SIMPLNX output bit-for-bit. The report and deviations file are updated to document D2, mark D1/D2 as A/B-verified, and correct the prior text that treated the ESD difference as proportional to the volume shift rather than a separate deviation. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Fixes from adversarial review of this PR: * Fix Bug-1: the 2D (one-empty-dimension) voxel area multiplied all three spacings, computing a volume instead of an area, and diverged from DREAM3D 6.5.171 whenever the flat dimension's spacing was not 1.0. The area now uses only the two non-flat spacings, matching legacy FindSizes::findSizesImage. The prior 2D fixture used a flat-dim spacing of exactly 1.0, hiding the defect. With this fix the deviations file's "ImageGeom path - no deviations" claim is once again correct. * Add a characterization test (2D area excludes the flat-dimension spacing) that GENERATEs all three flat orientations with a non-unit flat-dim spacing of 5.0 and asserts area 24.0, not 120.0. * Gate the ImageGeom and RectGrid parallel scans with requireStoresInMemory on featureIds: the workers read the store concurrently across slices, which the project thread-safety policy only permits for in-core stores. * Correct the stale provenance canonical oracle block (Volumes[1] 2358.834 -> 2362.434, EquivalentDiameters 16.516/3.0994 -> 16.5242/ 3.0669) to agree with the tests and the provenance's own per-slice trace; fix the matching stale comment in the RectGrid fixture. * Clear the report's "1 open bug" flag (Bug-1 now fixed) and document the retired "Legacy: Small IN100 Test" in the test inventory. * Qualify the D1 Kahan claim: the compensator resets per TBB chunk, so the error reduction is per-chunk, not a full continuous-Kahan O(eps_f64); the float64 accumulation is the dominant improvement. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
63e2da2 to
f7ea5ee
Compare
* Replace absolute float32-epsilon comparisons (which demanded bit-exact equality at magnitudes where one ULP far exceeds epsilon) with Approx().epsilon(1e-6) relative comparisons * A few ULPs of slack keeps the oracle pins meaningful while surviving platform and TBB reduction-order differences Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Verified every claim in the V&V report and deviations file against the current algorithm/test sources and the stock 6.5.171 FindSizes source (pre-proof-patch commit). Corrections: * Attribute the ImageGeom port to FindSizes::findSizesImage() (execute() only dispatches to it) * Document two previously unlisted port-time behavior changes: the overflow guard tightened from 2^53 to INT32_MAX (legacy silently overflowed int32 NumElements between 2^31 and 2^53; RectGrid path had no guard), and the geometry scope narrowed to Image/RectGrid * Rewrite the ImageGeom precision note from source: 3D Volumes are bit-identical to legacy (same roundings, same order); 2D Areas can differ by <=1 ULP because SIMPLNX evaluates the spacing product in float64 while legacy rounds it to float32 first; ESD/ECD evaluation differences are covered by D2 * Update stale Kahan line citations in D1 (274-283 -> 293-305, 341-358 -> 368-385) * Oracle table: 2D voxel area derivation no longer shows the excluded flat-dimension spacing in the product * Record the new relative-1e-6 test tolerance in the second-engineer review note (was float32 epsilon) Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
…2D Image Geometries. Added a TEST_CASE that will exercise the issue. This test will fail and force the CI to be RED until the issue is figured out.
Compute Feature Sizes completely V&V
The patched bug was in the Kahan Summation during the reduction phase of the RectGridGeom path