Skip to content

Test guards: empty port waves fail, no oracle fallback, scoped matmul precision (#2494, #2444, #2428) - #213

Merged
maraxen merged 2 commits into
mainfrom
fix/261011-test-hygiene
Oct 12, 2026
Merged

maraxen merged 2 commits into
mainfrom
fix/261011-test-hygiene

Conversation

@maraxen

@maraxen maraxen commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Fixes debts #2494, #2444 and #2428: three ways the test suite could report green, or use the wrong reference, without anyone noticing.

#2494: a selected port wave that collects nothing now fails. When AMINX_PORT_WAVE is set and no items for that wave remain, or a comparison was parametrised from an empty set, the session fails and names the wave (tests/port_guards.py, wired in tests/conftest.py). With no wave selected, the guard does nothing.

#2444: no silent fallback to another wave's oracle. Without AMINX_PORT_WAVE, only the default port_selftest target runs. Every other wave's tests skip with "set AMINX_PORT_WAVE= to run this wave" instead of loading the self-test oracle (tests/port/conftest.py). A plain pytest run still collects and passes.

#2428: matmul precision no longer leaks between tests. The four global jax.config.update("jax_default_matmul_precision", "highest") calls are now a scoped decorator (tests/matmul_precision.py). An autouse fixture in tests/parity/conftest.py and in a new tests/model/conftest.py fails any test that leaves the precision changed.

Controls (tests/test_port_guards_controls.py, pytester): a selected wave with items passes; a selected empty wave and an empty parameter set fail; an unselected wave is inert; an unset wave skips non-default waves and runs the default; the scoped decorator restores the value; a deliberate leak is caught. The controls drive the guard functions through a test conftest that mirrors the real hooks.

Run on titanix: tests/test_port_guards_controls.py tests/model tests/parity: 382 passed, 12 skipped, 1 xfailed. Ruff is clean on the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGHJhq24fYihaMivnXNhro

maraxen and others added 2 commits October 10, 2026 20:23
…matmul precision

- #2494: an explicitly selected AMINX_PORT_WAVE that collects zero items for that
  wave, or any item generated from an empty parameter set, raises UsageError naming
  the wave (tests/port_guards.py check_selected_wave, called from tests/conftest.py).
- #2444: with AMINX_PORT_WAVE unset only the pyproject default wave runs; other
  waves skip with "set AMINX_PORT_WAVE=<wave>" (unset_wave_skip_reason, tests/port/conftest.py).
- #2428: the four global jax.config.update("jax_default_matmul_precision") calls are
  replaced by a scoped @highest_matmul_precision decorator; autouse guards in
  tests/parity and tests/model fail any test that leaves the precision changed.
- tests/test_port_guards_controls.py: pytester negative controls for each guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGHJhq24fYihaMivnXNhro
…h has no wheel -- main fails the same way)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014bjCGQZgFEE6nR8cGTMFt7
@maraxen
maraxen merged commit aa6106d into main Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant