Repository navigation
test_lab: fail when a zeta>=1 physics-sweep row oscillates or its flags contradict its reading - #65
Merged
Merged
Conversation
The overdamped assertion counted lines containing "settles", and every underdamped row reads "x OSCILLATES, energy settles", so it passed with the zeta=1 and zeta=2 rows oscillating (hq#58, DYN-LAB-1). tests/check_physics_sweep.py parses the table: each zeta row must carry its required reading, the reading must agree with its energy-grew and x:osc flags, and the zeta=0 energy must never read converged. tests/test_physics_sweep_plants.sh runs six planted faults through it in CI, one or more per check; each must apply to exactly one line and be rejected with the message of the check it targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149GnPvac4QFD5y1CrHCcb1
Member
Author
|
@codex review Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
tests/test_lab.shclaimed to check that the critically damped and overdamped rows of thephysics.eigszeta-sweep (zeta=1, zeta=2) do not oscillate. What it actually did was count lines containingsettles. Every underdamped row readsx OSCILLATES, energy settles, so the count was always at least 1, and the gate stayed green even when the zeta>=1 rows oscillated.This PR replaces that count with a row-by-row check:
tests/check_physics_sweep.py(new) parses the sweep table and makes five checks:-0.05, 0, 0.1, 0.4, 1, 2, in that order.DIVERGES (energy grew), 0<=zeta<1 must readx OSCILLATES, energy settles, and zeta>=1 must read exactlysettles.Yexactly when the reading is DIVERGES.Yexactly when the reading isx OSCILLATES.E:convflag is-. This is the lab's stated claim: at zeta=0 energy is conserved, so it never converges.tests/test_lab.sh: thegrep -c settleslines are replaced by a call to the checker. TheDONE,DIVERGESandx OSCILLATESgreps are kept, so no existing assertion is removed.tests/test_physics_sweep_plants.sh(new) is a CI plant harness:physics.eigsmust pass first.physics.eigs, at least one per check.DONE, so a crash does not count as a rejection..github/workflows/test.yml: one new row inrunCmdruns the plant harness. This is unavoidable, becauserunCmdis the only place tests are enrolled.python3is already used bytest_lab.sh(check_solver_output.pyon main), so the devcontainer image needs nothing new.There is no
changes/fragment. This PR changes only tests and CI, and dynamics CI has no fragment check (#55 landed without one).Checklist
eigenscript <file>.eigs). No specimen changed.physics.eigsruns unmodified and under every plant.bash tests/test_smoke.shandbash tests/test_lab.shpass locally (pinned v0.48.0)eigs.jsonversion bumped if the importable surface changed. Not applicable: the surface is unchanged.Finding
tests/test_lab.sh:16-18(origin/main). The sweep rows are printed atphysics.eigs:116-126. TheE:/x:flag columns were never checked.Plant: red before, green after
All runs below use the pinned runtime, EigenScript v0.48.0 (546848c0, the
.devcontainer/DockerfileEIGS_REF). "Old gate" isgit show origin/main:tests/test_lab.sh.Plant A is the Wave-1 reproduction. It is a 1-line change to
physics.eigs:122:Old gate, rc=0. It lies: both zeta>=1 rows read oscillating and the gate still prints PASS.
New gate,
EIGENSCRIPT=$E bash tests/test_lab.sh, rc=1:All six plants, old gate compared with new gate. Each plant changes 1 line.
zeta=1 reads 'x OSCILLATES, energy settles', expected 'settles'or (zeta >= 1.0)on the x observer)expected zeta rows ['-0.05', '0', '0.1', '0.4', '1', '2'], got ['-0.05', '0', '0.1', '0.4', '1']zeta=0 x:osc flag '-' contradicts reading 'x OSCILLATES, energy settles'zeta=-0.05 energy-grew flag '-' contradicts reading 'DIVERGES (energy grew)'zeta=0 energy reported converged; the undamped row must conserve energyGreen after the fix. On the unmodified tree,
EIGENSCRIPT=$E bash tests/test_lab.shgives rc=0:EIGENSCRIPT=$E bash tests/test_physics_sweep_plants.shgives rc=0:Every check is load-bearing. In scratch copies, each of the checker's five checks was disabled in turn (its
ifreplaced byif False:), and the checker was also gutted withsys.exit(0). The plant harness then gave:plant overdamped-reads-oscillating rejected for the wrong reasonplant grew-column-desync rejected for the wrong reasonplant x-flag-column-desync was acceptedplant overdamped-row-dropped was acceptedplant zeta0-energy-converged was acceptedplant overdamped-reads-oscillating was acceptedChecks run
All locally, on pinned v0.48.0, covering the full CI
runCmd:test_lintrc=0test_smokerc=0test_labrc=0test_physics_sweep_plantsrc=0test_orbit_histrc=0test_bifurcationrc=0test_orbit_oraclerc=0 (Xvfb)test_orbit_mouserc=0test_bif_memrc=0bash -nandpy_compilepass on the new and changed files.The added CI time is about 0.3s (the plant harness reruns
physics.eigs7 times). For context, the "suite (in devcontainer)" job takes 139s p50 and 155s p90 (n=40, 2026-10-04..2026-11-01). This PR is not a speedup.Coverage goes up and nothing is removed. One weak count assertion becomes 6 row checks plus 1 claim check, and 6 plants are added.
Done when
suite (in devcontainer)log showsPASS: every physics-sweep plant is rejectedandPASS: zeta=2 reads 'settles' (grew=-, x:osc=-)physics.eigsmakesEIGENSCRIPT=eigenscript bash tests/test_lab.shexit 1 withFAIL: physics sweep: zeta=1 reads 'x OSCILLATES, energy settles', expected 'settles'rows[1][2] != "-"condition intests/check_physics_sweep.pywithFalsemakesbash tests/test_physics_sweep_plants.shexit 1Overlaps
There are no open PRs in dynamics (
GET /repos/InauguralSystems/dynamics/pulls?state=openreturned nothing).Not done in this PR:
Generated by Claude Code