feat: add fp-stability command for Verrou-based FP instability testing#1403
feat: add fp-stability command for Verrou-based FP instability testing#1403sbryngelson wants to merge 4 commits intoMFlowCode:masterfrom
Conversation
Adds ./mfc.sh fp-stability — a persistent floating-point stability test
suite using Verrou's random IEEE-754 rounding mode.
For each registered test case the runner:
1. Generates initial conditions via pre_process
2. Runs simulation once with --rounding-mode=nearest (reference)
3. Runs simulation N times with --rounding-mode=random
4. Reports max L-inf deviation vs threshold (PASS/FAIL)
Two cases probe known ill-conditioning in MFC:
- sod_strong: 1-D Sod p_L/p_R=100,000 — HLLC xi-factor cancellation
(s_L - vel_L)/(s_L - s_S) near sonic contact
- water_stiffened: 1-D water shock pi_inf=4046 — pressure recovery
p=(E-pi_inf)/gamma loses ~4 decimal digits on low-pressure side
Requires a Verrou-enabled Valgrind at $VERROU_HOME/bin/valgrind
(default: $HOME/.local/verrou). Silently skips if not found.
Binaries are auto-discovered from build/install/ or passed explicitly.
Claude Code ReviewHead SHA: 5c8eaab Files changed:
Findings1.
|
Automated Code ReviewSummary: 1 critical issue, 3 important issues. Critical IssueConsole indent level leaks permanently on exception (confidence: 95%) File:
Fix: Move try:
...
finally:
shutil.rmtree(work_dir, ignore_errors=True)
cons.unindent()
cons.print()Important Issues1. File:
2. Workflow triggers on every push to every branch (confidence: 90%) File: on:
push:
workflow_dispatch:No branch filter ( Fix: Add appropriate filters: on:
push:
branches: [master]
schedule:
- cron: '0 3 * * 1' # weekly on Monday
workflow_dispatch:3. Build uses File: The workflow builds with Suggestions
Strengths
|
Summary
Adds a Verrou-based floating-point stability CI suite (closes #650).
./mfc.sh fp-stabilityruns three 1-D shock cases under randomized IEEE-754 rounding and reports the max L∞ deviation from a nearest-rounding referencesod_standard(standard Sod, threshold 1e-13) — well-conditioned canary that should always passsod_strong(p_L/p_R=100,000, 50 cells, 10 steps) — probes HLLC xi-factor cancellation(s_L - vel_L)/(s_L - s_S)near sonic contactwater_stiffened(stiffened EOS pi_inf=4046, 50 cells, 10 steps) — probes pressure-recovery cancellationp = (E - pi_inf)/gamma(loses ~4 decimal digits when pi_inf/p_right ~ 40,000)verrou_dd_symon failure: when a case exceeds its threshold, delta-debug bisection automatically runs to identify the minimal set of responsible function symbols; logs saved tofp-stability-logs/and uploaded as a CI artifact.github/workflows/fp-stability.yml): builds Verrou once (~20 min), caches it, builds MFC in serial debug mode, runs the suite with N=5 samplesTest plan
sod_standardreports PASS at threshold 1e-13sod_strongandwater_stiffenedreport their instability magnitudesfp-stability-logs/artifact containsdd_sym.logandrddmin_summary./mfc.sh fp-stability --helpshows available options