Skip to content

Read long constant lists in place: Bad Apple builds again - #71

Merged
jeany55 merged 1 commit into
mainfrom
bad-apple-showcase
Oct 26, 2026
Merged

jeany55 merged 1 commit into
mainfrom
bad-apple-showcase

Conversation

@jeany55

@jeany55 jeany55 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

TrigScript 4.0's own backend refused probes/bad-apple.ts:

arrays and stacks of 657478 cells, past the 65536 a map of our own lays out (72 bytes a cell)

A list known when the script is built whose values have more than 6 bits between them was laid out as cell triggers, 72 bytes a value. A video's brushes for the fog are hundreds of thousands of 18-bit words, so any script that plays a real video through fog.play was refused. The step 16 gate listed bad-apple as "not built here" (its video was not on the disk), which is how it got through.

The fix (compiler/backend/emit.ts): a list longer than 16,384 values is read where it is, whatever its width — a dword a value, a trigger a bit (Bad Apple's words: 18). Shorter lists are laid out as before.

Checked

  • tests/own-build.test.ts: a 70,000-value, 20-bit list built and walked as the game walks it; fails without the fix. Full suite: 1,360 passed.
  • Lifted game: all 5,216 frames of Bad Apple light exactly their cover; nothing lit below the board; 31k conditions and actions a frame on average, 94.5k at the most (the version played on 2026-10-17 peaked at 151k).
  • game-check: 0 accesses ending the game, 0 ignored.
  • probes/halftone.ts, the other probe the gate did not build, builds.

Also

  • probes/bad-apple.ts is now the showcase map for the YouTube recording: no units, the board lit as build-time pictures so the rows below it stay never seen (black), a curtain into and out of the video, credits.
  • scripts/build-fixture.mts: NO_BASES=1 places no base or troops at the start locations.
  • probes/lib/bad-apple-map.mts: the description credits the song and the video.
  • docs/v4-plan.md: the gate table says bad-apple and halftone build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U79fdupFuMLxYQmMJtffPN

TrigScript 4.0's own backend refused probes/bad-apple.ts: "arrays and stacks of 657478
cells, past the 65536". A read-only list whose values have more than 6 bits between them
was laid out as cell triggers, 72 bytes a value, and a video's brushes for the fog are
hundreds of thousands of 18-bit words. A list longer than 16,384 values is now read where
it is, a dword a value and a trigger a bit, whatever its width. The gate of step 16 had
not built bad-apple (its video was not on the disk), which is how it slipped through.

In the lifted game all 5,216 frames light exactly their cover, 31k conditions and actions
a frame on average and 94.5k at the most (151k before, through cells); game-check clean.

The probe is the showcase map now: no units (build-fixture's new NO_BASES=1), the board
lit as pictures so the rows below it stay never seen, a curtain into and out of the video,
and the song and video credited in the map's description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U79fdupFuMLxYQmMJtffPN
@jeany55
jeany55 merged commit e14b9bf into main Oct 26, 2026
1 check 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