test: shear-wave modal-extinction handling; TG mock verify_source flow arg

- shear_wave.fit_rate: finite late R=0 returns rate_fit_valid=false with
  null fit quantities (no clipping, no invented rate); own screens and
  budgets treat it as a failure (CONTROL_SCREEN_FAIL / refined FAIL),
  other finite metrics retained, JSON-safe.
- test_projected_pairs: dry-run/execution mocks expect the explicit
  'taylor_green' flow argument now passed to verify_source.
- run_case: SHEAR_WAVE_SHA256 repinned; extinction test added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-19 00:36:19 +00:00
1 parent f337652683
commit de5b0cc080
5 files changed
+57 -14

No files matched your search

@@ -4,6 +4,7 @@ Run from this directory with PYTHONPATH=<checkout>/src (same as test_oracle.py).
"""
import hashlib
import json
import math
import unittest
from pathlib import Path
@@ -286,6 +287,32 @@ class AssessTests(unittest.TestCase):
with self.assertRaises(ValueError):
sw.assess(base, fine, [record(128, 2, rows_for(128)), record(128, 2, rows_for(128))])
def test_modal_extinction_is_a_failure_not_malformed(self):
def extinct(rows):
for row in rows[1:]:
row.update(a_hat=0.0, b_hat=0.0, modal_amplitude=0.0, amplitude_ratio=0.0,
amplitude_error=-1.0)
return rows
base = record(128, 1, rows_for(128))
fine = record(256, 1, rows_for(256))
refined = record(128, 2, extinct(rows_for(128)))
report = sw.assess(base, fine, [refined])
self.assertEqual(report["status"], "FAIL")
own = report["refined"]["constant"]
self.assertTrue(own["valid"])
self.assertFalse(own["rate_fit_valid"])
self.assertIsNone(own["rate_error"])
self.assertIsNone(own["control_ratios"]["root"]["rate_error"])
self.assertFalse(own["own_screens_pass"] or own["controlled_pass"] or own["budget_pass"])
self.assertEqual(own["residual_l2"], 1e-4) # other finite metrics retained
json.loads(json.dumps(report, allow_nan=False))
control = sw.assess(record(128, 1, extinct(rows_for(128))), fine,
[record(128, 2, rows_for(128))])
self.assertEqual(control["status"], "CONTROL_SCREEN_FAIL")
self.assertIsNone(control["refined"]["constant"]["budget"]["rate_error"])
self.assertFalse(control["refined"]["constant"]["controlled_pass"])
json.loads(json.dumps(control, allow_nan=False))
def test_wrong_shapes(self):
base = record(128, 1, rows_for(128))
fine = record(256, 1, rows_for(256))