Repository navigation
The ledger: every feature, its step off eudplib, and what a map of our own makes of it - #41
Merged
Merged
Conversation
…es, and its line Most refusals read "a assign it does not lower (no reason given)": the checks' reasons were dropped or kept from an earlier statement, so `a * b`, `a / 4`, `random(6)` and `minerals(P1)` were refused in the same words. Now each statement refused keeps its own reason, and `unlowered` names the first part of it the emitter never takes, in a script's words — "a product of two values, line 51", "the action Set Resources", "a write of unit.sight", "a unit's hp", "an event handled (on.killed)", "an error thrown or caught (try, throw)" — preferring such a part over a reason of how things are put together. build-own's checks move into emitOwn (compiler/backend/own.ts), which the ledger asks too. A print to the owner by its slot is taken; a program owned by P9 to P12, whose triggers the game does not run, is refused. The maps build-own makes of the five own probes are byte for byte as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
…e script is built
`print(`${first({ owner: P1 })?.hp}`)` printed "undefined", `if (first(…)?.cloaked)` compiled to nothing, and
`n = first(…)?.hp ?? 5` to `n = 5`: the evaluator worked the field out of the pick object itself. A field of a pick is
read while the game runs now, as one of `local.selected` already was. Both builds had it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
…order GAME_CALLS took every on.* event's name, so the library's own action `order(…)` was never worked out when the script was built, and a program using it failed with "A call's arguments must be known". An event's name is the game's only as `on.order(…)` or a unit's `u.order(…)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
…op's own `while (true) await play(s)` showed the loop no sleep of its own, so `start(music.loop(song))`, the module's own example, never compiled. The loop plays the song itself and waits at least a frame at the end of each turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
… a map of our own makes of it 831 scripts in ledger/<area>/, each a feature of the language or the library, its first line the step of the way off eudplib that makes it a map of our own's and whether one takes it today, in the words of its refusal. 250 are taken: steps 1-3 whole, the start but for a ?: of booleans, fixed arrays but for a cell read at a shifted index. tests/ledger.test.ts holds every script to its first line, and holds the ledger to the language: every kind of the IR (but the six the front end takes out), every name a script has from the library, the members of on, ui, memory, local, a unit, a set of units and a task, and every export of the standard library's modules is in some script. scripts/ledger.mts prints the table by step, writes the first lines anew after a step (--write), and checks a few or lists what nothing reaches (--check, --missing). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
Its table by step; what was fixed with it (a field read off a pick, order() in a program, music.loop, a print to the owner by slot, owners P9-P12); what is open (a function of the script that keeps a state, called in a program, worked out once; orders.* in order(); disabled() and preserve() in a program said nothing; false errors; JavaScript a program lacks); and the README's language reference, older than TrigScript 4, to be written again from the ledger at 4.0. Refusals now name what they refuse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
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.
The ledger the audit (#40) asked for, built before step 4: one script per feature of TrigScript, each saying which step of the way off eudplib makes it work in a map of our own, and whether a map of our own takes it today. It turned up three bugs that both builds had, now fixed.
The ledger.
ledger/<area>/holds 831 scripts. Each one's first line is// ledger: step 4, refused: a product of two valuesor// ledger: step 1, takes.tests/ledger.test.tscompiles each script as the editor does and asksemitOwn, the checksbuild-ownmakes, now shared. It fails when a first line no longer says what happens.on,ui,memory,local, a unit, a set of units or a task, or an export of a standard-library module (340 names).npx tsx scripts/ledger.mts:--writerewrites the first lines after a step lands, so the diff is the step's account;--check <files>checks a few and shows the IR kinds they compiled to;--missinglists what nothing reaches.asyncand errorsTwo steps counted as done each still have one gap: a
?:of two booleans (step 0), and a cell read at a shifted index,xs[a >> 1](step 3). Every script a map of our own takes was also run from its laid-out bytes against the simulator, with about forty edge cases besides. All printed the same.Refusals say what they refuse. Most read "a assign it does not lower (no reason given)", which is how the missing arithmetic stayed hidden. Now
unlowerednames the first part of the statement the emitter never takes, with its line: "a product of two values, line 51", "the action Set Resources", "a write of unit.sight", "a unit's hp", "an event handled (on.killed)", "an error thrown or caught (try, throw)". Each refused statement keeps its own reason. A print to the owner named by its slot is now taken. A program owned by P9–P12 is now refused, since the game runs triggers for P1–P8 only (still to confirm in the game). The mapsbuild-ownmakes of the five own probes are byte for byte as before.Fixed, in both builds:
undefined.print(`${first(…)?.hp}`)printed "undefined", andif (first(…)?.cloaked)compiled to nothing. It is now read in the game, asu.hpis.order(…)did not compile inside a program.on.order's name was taken for it.music.loop(song)never compiled, not even the module's own example.Each has a test that fails without its fix.
Open, recorded in the plan's new section "The ledger":
order(…, orders.Move)makes an Order action with modifier 6.disabled()andpreserve()inside a program pass without a word.The suite: 1239 pass, the ledger included (the whole run 222 s against 215).
🤖 Generated with Claude Code
https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg