VV: Create Element Array from Feature Array fully V&V'ed - #1689
Open
imikejackson wants to merge 1 commit into
Open
VV: Create Element Array from Feature Array fully V&V'ed#1689imikejackson wants to merge 1 commit into
imikejackson wants to merge 1 commit into
Conversation
imikejackson
force-pushed
the
vv/copy_feature_array_to_element_array
branch
from
July 24, 2026 01:39
7fa565f to
af11360
Compare
nyoungbq
approved these changes
Jul 28, 2026
Comment on lines
+108
to
+129
| ## Post-V&V hardening (five-review pass, 2026-07-23) | ||
|
|
||
| Five independent reviews were run after the standard workflow: adversarial, nit-picky senior engineer, CPU performance, memory performance, and out-of-core. Actions taken: | ||
|
|
||
| **Fixed (code):** | ||
| 1. *(Adversarial, Critical)* Selecting a NeighborList/StringArray crashed preflight with uncaught `std::bad_cast` — parameter now constrained to `ArrayType::DataArray`; pinned by test. | ||
| 2. *(Adversarial)* The empty-selection guard was untested (old `Parameter Check` failed on the FeatureIds parameter before reaching the guard) — test reworked to exercise the guard itself. | ||
| 3. *(Adversarial)* Suffix containing `/` threw uncaught `std::invalid_argument` — preflight now rejects with -3021; pinned by test. | ||
| 4. *(Adversarial)* Zero-tuple FeatureIds dereferenced `end()` (UB) in `ValidateFeatureIdsToFeatureAttributeMatrixIndexing` — empty guard added in the shared utility; pinned by test. | ||
| 5. *(CPU/Memory/OOC, consensus)* FeatureIds min/max validation ran once per selected array (K full array scans) — hoisted to a single call (valid because preflight -3020 guarantees equal tuple counts). | ||
| 6. *(CPU perf)* Copy kernel did ~3 virtual calls per component-element via `AbstractDataStore`/`ValueProxy` (~10-30× slower per thread than the legacy memcpy gather) — added a raw-pointer fast path taken when all three stores are concrete in-core `DataStore<T>` (`std::copy_n` per tuple, cancel check every 65536 tuples), with the virtual path kept as the OOC/other-store fallback. This also resolves the thread-safety review question: parallel threads write disjoint ranges of a raw buffer on the fast path; non-`DataStore<T>` stores fall back to the virtual path, and `requireArraysInMemory()` + the OOC auto-serialization keep that path serial. | ||
| 7. *(Senior)* Naming/style/test-hygiene items: `k_SelectedFeatureArrayPaths_Key` rename (JSON key unchanged), `Xmdf`→`Xdmf`, `tDims`→`tupleShape`, `p...Value` prefix consistency, const `InputValues` ctor param, doxygen rewrite, `REQUIRE_NOTHROW` before every `getDataRefAs`, `CAPTURE(i)` in assertion loops, tag standardization to `[SimplnxCore]`, magic-number cleanup, removed unused `<fstream>`, backcompat test now asserts the converted multi-path value. | ||
| 8. *(Memory/docs)* Docs now state the per-array Element-sized memory cost and the -3020/-3021 error codes. | ||
|
|
||
| **Corrected finding:** the adversarial review predicted the name-collision case would error at *preflight* (-266); empirically `IFilter::preflight` does not apply output actions, so the error surfaces at execute (or pipeline-level preflight in the GUI). The test pins the actual behavior and that the source array is untouched. | ||
|
|
||
| **Deferred / escalated:** | ||
| - *(OOC, Critical — infrastructure, not this filter)* The `simplnx-ooc-Rel` build registers no OOC backend, so its "OOC" test runs are actually in-core (see At a glance caveat). Needs a build-infrastructure decision (FileStore source dir vs SimplnxOoc wiring). | ||
| - *(OOC)* Slab/bulk-I/O restructure and feature-array local caching for the OOC rewrite branch's chunked stores — deferred to the OOC architecture rewrite, where `copyIntoBuffer`/`copyFromBuffer` exist. | ||
| - *(OOC)* Tier-1 200³ OOC test — deferred until the OOC backend gap is fixed (it would prove nothing today). | ||
| - *(Memory, framework-wide)* `CreateArrayAction` zero-fills every created store before the kernel overwrites 100% of it (double touch) — framework enhancement request, not filter-specific. | ||
| - *(Adversarial, framework-wide)* `MultiArraySelectionParameter` stores but never enforces `AllowedDataTypes`; the `ArrayType` constraint is what protects this filter. |
Contributor
There was a problem hiding this comment.
I would try to consolidate this if possible
Summary: - Found and fixed 3 bugs (uncaught std::bad_cast in preflight when a NeighborList/StringArray was selected - parameter now constrained to ArrayType::DataArray; uncaught std::invalid_argument for a '/' in the created-array suffix - now clean preflight error -3021; end() iterator dereference (UB) on zero-tuple FeatureIds in the shared ValidateFeatureIdsToFeatureAttributeMatrixIndexing utility); - documented 3 deviations from DREAM3D 6.5.171 (D1 output-array naming for converted pipelines, D2 over-provisioned feature array accepted in NX vs legacy error -5555, D3 legacy bug: silent out-of-bounds garbage for negative feature ids vs NX error -5355) - numeric output bit-identical on valid input across float32/int32x3/bool fixtures; - retired 1 test (Parameter Check exercised parameter validation instead of the filter's empty-selection guard; replaced with a guard-specific test); - augmented existing tests with 6 inlined Class 1 (Analytical) + Class 4 (Invariant) test fixtures (21 ctest entries total, 13 of 14 code paths; cancel path excluded); - V&V deliverables (report, deviations) archived to OneDrive per program decision; no exemplar archive needed (all fixtures in-memory); - PERF: raw-pointer fast path for in-core DataStore<T> in the copy kernel (removes ~3 virtual calls per component-element), FeatureIds min/max validation hoisted out of the per-selected-array loop, cancel check throttled; OOC and other store types keep the serial virtual path; - fixed Xmdf->Xdmf typo, documented error codes, memory note, and example pipelines in the user-facing doc. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
imikejackson
force-pushed
the
vv/copy_feature_array_to_element_array
branch
from
July 28, 2026 19:38
af11360 to
ee3d0a6
Compare
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
Full V&V of
CopyFeatureArrayToElementArrayFilterper the v2 MTR V&V policy (Class 1 Analytical oracle + Class 4 Invariant companions), followed by a five-review hardening pass (adversarial, senior-engineer, CPU-perf, memory-perf, out-of-core). V&V report/deviations are archived to OneDrive per program decision.Correctness
Bug fixes
std::bad_castfrom preflight — parameter now constrained toArrayType::DataArray(pinned by test)./in the created-array suffix threw an uncaughtstd::invalid_argument— now a clean preflight error (-3021).end()(UB) in the sharedValidateFeatureIdsToFeatureAttributeMatrixIndexing— empty-store guard added.Performance
DataStore<T>(removes ~3 virtual calls per component-element); OOC/other store types keep the serial virtual path (requireArraysInMemoryadded).Tests
/suffix, name collision (-266), zero-tuple FeatureIds, negative id (-5355), id-out-of-range (-5351), over-provisioned pin (D2). The TEMPLATE_LIST test previously compared uninitialized feature data (could not detect indexing bugs) — now uses distinct per-feature values. SIMPL backcompat test now asserts the converted multi-path value.Docs
Test Plan
EMsoftSO3SamplerFiltermissing SIMPL fixture in SimplnxReview)