You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/simlin-engine/tests/wrld3_ltm_panic.rs::wrld3_element_level_enumeration_is_uncapped asserts that unbudgeted element-level circuit enumeration on WRLD3 produces exactly 1,863,803 elementary circuits. It runs unconditionally in debug builds, including the normal cargo test / cargo test -p simlin-engine flow used by the pre-commit hook.
Johnson's algorithm over 1.8M circuits is expensive in release mode; in debug mode (no optimization, bounds checks enabled, Vec growth not coalesced) the test can balloon in both wall time and peak memory. That's a problem for the default developer flow where cargo test is expected to complete in reasonable time without DoS-ing the developer's workstation -- especially when the pre-commit hook fans out.
No cfg gate. find_indexed_circuits_with_limit(usize::MAX) then produces all 1,863,803 circuits from the WRLD3 element-level graph.
Proposed fix
Gate the test behind #[cfg(not(debug_assertions))] (release-only) or move it to a bench / --ignored test that's run on demand. The test's job is to verify the cap-lift semantics (usize::MAX must not trip TruncatedByBudget); that assertion has value as a regression check but doesn't need to run on every developer cargo test invocation in debug mode.
Alternative: reduce the fixture to a smaller dense graph that exercises the same code path without requiring 1.8M circuits. The existing comment calls out the "2026-04-18 adversarial cap-lift validation" specifically citing the WRLD3 count, so the full-count assertion has historical significance that would be lost with a smaller fixture.
Severity
Low. The test is correct; the concern is resource use on the default test flow.
Discovery context
Noted during adversarial review of PR #461 (branch ltm-perf-enable-always).
The accompanying docstring explains the gating ("Johnson's algorithm on WRLD3's 166-node SCC takes ~30s in debug -- over the per-test budget and a meaningful fraction of the 180s workspace cap") and documents the on-demand invocation:
cargo test --release -p simlin-engine --test wrld3_ltm_panic -- --ignored wrld3_element_level_enumeration_is_uncapped
The sibling wrld3_ltm_compilation_finishes_in_time (not ignored, 60s thread budget) continues to protect every-push compilation correctness, so the cap-lift regression-detection role is still covered on the default flow.
Activity
engine: close LTM auto-flip gaps flagged in review
engine: close LTM auto-flip gaps flagged in review
bpowers commentedon Apr 30, 2026
Fixed in commit fee04c6 ("engine: ignore wrld3_element_level_enumeration_is_uncapped by default").
The test now carries
#[ignore]:The accompanying docstring explains the gating ("Johnson's algorithm on WRLD3's 166-node SCC takes ~30s in debug -- over the per-test budget and a meaningful fraction of the 180s workspace cap") and documents the on-demand invocation:
The sibling
wrld3_ltm_compilation_finishes_in_time(not ignored, 60s thread budget) continues to protect every-push compilation correctness, so the cap-lift regression-detection role is still covered on the default flow.Verified on
mainat HEAD 630fceb (2026-04-29).doc: refresh LTM tech-debt entries after triage of open issues