Commit ea4920f
test: witness coverage for 4 under-tested invariants (#222)
* test: witness coverage for 4 under-tested kuramoto/physics modules
Adds INV-* anchored witness tests for modules that were either at 0%
coverage (core/kuramoto/falsification, core/kuramoto/metrics) or had
behavioural tests without physics-contract anchors (core/physics/landauer,
core/physics/tsallis_gate).
New test files (all physics-validator L1-L5 clean):
* test_T24_kuramoto_metrics_witness.py — 8 tests
- INV-K1 bound on order_parameter via Hypothesis + antipodal witness
- INV-SB2 determinism of permutation_entropy
- INV-HPC2 chimera_index on disconnected graph; rolling_csd window edges
* test_T25_falsification_surrogates.py — 8 tests
- INV-HPC1 seeded replay of IAAFT surrogate + different-seed falsifier
- INV-HPC2 amplitude multiset preservation + spectrum residual bound
- INV-K1 bound on time_shuffle_test observed + null samples
- INV-HPC2 degree-preserving rewire preserves degree sequence
* test_T26_landauer_witness.py — 9 tests
- INV-TH2 non-negative entropy per step (property + falsifier)
- INV-HPC2 formula equality to k_B·T·ln2, ratio finiteness, temp rejection
- INV-HPC1 bit-identical replay across runs
* test_T27_tsallis_gate_witness.py — 11 tests
- INV-FE2 position_multiplier ≥ 0 via Hypothesis + crisis-floor falsifier
- INV-HPC2 estimate_q finite and ≥ 1; zero-variance guard
- INV-SB2 deterministic replay across fresh instances
Targeted coverage delta (before → after, using .coveragerc source tree):
core/kuramoto/falsification.py : 0.00% → 54.14% (+54.1 pp)
core/kuramoto/metrics.py : 0.00% → 40.99% (+41.0 pp)
core/physics/landauer.py : 94.74% → 96.49% (+1.75 pp)
core/physics/tsallis_gate.py : 90.43% → 96.81% (+6.38 pp)
Every tolerance in the new tests is derived from a documented formula
(float64 unit roundoff, IAAFT convergence bound, Bickel-Freedman kurtosis
std error, Molloy-Reed degree-sequence invariant). Every new test
includes a falsification probe per the ladder discipline.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style: apply black to new T24/T26 witness tests
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Yaroslav Vasylenko <neuron7x@users.noreply.github.com>1 parent c98d1a2 commit ea4920f
4 files changed
Lines changed: 1624 additions & 0 deletions
0 commit comments