Skip to content

Own backend: programs, owners and players (step 7) - #47

Merged
jeany55 merged 2 commits into
trigscript-4from
programs
Oct 20, 2026
Merged

jeany55 merged 2 commits into
trigscript-4from
programs

Conversation

@jeany55

@jeany55 jeany55 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Step 7 of the way off eudplib: several programs in one map, programs for several players, and the walk surviving a player who leaves.

What changed

  • own.ts: a run per program, and one for each player of a per-player program (owners checked against the map's slots and forces, as the Python side's owner_slots). Each run's graph has its own labels, scratch cells and variables, except shared ones, which belong to the program. Nothing is indexed by player while the game runs: the program is copied for each player. That is faster, and the payload grows with each copy.
  • layout.ts: each run's @wake also checks that its player's list is not empty (eudplib's f_playerexist). The start-up goes in every player's triggers and links each list to an entry node of that player's own, alone in the list. A gate lets the walk into the runs only when every player before this one has an empty list.
    • Why it is shaped this way: measured in the lifted game, when a player leaves, the game empties their list by following next pointers, zeroing each node's two pointers and freeing it. Only the per-player entry is ever reachable from a list, and its next pointer is back at the list's end whenever the walk is not in it.
  • emit.ts: prints to All Players or a force use the map's human and computer slots. hasLeft(p) is one condition, as eudplib's.
  • build-own.mts: PEOPLE and // probe-players: as in build-fixture; the map's slots and forces passed through.
  • Fixed: a program whose first statement jumps (let done = false) lost the jump in a map of our own, and the walk came in at the true side. eudplib's build was right.

Ledger: step 7, 27 of 28 (a program owned by P12 is refused on purpose, as Python refuses it). Nothing outside step 7 flipped to takes; three rows of steps 11 and 12 kept their refusals, now naming their own step's feature. New rows: array-per-player, recursion-per-player, owner-player-twelve, boolean-declared-first.

Lifted game, Remastered's weights Own eudplib
own-programs start: 5 runs of 4 programs 0.008 ms 1.077 ms
A frame where every run sleeps < 0.001 ms 0.007 ms
fog-lib: the fog library's program, a frame 0.003 ms 0.007 ms

Checked

  • probes/own-programs.ts: built both ways, the same lines at the same frames, every line ok.
  • probes/fog-lib.ts: the tile flags hash the same in both builds every frame.
  • probes/own-leaver.ts: a game of two people, either leaving at frame 40, each player's deaths the same in both builds at every frame.
  • The step 7 rows against the simulator.
  • npx vitest run: 1267 passed.

probes/own-programs.ts is in Maps/TrigScript as own-step7.scx with an answer sheet, for Remastered.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom

jeany55 and others added 2 commits October 20, 2026 10:17
Every program of a script, each as every player it runs for: a run per program, one for each of
its players' slots for a per-player program, each with variables of its own but the shared ones.
The start-up is in every player's triggers and links each list to an entry of that player's own,
alone in it; a gate lets the walk into the runs from the first player still in the game, so a
player who leaves stops nobody else's programs (the game frees a leaver's list by its next
pointers: only the entry is reachable from it). Prints to a force and All Players go to the map's
slots; hasLeft is one condition. Played in the lifted game against eudplib's build: the probes
own-programs, fog-lib and own-leaver (a game of two, either leaving) the same frame for frame.

Also fixed: a program whose first statement jumps (let done = false) lost the jump in a map of our
own, and the walk came in at the true side.

Ledger: step 7 27 of 28 (a program owned by P12 refused on purpose).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
@jeany55
jeany55 merged commit 1eb057e into trigscript-4 Oct 20, 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