feat(linear-static-3d-euler-beam): step 22 - result-recovery

This commit is contained in:
KOKO\Mimi
2026-08-09 21:15:25 +09:00
parent df84903745
commit 084e6b0be1
6 changed files with 1358 additions and 0 deletions
@@ -1021,3 +1021,112 @@
substitution, reconstruction, recovery, and output sequencing.
- concerns: none; no critical implementation, environment, backend, or
upstream-contract conflict was found.
## Step 22 — result-recovery
- task_id: `TASK-22`
- status: `completed`
- changed_files: `include/fesa/results/result_recovery.hpp`,
`src/fesa/results/result_recovery.cpp`,
`tests/unit/results/result_recovery_test.cpp`, `src/fesa/CMakeLists.txt`,
`tests/CMakeLists.txt`,
`docs/implementation-plans/linear-static-3d-euler-beam-implementation-report.md`,
`phases/linear-static-3d-euler-beam/index.json`
- requirement_ids: `FESA-REQ-LS3DEB-004`, `FESA-REQ-LS3DEB-027`,
`FESA-REQ-LS3DEB-031`, `FESA-REQ-LS3DEB-032`,
`FESA-REQ-LS3DEB-034`, `FESA-REQ-LS3DEB-035`,
`FESA-REQ-LS3DEB-042`
- test_ids: `T22-RECOVERY-001`, `T22-RECOVERY-002`,
`T22-RECOVERY-003`, `T22-RECOVERY-004`, `T22-RECOVERY-005`,
`T22-RECOVERY-006`
| stage | exact command | exit_code | expected_or_observed_result | evidence_tail |
| --- | --- | ---: | --- | --- |
| RED-build | `cmake --build .harness/build --config Debug --target fesa_tests` | 1 | Exactly six planned tests were registered before production and the recovery public API was absent | MSVC C1083 reported missing `fesa/results/result_recovery.hpp` from `result_recovery_test.cpp` |
| GREEN-build | `cmake --build .harness/build --config Debug --target fesa_tests` | 0 | Recovery, station normalization, six tests, solver library, and unit executable compile and link | `result_recovery.cpp`, its test, `fesa_solver.lib`, and `fesa_unit_tests.exe` built without a FESA warning under `/W4 /WX` |
| GREEN-test | `ctest --test-dir .harness/build -C Debug -R ResultRecovery --output-on-failure` | 0 | Residual reaction, residual criterion, distinct result types, signs, stress order, and station policy pass | 6/6 exact `ResultRecovery` tests passed |
| RED-state-consistency | `cmake --build .harness/build --config Debug --target fesa_tests; ctest --test-dir .harness/build -C Debug -R ResultRecovery.EnforcesNormalizedFreeResidual --output-on-failure` | 1 | A constrained displacement inconsistent with prescribed `dc` must fail before residual evaluation | Test expected `invalid-recovery-state` but observed later `free-residual-tolerance-failure`, proving missing prevalidation |
| GREEN-state-consistency | same focused build/test command after the minimum validation change | 0 | Prescribed-order/state consistency fails before recovery and the exact zero-load/zero-displacement equilibrium remains valid | Focused test passed; subsequent exact suite passed 6/6 |
| VERIFY-configure | `cmake -S . -B .harness/build -A x64 -DFESA_GTEST_SOURCE_DIR=C:/git/googletest "-DMKL_DIR=C:/Program Files (x86)/Intel/oneAPI/mkl/2026.1/lib/cmake/mkl" "-DTBB_DIR=C:/Program Files (x86)/Intel/oneAPI/tbb/2023.1/lib/cmake/tbb" "-DHDF5_DIR=C:/Program Files/HDF_Group/HDF5/2.1.1/cmake"` | 0 | Approved explicit-dependency MSVC x64 build tree generates | Windows SDK 10.0.26100.0, oneMKL 2026.1 ILP64/dynamic, oneTBB, and HDF5 resolved; configure/generate completed |
| VERIFY-build | `cmake --build .harness/build --config Debug` | 0 | Full Debug build passes without a new FESA warning | `fesa_solver.lib` and `fesa_unit_tests.exe` built under `/W4 /WX` |
| VERIFY-targeted | `ctest --test-dir .harness/build -C Debug -R ResultRecovery --output-on-failure` | 0 | Focused Step 22 suite remains green | 6/6 exact `ResultRecovery` tests passed |
| VERIFY-discovery | `ctest --test-dir .harness/build -C Debug --show-only=json-v1` | 0 | CTest discovers the accumulated suite and all six exact names | 68 tests discovered, including 6 `ResultRecovery` tests |
| VERIFY-full | `ctest --test-dir .harness/build -C Debug --output-on-failure` | 0 | Full accumulated C++ suite has zero failures | 68/68 tests passed |
| VERIFY-contract-scans | Exact-test-count, public-backend, forbidden shear/averaging, whitespace, and reference diff/status scans | 0 | Recovery scope and adapter/reference boundaries remain isolated | exact tests 6; public backend leaks 0; forbidden scope 0; whitespace clean; reference unchanged |
- contract_checks: full `internalForce=K*d` and
`residual=internalForce-externalForce` are computed as private candidates;
the full residual is preserved in reaction so free residual evidence remains
visible and constrained entries are the physical support reactions. No
endpoint-action summation participates in reaction recovery.
- contract_checks: the free residual uses
`||r_f||/max(||Fint_f||,||Fext_f||)` with no unit floor. A positive physical
denominator must meet `1e-10`; exact zero numerator/denominator is accepted
as zero-load equilibrium, while nonfinite arithmetic fails closed.
- contract_checks: dimensions, finite input, stable free/constrained order,
exact prescribed displacement, active entity references, and twelve-DOF
scatters are checked before computing candidates. Internal/residual/reaction
vectors and endpoint/Gauss/stress rows replace AnalysisState only after all
elements recover finite results, so failure is atomic.
- contract_checks: active element order produces endpoint `0,1`, Gauss `1,2`,
and element/Gauss/section stress order. Equilibrium end action
`[FX,FY,FZ,MX,MY,MZ]`, endpoint `[N,T,My,Mz]`, Gauss strain/resultant, and
section-point/default-centroid `S11` remain distinct.
- contract_checks: node-station projection requires exact endpoint row
identity, a two-endpoint unloaded interior chain, identical section and
local axes, finite component tolerances `[N,T,My,Mz]`, and agreement before
selecting the smaller stable element ID. Positive-local-x section-cut rows
compare directly and are never averaged; reversed, branched, loaded,
section-jump, nonfinite, and mismatch cases fail structurally.
- generated_evidence: `.harness/build/src/fesa/Debug/fesa_solver.lib`,
`.harness/build/tests/Debug/fesa_unit_tests.exe`
- reference_diff: unchanged; `git diff --exit-code -- reference/` exit 0
- handoff: Step 23 can serialize the stable nodal vectors and distinct
endpoint/Gauss/stress rows; Step 24 reference tooling can reuse
`normalizeSectionResultantsToNodeStations` without backend or HDF5 types.
- concerns: none; no critical implementation, environment, numerical, or
upstream-contract conflict was found.
### Step 22 Review Fix Round 1 — full-space free-residual visibility
- review_trigger: the approved I/O contract requires Reaction at every node
and component, including the accepted free-DOF residual; the AnalysisState
storage comment likewise makes reaction a full-index residual view.
- RED-test: `cmake --build .harness/build --config Debug --target fesa_tests;
ctest --test-dir .harness/build -C Debug -R
'^ResultRecovery.EnforcesNormalizedFreeResidual$' --output-on-failure`
built successfully and exited 1 in CTest. The accepted below-tolerance free
residual was `-1.000000082740371e-09`, while its reaction entry was `0`.
- production_fix: the private reaction candidate is now a full copy of
`residual=K*d-F`. Constrained entries remain the physical reactions, free
entries retain residual evidence, and element end actions are still never
summed into reaction.
- GREEN-focused: the same focused build/test command exited 0 and passed 1/1
after the minimum production change.
- VERIFY-build: `cmake --build .harness/build --config Debug` exited 0 under
MSVC x64 Debug with no new FESA warning.
- VERIFY-targeted: `ctest --test-dir .harness/build -C Debug -R
ResultRecovery --output-on-failure` exited 0 and passed the unchanged exact
six names 6/6.
- VERIFY-discovery-full: `ctest --test-dir .harness/build -C Debug
--show-only=json-v1` discovered 68 tests, exactly six ResultRecovery tests;
full `ctest --test-dir .harness/build -C Debug --output-on-failure` exited 0
and passed 68/68.
- failure_atomicity: the existing tolerance-failure branch in
`ResultRecovery.EnforcesNormalizedFreeResidual` still proves prior internal,
residual, reaction, and endpoint state remains unchanged on failure.
- supersession: this review section records the historical pre-fix finding
that implementation and report originally kept only constrained residual
entries. The final Step 22 contract above now states that reaction is the
full residual dataset; only constrained entries are physical reactions.
- phase_index: the review-fix worker intentionally left phase metadata
unchanged. After independent root verification, finalization preserved exact
`started_at=2026-08-09T20:42:15+0900`, added
`completed_at=2026-08-09T21:14:47+0900`, and updated the summary to state
the corrected full-residual reaction contract.
- evidence_hygiene: an initial parallel VERIFY/audit wrapper terminated before
product commands because its PowerShell count expression was malformed. It
is excluded from TDD and product VERIFY evidence; the recorded evidence is
the subsequent uncontended serial build, targeted, discovery, full sequence
followed by a separate successful audit command.
- concerns: none; no upstream-contract conflict or critical blocker remains.