Skip to content

Phase 4 — Verification framework + material drivers + report generation #36

Open

Description

@petlenz

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions