Public: anyone can read this; the crew can change it.

The landsim corpus test runs under the 2 s per-test budget, and test/landsim.test.ts leaves SLOW #12488

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Every test in test/landsim.test.ts is now under 2 s alone here, and the SLOW entry is gone from scripts/gate.ts. bun scripts/gate.ts and bun x tsc --noEmit are green, and the file's 20 tests pass. I did not run the full suite; the forge does that on push.

Notes

opened this

Every test in test/landsim.test.ts is now under 2 s alone here, and the SLOW entry is gone from scripts/gate.ts. bun scripts/gate.ts and bun x tsc --noEmit are green, and the file's 20 tests pass. I did not run the full suite; the forge does that on push.

What changed

  • One test a seed: the single 18 s corpus test is now one test per seed. The additive-merge pair check is one test per landing order, and the order-independence check is its own test.
  • Determinism: it runs seed 34 twice, one run per test, and the second run compares signature and final tree against the first. This replaces seed 2.
  • Quick seeds: they are now 1, 3, 5, 8 instead of 1 to 4, chosen because they land fastest. Seed 2 took about 2.3–3 s alone. Seeds 1 and 5 cover additive merges and seed 8 covers order independence.
  • Landed check: the old corpus.landed > 0 check is now a last test that sums what the seed tests landed.
  • Helper change: checkAdditiveMerges in test/support/landsim.ts takes an optional list of orders, defaulting to both, so existing callers behave the same.
  • Wide run: LANDSIM_SEEDS=n still runs seeds 1..n for the nightly job. Some seeds there (6, 7, 13 and others) take over 2 s alone, and the nightly has no per-test budget.
  • Unchanged: the #12104 reproducer stays in the gate as before.

Not done

  • Timings: these are from this sandbox, not the gate box. The slowest run (a quick seed's own test) came in under 1.8 s, so there is less margin there. Check the budget on the gate box.
  • Determinism seeds: the nightly no longer checks determinism on every seed with seed % 16 == 2; it runs seed 34 only. I judged that enough, but it is less than before.

To try it: bun test test/landsim.test.ts, or LANDSIM_SEEDS=24 bun test test/landsim.test.ts for the long run.

Closes #12447

2 earlier comments
commented

Every test in test/landsim.test.ts is now under 2 s alone here, and the SLOW entry is gone from scripts/gate.ts. bun scripts/gate.ts and bun x tsc --noEmit are green, and the file's 20 tests pass. I did not run the full suite; the forge does that on push.

What changed

  • One test a seed: the single 18 s corpus test is now one test per seed. The additive-merge pair check is one test per landing order, and the order-independence check is its own test.
  • Determinism: it runs seed 34 twice, one run per test, and the second run compares signature and final tree against the first. This replaces seed 2.
  • Quick seeds: they are now 1, 3, 5, 8 instead of 1 to 4, chosen because they land fastest. Seed 2 took about 2.3–3 s alone. Seeds 1 and 5 cover additive merges and seed 8 covers order independence.
  • Landed check: the old corpus.landed > 0 check is now a last test that sums what the seed tests landed.
  • Helper change: checkAdditiveMerges in test/support/landsim.ts takes an optional list of orders, defaulting to both, so existing callers behave the same.
  • Wide run: LANDSIM_SEEDS=n still runs seeds 1..n for the nightly job. Some seeds there (6, 7, 13 and others) take over 2 s alone, and the nightly has no per-test budget.
  • Unchanged: the #12104 reproducer stays in the gate as before.

Not done

  • Timings: these are from this sandbox, not the gate box. The slowest run (a quick seed's own test) came in under 1.8 s, so there is less margin there. Check the budget on the gate box.
  • Determinism seeds: the nightly no longer checks determinism on every seed with seed % 16 == 2; it runs seed 34 only. I judged that enough, but it is less than before.

To try it: bun test test/landsim.test.ts, or LANDSIM_SEEDS=24 bun test test/landsim.test.ts for the long run.

commented

I rewrapped the three comment lines in test/landsim.test.ts that were over 100 columns, and pushed the fix to the pull. bun scripts/gate.ts is green and bun x tsc --noEmit is clean. All 20 tests in test/landsim.test.ts passed when I ran them, before I committed the rewrap.

One of the three lines was the one the check named, at line 64. The other two were an older header comment and a comment in the shrinker test. The gate only reads committed changes, so it kept reporting line 64 until I committed the rewrap.

What changed in the pull

  • The single 18 s corpus test is now one test per seed.
  • The additive-merge pair check is split into one test per landing order.
  • The order-independence check is its own test.
  • Determinism runs seed 34 twice, one run per test.
  • The quick seeds are now 1, 3, 5 and 8, picked because they land fastest. Seeds 1 and 5 cover additive merges and seed 8 covers order independence.
  • The SLOW entry for test/landsim.test.ts is gone from scripts/gate.ts.
  • checkAdditiveMerges in test/support/landsim.ts takes an optional list of orders. It defaults to both, so existing callers behave as before.
  • The #12104 reproducer stays in the gate.

Not done

  • Timings come from this sandbox, not the gate box. In the last full runs the slowest test was about 1.8 s, so check the 2 s budget on the gate box.
  • LANDSIM_SEEDS=n still runs seeds 1..n for the nightly job. Some of those seeds take over 2 s alone, which only matters if the nightly has a per-test budget.
  • The nightly no longer checks determinism on every seed with seed % 16 == 2; it runs seed 34 only.

To try it: bun test test/landsim.test.ts, or LANDSIM_SEEDS=24 bun test test/landsim.test.ts for the long run.

commented

The 18 s landsim corpus test is now one test per seed, and test/landsim.test.ts no longer needs a SLOW entry. bun test test/landsim.test.ts passes (19 tests, 22 s in my sandbox), and scripts/gate.ts and tsc --noEmit are clean. All changes are in test/landsim.test.ts.

Changes, against the four review points:

  1. Vacuous assertion: the >= 0 check is gone. The first determinism test now asserts a non-empty signature and unowned(violations) equal to [].
  2. Order coupling: determinism now sits in a describe(\determinism, seed N\) group. Its beforeAll runs the seed twice, and two self-contained tests read the results, so each also passes under -t. Each seed test now asserts out.landed > 0, and the shared landed counter and the "seeds landed something" test are removed.
  3. Determinism coverage: it is not reduced any more. Quick runs check seed 34. With LANDSIM_SEEDS set (the nightly's 24 seeds), it checks every seed where seed % 16 == 2, as before. I updated the header comment to say so.
  4. Budget: I disagree that a 2 s timeout belongs on these tests. The 2 s limit is enforced by the gate, not by per-test timeouts. scripts/test-budget.ts reads each test's time from the JUnit report and fails any test over 2 s unless the file is in SLOW, and this file no longer is. The repo's usual timeout is 30_000 as a safety net, so I replaced 300_000 with that. A regression to a slow seed now fails the gate.

Timings: The slowest seed tests in my sandbox are 1.6 s (seed 1), 1.5 s (seed 8 order independence) and 1.5 s (seed 3). I can't see how long seed 34 takes on the gate box. Its two runs are in a beforeAll, and the budget counts only each test's own time, not its hooks. The 20 s file budget does still count them: the whole file took 22 s here, which is over, and I have no gate-box time to tell whether it is over there. If the gate box turns out over 20 s, the way out is to cut a quick seed or run determinism on a cheaper seed.

Left out: I did not change the seed choice or the scenario generator.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs