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

Migrated from github.com/amirmushichge/pixel-plays

Keep the full `bun test` well inside the deploy's 600 s limit as the catalogue grows #233

Merged opened this

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

Merged

The full bun test now takes 329 s locally, down from about 524 s, so it is about 37% faster and misses the "under half" target (262 s). It passed in full: 1267 tests, 0 failures.

Notes

shipped production is serving it deploy ab54f53

opened this

The full bun test now takes 329 s locally, down from about 524 s, so it is about 37% faster and misses the "under half" target (262 s). It passed in full: 1267 tests, 0 failures. I did not run bun scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed its help text (no tsconfig), so it was not a real type check.

What changed

  • Share-card test (serve.test.mjs): every game is captured once and every committed card is still compared. A second capture, to check determinism, is made only for the first, middle and last game.
  • Shared boot (playtest.test.mjs): the "boots and paints" and "idles four seconds" tests now share one boot, and the idle test carries on from the first test's two seconds. The round test's untouched twin is that same boot, carried on to the round's end. All five behaviours are still asserted for every game, and no assertion was removed or loosened.
  • Per-game budget test: each game gets a test that fails, naming the game and its time, when that game's playtests together exceed 15 s plus 300 ms per second of the scripted round. I scaled it with the round because a long round such as go-kart's (178 s of play, about 14 s of test time) cannot fit a flat 15 s.
  • README: the testing section states the measured time and the per-game budget.

Not done

  • The scripted rounds dominate what is left: playtest.test.mjs alone takes 266 s. A round has to play to its end, and its untouched twin has to run for as long, so I did not shorten either. Getting under half would mean changing what the rounds prove, so I left that to a person.
  • I did not re-measure the old suite beyond the issue's 524 s figure.

To try: bun test playtest.test.mjs serve.test.mjs.

🤖 Generated with Claude Code

Closes #227

1 earlier comment · 2 events
commented

The full bun test now takes 329 s locally, down from about 524 s, so it is about 37% faster and misses the "under half" target (262 s). It passed in full: 1267 tests, 0 failures. I did not run bun scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed its help text (no tsconfig), so it was not a real type check.

What changed

  • Share-card test (serve.test.mjs): every game is captured once and every committed card is still compared. A second capture, to check determinism, is made only for the first, middle and last game.
  • Shared boot (playtest.test.mjs): the "boots and paints" and "idles four seconds" tests now share one boot, and the idle test carries on from the first test's two seconds. The round test's untouched twin is that same boot, carried on to the round's end. All five behaviours are still asserted for every game, and no assertion was removed or loosened.
  • Per-game budget test: each game gets a test that fails, naming the game and its time, when that game's playtests together exceed 15 s plus 300 ms per second of the scripted round. I scaled it with the round because a long round such as go-kart's (178 s of play, about 14 s of test time) cannot fit a flat 15 s.
  • README: the testing section states the measured time and the per-game budget.

Not done

  • The scripted rounds dominate what is left: playtest.test.mjs alone takes 266 s. A round has to play to its end, and its untouched twin has to run for as long, so I did not shorten either. Getting under half would mean changing what the rounds prove, so I left that to a person.
  • I did not re-measure the old suite beyond the issue's 524 s figure.

To try: bun test playtest.test.mjs serve.test.mjs.

🤖 Generated with Claude Code

Changes requested — before the latest push

Box 4 is not met, and it is the point of the issue: the full bun test is 329 s against about 524 s before, 37% faster, where the box asks for under half (262 s). The README states the measured time honestly, but the target stays open. The builder says the remaining cost is the scripted rounds and the untouched twins (playtest.test.mjs alone is 266 s).

Fix first: cut the round cost without dropping an assertion. Options, best first:

  1. The untouched twin in the round test only needs its HUD text at the end. Step it without rendering or painting each frame (a step-only path in playtest.mjs) and read the picture and text once at the end.
  2. Share boots in the pointer-play and keyboard tests too. Each boots an idle twin plus a played game. A fresh boot per test is the cost, and the idle twin of seed 7 or 3 could be built once per game and reused by the pointer test and the round.
  3. If the remaining time cannot honestly reach 262 s, say what the measured number is and why in the README, and move the 'under half' target into a follow-up issue in your pull description rather than leaving it silently unmet.

The rest is good. The shared boot, the three-game determinism check (every committed card still compared) and the per-game budget test naming the game all do what boxes 1 to 3 ask, and tests passed. One small point: the budget test reads spent[id] and roundSeconds[id], which are empty if a filter runs only that test, so it passes vacuously. Keep that in mind when you restructure.

Other items: nothing else blocks this. No security surface changed, and there is no UI change to the preview.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The full bun test now takes 259 s, down from about 524 s. That meets the "under half" target (262 s). It passed in full: 1267 tests, 0 failures.

I couldn't find the review text. The forge reports one "changes requested" review but returns none of its content, so I took the target I missed as the feedback. If the review asked for something else, tell me.

What changed since the last push

  • Untouched twin (playtest.mjs, playtest.test.mjs): the round test's untouched twin is only read for its text at the end, so I added stopDrawing() and call it before the twin is stepped on. It swaps the page's draw for a no-op, so most of each frame's cost is gone. A game without a draw function is unaffected, and the real game's assertions are untouched.
  • Budget test: it now first asserts that the game's round ran. Run alone, it fails with that reason instead of passing on a zero time.
  • README: the testing section now says 259 s, with playtest.test.mjs at 188 s (it was 266 s), and mentions stopDrawing.

Not done

  • I did not run scripts/gate.ts or scripts/fast.ts. This clone has no scripts/gate.ts or scripts/fast.ts.
  • The type check isn't real. bun x tsc --noEmit isn't a real type check here because there is no tsconfig. It also wrote a lockfile, which I did not commit.
  • I did not shorten any scripted round, so what the rounds prove is unchanged.

To try: bun test playtest.test.mjs serve.test.mjs.

🤖 Generated with Claude Code

Approved

Earlier ask (the full suite must come in under half of 524 s) is met: 259 s measured, README states it and the per-game budget. stopDrawing keeps the twin text-only check intact, and the budget test now fails with a clear reason when run alone. Next, non-blocking: (1) Non-blocking: shorten the longest scripted rounds (wood-split, go-kart) if the catalogue keeps growing, since rounds are now the bulk of the time. (2) Non-blocking: have the budget test also print the per-game times so a creeping slowdown is visible before it fails.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs