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
Check · Review · Land · Live done — Landed and live in production.
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.
shipped production is serving it deploy ab54f53
1 earlier comment · 2 events
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.mjsalone 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
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:
- 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. - 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.
- 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 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 addedstopDrawing()and call it before the twin is stepped on. It swaps the page'sdrawfor a no-op, so most of each frame's cost is gone. A game without adrawfunction 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.mjsat 188 s (it was 266 s), and mentionsstopDrawing.
Not done
- I did not run
scripts/gate.tsorscripts/fast.ts. This clone has noscripts/gate.tsorscripts/fast.ts. - The type check isn't real.
bun x tsc --noEmitisn'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
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.
The full
bun testnow 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 runbun scripts/gate.tsorscripts/fast.ts, andbun x tsc --noEmitprinted its help text (no tsconfig), so it was not a real type check.What changed
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.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.Not done
playtest.test.mjsalone 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.To try:
bun test playtest.test.mjs serve.test.mjs.🤖 Generated with Claude Code
Closes #227