Skip to content

The gate before the Python goes (step 16) - #63

Open
jeany55 wants to merge 1 commit into
trigscript-4from
gate
Open

jeany55 wants to merge 1 commit into
trigscript-4from
gate

Conversation

@jeany55

@jeany55 jeany55 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

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=SEED the 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 / 2 was 3.5; + − *, the shifts, unary minus and Math.abs did 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 … while tests needing values first (IR do.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 : t losing 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-*.ts input 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

…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
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