feat(linear-static-3d-euler-beam): step 20 - mkl-pardiso-solver

This commit is contained in:
KOKO\Mimi
2026-08-09 20:05:20 +09:00
parent 584c5c8714
commit 80f25e569a
8 changed files with 840 additions and 0 deletions
@@ -860,3 +860,66 @@
effective RHS without changing this module's mapping responsibility.
- concerns: none; no critical implementation or upstream contract conflict
was found.
## Step 20 — mkl-pardiso-solver
- task_id: `TASK-20`
- status: `completed`
- changed_files: `include/fesa/solvers/linear/linear_solver.hpp`,
`include/fesa/solvers/linear/mkl_pardiso_solver.hpp`,
`src/fesa/solvers/linear/mkl_pardiso_solver.cpp`,
`tests/unit/solvers/linear/linear_solver_test.cpp`,
`tests/unit/solvers/linear/mkl_pardiso_solver_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-025`, `FESA-REQ-LS3DEB-026`,
`FESA-REQ-LS3DEB-034`, `FESA-REQ-LS3DEB-035`
- test_ids: `T20-PARDISO-001`, `T20-PARDISO-002`,
`T20-PARDISO-003`, `T20-PARDISO-004`, `T20-PARDISO-005`,
`T20-PARDISO-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 both solver public APIs were absent | CMake regenerated with all dependencies resolved; MSVC C1083 reported missing `fesa/solvers/linear/linear_solver.hpp` and `fesa/solvers/linear/mkl_pardiso_solver.hpp` from the two new test files |
| GREEN-build | `cmake --build .harness/build --config Debug --target fesa_tests` | 0 | Minimum backend boundary, private PARDISO state, six tests, solver library, and unit executable compile and link | `mkl_pardiso_solver.cpp`, both tests, `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 MklPardisoSolver --output-on-failure` | 0 | SPD solution, repeated RHS, refactorization, validation/failures, and conditioning behavior pass | 6/6 exact `MklPardisoSolver` tests passed |
| 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 MklPardisoSolver --output-on-failure` | 0 | Focused Step 20 suite remains green | 6/6 exact `MklPardisoSolver` 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 | 57 tests discovered, including 6 `MklPardisoSolver` tests |
| VERIFY-full | `ctest --test-dir .harness/build -C Debug --output-on-failure` | 0 | Full accumulated C++ suite has zero failures | 57/57 tests passed |
| VERIFY-contract-scans | Fail-on-match public-header scan for `mkl.h`, `MKL_INT`, `pardiso`, oneTBB, and HDF5 symbols; exact-test-count, `git diff --check`, and reference diff/status checks | 0 | The solver backend remains private and Step scope/artifact invariants hold | public PARDISO leaks 0; solver-header backend leaks 0; exact tests 6; whitespace clean; reference unchanged |
- contract_checks: `LinearSolver` exposes only the exact separate
`factorize(SparseMatrix)` and const `solve(rhs,solution)` boundary.
`MklPardisoSolver` exposes only its constructor, virtual destructor,
overrides, and `unique_ptr<Impl>`; every MKL header/type/handle is confined
to the `.cpp` and private `Impl`.
- contract_checks: factorization first validates the full square, nonempty,
finite, sorted-unique public CSR, full symmetric structure/value tolerance,
every diagonal slot, and all `size_t` to `MKL_INT` conversions. It then
copies only the sorted upper triangle while retaining exact structural-zero
diagonals.
- contract_checks: the private adapter uses real SPD `mtype=2`, explicit
phases `11`, `22`, `33`, and `-1`, `iparm[26]=1` matrix checking, and
`iparm[34]=1` zero-based indexing. A successful factorization is retained
for repeated RHS; refactorization and destruction release the previous
PARDISO state through the same RAII path. No regularization or fallback is
present.
- contract_checks: solve-before-factorize, RHS/solution dimension mismatch,
nonfinite RHS/solution, nonsquare/empty/asymmetric/missing-diagonal input,
singular or indefinite SPD failure, checker/integer/backend errors, and
phase-specific `-4`/`-7` failures return one deterministic
`FailureCategory::solver` diagnostic. The known SPD system meets normalized
residual `1e-10` and relative analytical error `1e-9`; common-scale and
stiffness-ratio sweeps either meet both limits or return the structured
solver failure without adding a conditioning threshold.
- 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 21 can form the effective free RHS after this adapter has
factorized `Kff`, then call `solve` repeatedly without refactorization or
depending on MKL types.
- concerns: none; no critical implementation, environment, backend, or
upstream-contract conflict was found.