Repository navigation
Conversation
…oth ways TrigScript 4, step 16. Whole programs made at random (tests/randomScript.ts), rendered as TrigScript and as JavaScript from one tree, run as JavaScript, in the simulator and as the built map walked from its bytes (tests/random-scripts.test.ts, 60 seeds in CI), and with scripts/random-scripts.mts in the lifted game on both builds, the game's thirteen-line ring modelled; --reduce cuts a failing seed to the smallest script. scripts/gate-sweep.mts builds every probe both ways and plays both. Found and fixed in the front end: a game condition in ?:, ! or && taken as true when the script was built (the evaluator and the hoister); 7 / 2 folded to 3.5; constant sums, products, shifts, negation and Math.abs not wrapping at 32 bits; a store's index worked out after a value that calls or pops. Found and fixed in the map of our own: a do loop whose test needs values first (IR do.before), a cell at a masked index compared with a constant, calls among a print's parts run through the one cursor (texts read ahead), a game read against a negative constant asked unsigned, a text ternary with one text losing its call, tasks dying with the program's body, sync() inside a branch, a called text function's result (Snake), a two-term index (Tetris), and the texts' do-loop work dropped by the rewriter. tests/gate.test.ts holds each as its smallest script. The simulator's comments and docs/ir.md name the backend as their model. The plan's section has the numbers, the sweep and the Open list; the play pack is in Maps/TrigScript/gate/. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TrigScript 4, step 16 of the way off eudplib. See docs/v4-plan.md, "The gate before the Python goes (2026-10-23)".
Built
tests/randomScript.ts: whole programs made at random, one tree rendered as TrigScript and as JavaScript.tests/random-scripts.test.ts: 60 seeds in CI, each run as JavaScript, in the simulator and as the built map walked from its bytes, lines compared frame by frame (RANDOM_SCRIPTS=n,RANDOM_SEED=n).scripts/random-scripts.mts: any range;--game [--eudplib]in the lifted game on both builds through the game's ring;--reduce=SEEDthe smallest script that still fails.scripts/gate-sweep.mts: every probe built both ways and played, a Markdown table.tests/gate.test.ts: every finding as its smallest script.Fixed, front end: a game condition inside
?:/!/&&/||was taken as true when the script was built;7 / 2was 3.5;+ − *, the shifts, unary minus andMath.absdid not wrap at 32 bits when known; a store's index was read after a value that calls or pops.Fixed, map of our own:
do … whiletests needing values first (IRdo.before); a cell at a masked index against a constant; a call among a print's parts through the one cursor; a game read against a negative constant;f() ? t : tlosing its call; tasks dying with the program's body;sync()inside a branch; a called text function's result block (Snake); a two-term index (Tetris); the do loop's text work dropped by the rewriter.Numbers: seeds 1–100, 201–300, 301–400 all agree (13,922 lines); 30 seeds in the lifted game, own and eudplib builds line for line the same. Suite 1,399 green. The probe sweep's table and the Open list (recursive text functions, a unit's name from a made text, texts in records in growing arrays, the
game-*.tsinput harness on own maps) are in the plan.To play (Maps/TrigScript/gate/,
gate-answers.txt): 14 maps built our way, Tetris and Snake for the first time.🤖 Generated with Claude Code
https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5