Part of the NumSim compiler epic: **#28**. ## Summary Every generated material must be verifiable on its own; the project must produce human-readable documentation of what was generated. ## Scope ### 4.1 — TangentCheckPass - Generates a small driver per recipe - Compares algorithmic tangent (from Phase 3b) against forward-FD `(σ(ε+h) − σ(ε))/h` - Per-region tolerance scheme (per the plan): - Tight (1e-6) on smooth regimes - Looser through elastic-plastic transitions, kinematic-hardening reverse loading, multi-surface corners - Runs in CI on the entire golden recipe set - Failure breaks the build ### 4.2 — Material drivers A small library of standard load paths (`tests/drivers/` or own lib): - Uniaxial tension / compression - Simple shear - Plane stress / plane strain - Biaxial loading - Cyclic loading Each takes a generated `compute()` function and produces (ε, σ, internal variables) traces. Used by verification and reports. ### 4.3 — Report generator A pass that consumes the verified IR + driver results and emits: - HTML (MathJax for equations, embedded plots) - PDF (LaTeX path) - Markdown (lightweight) Report contents per the spec § 23: model metadata, rendered equations, state variables table, tangent verification results, driver plots, generated targets summary. ## Acceptance - `TangentCheckPass` runs in CI; every golden recipe passes - Driver suite is wired into the standalone backend - Report renders cleanly for J2 + NeoHookean + Drucker-Prager - Edge-case loading paths (transition, reverse, multi-surface corner) are explicitly in the verification matrix ## Files affected - New: `include/numsim_codegen/passes/TangentCheckPass.h` - New: `tests/drivers/` library - New: `include/numsim_codegen/passes/ReportPass.h` - New: `templates/report/` (HTML/MD/LaTeX templates) ## Dependencies - Phase 3b (algorithmic tangent must exist before it can be verified)
Activity