WIP: feat(game)!: the game side and the whole mod API in Rust, with system mods and the sandbox on by default #2434

Draft
HumanBean wants to merge 1037 commits from HumanBean/Longshot:feat/game-rs into main
Owner

Summary

Stacked on #2411. Review from the first commit after
fefe58d7 (#2411's head). This merges after #2411 and
#2286.

What it does. The game side and the whole mod API are now Rust. The host's C is still there, and the renderer is
unchanged apart from the menu's link to the game side.

  • Crates: the game side lives in game/crates: guest, host-sys, oot, game-sites, api, content,
    script, schema, mod-format and longshot-game. longshot-rs links them into the game as one static library.
  • System mods: every game setting and feature that was C is now a system mod in game/mods, one Rust crate each:
    • area names, cheats, colour vision, CRT, damage, field of view, game settings, heart containers, shadows, skip
      title, sprint and walk, text, voice language, widescreen.
    • Discord status and the mod inspector are TypeScript system mods, installed in system_mods/ by the build and
      trusted only when their files hash to the build's table.
  • The mod API goes through one trait (Mod), with typed settings and state, thiserror errors, and one undo
    journal. A mod's stop puts back whatever it changed.
  • The sandbox is on by default: Landlock and seccomp on Linux, an AppContainer on Windows. A broker process carries
    the mods' network and IPC, crash reports, and the links and folders the game opens.
  • C mods are removed: no native mods and no wasm. A mod.json that asks for native is refused with a message
    saying why. See game/DESIGN.md, "What was removed".
  • The builder compiles the game's Rust for the game it builds, Linux or llvm-mingw's Windows.

What players see change

  • The Mods tab is there for everyone. Every game has system mods, so the tab always has rows (Discord status is one
    of them, no longer a Gameplay tab row).
  • Cheats' switches start off, once. They now live in mods.json ("cheats"), so switches saved by an older build
    are not carried over. This needs a line in the release notes.
  • Skip opening is now a setting of the Skip title mod. Same row, same key, and HOS_SKIP_OPENING still takes
    precedence over it.
  • Settings are read and written by key. Every key in tests/test_menu_ini_keys.py's FROZEN list is kept, so a
    player's longshot_options.ini reads the same. The old option numbers are kept only so older input recordings still
    replay.
  • Behaviour bugs fixed on the way: each is listed in game/DESIGN.md, "Fixed on the way" (51 entries), with what
    the C did and why it was wrong. Otherwise, what players see is unchanged.

Read first

  • game/DESIGN.md: the design, the crates, threads, site chains, the Mod trait, the undo journal, settings and the
    script engine.
  • game/game.h: the line between the C host and the Rust game side.
  • gpu/vk/vk_api.h: MKWVK_API_VERSION 49 to 53 (the game's rows, the Mods tab, the broker, the mods' UI, a game
    row's default).

Testing

Tested: On Linux (CachyOS, Linux 7.3, RTX 3090, NVIDIA 620.70.06, Ryzen 9 7900X), three headless runs through the
job queue, each booting the repository save kokiri-start.

  • Run 1: stuck in "loading" after the save was chosen.
    • The cause was found in run 2 (below).
    • The same run found that no build step installed the TypeScript system mods: "the built-in mod system/discord is
      not installed". Fixed: the build installs them in system_mods/, with a test.
  • Run 2: the stacks while it hung, taken with the game's own sampler (HOS_SAMPLE_ALL). gdb could not attach:
    Yama's ptrace scope is 1.
    • Every thread was parked except gmd::SaveDataMgr. It called nn::fs::Commit without end: each commit failed
      syncing the user folder's parent folder, which the sandbox does not let the game open.
    • Fixed: a folder the game may not open counts as one this run did not change, and the sandbox syncs those folders
      before it confines the game. tests/test_fs_save_commit.py has a case that fails without the fix.
    • Also fixed: shots failed under the sandbox. The game now writes them into the control socket's folder and the
      client moves them, with tests in tests/test_longshot_ctl.py.
  • Run 3: reached play in 18 s from the start of the session, about 4 s of it loading.
    • It then spent about 60 s in play with four stick moves, took a screenshot, and quit cleanly.
    • No faults, panics or [error] lines.
    • All 14 native system mods and the Discord script mod started. The mod inspector loads only alongside a player's
      mod, so it correctly did not start.
    • The sandbox was confined with the network closed, and settings were read from the options file.
    • The save committed once (fs: save: published 1 files), with no retries.
    • The Discord mod set a live status from that test run. Every tool's run now starts with HOS_DISCORD=0 unless the
      caller asks otherwise, with a test.

The checks

  • Rust: fmt clean; clippy with -D warnings clean for Linux and for Windows (x86_64-pc-windows-gnullvm).
  • cargo test --workspace: 1616 passed, 0 failed, 1 ignored.
  • Python checks (tests/run_all.py): 659 passed, 17 failed, 99 skipped.
    • 15 of the failures also fail on fefe58d7, the base: test_amd_subgroup_profiles, test_flat_map,
      test_guest_holes, test_menu_save_atomic, test_menu_text_field, test_pipeline_share,
      test_prepare_cache_save, test_rdna2_mesh_only, test_readback_timeout_source, test_rumble_menu,
      test_shader_profile_caps, test_target_image_reuse, test_vibration_menu, test_vram_compact, test_wb_spans.
    • test_mise_build fails on the base too: this PC's mise lists a tools task.
    • test_lifter failed on a formatting slip, since fixed; formatting is clean now.
    • Since that full run, the checks these commits touch have passed again: test_longshot_ctl, test_fs_save_commit,
      test_bug_report_defaults, the test_menu_i18n pair, the test_sandbox_* checks, test_switch_table,
      test_menu_ini_keys, test_pipeline_tour, test_dev_ab and test_parity_gates.
  • Windows cross-link: on this PC, the builder made the whole Windows game folder with llvm-mingw 20261104 (UCRT):
    longshot.exe, longshot_vk.dll, the SDL DLLs and system_mods/.
    • All the Windows-only C compiled and linked: sandbox_windows.c (the AppContainer), broker_windows.c,
      broker_net.c, pad_mods.c, mod_watch.c and hos_crash_dialog.c.
    • It took one builder fix: cargo's run now gets the toolchain's compilers and linker.
    • It has not run on Windows.

Still to test:

  • Linux and Windows, against #2411: the parity gates
    (scripts/parity_gates.py) and the feature checks. Expecting the same results as #2411's head, apart from the
    entries in "Fixed on the way". (@Beanstalk, or by hand)
  • Windows on the Test Farm: start the game with the sandbox on. Expecting it to reach play inside the AppContainer,
    with the broker running, saves committing, shots written, and mods' IPC working through the broker. (@Beanstalk)
  • Phase 5 in game: the mods' scripts, hot reload, the Mods tab's switches, permission prompts and settings, and the
    mods' UI, run by hand with the example mods. Expecting every mod to start, stop and undo its changes as
    game/DESIGN.md says. (by hand)
  • Steam Deck and AMD (the lab PC): boot to play from kokiri-start with the sandbox on. Expecting play, saves
    committing, and no sandbox refusals in the log. (@Beanstalk)

Measurements

Not measured yet. This is a port: the renderer and the lifted game code are unchanged. But the per-frame hooks
(frame-time step, barriers, OCB hold, texture compaction) now run in Rust instead of C. An fps and frame-time A/B
against #2411 in Kokiri Forest, Hyrule Field and the Market, at 1080p, native and uncapped, is still to be done before
this leaves WIP.

Risks

  • A large change: 400 commits, about 1,300 files. A behaviour slip in a ported fix or hook could show only in one
    area of the game. The parity gates and feature checks above are what catch that. The fallback is a revert of the
    whole stack; there is no switch back to the C game side.
  • The sandbox, on by default, can refuse something a player's setup needs. Run 1 was one such case (save commits).
    HOS_SANDBOX=0, set in the real environment, turns it off for debugging; longshot_env.txt cannot.
  • After updating, players notice:
    • cheats' switches are off once;
    • Discord status has moved to the Mods tab;
    • native C mods no longer load (they are refused with a message).
    • longshot_options.ini, saves and caches read the same.
  • MKWVK_API_VERSION is 69: a renderer built for an older version refuses to load, as it should.

To do

  • Start slot (HOS_START_SLOT): a known gap, shipped without it. skip-title cannot see the save list open until the
    list takes a button, so the title's repeated A can land on the newest save before the cursor moves. A fix needs a new
    site for the list's open wait. skip-title's README lists it.
  • Open items from the last full check (l4fj3-1), fixes on their way:
    • the fake game's debug key did not close the page it opened;
    • discord's quiet-spell test counted from the wrong time;
    • the control bridge reported no focus on the menu's first page, so the key checks went wrong;
    • the mic test in a scripted run (and a private audio source for test jobs);
    • gamescope in queue jobs: the game finds no video device there, so key runs fall back to a window (the documented
      path).

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Not on main: stacked on #2411 and merges
    after it and #2286. The title is a Conventional Commit.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Linux; Windows is cross-linked
    only, and is in Still to test.)
  • mise run test passes (any failure that also fails on main is named). (The 15 failures, plus
    test_mise_build, also fail on fefe58d7, #2411's head; they are named in Testing.)
  • Measured against main, or Measurements says why there is nothing to measure. (The A/B against #2411 is still to
    be done.)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.
    (The site tables hold masked signatures and addresses only.)

When it applies

  • A fix: a game-free test that fails on main and passes here. (Each fix made after a run has one; for the save
    commit, test_fs_save_commit's new case fails on the old source.)
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
    (The sandbox ships on by default for safety, not from measurements; its cost is not measured yet.)
  • A check under tests/ that reads changed source is updated, not weakened.
  • MKWVK_API_VERSION bumped (MkwVkHost or MkwVkRenderer in gpu/vk/vk_api.h changed). (49 to 53.)
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Screenshots of the same spot on main and here, for a change that shows on screen. (Only this side's shot of
    Kokiri Forest so far; the #2411 side comes with the parity gates.)
  • Docs updated. (game/DESIGN.md, docs/dev/reference/ for the architecture, the control bridge and the
    sandbox, and the modding docs.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary **Stacked on [#2411](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2411).** Review from the first commit after `fefe58d7` (#2411's head). This merges after [#2411](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2411) and [#2286](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2286). **What it does.** The game side and the whole mod API are now Rust. The host's C is still there, and the renderer is unchanged apart from the menu's link to the game side. - **Crates:** the game side lives in `game/crates`: `guest`, `host-sys`, `oot`, `game-sites`, `api`, `content`, `script`, `schema`, `mod-format` and `longshot-game`. `longshot-rs` links them into the game as one static library. - **System mods:** every game setting and feature that was C is now a system mod in `game/mods`, one Rust crate each: - area names, cheats, colour vision, CRT, damage, field of view, game settings, heart containers, shadows, skip title, sprint and walk, text, voice language, widescreen. - Discord status and the mod inspector are TypeScript system mods, installed in `system_mods/` by the build and trusted only when their files hash to the build's table. - **The mod API** goes through one trait (`Mod`), with typed settings and state, `thiserror` errors, and one undo journal. A mod's stop puts back whatever it changed. - **The sandbox is on by default:** Landlock and seccomp on Linux, an AppContainer on Windows. A broker process carries the mods' network and IPC, crash reports, and the links and folders the game opens. - **C mods are removed:** no native mods and no wasm. A `mod.json` that asks for `native` is refused with a message saying why. See `game/DESIGN.md`, "What was removed". - **The builder** compiles the game's Rust for the game it builds, Linux or llvm-mingw's Windows. **What players see change** - **The Mods tab is there for everyone.** Every game has system mods, so the tab always has rows (Discord status is one of them, no longer a Gameplay tab row). - **Cheats' switches start off, once.** They now live in `mods.json` (`"cheats"`), so switches saved by an older build are not carried over. This needs a line in the release notes. - **Skip opening is now a setting of the Skip title mod.** Same row, same key, and `HOS_SKIP_OPENING` still takes precedence over it. - **Settings are read and written by key.** Every key in `tests/test_menu_ini_keys.py`'s FROZEN list is kept, so a player's `longshot_options.ini` reads the same. The old option numbers are kept only so older input recordings still replay. - **Behaviour bugs fixed on the way:** each is listed in `game/DESIGN.md`, "Fixed on the way" (51 entries), with what the C did and why it was wrong. Otherwise, what players see is unchanged. **Read first** - `game/DESIGN.md`: the design, the crates, threads, site chains, the `Mod` trait, the undo journal, settings and the script engine. - `game/game.h`: the line between the C host and the Rust game side. - `gpu/vk/vk_api.h`: `MKWVK_API_VERSION` 49 to 53 (the game's rows, the Mods tab, the broker, the mods' UI, a game row's default). ## Testing **Tested:** On Linux (CachyOS, Linux 7.3, RTX 3090, NVIDIA 620.70.06, Ryzen 9 7900X), three headless runs through the job queue, each booting the repository save `kokiri-start`. - **Run 1: stuck in "loading" after the save was chosen.** - The cause was found in run 2 (below). - The same run found that no build step installed the TypeScript system mods: "the built-in mod system/discord is not installed". Fixed: the build installs them in `system_mods/`, with a test. - **Run 2: the stacks while it hung, taken with the game's own sampler (`HOS_SAMPLE_ALL`).** gdb could not attach: Yama's ptrace scope is 1. - Every thread was parked except `gmd::SaveDataMgr`. It called `nn::fs::Commit` without end: each commit failed syncing the user folder's parent folder, which the sandbox does not let the game open. - Fixed: a folder the game may not open counts as one this run did not change, and the sandbox syncs those folders before it confines the game. `tests/test_fs_save_commit.py` has a case that fails without the fix. - Also fixed: shots failed under the sandbox. The game now writes them into the control socket's folder and the client moves them, with tests in `tests/test_longshot_ctl.py`. - **Run 3: reached play in 18 s from the start of the session**, about 4 s of it loading. - It then spent about 60 s in play with four stick moves, took a screenshot, and quit cleanly. - No faults, panics or `[error]` lines. - All 14 native system mods and the Discord script mod started. The mod inspector loads only alongside a player's mod, so it correctly did not start. - The sandbox was confined with the network closed, and settings were read from the options file. - The save committed once (`fs: save: published 1 files`), with no retries. - The Discord mod set a live status from that test run. Every tool's run now starts with `HOS_DISCORD=0` unless the caller asks otherwise, with a test. **The checks** - **Rust:** fmt clean; clippy with `-D warnings` clean for Linux and for Windows (`x86_64-pc-windows-gnullvm`). - **`cargo test --workspace`:** 1616 passed, 0 failed, 1 ignored. - **Python checks (`tests/run_all.py`):** 659 passed, 17 failed, 99 skipped. - 15 of the failures also fail on `fefe58d7`, the base: `test_amd_subgroup_profiles`, `test_flat_map`, `test_guest_holes`, `test_menu_save_atomic`, `test_menu_text_field`, `test_pipeline_share`, `test_prepare_cache_save`, `test_rdna2_mesh_only`, `test_readback_timeout_source`, `test_rumble_menu`, `test_shader_profile_caps`, `test_target_image_reuse`, `test_vibration_menu`, `test_vram_compact`, `test_wb_spans`. - `test_mise_build` fails on the base too: this PC's mise lists a `tools` task. - `test_lifter` failed on a formatting slip, since fixed; formatting is clean now. - Since that full run, the checks these commits touch have passed again: `test_longshot_ctl`, `test_fs_save_commit`, `test_bug_report_defaults`, the `test_menu_i18n` pair, the `test_sandbox_*` checks, `test_switch_table`, `test_menu_ini_keys`, `test_pipeline_tour`, `test_dev_ab` and `test_parity_gates`. - **Windows cross-link:** on this PC, the builder made the whole Windows game folder with llvm-mingw 20261104 (UCRT): `longshot.exe`, `longshot_vk.dll`, the SDL DLLs and `system_mods/`. - All the Windows-only C compiled and linked: `sandbox_windows.c` (the AppContainer), `broker_windows.c`, `broker_net.c`, `pad_mods.c`, `mod_watch.c` and `hos_crash_dialog.c`. - It took one builder fix: cargo's run now gets the toolchain's compilers and linker. - It has not run on Windows. **Still to test:** - **Linux and Windows, against [#2411](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2411):** the parity gates (`scripts/parity_gates.py`) and the feature checks. Expecting the same results as #2411's head, apart from the entries in "Fixed on the way". (@Beanstalk, or by hand) - **Windows on the Test Farm:** start the game with the sandbox on. Expecting it to reach play inside the AppContainer, with the broker running, saves committing, shots written, and mods' IPC working through the broker. (@Beanstalk) - **Phase 5 in game:** the mods' scripts, hot reload, the Mods tab's switches, permission prompts and settings, and the mods' UI, run by hand with the example mods. Expecting every mod to start, stop and undo its changes as `game/DESIGN.md` says. (by hand) - **Steam Deck and AMD (the lab PC):** boot to play from `kokiri-start` with the sandbox on. Expecting play, saves committing, and no sandbox refusals in the log. (@Beanstalk) ## Measurements Not measured yet. This is a port: the renderer and the lifted game code are unchanged. But the per-frame hooks (frame-time step, barriers, OCB hold, texture compaction) now run in Rust instead of C. An fps and frame-time A/B against #2411 in Kokiri Forest, Hyrule Field and the Market, at 1080p, native and uncapped, is still to be done before this leaves WIP. ## Risks - **A large change: 400 commits, about 1,300 files.** A behaviour slip in a ported fix or hook could show only in one area of the game. The parity gates and feature checks above are what catch that. The fallback is a revert of the whole stack; there is no switch back to the C game side. - **The sandbox, on by default, can refuse something a player's setup needs.** Run 1 was one such case (save commits). `HOS_SANDBOX=0`, set in the real environment, turns it off for debugging; `longshot_env.txt` cannot. - **After updating, players notice:** - cheats' switches are off once; - Discord status has moved to the Mods tab; - native C mods no longer load (they are refused with a message). - `longshot_options.ini`, saves and caches read the same. - **`MKWVK_API_VERSION` is 69:** a renderer built for an older version refuses to load, as it should. ## To do - **Start slot (`HOS_START_SLOT`): a known gap, shipped without it.** skip-title cannot see the save list open until the list takes a button, so the title's repeated A can land on the newest save before the cursor moves. A fix needs a new site for the list's open wait. skip-title's README lists it. - **Open items from the last full check (l4fj3-1), fixes on their way:** - the fake game's debug key did not close the page it opened; - discord's quiet-spell test counted from the wrong time; - the control bridge reported no focus on the menu's first page, so the key checks went wrong; - the mic test in a scripted run (and a private audio source for test jobs); - gamescope in queue jobs: the game finds no video device there, so key runs fall back to a window (the documented path). ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. *(Not on `main`: stacked on #2411 and merges after it and #2286. The title is a Conventional Commit.)* - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. *(Linux; Windows is cross-linked only, and is in Still to test.)* - [ ] `mise run test` passes (any failure that also fails on `main` is named). *(The 15 failures, plus `test_mise_build`, also fail on `fefe58d7`, #2411's head; they are named in Testing.)* - [ ] Measured against `main`, or Measurements says why there is nothing to measure. *(The A/B against #2411 is still to be done.)* - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. *(The site tables hold masked signatures and addresses only.)* ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. *(Each fix made after a run has one; for the save commit, `test_fs_save_commit`'s new case fails on the old source.)* - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. *(The sandbox ships on by default for safety, not from measurements; its cost is not measured yet.)* - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] `MKWVK_API_VERSION` bumped (`MkwVkHost` or `MkwVkRenderer` in `gpu/vk/vk_api.h` changed). *(49 to 53.)* - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. *(Only this side's shot of Kokiri Forest so far; the #2411 side comes with the parity gates.)* - [x] Docs updated. *(`game/DESIGN.md`, `docs/dev/reference/` for the architecture, the control bridge and the sandbox, and the modding docs.)* - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The first step of the lifter rewrite (lifter/README.md): a Cargo workspace beside nx2, standard library only, with
crates/a64 (an instruction word to a typed Insn, and Insn::flow() for discovery) and crates/longshot-lift (the command
make_game.py will call; for now decode <hex word>). It decodes the A78C's Armv8.2-A with LSE, RCpc, FlagM, PAuth and
CRC32; the SIMD and FP data-processing groups are Insn::Simd until the float semantics.

tests/test_lifter.py runs cargo test: the decoder against llvm-mc -mcpu=cortex-a78c -M no-aliases on random words in
every encoding group (0.8 million by default, 8.3 million run here, no difference), plus unit tests. run_all finds
cargo and llvm-mc as two new placeholders. Not part of a game build yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An Insn now formats itself (impl Display) from small operand types that each know their syntax (a register by its
width and what 31 means, a memory operand, a shift, a prefetch), every write's result passed on with ?. The
mnemonic tables are methods of the operation enums (Shift::name, Cond::name ...). Every public item has its doc; the
enums whose variants are the architecture's own names say so once. The workspace lints forbid unsafe and warn on a
missing doc, and tests/test_lifter.py now also runs rustfmt's check and clippy with warnings as errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every player feature that changed the game by a text patch, an edit after an instruction by address or a
direct call by fixed address now does it from a hook site (host/game/sites/, sites.toml: 132 sites, each
found by its function's words and checked by a guard) or through game_call. What is still done another way
(the HUD wrapper, the eight output-size edits, boot and a thread's entry) and why is in
docs/dev/reference/hooks.md. A player's ExeFS patch over a site is refused at build.

Skip title screen presses A on the game's own title and save-load waits, only with a saved game, and never
while the Insert menu is open or after the row is turned off.

The parity gates (scripts/parity_gates.py, docs/dev/reference/parity-gates.md) compare a refactor with main
in the game: behaviour at checkpoints, saves written, and what the game starts.

Sites are defined once (host/game/sites.toml: name, form, arguments, answer) apart from each game build's
locations (host/game/sites/<build id>/locations.toml), and found by what is there as well as by words: a call to
a named target or through a vtable slot, its ordinal, a slice from and to another site, a shift, a site inside
another's function. A site that does not resolve exactly once names its candidates and the nearest misses.
Several handlers can run on one site in a set order around its own callback (hos_site_add, hos_site_next), and
`nx2/hooks.py check` and `review` find and show every site from a lift's files. The ideas come from Morphe's
fingerprints and Fabric's Mixin and MixinExtras (docs/dev/reference/hooks.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
nx2/lift_plan.py writes what a64-kit's discovery and nx2's passes decided (the functions as runs of instructions,
labels, jump tables, PLT stubs, setjmp owners, the placed hook sites as records, and the functions only the old lifter
can write for now, with why): lift.py --plan, into the work folder's image/. lifter/crates/image reads the image
(image.bin, image.json); lifter/crates/plan reads a plan and compares two (the new discovery against the old). On
build e0f3ccfa: 294,518 functions, 1,475 jump tables, 9,917 PLT stubs, 132 sites, 130 functions old-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lifter/crates/cfg ports a64-kit's discovery and nx2's fixes to it: the walk (classify's masks bit for bit, nx2/insn.py's
PAuth forms first), the jump tables (the symbolic window, the bounds, the predecessors' search through moves and
stack slots, the hoisted and the function's one constant, the ADR candidates, and lift_fixes.py's fixes 1 to 3), the
second pass over the misses, the PLT stubs and the setjmp owners. Its entries come from the image alone: each module's
MOD0, dynamic section, symbols, RELA, JMPREL and RELR relocations, init array and .eh_frame_hdr (nx_image's entries,
nx2/adr_entries.py's ADR and ADRP+ADD code addresses), the hooks from image.json.

longshot-lift discover --image <dir> --plan <old plan> --check compares it with the old lifter's plan: on build
e0f3ccfa the same in every part (295,270 entries, 294,518 functions and their labels, 17,646,126 instructions, 1,475
jump tables, 9,917 PLT stubs, 13 setjmp owners), in about 2.5 s where the Python's discovery took about a minute.

.gitignore keeps lifter/crates/image/ (its image/ rule left the image crate out of the repository).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sites crate ports nx2/hooks.py's reader, resolver and placement: the
definitions joined with a build's locations and every rule of the format
checked (the same messages, naming the file and the site), signatures and
guards over the module's code, another site's function, anchors (words,
call, vcall, string, with from/to, ordinal and shift) and fingerprints
over the lift's functions, then each form's checks against the lift. A
placement is data, a typed point per form and what its hook does, for the
mid IR. The host's list (host/game/sites.def) is checked for every site's
slot and every rule's value.

longshot-lift sites --image --plan --tables [--check] places the build's
sites over an image and a lift plan; --check compares each with the plan's
site record. For build e0f3ccfa all 132 match.

The image crate, which the plan's commit meant to add, is committed here:
.gitignore's image/ rule had hidden it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/mir: a guest function as blocks of typed SSA values over guest-state locations (Get/Set), used only in
their own block, so no phis; explicit page marks, exclusives, calls, SVCs, polls on back edges; a verifier and a
text dump. crates/sem: every integer, memory, atomic and system form from the Arm ARM's pseudocode, keeping the old
lifter's host model where the system decides (PAuth the identity, the counter, cache type, marks, SP stores);
RMIF, SETF, CFINV and LDRAA, which the old lifter traps on, are done. crates/llvm: the IR as a textual LLVM
module with the old ABI (void f_<entry>(Ctx *), its layout, musttail, the BLR/BR site cache, the runtime's
functions), a slot per location promoted by LLVM and synced with the context at calls and exits.
crates/lift: a discovered function as mid IR (blocks, transfers, tail calls, jump tables, traps).
longshot-lift emit writes the plan's functions as .ll units: 262,607 of 294,518 on build e0f3ccfa (the rest:
SIMD/FP, and the 130 the old lifter alone writes). tests/test_lifter_semantics.py runs each form against Unicorn:
80,484 runs over 20,233 words, no difference (Unicorn's own narrow LDSMAX/LDSMIN are unsigned: those checked
against the Arm ARM).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nx2/lift_plan.py runs longshot-lift emit over the plan and has the old lifter leave its functions out; the hot list
stays with the old lifter (code_hot.c at RX_HOT_OPT with the play profile). nx2/build.py compiles gen/lifted_*.ll with
the chunks; the lift key takes LONGSHOT_LIFTER, RX_MARK_BITMAP and the lifter's sources; a chunk the new lifter took
every function of holds its header alone and is not taken for one cut short.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
crates/passes: share_marks gives the stores through one base register in a straight run one mark over their span (4 KB
at most), as the old lifter's mark_groups; simplify forwards a block's reads of a location to the value it holds,
removes writes nothing reads before the next (liveness over the function; calls, SVCs and exits read everything) and
values nothing reads. crates/llvm/src/sync.rs: the writer spills only the slots that may be newer than the context and
reloads only the ones read before they are written, at the entry and around each call and SVC, where it synced every
location the function used or wrote. On build e0f3ccfa: 304,749 stores share 80,607 marks; 6.5 M reads forwarded,
2.7 M dead writes; the 65 units' IR 5.6 GB -> 3.4 GB. tests/test_lifter_semantics.py runs the passes too: no difference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
crates/profile: a profile of how often each function, block and conditional branch ran, keyed by the function's entry
and a hash of its instruction words (a function whose code changed is left out, never misapplied), merged across runs,
addresses and counts only. longshot-lift emit --profile-generate counts every block and branch into one array a unit,
registered with host/guest_profile.c, which writes the counts where HOS_GUEST_PROFILE says (at exit, or on a .dump
file); profile_map.txt says what each counter is, and longshot-lift profile turns a run's counts into a profile. emit
--profile <file> writes branch weights and entry counts into the IR, the functions that never ran cold, and the
hottest (those holding 95 % of the counted runs, 4000 at most) into lifted_hot_*.ll, built at RX_HOT_OPT.
LONGSHOT_GUEST_PROFILE=gen or <file> chooses it for a mixed lift (in its key: gen, or the file's contents); with one,
the hot list's functions go to the new lifter too. nx2/lift_plan.py builds the lifter with cargo first when there is
one, so the command is the one the key's sources make.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The decoder's last undecoded groups as typed instructions: scalar FP (data processing, compares, conditional
compares and selects, immediates, the integer and fixed-point conversions, FMOV general), every Advanced SIMD
group (three same, different and extra, two-register miscellaneous, across lanes, pairwise, copies, permutes,
EXT, TBL/TBX, modified immediates, shifts by immediate, by element), FP16, RDM, the dot product, AES, SHA1,
SHA256, PMULL and the structure loads and stores. Insn::Simd is gone. The llvm-mc check covers the new groups
(200,000 words a group run, every word agreeing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Float and vector types in the mid IR (F16, F32, F64, vectors, the V registers as <2 x i64>) and their ops (IEEE
arithmetic, FMA, compares, conversions, lanes, saturation, reductions, table lookups), verified, and their LLVM IR; the
V registers synced with the context like the X registers. Every A78C form lowered inline from the Arm ARM: the FP model
(Arm NaN propagation and default NaN, FZ, DN), scalar and vector FP, the integer SIMD, the loads and stores of the V
registers (single, pairs, structures), AES, SHA1, SHA256 and PMULL. Pure ops shared within a block, constants as
literals. tests/test_lifter_semantics.py checks the FP and SIMD groups too, with the V registers, FPSR.QC and random
FPCR FZ and DN; its docstring lists where the old lifter's host model is kept on purpose.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
nx2/oot_patches.py's OUT_EDITS has an edit matched by its C text alone, its function (f_810a7b70) named in a comment:
mentioned_addresses() does not see it, so once the new lifter took the function (it uses SIMD), the edit no longer
found its text and the lift stopped. patched_functions() adds every function the file names in any form; the lift
plan's old-only list takes it. mentioned_addresses() is unchanged: it also decides the old lifter's guest locals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
dev.py ab stops its games from outside, so the counts written at exit never came, and the run's other process (which
runs no lifted code) wrote its counters, all 0, in their place. host/guest_profile.c writes them every 10 s while the
game runs, and leaves the file as it is when every counter is 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The calling convention's callee-saved registers come back from a BL or BLR as they were, as the old lifter takes
them (its sync after a call reloads X0 to X18 and X30 alone): sync.rs reloads none of them after a call, and one read
after it is read before it instead, where it is not already held. An SVC keeps syncing every register. emit
--sync-all-at-calls turns it off, to bisect a difference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Op::Checked { fast, slow, helper, args }: the fast value unless slow holds, then a helper's. A Helper is a pure
function a function carries (one block of pure ops over Op::Param, ending in a return), written once per module by
its name: internal, noinline, cold, memory(none). The writer lowers the op as a branch weighted unlikely around the
call and a phi. Op::IsSubnormal (llvm.is.fpclass), FBinOp::Maximum/Minimum (llvm.maximum/minimum) and Reduce::Or
for the fast paths' checks. The verifier checks the new ops and every helper; sync.rs syncs nothing for one.
words --count-checks counts the fast paths' runs and slow ones, for the semantics check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Every FP arithmetic op, FMA, FMULX, min/max (and the Num, pairwise and across forms), square root, rounding, float
conversion, float to integer and FRECPS/FRSQRTS, scalar and vector: the host's IEEE op inline, checked by a NaN
result or, under FPCR.FZ, a subnormal operand or result (any lane), and the exact semantics as before in a helper per
operation and type, taking the operands and FPCR (DN only changes NaN results: the helper reads it). Exact under
the host's MXCSR (round to nearest, DAZ and FTZ clear). Integer to float drops its flush: no result can be
subnormal. tests/test_lifter_semantics.py counts both paths and fails unless both ran with FZ set and clear.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
simplify's share_pure: in a block, a pure op that an earlier one computes, once forwarded reads made their operands
the same, is that op's value (each instruction's FPCR bits, a register's bitcasts and lane reads). share_marks lets
any pure op, a fast path's among them, sit in a run of stores.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The 32 functions that call a setjmp owner were the old lifter's alone: the IR now pushes the owner's slot, takes
recomp_sj_setjmp (returns_twice) on it, calls the owner or, after a guest longjmp, runs the owner's code from the
return address it came back to, and reloads the whole guest state after. Also llvm::Module::size, a unit's text so far.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
One is.fpclass per operand and one for the result (NaN or subnormal), ORed, and one reduction for a vector: no FPCR
bit, no separate NaN test, one reduction instead of two. A subnormal now takes the exact path with FZ clear too,
where the host's value was right: rare, and slow on the host's float unit as it is. Op::IsSubnormal becomes
Op::FClass (subnormal, or NaN or subnormal).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
What the IR calls and what host/ uses of a64-kit's rt/ and nx2/rtgen.py's changes, without what only the old C lift
used (suyu's helpers, the FPX headers, the inline-site macros). a64_config.h, written by the lift, carries its
choices (the window, the marks' table, the GPU page bitmap, polls) to the host's compile. a64_fp.c: the two exact
float helpers host/oot_sites.c calls, under the lifter's float model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A profile of some scenes does not see everything that runs (menus, cutscenes, other places): those functions are laid
out apart from the code that runs (cold), but keep their -O1 code, where minsize made them slower when they run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
From the image and the repository's tables alone: discovery, the sites placed, every function lifted into units cut
by estimated compile cost at stable places (the largest 25 MB of IR, was 400 MB), the function table, the boot
constants, the import stubs and the runtime written into gen/. A key of everything skips an unchanged lift; each
function's key is exactly what lifting it reads (lift::Program::inputs), each unit's its functions', so one changed
function or site rewrites one unit, and a unit lifted to the same text is not written again. The edits (sites,
entry hooks, text patches) go through one seam, whole::edits::Edits::apply: their functions are held until the
edits crate is in. emit, the mixed build's command, is gone; rust/README.md documents gen/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
lifter/ is now rust/: it will hold the whole builder (Longshot-notes' builder-rust-plan), not only the lifter.
crates/build-core: the builder apps' protocol (@@ lines, RecompLauncher's --prepare lines) from any thread; errors as
the sentence a player reads; the job count (--jobs, LONGSHOT_JOBS); the memory gate (nx2/build.py's MemoryGate);
atomic writes, links and copies; SHA-1 keys with named parts (the Python builder's, so caches stay valid); the work
folder's lock (std's file lock). Win32 calls through windows-sys in one module (the workspace denies unsafe
elsewhere).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Gate::enter_first reads the memory free once and lets in the first of the needs given that fits (below the floor, the
first); Gate::wait waits for a job to leave. The compile's scheduler starts the longest unit first, and while it waits
for room, the next one that fits, so the CPUs stay busy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The builder no longer speaks make_game.py's @@ lines or RecompLauncher's --prepare lines: the launchers will be
updated. build-core's report: a build is a stream of events (stage, progress with the whole build's share, the
compile's plan, each unit, the time left, log, warning, check, error, done), written as JSON Lines with a version
field for a launcher (--json), or as text for a person. Error::Player carries a stable code a launcher can show its
own words for; every error has a code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The new builder's compile (rust/crates/build-compile), a library the driver calls: build_compile::run(&Options,
&Reporter) -> Result<Outcome>, and preview() for what it would do.

- The toolchain (clang, clang++, llvm-mingw, the sysroot, the CPU: -march=native named by the CPU it is), the
  packages (Vulkan, SPIR-V, VMA, FFmpeg, dav1d, NGX), and every unit with its flags: the lifted C and the hot pieces,
  the new lifter's .ll units, the lift's tables and runtime, host/, libopus and zstd, Tracy, the renderer as its own
  module with its third-party parts, ReShade's FX compiler, the profiles, the light passes, LONGSHOT_CHUNK_OPT.
- Keys: the compiler's identity, the normalised flags (folders named, not spelled), the source's bytes and every
  header its depfile lists, by content (ccache's direct mode, the headers kept by base in the store's manifests). No
  build-wide input: a changed unit rebuilds alone, a builder update with the same sources reuses everything.
- The store (v1 layout, outside the builder's install), safe for a stopped run and builds side by side; the
  release's prebuilt third-party set; the kept lift; the build's state (hashes by stat, measured times and memory).
- The scheduler: the longest first, under the memory gate, past a job too big for now; a unit the system stopped
  compiled again alone. The links with their records, the image's reach, the renderer's unresolved symbols,
  compile_commands.json.

Checked: a synthetic compile and link with clang (unchanged: nothing compiled or linked; one change: one unit), and
the ported generators against nx2's own functions (tests/python_parity.rs, ignored by default).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
make_game.py, build.py, lift.py and oot_patches.py go back to #2272's state, and nx2/lift_plan.py goes: no
LONGSHOT_LIFTER, no mixed build, nothing of the new lifter in the old path. The new builder is rust/ alone, a command
of its own (longshot-build), sharing only the game's sources with the old one; either can be run and compared at any
time. host/guest_profile.c stays (the game's own code, shared; it does nothing in a build that counts nothing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Two units of the same source and flags may place one object or write one manifest at once from two threads: each
write now has a name of its own. A manifest entry ends with its header count, so one cut short by a stopped PC is
dropped, never read as an entry with fewer headers. The crate in rust/README.md's table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/romfs_index.c reads longshot_romfs.idx (written by the Rust builder, format in rust/crates/game-files/src/romfs.rs):
a binary search per lookup, a positional read per file read on the .nup's one handle, no lock. The few files the .nup
keeps as zstd frames were unpacked by the builder beside the index and are opened as files. The .nup is checked at
start (its size and its TOC's SHA-256): moved or replaced, the game says so (nup_moved) before it runs.

nn_fs.c: OpenFile, ReadFile, GetFileSize, CloseFile, GetEntryType and the directory calls take a path under the RomFS
from the index when the game folder has one and no romfs folder; mods, the overlay and the stand-ins come first, as
before; a mod's entries in a listed folder are added unless the .nup has them. zs.c's whole-file and head reads (the
dictionaries, the mods' and prompts' .zs files) go through it too. A developer's unpacked romfs folder is read as
before. tests/romfs_index_test.c checks the reader against an unpacked romfs from four threads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- Op::HostCall (a host function by name, or through a callback slot, with the context or not), Op::HostLoad and
  Op::HostStore (volatile, thread-local where the global is): what a hook site's flag, callback and data rule need.
  A host call with the context exposes the state as an SVC does (no callee-saved registers kept: sync.rs).
- A function may be named for a wrapper (a body f_1<entry> under f_<entry>), and a wrapper counts nothing for a profile.
- A block says whether it is a guest block's start and whether its branch is the guest's: an edit's blocks and tests
  are not counted by a profile, nor weighted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
game-files:
- nup: the .nup read with positional reads (its tables checked: ranges, reachability, no cycles), verify (TOC hash,
  extents, SHA-256s, the .zs heads), extract with every safety rule (device names, links, a stopped run, a full disk,
  zstd-stored files told from the game's .zs files), heal; read errors in plain words (locks, drive errors).
- romfs: the romfs indexed in place (longshot_romfs.idx) instead of unpacked: zstd-stored files unpacked beside it,
  damaged .zs files found by their first bytes and given stand-ins in the index; Index reads it back.
- nso: the modules loaded (LZ4, ZBIC, DT_RELR, symbols, relocations, .eh_frame_hdr), segment hashes checked, ZBIC
  modules unpacked in place. zstd: a decoder of zstd frames with ZBIC's count tables (no C library).
- checks (the modules, the supported build, the romfs's files, links, the game folder's paths, check's answer read in
  place from the .nup), patches (the mods' ExeFS patches: mods.json's rules, IPS/IPS32/pchtxt, the classification, the
  hook-site clash refusal, the list, apply), title, disk (free space, file system, hard drive or not).

image-build: the image laid out as Eden loads it, patched, relocated, bound; image.bin and image.json the same bytes as
the old builder's (checked on the game's exefs on this PC), built in 0.14 s.

Every player error has a stable code. Crates added: ruzstd 0.8.3, lz4_flex 0.14.0, sha2 0.10.9, libc 0.2.191 (unix).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A crate of its own: a small statement language for the code an edit adds (edits::code: expressions of the guest
state, guest memory, host globals and host calls; short-circuit conditions; a goto; the kept instruction), each hook
site's form over the host ABI of host/game/sites.h (site.rs), the supported build's patches as data, found by their
instructions (patches.rs: the output size's nine edits and the gameplay HUD's wrapper), and the host's entry hooks of
the SDK's functions (entry_hooks.rs). plan_edits gathers them per function, with a stable content key each, so one
site's or patch's change changes the edits of the functions it lands in alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/romfs.h: ready, stat, case (any case, where a caller needs it), read, head, list, open/read-at/close, over two
backends of the same API: the .nup's index (romfs_index.c) and a romfs folder (a developer's dump). Every reader of
the RomFS goes through it: nn_fs.c's handles, prompts.c (the size tables, the font), mods.c (the game's files a mod
replaces, their case, the size table; a folder's mod-only entries checked against the RomFS, any case), audio_source.c,
oot_heart_containers.c, oot_damaged_files.c's probe, zs.c's dictionaries, and the Vulkan back end's menu font (host
API version 46: romfs_read / romfs_free; vk_game_font.h's reader takes a read function).

The index no longer needs files unpacked beside it: a zstd-stored file is decoded when it is opened (libzstd through
zs.c), one copy shared by every open of it and freed with the last close. Measured on the dump that has them (40,588
files, 2.75 GB of frames for 2.99 GB, nearly all raw blocks): libzstd about 2 GB/s, the largest (117 MB) in 30 ms. So a
game folder holds the 16 MB index and nothing of the romfs; indexing that dump took 7 s (it unpacked 3 GB before).

The builder: romfs::index writes the index alone; romfs::reuse takes another game folder's index of the same .nup;
the checks for romfs folders an old builder unpacked are gone (a damaged dump is the index's stand-ins, or the host's
table for a folder: the builder's choices are that table's, checked on the dump). zstd.rs states its provenance.
tests/romfs_test.c runs both backends against an unpacked romfs from four threads and compares their listings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
lift::Program takes the edits (edits::plan_edits) and writes them in as each function is built: before, after or in
place of an instruction, at a conditional branch, at the entry in a block of its own; a wrapped function is lifted as
its body f_1<entry> and its wrapper f_<entry> (lift::Lifted), both in its unit.

lift::whole plans the edits from the placed sites, host/'s entry hooks (with their size gate) and the patches' Rust
data, and keys each function by its edits' key (FunctionEdits::key); EDITS_SOURCES (the edits and sites crates) is
in the whole lift's key, LIFTER_SOURCES holds only the edits' lowering, so one patch's or site's change lifts again
only the units it lands in. The held mechanism is gone (held.txt, --allow-held, --patched, LiftOptions::patched,
LiftOutcome::{held, complete}): an instruction the lifter does not cover stops the lift. gen/edits.txt lists each
edited function, its key and what changes it; LiftOutcome::edited counts them. The plan's old records are no longer
read, and --check-plan compares the discovery alone.

On the supported image: 294518 functions in 495 units, 99 edited, none held; two lifts give the same bytes; one
site's table entry changed rewrites one unit. Tests: each form on synthetic functions, verified, through the passes
and compiled by clang; the forms run against a C harness of the host's side; the whole lift's cache over a site
added and its form changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The units are those units.txt lists, each keyed from the content hash the list gives while its file is the
listed size; table.c, imports.c, image.c and gen/rt's runtime are the lift's C. The host is compiled with
-I gen/rt and none of the A64_* defines (gen/rt/a64_config.h holds the lift's choices). The work folder's
layout is the caller's (Options::gen_dir, build_dir).

Removed with the old lift: the C chunks and hot pieces (lifted.rs), the kept lift (kept.rs), a64-kit's
runtime adapted (rt64.rs), the light passes, LONGSHOT_CHUNK_OPT and its parts, RX_PGO and the hot link
order, RX_MARK_BITMAP, chunk_costs.txt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
And the scheduler's test no longer races: two jobs that start together may note their starts in either
order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build-driver runs the read stage (game-files, image-build), the lift, the compile and the finish in
order, the romfs's index beside the lift and compile; each stage behind one seam (the assets' pending).
A work folder per game folder in the per-user cache, the object store and the lifts' store shared by
all of them; the game folder's files staged and swapped, its record for update. longshot-build:
build, update, check, and image, index, lift, compile one at a time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
It read the jobs' start order from inside their threads, which a loaded PC reorders (3, 0, 2, 1): it failed one run in
three under load. Job 0 now holds its room until both small jobs are in (an event, not a sleep), and the test checks
who started while job 0 held its room (0, 2 and 3) and who only after (1). 40 runs of 40 pass at 6 threads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A new library crate, rust/crates/build-assets, for the Rust builder's finish
stage (plan R4). This first part:

- romfs: the game's files behind a Romfs trait (list, read, fingerprint), so
  the stage reads the .nup's index or an unpacked folder alike;
- zs and sarc: the game's zstd frames with its dictionaries (ruzstd), SARCs;
- texts: the console's wording made the PC's, as nx2/text_assets.py; the
  output frames state their content size;
- pipelines: the shipped pipeline list merged from assets/pipeline_states,
  version 1 records converted, as nx2/pipeline_states.py (xz by lzma-rs);
- census: every shader program, as nx2/shader_census.py, read by several
  workers in a fixed order;
- cache: each output stamped with a key of exactly its inputs, file hashes
  memoised by size and time;
- raster: Pillow's resampling, blur, rank filters and mask blends, exact.

On the game's files: the shipped list and longshot_shaders.bin are byte for
byte the Python's; the 16 reworded text archives unpack to the same bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The game-free renderer checks (nx2/test_coop_spirv.py and the rest) are tests of gpu/, not of the builder: they move to
tests/, and tests/run_all.py finds checks in tests/ alone. assets/addresses.ini is what longshot-build stamps into a
game folder's longshot_version.txt (and nx2/addresses.py reads for the perf sender).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- font: an OpenType CFF font read (ttf-parser) and written again with glyphs
  added: charstrings, charset, names, metrics, a format 4 cmap; outlines moved,
  bounded, reversed and rasterised (ab_glyph_rasterizer);
- prompts::glyphs: the game's icon font with every face's Kenney icons and the
  keyboard face's keys, words and mice, as nx2/prompt_assets.py faces_font and
  nx2/prompt_draw.py keyboard_glyphs; the tables of nx2/prompt_faces.py and
  nx2/prompt_keys.py as Rust data (prompts::faces, prompts::keys);
- prompts::layout: ring.bin and hint.bin from the layout archive;
- icon: the window's icon, .ico and .res files (nx2/make_icon.py).

On the game's files: every one of the font's 2300 code points has the
Python font's glyph, advance and outline (point for point); ring.bin and the
six hint.bin are byte for byte the Python's. The .res files are byte for byte
make_icon.py's; a picture's square differs from Pillow's by the JPEG decoder
alone (at most 3 levels).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The two checks of tests/test_hooks.py that read the repository's own tables (every build's locations with the
definitions, every site's host line, every engine site in a table; the host list's names once each) are a test of the
sites crate now (crates/sites/tests/repository.rs). build-compile's python_parity test, which compared the Rust
outputs with nx2/'s Python, goes with the Python; the generated headers and the sites' error name no nx2/ file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- texture: the Switch 2's block-linear BNTX read; an ASTC LDR decoder of every
  block mode and an encoder of 4x4 blocks (void extent, one or two partitions,
  one or two planes, every weight precision with the endpoints' that fits,
  least-squares endpoints, the best of each decoded); BC4 as the Python's;
- draw: Pillow's rectangles, polygons and bicubic rotation (exact), an
  ellipse and a rounded outline;
- prompts::icons, guides, textures: the faces' layers (the ocarina's notes,
  the letters, the controller picture with its tinted copy and shadow, the
  leader lines routed round the parts), hand-made pictures in their place,
  encoded into textures.bin;
- prompts::make: every prompts output, each stamped by its own inputs (the
  font; the layouts; the archive; each face's textures by its Kenney font and
  hand-made pictures), the faces drawn by several workers;
- Finish: texts, prompts, shader list (kept while its files are the same),
  pipeline lists (with the seed list), window icon; title_res for Windows.

On the game's files: every layer is the Python's but for edge pixels (the
leader lines within 0.002%, the icons within 2% of their pixels by more than
16 levels: FreeType's hinting); BC4 decodes are Pillow's exactly and ASTC
ones within one level of texture2ddecoder's. All of the prompts in 6.3 s
on 6 workers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
gen/hos_image.c is gen/image.c, a64-kit's and nx2/rtgen.py's runtime is rust/rt, the entry hooks, the sites and the
supported build's patches are rust/crates/edits and rust/crates/sites, and the build's other steps are build-compile,
build-assets and game-files. No code changes: the game already builds with the new builder's gen/ as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The Assets seam takes the places it needs (AssetPlaces: the game folder, the
work folder, the tools, the workers) and gains the window's icon; FinishAssets
reads the romfs through the game folder's index (each file fingerprinted by
the index's header and its place in the .nup) or its linked folder, and calls
build_assets::Finish. On Windows the game's own name is written as
<work>/longshot_game.res before the compile links it. PendingAssets stays as
the tests' stand-in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Tests of nx2/'s Python (the lift and its passes, the chunks, build.py's compile, link and memory gate, make_game.py's
driver, the stores, nup.py, the prompts' and texts' Python, the shader census, the stamps, discovery and the walk,
hooks.py's reader and emit) and of a64-kit's translator and runtime, with the C fixtures only they built. Their
behaviour that the new builder keeps is tested in its crates (rust/crates/game-files, build-compile, build-core,
build-assets, sites, edits, lift); the two checks of the repository's site tables moved to crates/sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
nx2/pipeline_share.py's port: the game folder's list checked as a list
someone sent is, the issue's template filled in from the game's last log,
its options and its mods, both in a zip (deflated, flate2) in the Downloads
folder or --out. On a test folder the template is line for line the
Python's and the zip holds the same two files byte for byte.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The host callbacks' checks compile each callback against a fake game that reaches it as the lifted code does at its
site. They took the tables and the hook's C from nx2/hooks.py; tests/sitetable.py now reads the tables (definitions
with a build's locations, the host list) and gives the same C for each form, standard library only (the format's every
rule is rust/crates/sites'). The checks that the old text patches were gone from nx2/oot_patches.py go with that file;
test_function_ends.py checked only the old lift's C passes and is deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/prompts.c no longer reads prompts/Common.bntx (244 MB) and Common.blarc (9.9 MB), copies of the
game's files: it streams them from the RomFS (zs.c hos_zs_romfs_stream) and patches them as they come
(host/prompts_base.c). The builder keeps prompts/Common.bntx.base and Common.blarc.base: the game's
bytes under every run any face may write, the header and the samples the host knows the pool by,
checked against the stream (another game version is refused, the game's own served).

Game-free test: build-assets prompts::base::the_host_patches_the_stream builds host/prompts_base.c with
tests/prompts_base_test.c. tests/test_prompts_live.py, test_prompt_cache_errors.py,
test_prompts_size_table.py and test_mods_size_table.py follow (the fixture now links host/romfs.c).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
What a check took from nx2/build.py (a host file in ZSTD_HOST, host/game/ compiled, the exe's name, the shader stamp's
files, gpu/render left out) it reads from rust/crates/build-compile now; the runtime it compiled from a64-kit's rt/ is
rust/rt. The halves that tested the deleted Python (nup.py's stand-ins, exefs_patches.py's list reader, log_redact.py,
kit.env_on, entry_hooks.py's splice, make_game.py's copies) go with it. test_relocations.py tested a64-kit's image
writer, which rust/crates/image-build replaces with its own tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The pipeline lists' shipping, the share zip's fields, the shader stamp's files, the prepare step's messages, the
manifest, the link's libraries and the prompts' constants are read from rust/crates/build-compile, build-assets and
build-driver; the halves that tested nx2/'s Python (pipeline_share.py, translator_files.py, make_game.py's merge) go
with it. tests/run_all.py's own checks make no nx2/ folder. The switch table: HOS_FMA_FAST, read only by the old lift's
fma_soft.h, is gone; HOS_GUEST_PROFILE (host/guest_profile.c) gets its row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
nx2/make_game.py, build.py, the Python lift and every pass of it, hooks.py, the stores, nup.py and the rest of the
read stage, the prompts', texts', icons' and shaders' Python, and a64-kit (its translator, runtime, image writer and
tools) are gone: longshot-build (rust/) does all of it. nx2/ keeps four developer tools that are not the builder:
perf_report.py and addresses.py (the Launcher's performance sender), pipeline_states.py (the pipeline lists' tour and
check) and lower_test.py (now needing only a C++ compiler). TOTKPort's notice for host/'s parts moves to
host/NOTICE.TOTKPort.md. test_finish_output.py tested make_game.py's finish and goes with it; requirements.txt no
longer pulls in the prompts' Python packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
compile takes what it makes from its command line (the renderer alone, the game alone, a dry run of a tools tree, the
release's third-party set), no longer from RX_VK_ONLY / RX_GAME_ONLY. build-driver's runtimes step downloads NVIDIA's
DLSS SDK, AMD's FSR 4 runtime and Intel's XeSS library at fetch.py's pins, SHA-256 checked and cached in the per-user
cache, once --accept-licenses names their vendor; --upscaler takes xess.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
nx2/prompt_assets.py and nx2/prompt_faces.py read them there too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- longshot-lift sites places the sites over the image's own discovery; its --plan and --check compared with the old
  lifter's lift_plan.txt and are gone.
- longshot-build stamps the report addresses (assets/addresses.ini) only from packaged tools, whose release is in
  their VERSION or version.txt, as the old builder did: a checkout's build sends nothing on its own.
- assets/profiles/hot_funcs.txt, the old lift's hot list, is deleted: the guest profile replaces it.
- host/hos_tracy_game.c keeps only the Tracy client's start: the game functions' zones were the old lift's wrappers,
  which the Rust lifter does not write (HOS_TRACY_GAME is gone).
- rust/rt/PROVENANCE.md says what the runtime takes from a64-kit; README.md and CONTRIBUTING.md name
  host/NOTICE.TOTKPort.md for a64-kit's notice now that third_party/a64-kit is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Two -mllvm options on every IR unit (ir_unit_flags, with a test that they are there):
- -cgpp-huge-func=1000: CodeGenPrepare restarts its walk over a function's blocks after each change to the dominator
  tree unless the function has 10,000 blocks or more. On the game's interpreter dispatch (one function of about 4,000
  blocks, a jump table of 1,953 cases) that was 145 s of a 150 s unit, the build's critical path; with the walk going
  on, 6 s for the unit, the object byte for byte the same.
- -grow-region-complexity-budget=1000: on a player's CPU without AVX-512 (16 vector registers: most Intel desktops,
  AMD before Zen 4, -march=x86-64-v3), one float-heavy function took 23 minutes in the greedy register allocator
  (18 s with AVX-512's 32 registers); 14 s with its region growth capped.

Measured with these flags alone changed, clang 23.1.4, one unit at a time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
rust/README.md moves into docs/dev/reference/builder.md (the crates, a build's stages, the game folder, the romfs read
in place, the lift and its caches, units, gen/, the compile, the stores, the runtime, the guest profile) and stays a
pointer. build.md is rewritten for longshot-build: commands and options, what builds again, every build switch the code
reads, the memory gate, where things are, the guest profile and how to record it, measured build times, and what to do
for each error code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
As the old builder did: assets/profiles/longshot_vk.profdata.xz is unpacked into the work folder
(longshot_vk.shipped.profdata, written only when its bytes change) and the renderer's own units are compiled with
-fprofile-instr-use, their object keys holding the profile's content, unless RX_VK_PGO says otherwise (gen, or a
developer's profile) and only when this compiler reads it (a one-line probe; one that does not builds the renderer
without it and says why). A player's build had lost the 3 to 5 % it measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
passes::split cuts a function whose estimated cost (its instructions, its blocks, each call's moves of the state) is
over SplitOptions::over into pieces at block boundaries, in address order, each cut where the fewest edges cross,
a loop's back edge weighing eight. An edge between pieces goes as a tail call does: the state that may differ from the
context written to it, the entry block's index put in Ctx.piece (a new 4-byte field at 860, rust/rt/a64.h asserting
it), and the other piece entered by musttail, which reloads what its entry blocks read. The function's own symbol is a
trampoline to the first piece; the pieces are <symbol>.p<n>, internal. The site caches' globals are named by the
function's symbol (two pieces of one function had the same names).

mir: Pieces, Dest::Piece, Function::entries, set_guest_start, inst_count. The writer: a piece's linkage, its entry
dispatch, the piece edge; sync.rs reloads at a piece's entry what any of its entry blocks reads. lift::whole runs it
after the passes (LiftOptions::split, in the IR options' key); longshot-lift lift --split-over N --split-piece N.

Tests: a split function's pieces verify, and twelve splits of a loop function (a piece a block to a few blocks a piece,
pieces entered at several blocks, a polled back edge across a cut) run against the whole function in a C harness and
leave the same guest state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
architecture.md's parts and stages are the Rust builder's: read, image, lift, compile, finish and shaders, the caches
and their keys, the mid IR and where the sites live, gen/ and the runtime, the host's RomFS API, and the game folder
without a romfs folder. hooks.md names the sites, edits and lift crates in place of nx2/hooks.py and the lifted C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
LongshotBuilder.exe --cli <longshot-build's arguments> runs tools\bin\longshot-build.exe with --json, passes its events
on unchanged and says them on stderr (progress, warnings and the error by code); its own error event when the program
is missing (tools_incomplete) or stops without one (tool_failed). The zip carries tools\bin\longshot-build.exe (dist),
the third-party objects longshot-build makes, and no nx2/, scripts/ or Python. The Windows renderer checks are
longshot-build compile --only renderer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
With reg_calls each lifted function f_<entry> gets a body f_<entry>.r of LLVM's preserve_none convention taking X0-X8,
SP and X30 as arguments besides the context and returning X0 and X1; f_<entry> stays, a thunk from the context to the
body, for indirect calls, the host, the sites and the table. A direct call or tail call of a lifted function calls its
body; a function whose code takes the context (a wrapper, a split function's trampoline) gets an adapter body.

Exact by construction: a caller writes to the context before a call what it does today, so a body's arguments come as
the context holds them and it loads none; the body writes back at its exits what it changed but X0 and X1, which come
back as the call's value, newer than the context (sync.rs: RegSync). A register body's tail call of a function the host
implements is a call through the context and a return. Indirect calls, a devirtualised call's direct arm and a setjmp
owner's call stay calls through the context.

Which entries are lifted functions the module is told (Module::set_lifted); with reg_calls on that list is in every
unit's key. longshot-lift lift --reg-calls.

Test: a program of seven functions (calls, a moved SP, a host function calling back into a context entry, a BLR, tail
calls of lifted and host functions, a setjmp owner longjmped back into) leaves the same guest state with register calls
and without, at -O0 and -O2; dropping X1's return or a body's write-back fails it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
make_game.py, nx2/build.py, the lift to C, hot lists, kept files, romfs folders and the builder's Python leave the
developer pages and the root README, CONTRIBUTING and AGENTS. Where dev.py's or the builders' new command lines are not
settled yet, the page says so in a TODO comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/nn_fs.c reads the RomFS through host/romfs.c now (the index or a folder): the two fixtures compile the real
romfs.c and romfs_index.c with the folder backend at their made-up romfs (no index, the zstd frame stubbed), so they
link again and exercise what the game runs. Their checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
AppRun --cli <longshot-build's arguments> runs usr/share/longshot/bin/longshot-build (static musl, dist) once
builder/linux/tools.sh has found or downloaded tools.lock's linux-x64 tools (the AppDir, the launcher's toolchains, the
builder's own), a JSON error event when one cannot be had. The image holds the tree longshot-build reads and its
third-party objects; check_player_build.sh dry-runs its compile, with and without FSR 4. deps.sh builds no Python.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A thunk's call of its body (and an adapter's of the context's function) is noinline: LLVM inlined small bodies into
their thunks, two copies of each. The lift tests' compiles() named its folder by the text's length, and two tests
whose texts came out the same length removed each other's file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A first build is about 7 minutes on a 12-core desktop and needs about 10 GB, kept for quick updates; the game reads its
files from the .nup, so it stays where it was, and the game says so when it moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- game-files: mod_order (the list, the file beside it, the old list) out of collect, and an example printing it and
  parse_list's answer, so tests/test_mods_list.py compares the game's reading of mods.json with the build's again; its
  fixture builds host/romfs.c's folder backend. A number past f64's range (1e999) stopped parse_list where the game
  takes the list: such numbers read as 0 now, the grammar's rules kept.
- build-driver: the logs' redaction is the game's rule (the home folder as ~ or %USERPROFILE%, the user's name as a
  folder of any path as <user>), redact.rs, with an example tests/test_log_redact.py compares with the C and C++ rule;
  the log's last line without a line break is no longer lost.
- build-assets: a test of the shipped pipeline list's merge: the tour's list first, each pipeline once, a damaged
  source left out and the rest kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
dev.py packs base/pack build the checkout's own longshot-build (cargo, mise's Rust; LONGSHOT_BUILD names another) from
the game (LONGSHOT_DEV_GAME, dev_build.json's "game", else the newest .nup in ~/Games), every build sharing the
development folder's store/ (LONGSHOT_STORE); a pack keeps the modules whose objects differ from the base's, as
before, without the kept-lift and object-linking tricks. dev.py packs run [--tree T] -- ARGS is the tree's
longshot-build (game, vk, update, mise run build). The build tools are tools.lock's, installed by tools.py on both
systems. setup.py checks Rust; fetch.py stays for developers and CI, its pins the builder's; perf, profiling, tours and
the PR check name the new tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
ci.yml: rustfmt, clippy and cargo test of rust/, and scripts/check_host_compile.py (every host unit a Windows build
plans, compiled -fsyntax-only with llvm-mingw and tools.lock's cpm against a synthetic gen/rt). .circleci mirrors the
Forgejo workflows. mise.toml pins Rust 1.99.1 (rustfmt, clippy, the musl target) and its build tasks run dev.py packs
run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
dev.py's and mise's new commands and variables, longshot-build's compile --only/--dry-run/--third-party-objects, the
upscalers' runtimes it downloads with --accept-licenses and the new error codes, the --cli command lines, the release
packages' contents, the launcher's cache and its nup_moved answer, assets/addresses.ini written only from packaged
tools, longshot-lift sites without a plan, and the giant-function split and compile caps with their measurement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The game read its 100 MB image into the window at the start (46-70 ms here from the page cache, more from a cold
disk) and kept a private copy of every page. On Linux it is now a private file mapping over its place in the window:
pages come from the file as they are first touched and stay shared with the page cache until the game writes them.
The rest of the window stays the memfd's; the image's range has none of its pages in the memfd, so the Vulkan back end
makes no dma-buf of it (a host-pointer import instead) and reads no memfd holes there (hos_posix_guest_private). A file
that cannot be mapped is read as before, and so is every image on Windows: a view goes into a reserved range only as a
placeholder (MapViewOfFile3), and the window is one reservation committed on first touch or in large pages.
HOS_IMAGE_MAP=0 reads it. tests/test_image_map.py checks the mapping, the copy-on-write and the memfd around it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The read stage's tests built .nup files in memory (nup::tests::Builder); another crate's tests now can too, through
the `testkit` feature (game_files::testkit::NupBuilder, zstd_frame). Moved, not changed: the read stage's own tests use
it as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
checks::check_build_in(exefs, builds) and read::read_exefs_of(..., builds): the read stage's exefs for a game of one of
these builds. The builder's own read stage asks for the supported build alone, as before (check_supported_build,
ReadStage::read_exefs); a test's stage gives its synthetic game's build id, so the player's check is never weakened.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
rust/crates/synthetic-game: a small AArch64 program written here (game/main.S: integer, float and memory work, indirect
calls through a relocated table, an SVC, two RomFS files read through a host import, a function big enough to be a
unit of its own), assembled and linked by the pinned clang at test time, made an NSO, packed in a .nup with a
main.npdm and a small RomFS. tests/end_to_end.rs builds it with build_driver::build::build and the builder's read
stage, lift, compile (the game alone, from a synthetic tree: the test's host with the real host/romfs.c,
host/romfs_index.c, runtime and zstd) and finish; runs the game and checks its result against the one src/lib.rs
computes; then changes one instruction of one function and checks, by the --json events, that its unit alone was
compiled again. #[ignore]d: cargo test --release -p synthetic-game -- --ignored (LONGSHOT_E2E=1: no skip).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A release's longshot-build embeds one pack (build.rs, LONGSHOT_SOURCES): the
sources, the prebuilt third-party objects and the build tools, each part a
zstd member of its own so a release with the same tools differs little.
build-driver's sources.rs unpacks it into <cache>/sources/<hash>/, every file
checked by its SHA-256, each folder renamed into place whole with a .complete
note written last; a tool is unpacked once into <cache>/tools/<name>-<hash>/
and hard-linked into each tree. Relative symlinks inside a member are kept,
any other refused. tree_root takes it after --root and LONGSHOT_ROOT; a
developer's build carries nothing and says to name a checkout.
`longshot-build sources` unpacks ahead of a build and prints the folders.
The game is always the folder's own exe (no launcher in bin/); the Windows
icon moves to assets/longshot.ico.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
sources: the tracked tree a player's build reads, VERSION, the third-party
objects, --add files and --tool/--tools folders, as deterministic zstd -19
members; build --sources embeds it; unpack reads one back as the program
does. deltas: zstd --patch-from --long=30 from each earlier full file, each
checked by applying it, and longshot-build-<v>-<p>.json listing the full
file, the deltas, their bases and SHA-256s and the stamps. fetch-bases: the
channel's last 5 releases' full files, checked against their manifests.
llvm-mingw moves here from builder_package.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A release ships longshot-build alone. Removed: builder/ (AppRun, tools.sh,
longshot-folder, LongshotBuilder, setup), scripts/linux/appimage.sh,
check_player_build.sh, builder_package.py, check_windows_files.py,
recomplauncher.json and their tests; dev.py, the profiling and coverage
tools, the docker environment and the remaining tests now name
longshot-build's own layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build-linux.yml and build-windows.yml make longshot-build-<v>-linux-x64 and
longshot-build-<v>-windows-x64.exe from tools.lock's bundle, the third-party
objects, RenHDrum's library and the sources; a player's build's dry run over
what each carries (the Linux one from an empty cache, the Windows one started
under Wine); then, for a release, the deltas from the channel's last 5
releases and the manifest. release.yml publishes them with SHA256SUMS over
every file. ci.yml: the .NET builder checks go, the e2e job runs
rust/crates/synthetic-game on every change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The AppImage, Windows builder and builder-cli jobs go; linux-longshot-build
and windows-longshot-build mirror build-linux.yml and build-windows.yml,
each also a release job (deltas and manifest when on a channel);
release-stage checks both full files and manifests; e2e runs the synthetic
game on pull requests and main. release-checked-skip no longer fails a
commit that was never released.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
`--game G --out G` linked the dump's romfs over itself (link_or_copy removed the destination first) and
`--work` inside the dump made exefs/ again there. folder::check_places refuses a game or work folder that
overlaps a dump's folders (either way round) or holds the .nup, before anything is touched; fsx::link_or_copy
links or copies to a temporary beside the destination and renames it over, and leaves a destination that is
already the source alone. Temporary names are each call's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The release ships longshot-build-<v>-<platform> with the sources, assets, prebuilt objects and build tools packed
inside, its zstd deltas from the channel's last five releases and a manifest; players build through the Longshot
Launcher only. The pages and the host/ and rust/ comments that described the AppImage, the Windows Builder, its setup
and --cli, the zip, recomplauncher.json and the tools' download say so now, with what the pack holds, where it unpacks,
the order the tree is found in, and the CI jobs that build it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
folder::install moves each old file aside before its new one goes in and puts every swapped file back when one
fails, so a folder holds the old build or the new one, never half of each. A vendor's DLL or DLSS runtime was
taken for the player's own whenever its bytes were not this pin's, so a pin bump never reached a folder built
before: now one rule for DLSS, FSR 4 and XeSS, by the installed note (folder::ours): the builder's own files are
replaced, and a build without that upscaler removes only them (folder::uninstall; ngx/ was removed whole).
build-core gains fsx::rename (Windows: retried on access denied and sharing violations) and key::file_sha1;
build-compile's key::file_sha1 is now that one (build-compile/src/key.rs only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
scripts/linux/deps.sh trims LLVM 23.1.5's release to clang, lld (as ld.lld), clang's headers and the builtins and
profile runtimes (96 MB, 407 MB unpacked, from emsdk's 142 MB); scripts/windows/deps.sh trims llvm-mingw 20261104 to
the x86-64 target (50 MB, 314 MB unpacked, from 191 MB), cross-builds the Windows cpm's FFmpeg and dav1d with llvm-mingw
and packs libsdl's SDL3 and sdl2-compat DLLs. tools.py pack: sorted, fixed times and owners, zstd 1.5.7 built from its
pin at -19 --long=27; repack moves the earlier zips; add --no-upload, missing and publish for the release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
One block's sequences could copy gigabytes (each match up to 128 KB, tens of thousands of them), and a head's
prefix decode had no limit at all. Each sequence and the block's last literals are now checked against the
format's Block_Maximum_Size and the frame's limit before they are written; the test is a hand-made 16-byte
block of four 64 KB matches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build-driver's tools.rs: tools.lock's tools at <root>/tools/<name> named to the compile by their variables (one table:
LONGSHOT_LLVM, LONGSHOT_SYSROOT, LONGSHOT_FFMPEG, LONGSHOT_SDL2, RX_CPM; LONGSHOT_MINGW, LONGSHOT_SDL_DIR), over whatever
the PC sets; LONGSHOT_OWN_TOOLS=1 is a developer's own (the variables, EMSDK, the PATH). The builder's llvm has no
aliases: bin/clang, C++ with --driver-mode=g++, bin/ld.lld. A Windows build links llvm-mingw's FFmpeg (lib*.a) and
takes the SDL DLLs from LONGSHOT_SDL_DIR. longshot-build stamps (a stamps event) and longshot_version.txt carry the
compiler stamp (tools.lock's compiler, sysroot and cpm lines) and the shader translator's. The synthetic game's
end-to-end test compiles with the checkout's tools/ the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Nup::open checks every record's extent (no wrap, inside the file: an offset + size that wrapped read as an
empty file that looked whole); a record's size reserves at most 64 MB up front; a directory's children range
is added in usize. The romfs index refuses an entry past its .nup. An NSO's segments must fit a module (1 GB:
a u32 size or offset asked for gigabytes before anything was checked), and its MOD0's bss with checked
offsets (a negative one wrapped and the image's resize panicked). The le32/le64/u32_at readers of nup.rs,
romfs.rs and nso.rs are now one module (le.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A bug's panic ended the event stream with Rust's message on stderr and status 101. A hook now says it as an
error event (code internal_error, the panic's message and place, where the build log is) on stdout and in the
log, and ends the process with status 1. A debug build's panic-test command lets a test run it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
parse_ips and parse_pchtxt take main's size and stop at the first write outside it (an IPS of 64 KB runs, 8
bytes each, grew the writes' map by gigabytes); a file's writes, runs counted, stop at 1 MB; a pchtxt offset
and its shift add with checked arithmetic (an overflow panicked in a debug build, wrapped in a release one);
collect reads no patch file over 4 MB (said as unsupported).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The old lifter that such functions were left to is gone, so a single uncovered
word (an FP16 fused multiply-add, or data that discovery walks into by
mistake) failed the whole build. It now stops the guest at its address, as an
undefined one does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
take() and compile() wrote the new stamp after placing the object but left the old one in place until then: a
run stopped between the two left object B stamped with key A, taken for up to date. Both now go through
stamped(): the old stamp removed first, the new written once the object is in. A header (or the source) written
while its compiler ran was hashed afterwards and the object stored under the new bytes' key: now such an object
is used and not stored. State::remember records a hash only when the file's stat is the one before the read.

Hunks (build-compile only): compile.rs take(), stamped() (new), compile()'s start time, its headers line and its
final rename/stamp block, changed_since() (new), depfile_headers()'s check; state.rs sha1() and remember().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The private file mapping put file-backed pages in the window: a GPU pool overlapping the image could not be imported
as a dma-buf or a userptr on AMD, and it saved about 50 ms at the start. map_image, hos_posix_guest_private, the
Vulkan back end's host-pointer branch and hole-scan skip for it, and tests/test_image_map.py are gone;
HOS_IMAGE_MAP is a GONE row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Half add, subtract, multiply, divide, square root, roundings, min and max,
compares and conversions (scalar, vector, pairwise, across lanes, by element)
are lowered: each host operation on halves is done in single precision and
rounded back, which is exact (24 >= 2 x 11 + 2). The fused forms, the
estimates and the fixed-point conversions of halves stay uncovered and trap.
One gate (fpscalar::float_elem) says which.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/ reads the RomFS through romfs.c now: the audio source's, the mods' size tables' and the virtual cores' file-open
fixtures build its folder backend (or cut index_rel from nn_fs.c), and test_vcore_fs_open also checks the new .nup
index path (no core, no save lock held, the core given back). The teleport fixture's Ctx has rust/rt's vreg[32][2],
mods.c's game_file takes its size, and test_hos_ab lets later API versions' entries follow hos_ab_frame's group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Two builds into one game folder from two work folders swapped their files in over each other's and wrote two
romfs indexes. build-core's lock gains GameLock (`.longshot-build.lock` in the game folder, game_folder_busy),
taken by build, image and index (index took no lock at all). The places check now comes before the work and
game locks, so a refused place (a dump as the work folder) gets no folder and no lock file written into it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- hos_romfs_head of a zstd-stored file decodes its frame's first blocks (hos_zs_frame_head), not the whole file.
- A decoded zstd-stored file is kept after its last close, 256 MB of closed copies at most, the least recently used
  let go first; the most held at once is logged as it grows.
- hos_romfs_case finds folders too (mods.c's mod-only listing listed a mod folder the game also has twice), and the
  very spelling first (of two names that differ in case only, the other could be found).
- hos_romfs_ready says whether a RomFS is there: an index open, or a folder that exists (the beside path was set
  always).
- The index is checked at open: every entry within the .nup, sizes sane, the names in strict order (lookups are binary
  searches); else romfs_index_bad.
- Windows: the .nup's handle is overlapped, each read waiting on its thread's event (one synchronous handle served every
  thread's reads one at a time); a long path is made whole by GetFullPathNameW ("..", a relative path) and extended as
  \\?\ or \\?\UNC\; the index's path beside image.bin takes either separator and refuses one that does not fit.

tests/romfs_test.c checks each (they fail on the code before), with two names that differ in case only and damaged
indexes from the Rust side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
They decoded to Flow::Return, so the lifter made an ERET a RET to X30. At EL0
both are undefined: they are Flow::Trap now, the lifter's trap at that pc.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
test_ffx_sdk and test_xess_sdk checked nx2/make_game.py's licence gate and runtime placing, which longshot-build's
runtimes.rs does and tests now: they check that scripts/fetch.py and runtimes.rs pin the same files (tests/vendor_pins.py).
test_linux_update's folder launcher and bin/ tests went with the code; its sysroot check is a build-compile key test.
test_pipeline_tour reads the renderer's PGO_ENV flag in build-compile's plan; test_job_queue's Windows build outside the
queue is a longshot-build.exe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Every command hashed the whole embedded pack (hundreds of MB) to find its tree: the tree's hash is of the
members' recorded hashes, and a member's bytes are checked only when it is unpacked. Each use marks its
folders (.used); under <cache>/sources and <cache>/tools a folder no release used for a week goes, the last
two of each kept, and a stopped unpack's .part folder goes after a day. The unpacking tests run one at a time
(they share the process's tool table).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
hos_prompts_base_at finds a range inside one run, so a base with two runs that touch would not serve a range across
them; the builder (rust/crates/build-assets prompts::base) merges runs that touch or overlap and never writes one. The
parse took them (only overlapping runs were refused). The_host_patches_the_stream checks a hand-made base with two
touching runs is refused (prompts_base_test's new exit 3: the base refused); it fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
DC ZVA was lowered but DCZID_EL0, which code reads before using it, was an
undefined system register: the guest stopped there. It reads 4 now (BS 4,
DZP clear).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- scripts/reshade/check_fx.py takes the adapted preprocessor from build-compile (examples/reshade_preprocessor.rs, run
  with cargo) in place of nx2/reshade_fx.py.
- scripts/check_third_party.py skips a folder that holds only ignored files (a deleted part's build output left in a
  checkout), with a test of it.
- test_linux_docker_packages: every package and PPA the workflow installs is in the Dockerfile, which keeps g++-13's PPA
  for the sysroot; test_windows_on_linux skips comment lines; test_mise_build reads the Rust pin where the docs say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A work folder (its lift and build: gigabytes) outlived its game folder forever. Each build notes its game
folder in the work folder (game_folder.txt); after a build, the cache's other work folders whose game folder
has no build record, unused for a day and held by no build, are removed. A work folder named with --work is
never pruned beside.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- zs.c's two once-guards around read_dicts (hos_zs_decode's and hos_zs_romfs_stream's) are one hos_zs_dict(id):
  each caller waits for the first read to end (a second one saw no dictionaries while the first read, and the two
  could both read them).
- hos_zs_romfs_stream of a .zs the .nup keeps in a zstd frame of its own (hos_romfs_open_stored) unwraps that frame as
  it streams, never the whole file decoded in memory.
- audio_source.c, oot_heart_containers.c and prompts.c read their frames through zs.c (hos_zs_read_romfs,
  hos_zs_decode), its dictionaries found by the frame's id; their own decoders, SARC readers and dictionary loads are
  gone, and so is their zstd.h (ZSTD_HOST: hos_zstd.c and zs.c).
- One writer of a frame of raw blocks (prompts_base.h hos_zs_raw_head/hos_zs_raw_block): the patch, zs.c's
  hos_zs_write, and prompts.c's served files (written beside and moved over, as hos_zs_write does).

tests/zs_test.c (game-files' the_host_streams_a_wrapped_zs) checks the stream, decoded bytes never held; it fails on
the code before. The audio, heart containers, mods sizes, mods list and damaged files fixtures follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Constant shifts by the width or more; atomics (AtomicRmw, CmpXchg, atomic
Load and Store) of anything but a scalar integer of 8 to 64 bits (CmpXchg: or
i128); loads and stores of flags; exclusives of a size the monitor has not
(1, 2, 4, 8; a pair's halves 4 or 8); marks of no bytes; byte swaps of less
than whole halfwords; a switch with one address twice; an edge from a piece to
itself or to piece 0. verify_pieces checks a split function's pieces together
(every piece edge names a piece and an entry block of it); the whole lift and
the split test call it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The driver read the tree's assets/profiles/guest.profile or nothing; recording a profile for the new lifter needed
the lift and the compile run by hand. build --guest-profile generate lifts with every unit's counters
(lift::whole::Profiling::Generate, its gen/profile_map.txt beside them), --guest-profile <file> lifts with that
profile instead of the tree's. A build's alone: an update lifts with the tree's profile again.
(stages::profiling: the one place the choice becomes the lift's Profiling.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Two builds downloading one runtime wrote the same <file>.part: each download now writes a temporary of its own
(fsx::temporary). curl gives up under 1 KB/s for a minute (--speed-limit, --speed-time), as wget's timeout
does, instead of waiting for ever. The record keeps each license with the pin its files came from
(Record::accepted): an update after a pin bump asks for the license again. runtimes' sha256_of streams the
file; build-core gains key::to_hex, used by sources.rs, runtimes.rs and game-files for their hex.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The timer thread's writes (every 10 s, or on <path>.dump) and the one at exit wrote the same <path>.tmp at once: a
profile could come out cut or mixed, or a write fail. lsp_write takes a lock (and lsp_reset), and the write at exit is
the last. tests/test_guest_profile_write.py (tests/guest_profile_test.c: two threads writing 200 times each, then the
last) fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
MRS and MSR were left out whole, though the docstring said only the system
registers but NZCV and TPIDR_EL0 were; DC ZVA (a SYS) was left out; a register
offset's index was always 0 to 0x3f, so neither the upper 32 bits UXTW and
SXTW drop nor a negative index was ever drawn; and the marks of written pages
were never looked at. Now TPIDR_EL0 is compared after each word, the index has
random upper bits and a random sign, and every 4 KB page a word changed must be
marked in a64_dirty unless it wrote through SP. The docstring lists exactly
what is left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
gen/'s lifted_*.ll were 5.7 GB per work folder, written by the lift and read once by the compile. The per-unit key
already decides whether a unit's object is needed, so the text is made only then:

- lift::whole::Session: discovery, the edits, the profile and the units' plan with their keys, worked out once
  (run_with returns it). The lift lists each unit in units.txt by its key; a unit whose key the last list has keeps
  its content key, a new one is listed pending (content key -, size and cost estimated). No unit file is written,
  and any left in gen/ are deleted.
- lift::whole::Texts makes a unit's text on demand from that session, or from one worked out again (an unchanged
  lift whose objects the store lost), checks gen/ still holds that lift, and after the compile notes the units made
  in units.txt with their content keys: the next update knows every object's key without making a text.
- build-compile: a lifted unit with no file and no content key has its text made in its compile worker (under the
  memory gate as before), hashed, looked up in the store by that hash (a unit whose key changed but not its text
  compiles nothing: Made::Stored), else compiled from standard input (-x ir -). Its object key is its text's, as a
  file's would be. Keys::base is None for a unit whose text is not made yet.
- llvm: each unit names its file inside (source_filename), so the object's file symbol, and the whole object, are
  the same whether clang read the file or the text (checked byte for byte on a game unit, and in
  build-compile's compile_link test).
- The driver passes the lift's texts to the compile (build and the compile stage alone) and notes them after it.

LONGSHOT_KEEP_IR=1 (and longshot-lift lift, and an instrumented lift) writes the texts as before, to read or compare.
Behaviour of the game unchanged by construction: the same IR text reaches clang with the same flags, and the objects
are byte-identical to the file route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The romfs's names went unchecked into the index, and the assets write files by them (build-assets' texts):
a name such as ../outside.zs wrote outside the game folder. romfs::entries runs package_parts over every
name (nup_unsafe_path), and Index::open refuses an index holding one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The host and the renderer are built together, so a host of another version never loads this renderer. init_body's
copy ladder (version 14 to 45) and every host->version guard (the Mods tab's, the A/B's, sprint's, the input movie's,
the out-of-memory call's, the load mode's version-14 rule) are gone: one check, h->version == MKWVK_API_VERSION, and
the table copied whole. The tests that read those guards in the source follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Image::modules() said address order but kept image.json's; Image::new added
base + size and segment addr + size unchecked (a panic in debug, a wrap in
release). Both are checked now, the modules sorted by base (DT_INITs with
them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
With a guest profile, the functions it never saw run are most of the game: 223,055 of 294,518 functions, 3.7 GB of
the 5.7 GB of IR with the six scenes' profile merged with the earlier one. They now go into units of their own,
lifted_cold_<entry> (units::Sizing::cold_budget, 240,000 by default, three times a regular unit's, as -O0 compiles
the IR in a fifth of -O1's time; longshot-lift lift --cold-unit-cost N, 0 keeps them in the regular units), which
build-compile builds at RX_COLD_OPT (Kind::LiftedColdIr, -O0 by default; RX_COLD_OPT=O1 builds them as the rest).
Without a profile nothing changes: no function is cold.

Measured (Ryzen 9 7900X, clang 23.1.4):
- The cold units alone, rusage CPU time: 1,180 s at -O1, 239 s at -O0; .text 330 MB and 520 MB. Of the cheaper
  choices on 20 sample units: -O1 -fast-isel 91 % of -O1's time, -Os 133 %, -O1's middle end with -O0's code
  generation 55 % (190 % of the size), -O0 19 % (147 %).
- A first build with the profile, 23 jobs on all 24 threads, the timing queue: 124 s at -O0 against 183 s at -O1
  (the compilers' time summed 1,858 s against 3,233 s); the executable 774 MB against 590 MB, far under the 2 GB its
  code can address.
- The game, headless, a tour of ten areas each teleported to, walked 15 s and held 15 s, three interleaved runs a
  side (RTX 3090): the areas the profile was not recorded in (Zora's Domain, Jabu-Jabu's Belly, the Lost Woods, Lake
  Hylia, Gerudo Valley, the Water Temple, Death Mountain Trail) and those it was (Hyrule Field, the Fire Temple,
  Kakariko). Warm fps, p99 frame time, the 1 % low and the game's own CPU time a frame all within 1 % of -O1's in
  every area but Kakariko (109 against 113 fps, two runs against three), no more frames over 33 ms (17 against 36 in
  all). -O0's frames are about four times larger (a lifted function's median 104 bytes against 40); guest threads
  run on 64 MB host stacks.

The same IR either way: only the level its compiler is given changes (musttail, the only tail calls, holds at -O0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
An antivirus or the search indexer opening a file just written makes Windows refuse its rename for a moment.
fsx::rename (retried with backoff on access denied and sharing violations) is now what fsx::write_atomic,
fsx::link_or_copy, the store and the unpacked tree's rename use. build-compile's store.rs drops its own
beside/write_whole/place for fsx::write_replace (unflushed, for the manifests) and fsx::link_or_copy (store.rs
only, those three functions and an import).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
MkwVkHost.romfs_dir, host/rx_backend.c's host_romfs_dir, vk_imgui.cpp's folder fallback and game_font::Reader's
open(dir) are gone: romfs_read serves a romfs folder as it serves the .nup's index (host/romfs.h). tests/test_game_font.cpp
opens its folders through a reader of its own, as the host's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Measured on the development PC (Ryzen 9 7900X, 24 threads, NVMe SSD), the timing queue on all 24 threads, a fresh
work folder and stores, the split, the compile caps and no unit texts kept: a first build 180 s (lift 5 s, compile
164 s, finish 9 s), its work folder 1.7 GB (from 7.2 GB with the texts), an update with nothing changed 10 s. The
player docs said 7 minutes and 8 GB kept / 10 GB free (a 6-job build with the texts): now about 3 minutes and 2 GB
kept / 5 GB free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
enter_first let any smaller job by a first choice that did not fit, so the small ones could take its room as
fast as it came free and the longest unit ran last, alone. Once the first choice has waited PATIENCE (10 s),
nothing else is let by it: the running jobs end and its room comes (memory.rs only; the scheduler is
unchanged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build-windows.yml, vulkan-dlss.yml and every RenHDrum cache restored the
whole unpacked toolchain (rustc included), which toolchain() trusted by its
.complete note alone, a release's build too. They now keep the .tar.xz parts
and the crates, which are checked by their SHA-256 each time they are taken;
CircleCI's RenHDrum caches likewise. toolchain()'s note names each part's
SHA-256, so a folder of another pin is made again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A romfs folder was read with the host's own handles (CreateFileA, FindFirstFileA, GetFileAttributesA) and the .nup's
index through romfs.h; now every path under hos_romfs_dir is romfs.h's (romfs_rel, once index_rel), so Handle.rom is
the only RomFS handle and a folder's listing, type and reads are romfs.c's, as an index's. Paths a mod, the overlay
or a stand-in sent elsewhere are opened as before. A flush of a RomFS handle touches no host handle. The damaged
files, vcore open and save commit fixtures follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Bit 32 of the FPCR location was kept for the deleted lifter's fast-float
regions (RECOMP_FPX_INHIBIT); nothing sets it now. MSR FPCR writes the low 32
bits (the rest is RES0) and MRS reads them back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
assets/profiles/guest.profile.xz: the six scenes of the old hot list recorded with the new builder's instrumented
game (hyrule-field, hyrule-field-adult, market, kakariko, deku-tree, fire-temple: 43,333 functions ran), merged with
the earlier recording on the new lifter (boot and loading included, 71,601 functions, every one still matching this
build's code): 71,741 of the game's 294,518 functions. xz -9e, 2.8 MB (13.8 MB of text). Each of its 813,088 lines
checked to be the header, f <entry> <code hash> <entries>, b <block> <count> or t <block> <count>: addresses, hashes
and counts, no game code.

- profile::Profile::load (and Map::load) read an xz file as it is, told by its magic bytes; the lift's key holds the
  file's bytes as before. The driver's shipped profile is the .xz.
- A build without --guest-profile now lifts with it: branch weights, the hottest functions in lifted_hot_* units at
  -O2, the never-run ones in lifted_cold_* units at -O0 (RX_COLD_OPT). A function whose code hash no longer matches
  takes no counts and is neither hot nor cold (tested: profile's xz test).
- Docs: build.md (the shipped profile, its defaults, recording one again with the .xz), builder.md, and
  assets/profiles/README.md (what it holds, what it was recorded on, what it measured).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Nup::frame_length decoded its frame a second way: it is now decode's (which says the frame's length too).
nup.rs and checks.rs had an is_link each: one, in checks. patches::Context::from_env read HOS_MODS and
HOS_OPTIONS_FILE itself: Context::new takes the caller's environment (the driver's crate::env). Removed:
checks::check_cache_paths (only its test used it: every write into the game folder is a rename now, which
replaces a link and never writes through it) and disk::slow_disk_warning (the driver's warning is the one).
Kept: nup::read_exact (the nup example's), and the old mods list, longshot_mods.txt, which host/mods.c still
reads while there is no mods.json (the builder applies patches in the order the game shows).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
longshot_build.py llvm-mingw checks the kept archive on every call and takes
an unpacked folder only when its stamp names the pinned SHA-256, written
last. Every workflow and CircleCI keep only the archive. ci.yml's
host-windows restores its caches on every run and saves them only on a push
to main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
romfs.h's hos_romfs_fold and HOS_ROMFS_PATH (1024, with its 0) in place of romfs_index.c's and romfs.c's own folds
and caps, and of the locale's tolower and MAX_PATH where mods.c and prompts.c hold or fold a RomFS path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
like() was k_like(), konst_like_mask() k_like(x, 0); lower() builds a Sem as
Sem::new does; FRECPS's infinity times zero is fp.rs's; a pair's two store paths
are one, and the space of a store one function; SDOT and UDOT, and the widening
multiplies of three-different and by-element, share their bodies; the
immediate SQSHL and UQSHL saturate as the register shifts do. mir's unused
recip_estimate export goes (sem computes it). Comments no longer speak of the
old lifter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The lift keys all 294,518 functions (what lifting each reads, written out and hashed) before it plans the units: on
one thread that was most of a lift that writes no unit texts. Now on the lift's workers, chunked, the same keys in
the same map (the plan reads them by entry).

Measured, `longshot-build lift` on a fresh gen/ (no unit texts kept, the shipped profile), three runs each, 23 jobs:
5.66 / 5.68 / 6.16 s before, 3.77 / 3.85 / 3.85 s after (discovery 1.3 s of it).

The lift's line "N units, M kept from the last lift" counted the units listed without their text as kept; it now
says "K kept, M new".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
folder::old_builder_leftovers is gone (a clean break: no supported builder wrote those files into a game
folder of this one); the romfs/ folder a dump build linked is still removed for a .nup build, as the game would
read it before the index. folder::version_text takes LONGSHOT_BUILDER_EXE from the driver. The tests share one
scratch folder helper. layout.rs says the cache as it is (the store's v1, sources/, tools/, runtimes/), and the
disk estimate the 16 MB index.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A release whose manifest cannot be read, is not JSON, names no full file or
another one, or whose full file does not download is left out and the next
taken; the release list is asked again three times, and when it still cannot
be read the release has no deltas instead of failing. Game-free test:
tests/test_longshot_build_bases.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The Tracy client's start was all that file held (the Rust lifter writes no zones of the game's functions); it is
hos_main.c's now, and the compile plan has no rule for it. zs.c's header names every reader it serves, and the damaged
files' zstd check names the Rust builder's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
passes::summary: a function's reads before writes and its writes (mir::Summary, Loc::bit sets), its own code's
(local) then through its direct callees (close); an indirect call or jump, an SVC, a host call given the context, a
setjmp owner's call or a trap reads and writes everything, as does a callee that is not lifted. lift::whole summarises
every function (its IR before the passes, which only take reads and writes away) when register calls are on, and a
function's key holds its own summary and its direct callees' (in place of the whole list of lifted entries).

At a register call to G with summary (R, W): only the dirty slots in R|W are spilled, only the arguments in R|W passed
(poison for the others), X0 and X1 taken back only when G may write them, and only W but the callee-saved reloaded;
what G neither reads nor writes stays in the caller's slots, dirty if it was. An adapter stores only the arguments in
its function's R|W.

Test: the differential harness gets a function whose caller-set register its callee writes, a build with every
function split (pieces entered through adapters), and the summaries checked; three builds at -O0 and -O2 agree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Dest::Piece's code dropped the edge's poll, so a loop cut across its back edge never handed its core on (a stall, or a
deadlock with virtual cores). The writer's test that a polled piece edge loads the poll flag, and an unpolled one
does not. The lifter's tests that compile or run with clang fail when there is none (LONGSHOT_NO_CLANG=1 passes over
them), and the writer's compiles() has a folder of each call's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
share_marks widens a group's marks to one of up to 4 KB, which can start on a page the GPU does not map and end on one
it does; the gate tested the first page only, so the GPU page went unmarked. The lifted code's mark and A64_MARK now
mark when either page is the GPU's (a mark spans two pages at most). A mark of no bytes marks nothing (the writer
took 1 from a u32 for it). Tests: the writer's text asks both pages' bits, and A64_MARK compiled against the lift's
a64_config.h marks a store from a CPU page into a GPU page, and not one on CPU pages only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Program::inputs wrote each address the function's own instructions may go to with whether it is an entry, but not
where its edits' code goes (a jump site's target, a label): an entry made there turns the goto into a tail call, and
the cached unit stayed as it was. FunctionEdits::targets gives those, and inputs writes them as the others. Wrap and
its lowering into mid IR move from edits/src/lib.rs to code.rs, the one edits file the lifter's own key hashes (a
change to the wrapper's IR kept every cached unit); its Infallible emit is unwrapped by pattern.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
llvm.threadlocal.address is memory(none) to LLVM: at -O2 it gave one address to two reads with a call between them,
and a guest thread's fiber can resume on another host thread across a call, with another copy of the global. Each
access now calls @tls.<symbol>(), a weak hidden noinline accessor (any unit's copy may be the one linked, so LLVM
neither inlines it nor infers it pure). Test: two reads around a call ask the accessor twice, and the function's own
code has no threadlocal.address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A host call without the context (mir HostArg::Ctx absent) syncs nothing: the guest state stays in the lifted
function's registers, and the context is stale. game_call(NULL) took the thread's own context then, so a host function
called that way could run guest code on stale state. Every caller passes the context it was given; a call with none is
refused (logged once, as the other refusals), and HostArg documents the contract. tests/game_call_test.c's calls pass
the context, and a call with none is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
share_marks keyed its groups by register, its one-base rule a debug assertion: a register's old value still used
after the register's next write (forwarded) joined the new value's group, and the shared mark went out from the new
base, missing the old one's pages. Groups are keyed by register and epoch (each value of it); a write no longer ends a
group, as its base value is still the one it was. Test: an old value's two stores share a mark from it, the new
value's keeps its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The review's undefined NaN constant cannot be made: mir's verifier refuses a float Op::Const (constants are integers),
and the writer defines a float NaN's bitcast and splat from the integer's bits. This guards that path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- mir: Loc::bit/from_bits/ALL_BITS and Function::succs, in place of sync.rs's LocBits and simplify.rs's Locs and their
  two successor lists; sync's dirty set has one transfer function.
- plan::Plan::callee and holders, in place of the PLT-following callee in lift, edits and sites and two holders loops.
- llvm: Module::add takes the runs (add_with gone); fresh_label in place of a temporary's name cut for a label;
  %x.lo/%x.hi only in a function with an LDXP.
- rt/a64.h: A64_POLL_CTX and a64_poll(Ctx *) (host/mkw_glue.c's too), and the g_module_base macro, 0 since every
  module is lifted at its address (host/oot_sprint.c, oot_menu.c, oot_sites.c name the addresses themselves).
- Comments that described the old lifter's ABI, its files and its asides now say what the code does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A second C harness over the lifted code: scale_f32's value 1.0 and 0 leave all of V0 (the product would clear its
upper half), note_u64 notes the register after its instruction, a replaced bl on sets X30 to its return address and
hos_site_callee to the function it calls and the callback's own call runs, memset's entry hook asks the host at
exactly 8 bytes and not at 7, a before site runs before a branch site at the same cbz, and a callback's Z is what the
b.eq after it reads. Each fails with its key line undone (checked). The lifter's clang tests fail without clang
(LONGSHOT_NO_CLANG=1 passes over them; from tnkyyzuk). tests/sitetable.py says line() and RULES are the old C contract.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A table's index was bounded by a mask found scanning back from the BR in address order, in
index_bound and in the window's own tracking of ANDs. So a mask from a block the load's block
is not only reached from was taken (`ldrb w8, [x0]; cbnz w1, L; and w8, w8, #1; L: ...` read
2 entries of a 256-entry table). So was a mask made after the load used the index
(`ldrsw x10, [x9, x8, lsl #2]; and w8, w11, #3; ...; br` read 4).

index_bound now starts at the table's load and follows every predecessor path in the
function: its fall-through, branches and the tables found so far. Each path must end at a
write that bounds the register: an AND with a low mask, UBFM, or an ORR or MOV of bounded
values, searched the same way. The bound is the largest of them. A path that reaches an entry
(whose callers are unknown), crosses a call for a caller-saved register, or ends at any other
write gives no bound. Code no known edge reaches is reached from the function's BRs whose
tables are not found yet, this one among them. A copy that goes round a loop adds nothing of
its own (`mov w27, w17; bl; mov w17, w27`, a loop's back edge bringing it back). The window
takes no mask bound of its own any more. It keeps its compare-and-branch bounds and its MOV
copies of them.

The real image, against sqslzwzn's discovery: 294,518 functions, the same; 1,474 jump tables,
6 changed, each an over-read that stops now:
- 0x81776d90: 113 entries -> 4 (its index is `and x10, x10, #0x3`, the masked value that
  indexes the function's first table too).
- 0x817831a0 and 0x81900edc: 256 -> 4. 0x817779fc: 6 -> 4. 0x81ad3080: 10 -> 9.
  0x833d3dd4: 50 -> 46. Each is `cmp wN, #k; b.hi` on the switch value, then a copy of it
  masked with 0xff or 0xffff as the index. The mask had been taken as the bound, too wide for
  the 4,096 limit, so the table was read until an entry left the function. The compare's
  k + 1 is the bound now.
- Instructions: 17,635,231 -> 17,635,227 (code only the over-read targets reached).
The four tables checked by hand stay at 4: 0x81843860 (`(w24 & 1) | w17`, w17 a ubfiz of
one bit kept across a call in w27), 0x81dff940, 0x82092ae0 and 0x82092b38. jt_bounded
1,384 -> 1,392, jt_unbounded 58 -> 50.

The review's guard (keep the larger of the bounded and unbounded reads) is left out: the
unbounded read stops only where an entry leaves the function, so it would put back these
over-reads.

Tests: the review's two inputs (a mask only on one way into the load's block; a mask after
the load), both failing on the old code, and a mask every way into the block comes through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
InsnKind classified words as a64-kit's lifter did, the PAuth branches (RETAA, BRAA, BLRAA) plain instructions, while
the lifted code decodes them as the return, jump and call they are: an after site on one passed placement and its
code was dropped. InsnKind::of is now the decoder's (a word that does not decode traps, as in the lifted code; its own
sign-extension copy gone). The function builder refuses code after an instruction that ended its block (a branch, a
return, a trap) instead of leaving it out. Tests: RETAA, BRAA and UDF's kinds; after code on a ret is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The slots of lifted code's setjmp owners (recomp_sj_push / recomp_sj_pop, the longjmp a
missed jump finds: hos_setjmp_return) were per host thread (_Thread_local). A guest fiber
that sets a jump on one host thread can be resumed on another (hos_thread.c fiber_switch)
and longjmp there, on its own host stack, which went with it. There the jump found no slot,
or another context's, and the first thread's slot was left behind.

Each context (a thread's or a fiber's Ctx) now has its stack, found by its address under a
lock. A slot knows its stack, so recomp_sj_pop and the lifted code's calls are unchanged.
hos_setjmp_forget lets a context's stack go when the context ends: a thread destroyed, a
fiber finalized or set up again. So a context made at the same address later starts empty.

Past 256 nested owners, a push moved every slot down one to make room. The slots the frames
below hold then named their neighbours' return addresses. Such a push is now refused (a
buffer no return address matches: a longjmp to that owner misses, as it would unwrapped),
logged once.

Tests: test_setjmp_context.py builds the slots' code with a made-up lock and log. A push on
one thread is found and popped on another, and two contexts don't share slots. 258 pushes
leave the 256 live slots where they were, the refused ones match nothing, and it logs once.
test_thread_wake_cleanup.py's fixture gains the context and a hos_setjmp_forget stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- plan_edits refuses an edit in a PLT stub (lifted as its jump: the code would never run), and placement a jump site
  whose target is another function's entry in a holder (the lifted code would tail-call it, not jump there).
- A test assembles each patch shape's instruction and checks the decoder prints it as the shape (Shape::Asm compares
  that text: a printer change fails there rather than finding no patch).
- Gone, kept only to compare with the old lifter: plan's file format and parser (Plan::load, parse, FORMAT, Error),
  SiteRecord and Plan::sites, Difference and compare; Placed::record; Placement::keep_flags and keep_context; Placed's
  shape, thread, in_loop and how (logs had them); longshot-lift discover's --plan, --check and --plan-inputs and lift's
  --check-plan.
- hooks.md names sites::parse_table; a lift test's name says what it checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
never_ran said a function with an entry count of 0 never ran, even when its blocks counted:
code reached by a jump into its middle (a tail call or a longjmp into it) runs with no entry.
It now also needs the function's weight (its blocks' counts) to be 0.

Test: a record with no entries but a block that ran did run; one with no counts at all did not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- sites::HostList::site_lines, the one reader of the HOS_SITE lines (parse and the repository check use it; the check
  still finds an identifier named twice); tests/sitetable.py's site_lines likewise, which sitecheck.py's engine_fn
  now asks (engine_callback) instead of its own regex.
- game-files uses sites::Form::at_offset; edits takes a site's functions from Placed::functions; the site flag's two
  tests are one function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
An instruction lowering does not do (sem::Fault::Unsupported: the FP16 fused, estimate and
fixed-point forms) becomes a trap at its address, and the build went on in silence. A gap in
the coverage showed only as a guest's crash where the game ran it. Each lifted function now
lists those forms (Lifted::unsupported), and the lift's log says how many of each the units
lifted now have:

  lift: instructions lowering does not do, each a trap where it is (in the units lifted
  now): 2 an FP16 fused, estimate or fixed-point form

Test: an_uncovered_instruction_stops_the_guest_there also checks the trap is counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The longest-first order of a first build (no measured times yet) took every C and C++ unit to be 1.3 s and every
lifted unit 1 s per MB of its cost plus 1: the renderer's big files (vk_draw.cpp 10.6 s, vk_memory.cpp 8.6 s,
vk_shader.cpp 7.8 s at 23 jobs) started after every lifted unit and ended the build alone, and the time left said
was more than twice the real one. The rates are now those a 23-job first build on the development PC showed: a
lifted unit 0.45 s per MB of cost (hot 0.65, cold 0.1), C++ 12 s per MB of source, C 2.5 s, the lift's tables 0.35 s;
measured times still win from the second build on.

Measured by replaying that build's measured unit times through the scheduler's order (23 workers, longest
estimate first): 99.5 s with the old estimates, 97.2 s with the new, the same as ordering by the measured times
(the work spread evenly is 97.1 s). Only the order and the time-left estimate change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
a64::Kind (Kind::of from the decoder's Insn::flow: PAuth branches are the branches they are, ERET, DRPS and UDF
trap, a word that does not decode traps) is the kind discovery's walk and the sites' forms both read; Insn::writes(x)
says which X registers an instruction may write (destinations, a load's Rt and pair's Rt2, an address's writeback,
BL's X30), and Insn::adr_target ADR's and ADRP's address. cfg/src/classify.rs keeps only small wrappers over them
(writes, adrp, adr, add_imm, pair_offset, bl_target); its Kind, a64-kit's masks, reads_rt_only and the sign-extension
copies (cfg's two, sites' one) are gone, and a table entry's sign extension is a cast. The hoisted-constant scan
follows a register move to its source, and a table whose index no compare bounds is bounded by what made the index
(an AND with a low mask, UBFX/UBFIZ, an ORR of two such values, a move: index_bound).

The kit's write mask was wrong for every logical shifted-register op (MOV, ORR: its pair test matches them), for
UDF (x0) and LDAPRB, and its walk went on past UDF, ERET and the other trapping words.

Discovery on the real image, before -> after:
- functions 294,518 -> 294,518; entries 295,270 and PLT stubs 9,917 unchanged; all 132 sites place;
- instructions 17,646,126 -> 17,635,231 (10,895 words after a trap that only its fall-through reaches);
- jump tables 1,475 -> 1,474, five changed: the BR at 0x818af990 has none (its base register is a moved copy of a
  loaded pointer, which the kit did not see written); 0x81843860's has 4 targets (2 before: the kit kept a bound
  across an ORR that rewrites the index; its index is (w24 & 1) | (one bit at 1)); 0x81dff940's, 0x82092ae0's and
  0x82092b38's have 4 (7, 6 and 10 before, read until a target left the function: their indexes are UBFX #4, #2 and
  AND #3), each checked against the code that makes its index.

Test: an index masked to two bits bounds its table at four.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Every build indexed the romfs again: the heads of the .nup's 186 587 files, 0.3 s with the .nup in the disk
cache and 6.5 s without (the same before this branch: measured at its base too). After a build's compile the
cache no longer holds it, so an update that changes nothing spent 7 s in finish waiting for the index.
romfs::index_or_keep keeps the game folder's index when its note (.longshot_romfs.json: RECIPE and what the
index found) is there and the index opens as one of this .nup (path, size, TOC hash); else it indexes and
writes the note after the index (and removes it before). reuse copies the note with the index.

A no-change update, the .nup evicted from the cache: 0:00:08 (finish 0:00:05-07) before, 0:00:02 (finish
0:00:01) after; warm, 0:00:02.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The LIFTER key said it held the compiler that built the lifter, and it didn't. A new rustc, or
a crates.io crate's new version in Cargo.lock, can change the lifted code with the same
sources, and the lift kept its units. lift's build.rs now hashes `rustc -V` (cargo's RUSTC)
and the Cargo.lock entries of the registry crates lift is built with, its dependencies'
dependencies too (the workspace's own crates are in the key by their sources), beside the
sources. A change of the lock reruns it.

And two nits:
- edits Wrap::body_symbol asserts the entry fits 32 bits. f_1 and eight digits: a longer
  entry would make a name another entry's f_ could have.
- mir Loc::Fpcr's doc: the guest's register alone (no host bit in its upper half now).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The texts, the prompts, the shader list, the pipeline lists and the window's icon read only the romfs's index and
the tools, never the lift or the compile, yet were made after both: 7.7 s of a first build's finish. They are now
made on the romfs's thread as soon as the index is placed, on a quarter of the workers; the finish only reports how
they came out (a failure is still a warning: the game does without).

Measured, first builds through the timing queue on all 24 threads (the PC shared with other agents' work):
finish 7.7-8 s before, 1-2 s after. The whole build 168.1 and 142.4 s before (127.0 s in a quieter run), 134.0 and
128.8 s after: the compile, CPU-bound at about 92 %, takes back part of what the finish gives.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
LIFTER_SOURCES hashed the crates that shape the lifted code but not cfg, whose discovery decides every function's
instructions, labels and jump tables: a build after a cfg change took its whole lift from the lifts' store by the
old key, with the old discovery's units.

The lists are in lift/key_crates.rs, which build.rs includes, and a test reads lift's dependency closure among the
workspace's crates (their Cargo.toml [dependencies]) and fails on one in neither CRATES nor NOT_IN_KEY (edits and
sites: EDITS_SOURCES; build-core: keys and reports, never the lifted code), with its reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
romfs::RECIPE was a string to raise by hand with any change to how an index is made: easy to forget, and a
forgotten bump kept an index of other rules. It is now the format version (by hand, for format changes) and
ROMFS_SOURCES, a hash of romfs.rs, nup.rs, zstd.rs and le.rs that game-files' new build.rs makes (the files
and the hash in recipe_hash.rs, which build.rs and the test both include, as lift/build.rs does
LIFTER_SOURCES). The test checks the recipe is that hash of those files and that a byte changed in any of
them gives another.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The writer folds a constant splat into one u128, `acc | (e << (i * w))` over its lanes. For a
vector wider than 128 bits (`<4 x i64>`: SQRDMULH's products widened, with its rounding
1 << 30 and its shift 31 as splats; `<8 x i32>` of 15) lane 2 on shifts by 128 or more. With
overflow checks on (release and dist now) that panics: "attempt to shift left with
overflow" at lib.rs:585. Without them, Rust masks the shift, so lane 2 went to bit 0 again.

No wrong code came of it. A splat repeats every element, so the masked fold is the low 128
bits, which repeat across the vector, and the literal's lanes were read with the same masked
shift. The real lift has 2,847 such literals (1,700 `<4 x i64>` of 31, 1,116 of 1 << 30, 31
`<8 x i32>` of 15), every lane the splat's value. And this change writes every unit's text
byte for byte the same (494 units lifted, 0 written).

Now the writer does this on purpose: a splat folds its lanes in the low 128 bits only, and a
lane's bits are read at `(i * w) % 128` (lane_bits), in the literal and in the NaN check. A
Const wider than 128 bits, which no lowering makes and a u128 can't hold, is refused.

The real image lifted by a release lifter built with overflow checks
(`--config profile.release.overflow-checks=true`) runs through: no other overflow in a64,
cfg, sem, mir, passes, llvm or lift.

Test: a_splat_wider_than_128_bits_is_written_lane_by_lane (SQRDMULH's form). It panics at
the old lib.rs:585 (tests run with overflow checks) and passes now, its literals
`<i64 1073741824, x4>` and `<i64 31, x4>`, compiled by clang.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
LONGSHOT_QUEUE_HEAVY takes wildcards and names longshot-build-* by default;
the cargo that dev.py packs run builds longshot-build with carries
LONGSHOT_HEAVY and counts as a build outside the queue. LIFT_KEY_PREFIXES is
BUILD_SWITCH_PREFIXES, what it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
packs.builder holds <dev>/cargo.lock across the cargo build and the copy
out, so another checkout's build cannot replace the program in between.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
`mise run build` and `build-dev` ran longshot-build without the tools'
variables, the NGX SDK, dev_build.json's env or the store, which dev.py
base, pack and rt give theirs. Gone with the packaged builders:
LONGSHOT_TOOLS' drops, nx2/addresses.ini in BUILT and the bin/ layout check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
ci.yml's rust, e2e and host-windows jobs and CircleCI's rustup command piped
sh.rustup.rs, whatever it served, into sh. scripts/ci_rust.sh installs
rustup-init 1.29.0 checked by its SHA-256 when the machine has no rustup,
then the version mise.toml pins (the one place it is written).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
dry-run: a player's build's dry run over a tree, with and without AMD FSR 4,
checked (a release's program from an empty cache with --clean, or one with
--root). release: the stamps, fetch-bases and deltas for the version's
channel, nothing for a version on none. Forgejo's and CircleCI's jobs call
them instead of each carrying the same shell. build-linux.yml and
build-windows.yml are called by release.yml only (no dispatch, no
cancelling). One zstd path (the zstd program; no zstandard package for the
pack); sha256_of goes. llvm-mingw's Linux pin is read from
scripts/windows/deps.sh, where it is written, and --host windows handles
tools.lock's trimmed archive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
perf.py hotlist and analyses.hotlist wrote assets/profiles/hot_funcs.txt for
the old lifter's A64_HOT_FUNCS, and cover.py --hot compared against it;
nothing reads either now. cover.py run starts the game folder's own
longshot.exe (no launcher bin/).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
pipeline_states.py, perf_report.py, lower_test.py and addresses.py are
developer tools now that longshot-build builds the game; every reader
(tests, scripts, docs, gpu/ and rust/ comments) names scripts/. The
pipeline list's docstrings name build-assets' merge instead of make_game.py.
test_dev_packs no longer checks the removed bin/ refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
assets/prompt_faces/README.md's way to draw a face by hand runs build-assets'
example (PROMPTS_DUMP) and names prompts/faces.rs and guides.rs;
assets/pipeline_states/README.md names build-assets' merge and share; the
PROVENANCE notes name build-compile and game-files instead of nx2/build.py,
zbic.py, ui_fonts.py and prompt_*.py; tests' and scripts' comments too.
test_dev_update no longer patches the gone build.windows_prebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A cache key is anyone's to save first on the release runner, so the jobs
that make the release's files (build-linux.yml, build-windows.yml's package
job, CircleCI's linux- and windows-longshot-build with release: true) now
restore and save no cache: every download is fetched afresh and checked by
its SHA-256 into the run's own temp folder (one Rust folder for
longshot-build and RenHDrum). longshot_build.py builds in --work (default
<cache>-work) and renhdrum.py in <cache>-renhdrum-work, never inside the
cache; CircleCI's check runs copy back only *.tar.xz and crates/*.crate.
The build checks that ship nothing keep their object stores.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
setup.md's table says what mise run setup does (the checks' Python packages
with test-deps, Rust's check). The disk space is worked out once, in
build.md's Disk space (about 5 GB free), and README.md, setup.md and the
player pages link to it through the requirements; build.md's times are the
current ones at the default jobs, and it and builder.md say which units
each count is. ci.md lists ci.yml's rust, e2e and host-windows jobs, that
run_all runs on CircleCI only, PACKAGES_TOKEN_SEALED, the build workflows,
and that CircleCI does not make or publish the tools yet; releases.md the
dry-run and release steps, and the planned compiler of our own (about half
LLVM's release trimmed). vulkan-dlss.yml's header says it runs by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build-events.md's codes missed game_folder_busy, game_files_overlap, internal_error, the vendor files'
license_not_accepted, bad_license and download_failed, extraction_link, no_romfs, pipelines_not_shared and the
prompts' warnings, and listed game_folder_link and old_romfs, which nothing says. The table now holds every code
(the builder's own and the warnings in rows of their own), says an update asks for a license again after a pin
bump, and build-driver/tests/codes.rs checks it both ways against the crates' Error::player, warn, lock and
Event::Error sites. exefs_patch_past_main could not be said (the parsers keep every write inside main): that
check is now an internal error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
tools.py parse() refuses a line whose first two URLs are not Longshot's
store's for its name, version and SHA-256 (the sysroot's too); check
always refuses a lock without a tool a builder needs. release.yml's
version job runs check --require when nothing is missing (tools-publish
runs it after uploading, otherwise). releases.md says exactly when CI
remakes a tool. tests/test_tools_lock.py writes its lines with the store's
URLs and checks both refusals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
scripts/perf_report.py and addresses.py move into build-driver's perf.rs:
perf-report <game folder> shows the state, --send sends what waits in
perf_pending/, --tick on|off [--keep-sent on|off] sets the tick, each
answered with a perf_report event (build-events.md). The same behaviour:
the tick and keep_sent in longshot_perf.ini, oldest first, the version and
release filled in, 48 waiting and 5 a start at most, 60 KiB a body, the
answers (sent, refused only for 400/413/415/422, busy with Retry-After or an
hour doubling to a day, later), the copies in perf_sent/, and one sender at
a time under perf_pending/.sending's renewed lease. The relay is the folder's
perf_reports= (which a release's build stamps from assets/addresses.ini), or
LONGSHOT_PERF_URL; each POST goes through curl, as runtimes.rs downloads, a
redirect never followed. Its tests run against a relay on 127.0.0.1;
tests/test_perf_report.py keeps the game's side and reads perf.rs's
MAX_BODY.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Each thread kept an event for its overlapped reads in a _Thread_local and never closed it: a handle leaked for every
thread that ever read the RomFS. romfs_os_read makes its event and closes it (a few microseconds against a read).
No test here: the Windows read path is not built on Linux.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- The finish's assets (made beside the compile since zsmqqsrx) were written straight into the game folder, so a
  build whose compile or link failed left the old game with the new build's texts and prompts. They are made into
  the work folder's finish/ (AssetPlaces::into) and swapped in with the game's other files; those made no more are
  taken out in the same swap. The seed pipeline list (the game's own cache) is placed after the swap.
- A vendor's files no longer asked for were removed before the swap, so a swap that failed after left them gone:
  folder::install takes the removals, moves them aside like the files it replaces and puts them back on failure
  (uninstall is gone); a locked file is game_running.
- install first sweeps what a stopped swap left beside every file it knows: a <name>.old whose file is missing put
  back, any other .old removed (on Windows one a running game holds is removed at the PC's restart, sys.rs's
  MoveFileExW), an orphan .new removed. A .new is opened with create_new.
- A vendor's copy is checked against its pinned SHA-256 on the staged .new itself, the bytes swapped in.
- A vendor file is the builder's when the installed note says so (read once for all of them) or when its SHA-256 is
  this pin's or an earlier pin's (EARLIER_PINS, empty: each vendor is at its first pin); the note's failed write is
  logged, not dropped.
- Downloads: curl -q first, --globoff, --proto =https --proto-redir =https; wget --no-config --https-only; Windows'
  own %SystemRoot%\System32\curl.exe by its full path; elsewhere the PATH's, relative entries and the program's and
  game folders skipped.
- builder.md: the staging, the swap, what a crash leaves, the folders' lock, game_folder.txt, the .used marks;
  Cargo.toml's lint note names disk.rs too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Each link alone stayed inside the folder, but a/b -> .. then a/b/c -> ..
wrote a/b/c/x at the folder's parent. sources.rs, tools.py unpack and
longshot_build.py unpack_member now refuse a member whose path goes through
a link already there, or that is there already. Tests:
sources.rs nested_links_do_not_escape, tests/test_unpack_links.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- hos_zs_frame_head, hos_zs_romfs_stream's decoder of the .nup's frame and of the file's own take ZSTD_d_windowLogMax
  31 (stream_ctx): zstd's streaming default refuses a window over 128 MB, so a zstd-stored file of the .nup larger
  than that would not stream (the largest known is 117 MB), and its head fell back to a whole decode.
- zs_feed keeps a frame's first bytes until its header is whole (ZSTD_getFrameHeader) before it takes the dictionary
  id: a first piece shorter than the header read no id, and a frame made with a dictionary failed.
- tests/romfs_test.c is built with zs.c as it is (HOS_ZS_ALONE), not its own copies of hos_zs_frame and
  hos_zs_frame_head, and checks a head of a frame whose window is 256 MB, decoding nothing whole; tests/zs_test.c
  includes zs.c, streams a .zs whose .nup frame asks for 256 MB, and feeds a frame made with a dictionary one byte
  first. The test .nup's codec 2 is such a frame (testkit raw_frame, wide_window_frame); text.dict and text.dict.zst
  are a 2 KB dictionary trained on the synthetic text and a frame made with it. Each fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
romfs.c kept a zstd-stored file's decoded copy by its frame's offset alone, while a handle's reads were bounded by its
own entry's size: an index (untrusted, a hand-made one) with two entries at one offset of other sizes served the
larger's reads from the smaller's copy, past its end into the guest. The index is refused at open when two entries
share an offset with another size, stored length or codec (a stand-in shares its frame whole, and stays allowed); the
copies are keyed by offset, stored length and size; and a read of a copy is bounded by the copy's size too. The
the_host_s_reader case "shared" (two zstd-stored entries made to share an offset) fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
index_romfs cut a mod's host path (and its RomFS path) that passed MAX_PATH and served the cut one: another file, or
none. It now logs the path and leaves it out (and a folder whose listing would not fit). test_mods_sizes' case long
(a RomFS path of 4,040 bytes under a mod, its host path past 4,096) fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
add_run kept realloc's result unchecked: a refusal wrote through a NULL run list. On a refusal the run is left out and
it is said once (and a list of none would start at 64). No test: an allocation refused on purpose would need an
allocator of the test's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
ci.md's website row back in the table, the paragraph after it; the Steam Deck playbook's desktop build is ~3 minutes;
build.md's game folder about 0.6 GB as build.rs says (and no link to its own section); mods.md bounds a RomFS path by
HOS_ROMFS_PATH and says a mod's file whose host path does not fit is left out; builder.md's romfs section has the
256 MB of closed copies and a head read from a frame's first blocks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
vk_fsr4.h (--upscaler fsr4), vk_main.cpp's preparation stops (longshot-build's driver message and its 15 minutes of
silence, build-driver shaders.rs), vk_draw.cpp's warm saves and Compile shaders, vk_menu.cpp, host/options_path.c and
.h (compile_shaders=), display_sdl.c (the window's icon), vk_shader.cpp (RX_VK_DUMP_FAILED's reader) and rust/rt/a64.h
(gen/rt/, written by the lift).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The panic hook sent its text (which can name the home folder: a path in a panic's message) unredacted, to the work
folder's log alone, and a second terminal event after done or error. It now redacts as the logs do
(log::for_log: Who::here(), and the JSON-escaped Windows form, shared with Tee), writes to every log file (--log's
too, through a Tee), and once the run's done or error was sent (report::ended) writes the logs alone and keeps that
event's status. build.rs's join of the romfs thread said a panic there as an error the hook makes unreachable: an
expect, with why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A romfs file (the game's, or a mod's in its place) could hang the builder or run it out of memory:
- a SARC whose file is the archive itself recursed for ever: a file must start past the archive's table, SARCs nest
  three deep at most, and one file's archives unpack to 1 GB at most;
- a BNSH whose variations all name one program of nine slots of one stage copied it count x 9 times, and a BAHS's
  program heads of 0 bytes were walked up to 4 billion times: a file's stages are kept once by their place (Found),
  counts are bounded by what the data can hold (64-byte variations, 32-byte stages, 16-byte heads; a head shorter is
  refused), header offsets are added checked, and past the stages one empty program stands for all of them;
- NDVE searched the whole file for each control's pair: the pairs are found in one pass (pairs_of, find_all's places).
The list is made in the same order from the same stages (the hash still keys a stage). Tests with crafted bytes: a
SARC holding itself, four deep and past its budget, 2,000 variations of one stage, a BAHS of 0xffffffff empty heads,
and pairs_of against find_all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
check_places compared a path that did not exist yet (a game folder a build would make) as given, so one under a
link to the dump was not seen inside the dump. compared() resolves the longest existing ancestor and appends the
rest (its .. parts taken as they come).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- TXT2's string count is refused past what its table's bytes hold (four billion stated in 8 bytes reserved 32 GB),
  and LBL1's labels stop at as many as the data can hold (slots naming the same labels again and again made 100
  million strings); a string whose end is before its start is no room.
- texts::make checks each archive's name with game_files' package_parts, as a .nup's names are when it is read: a
  romfs folder's Mals/CON.sarc.zs would be read as an archive and written as texts/con.sarc.zs, a device on Windows.
  (build-assets now depends on game-files.)
Tests with crafted bytes: the labels' and the unsafe name's fail on the code before; the string count's passes there
on Linux too (the 32 GB reserve is only address space under overcommit), and is kept for the refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
prune_work called a game folder gone when its record was missing, so one on a drive not plugged in lost its work
folder (its lift and build). It is gone now only when its parent folder is there; and the work folder is emptied
while its lock is held (the lock file last), not after letting go of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A font (the game's icon font, or a mod's) whose em is a few units, or a glyph whose outline reaches far past it, made
the icons' picture any size before it was fitted (a billion pixels a side). Faces of under 64 units an em are not
fonts this reads, and a glyph more than 8 x size pixels wide or high at the icons' scale is no icon. The test (a
glyph 10^9 units wide) fails on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
enter_first knew the first choice by its MB, so another job of the same need inherited a wait it never had and
was refused at once. It takes (job id, MB) and keys the head by the id (schedule.rs passes the jobs' indexes:
build-compile's one line).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The window icon's picture (the game's, or one in its place) was given the buffer its header asked for. A PNG's size
is checked after its header (PICTURE_MOST), and zune-jpeg is told the most width and height. The tests (headers of
60,000 x 60,000) pass on the code before too here: Linux reserves 14 GB as address space only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The check compares this PC's clock at the compile's start with a file's time as its file system set it: the
resolution, another PC's clock and a time set back can hide a write. Said where it is, with what follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A frame's header may state any size, and that size was reserved at once (2 GB). reserve_for takes the least of the
stated size, 64 times the frame's bytes and 256 MB (a larger file grows as it unpacks); MOST is 512 MB (the game's
largest is 244 MB). The per-file budget of the census's archives is in the census's own commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- A file in perf_pending/ was sent if it was any JSON object: anyone who can write the game folder could send
  anything through the player's PC. perf/schema.rs holds the summary's keys and kinds as the game writes them
  (gpu/vk/perf_report.h summary_json and sample_json) and the histograms' bucket counts (perf_report_schema.h);
  a test checks those against the headers, and a file that does not fit is dropped unsent.
- The relay came from the game folder's longshot_version.txt; it is now the builder's own tree's
  assets/addresses.ini (a release's tree alone: perf::tree_relay), LONGSHOT_PERF_URL as before.
- curl: the Windows System32 one or a PATH entry outside the program's folder (runtimes::downloader), -q first,
  --globoff, --proto as the URL's, --proto-redir =https.
- --tick without --keep-sent keeps the folder's choice (it turned copies back on); set_tick and note_busy rename
  through fsx::rename (Windows' retries).
- Docs: profiling.md says who sends (the game as it plays, the launcher's sender what is left), who keeps what and
  where each sends; build.md's no-change update is 2 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
bntx_textures added a record's header fields unchecked and took any size: a texture of a billion pixels a side, or its
data past the file, was decoded or drawn on as it said, and the prompts' drawing at fixed places (the buttons' discs at
869, 227, ...) underflowed on a smaller one. Offsets are added checked; a texture that is not 1 to 4096 pixels a side with its last block (its
furthest) inside the file (Texture::within) is left out (the game's own has larger ones, never drawn on); decode adds
each block's end checked. The
textures the prompts draw on are checked against their known format and size (textures::KNOWN, unknown); another
(another game version, a mod's archive in the game's place) leaves the faces' textures.bin and Common.bntx.base
unmade, the game's own icons kept, with the warning prompts_textures. Tests: three crafted records left out and one that
fits read, and the known sizes' check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- Index::open refuses a zstd entry over 1 GB or whose frame is larger than host/romfs_index.c allows, and
  Index::read decodes through take(size + 1): a frame that makes more is refused, not decoded whole.
- Nup::read refuses a record over a module's most (nso::MAX_MODULE) before it decodes or reserves anything.
- check_tree: each directory and file the child of one directory at most (a shared subtree made the listing
  exponential); stopped at the first second parent.
- The header's 0x80 + strings_end and verify_toc's off + size are checked additions.
- zstd: an FSE table's counts are -1 or more and fill it exactly, and no cell is of a symbol with no count (a
  table of zeros reached high_bit(0)); ZBIC counts below -1 are refused.
- nso: the symbol table's entries are 24 bytes (DT_SYMENT 1 made a table of every byte), inside the image and at
  most MAX_SYMBOLS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
layout_panes reserved the count its header said (u32) and added its tables' offsets unchecked: the count is bounded by
the layout's bytes / 8 and the offsets added checked. share::read_list unpacked the game folder's list with no limit
(an xz bomb): to SENT_MOST, as a list someone sent is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- fsx::write_atomic and write_replace opened their temporary (<name>.<pid>-<n>.tmp: guessable) with
  File::create, which writes through a link someone left there: create_new. A test plants links at the next
  names and checks the file they point at keeps its bytes.
- check_writable's probe file is opened with create_new too (a stale one removed first).
- toolchain.rs: lld-link.exe was copied from lld once and then run as it was: it is checked against lld every
  build (the same file, or the same SHA-1) and placed again (a link, or a copy) when it is not (build-compile:
  lld_link and the new place_lld_link only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A crafted font (the game's icon font, or a mod's in its place) could panic the build or run it past its tables:
- two tables of one tag (the one ttf-parser read is not the one written) are refused, a table's end is added
  checked, and hhea, maxp and head must be as long as what is written into them (36, 6, 54 bytes);
- the CFF: an INDEX's offsets 1 to 4 bytes, the Private DICT's size and place and Subrs' place taken with get (one
  operand of two read past its operands), a table of no charstrings refused, a charset's range checked at 65535;
- a font of more than 61,439 glyphs refused (the prompts add at most 4096), the count saturates, and a write with
  more added is refused;
- the charstring writer's differences saturate (outline.rs), as overflow checks are on in release.
The tests (a crafted CFF table whole, with one Private operand, of no glyphs; Kenney's font with two tables of one tag
and hhea cut to 10 bytes) fail on the code before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
longshot-build --root <checkout> takes the tools at <checkout>/tools/<name>
(build-driver's tools.rs), but CI installed them into a bundle beside it,
so the third-party objects' compile found no VMA headers. tools.py install
now writes into the checkout (tools/ and .tools/ are git-ignored) in
build-linux.yml, build-windows.yml and CircleCI's two jobs; the
third-party objects, the dry runs and the renderer checks take them with no
per-tool variable. A Windows build on Linux names only the Linux
llvm-mingw (LONGSHOT_MINGW), as the bundle's is Windows' own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
update took the vendors' licenses from longshot_build.json, which anyone who can write or copy a game folder
can change. A build notes what the player accepted in the per-user cache (<cache>/licenses/<the folder's work
id>.json); an update takes a license when both the record and this PC's note say so, for the builder's pin
(build::update_options_in, Accepted::here/note_here). build.md says so, that the launcher passes
--accept-licenses on update too, and what else an update trusts its record for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- The *_at helpers of sarc, texts, census, prompts' layout and base, the font and the texture add the field's length
  checked (overflow checks are on in release: a header field near usize's end panicked).
- prompts/base.rs: the ranges' and samples' ends saturate, and the textures' samples stay in the file's bytes.
- layout.rs: the ring's first copy taken checked, a hint pane's offset checked, and runs of a copy too near the
  archive's end left out (keep_within), as the textures' runs are against Common.bntx (face_textures).
Test: keep_within drops the runs past a file and keeps the rest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
- --version printed the crate's 0.1.0: it prints the release the pack carries (its tree's VERSION, read from the
  small tree/files member alone) and the tree's hash, or says it is a developer's build.
- --help, -h and help print the usage with status 0 (they were an unknown command, status 2).
- A release's first run unpacks its pack (a minute on a hard drive) before any event: a 'tools' stage is sent
  first when sources::unpacks_now says it will (the pack's table alone). build-events.md has the stage.
- [profile.dist] strip = "debuginfo": the line tables go, the symbols stay for a panic's backtrace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
host/romfs.c reads a zstd-stored file's head through zs.c's hos_zs_frame_head and logs the decoded copies' high-water
mark with hos_log; the synthetic game's host had neither, so the end to end test no longer linked. Its zs.c stand-in
has both (the head as zs.c's: a window up to 2 GB; the log to stderr).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
A preparation was 13 s of every update on this PC (12 s of a 23 s no-change update on the lab's RX 580), though no
game code runs in it: its output depends on the renderer, the shader list, the shipped pipeline states, the level
and the drivers. Those are its key (cache/longshot_prepared_key.txt, written when a preparation gets to its end,
forgotten before one starts, ignored when the caches it left are gone); a file's SHA-1 is taken again only when its
size or write time moved.

The drivers, with no Vulkan call. Linux: each Vulkan driver manifest with its library's size and time, NVIDIA's
version, the GPUs' vendor and device, the cache switches. Windows, from the registry (build_core::machine_registry,
windows-sys in sys.rs): the loader's driver list and each display adapter's driver (name, device, DriverVersion,
the manifests of its VulkanDriverName), each manifest with its library's size and time, whether NVIDIA's and AMD's
shader cache folders are there, LONGSHOT_SHADER_STORE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
build.md: the per-user cache is trusted once unpacked, and which variables
redirect a build (the tree, the tools, the stores, the switches): a launcher
starts longshot-build with every LONGSHOT_*, RX_* and A64_* cleared but
those it sets. ci.md and releases.md: a branch workflow on the deploy runner
can unseal the release key and the packages token, so push access is
release-signing access until the runner takes only main's and the tags'
jobs; CircleCI's contexts must be restricted in its settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
The release build wrapped silently on an arithmetic overflow, so a header's sum past its type became a small
size or place. overflow-checks = true in [profile.release], which dist inherits. Before that, the sites of the
crates this branch owns that could overflow on a file's values: nup.rs's (first + count) of u32s (now usize),
and build-compile's link.rs image_span (phoff + i * phentsize checked, vaddr + memsz saturating: link.rs
image_span only). The rest are bounded by an earlier check (game-files' tables, segments, symbols and extents).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
infill's w00 = 16 - fs - ft + w11 went below 0 before w11 was added when fs + ft > 16 (u32: it wrapped and came back),
which overflow checks (on in release now) stop as a panic. 16 + w11 - fs - ft is the same value and never below 0:
(16 - fs)(16 - ft) >= 0 makes w11 = (fs * ft + 8) >> 4 at least fs + ft - 16.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
With the merge's own fixes: install's staged copy keeps the source's permissions (the game's executable stayed
without its exec bit after the create_new copy), build-events.md lists prompts_textures, a test helper used only
by the Unix link test is #[cfg(unix)], and one line of rustfmt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
rust/ is builder/ (the workspace, its crates, rt/ and README). The crate and
program longshot-build is longshot-builder: its release files
longshot-builder-<v>-<platform> (manifest and deltas likewise), its per-user
cache ~/.cache/longshot-builder or %LOCALAPPDATA%\Longshot\Builder, its locks
longshot-builder.lock and .longshot-builder.lock, its game folder record
longshot_builder.json. scripts/longshot_build.py is scripts/longshot_builder.py.

longshot-lift is folded into it: its commands are longshot-builder dev
discover|sites|lift|profile|words|decode (src/dev/), left out of the main
usage and listed by longshot-builder dev --help. The LONGSHOT_* variables
keep their names. The stray build logs in rust/ (cl.txt, clw.txt, e.txt,
t.txt) are dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Register calls passed guest registers between lifted functions in machine registers: each
function also had a preserve_none body f_<entry>.r, and a direct call or tail call of a lifted
function called that body. From lslxmuxp, a call also spilled, passed and reloaded only what
its callee's summary (passes::summary, closed over the direct calls) read or wrote. Both were
behind LONGSHOT_LIFT_REG_CALLS=1 (`longshot-builder dev lift --reg-calls`), off by default,
to stay only if a game A/B showed about 3 % more fps beyond the spread in Hyrule Field or the
Market, with no scene's 1 % low worse.

They don't pay. CPU-bound A/B on an RTX 3090: 1080p output, the 3D at 100 %, no upscaler
(Off), uncapped, V-Sync and frame generation off. 3 interleaved 60 s pairs per scene, the
context's calls (A) against register calls with summaries (B), fps (1 % low):

- Kokiri Forest: A 129.8 (115.5), 129.2 (113.5), 127.8 (83.0); B 123.7 (75.2), 118.3
  (99.9), 113.3 (63.1). -8.4 %, every B run below every A run, the 1 % low worse.
- Hyrule Field: A 119.9 (86.3), 111.7 (76.2), 119.2 (98.2); B 109.8 (75.0), 115.2 (65.4),
  111.5 (85.8). About -4 %, the 1 % low worse.
- Market: A 95.3, 96.3, 85.2; B 95.1, 95.7, 94.6. Medians 10.0-10.3 ms on both sides: the
  same.

And the game's compile took 20 % more CPU time with them (1,843 s against 2,226 s), its .text
561 MB against 643 MB.

So all of it goes:
- llvm: regs.rs, Options::reg_calls, Module::set_summaries, the bodies, thunks and adapters,
  and the register tail calls. sync.rs is back to a call that spills every dirty slot and
  reloads what is read after it (sync::RegSync gone; Loc::bit and from_bits stay).
- passes::summary, mir::Summary, Loc::ALL_BITS.
- lift::whole: the Session's summaries and callees, locals(), the units' summary key lines.
- --reg-calls (longshot-builder dev lift), LONGSHOT_LIFT_REG_CALLS (build-driver), and the
  differential test (calls_in_registers_leave_the_state_the_context_s_calls_do).
- The READMEs and docs/dev/reference/build.md. builder.md's "Still to come" now says it was
  tried and taken out, with these numbers.

The lifted code without the switch is unchanged. The lift's key changes: the options it hashes
lose a field, so the next build lifts again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
From #2272's new squash (d1ce425a2a), over the old one this stack held (fe97600a20), in the Rust builder's terms:

- the sites (builder/crates/sites): an anchor's `of` (with `ordinal`: how many matches its slice must hold, another count
  stops the lift; jump.takeoffVelocity's point is `ordinal = 1, of = 2`); an `after` site where a `replace` site already
  is refused in either order; host/game/sites.def's new HOS_SITE_OUTCOME lines read (HostList::outcome) and checked by
  apply against the table's sites that change the outcome on a worker thread (Site::decides_on_worker);
- the host: host/game/sites.c's chain kept per guest context, not per OS thread (a fiber resumed on another thread goes
  on with it), the replace site's callee kept across a handler's calls into the game, a removed handler run by no hook
  that loaded the dispatcher before, hos_site_remove_then (done at the acquire phase's reclaim once no hook is in the
  chain), a table published again not freed, and the HOS_SITE_OUTCOME sites refused a run-time handler or callback;
- Skip title screen (host/oot_autoload.c): no more presses once the game loads after the check's A
  (hos_oot_loading, host/hos_main.c: Sequence_IsLoadingBanc seen down since the press, then up once the A is released);
  the timed fallback when no wait on the title, its list or its check is told by 45 s, until one is;
- the Voice Language option read as the game reads it (game_flag_number_as_game: an index past the count is entry 0);
- scripts/parity_gates.py: the queue's --desc, the plan's names gone, caption.sav's date and picture left out of the
  noise as gate 4 leaves them out; docs/dev/reference/parity-gates.md and hooks.md as #2272 rewrote them, in this
  builder's terms; docs/user/graphics-and-controls.md's Skip title screen;
- tests: the anchors' `of` and the after/replace refusal (sites' unit tests), the outcome lines (sites::apply's test and
  tests/repository.rs, every build's table against sites.def), the drive target's sites found once at their copies
  (tests/repository.rs: the resolver part of #2272's test_drive_target.py), the host's list in the lift's key and parity
  gate 1's game-free half (lift's whole tests), and #2272's updated Python and C checks (test_site_chain, test_skip_title,
  test_oot_voice_option, test_parity_gates, test_drive_target, test_jump_takeoff_step, test_oot_barrier,
  test_high_fps_fixes, tests/sitetable.py's Anchor.of).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Mermaid diagrams, each in the section it explains:
- builder.md: the build's stages and what each keeps (A build); one function's way
  through the lift, decode to clang (The whole lift); what goes into the lift's, a
  function's, a unit's, an object's and a link's key, and so what one changed site,
  mod or ExeFS patch rebuilds (The lift's cache).
- architecture.md: the program, the runtime, the host and the renderer at run time
  (The parts); a game file call's way to its file: the overlay, the mods, the
  stand-ins, then romfs.h over the index, the .nup in place or a decoded copy.
- build-events.md: how a launcher installs longshot-builder (SHA256SUMS and its
  signature, the manifest, a delta or the full file) and runs check and build, the
  events and the exit status.

Docs that said otherwise than the code:
- An instruction the semantics do not cover is a trap at its address and the build
  goes on (lift/src/lib.rs); builder.md's step 2, developing.md's checks table and
  lift::whole's module docs said it stopped the lift.
- cfg's module docs named a plan::compare that is gone; lift::whole's pointed at a
  gen/ section builder/README.md does not have.
- unsafe is denied, and allowed in game-files/src/disk.rs as well as
  build-core/src/sys.rs (builder.md, standards.md).
- builder.md: the dependencies as Cargo.toml has them; the romfs's index starts
  once the exefs is read.
- build.md: game_folder_link and old_romfs, which no code says any more, gone;
  stamps and perf-report in the commands.
- architecture.md: gen/ keeps units.txt, not the units' texts; never-run units at -O0.
- common-issues.md: with the launcher, the builder's work is in the launcher's build
  files (LONGSHOT_CACHE), not ~/.cache/longshot-builder.

The two Rust files change in comments only, but the lifter's key hashes its sources'
bytes, so the next build lifts again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
dev.py packs base|pack|rt ran longshot-builder without --json: the Test Farm got a base's or a pack's failure as
text, with no code. `dev.py packs --json <subcommand>` (or LONGSHOT_BUILD_JSON=1) runs longshot-builder with
--json and leaves its stdout, the event lines as it wrote them, as this command's; this script's own lines, cargo's
and the game's (a preparation, a warm-up's runs) go to stderr then. packs run adds --json to the builder's
arguments the same way. Without it, the output is text as before. tests/test_dev_packs.py runs longshot_builder with
a stand-in builder both ways, and checks the option and the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Main's 1f8454a8 (#2323) gave nx2/make_game.py and dev.py packs a supervisor (nx2/prepare_supervisor.py) that
starts the game's --prepare-shaders run with a journal, reads which driver call a dead or hung run was in, leaves
that program out (a crash also into cache/longshot_driver_faults.txt) and starts the run again. #2286 deletes nx2/,
so the supervisor is ported to the builder:

- build-driver's supervisor.rs: the journal's reader, the retry policy with its bounds, the result list, the faults
  list's lines and supervise(), as the Python was; its tests are tests/test_prepare_supervisor.py's, against the
  same stand-in game, and the journal the real header writes (tests/data/prepare_journal.txt, which
  tests/test_prepare_journal.py now compares the header's output with);
- shaders::prepare runs the game through it (one run per start, the silence limit kept); a test with a stand-in
  game that dies once inside the driver;
- longshot-builder prepare <game folder>: a built folder's shaders prepared again, supervised, exit 1 when not;
  dev.py packs prepares bases and runtimes with it, as main's packs.py prepared through the Python supervisor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's 3e75d518 (#2307) swapped suyu's CPU texture decoders for gpu/vk/texdecode and made nx2/build.py compile
texdecode's sources in place of suyu's decoders.cpp and astc.cpp. #2286 deletes nx2/build.py: build-compile's
vk_sources does the same (texdecode's files as the renderer's own, with its profile), and its test, in place of
tests/test_texdecode_build.py, checks the list on a made-up tree and on the checkout (every texdecode source in it,
nothing of gpu/third_party, no two units of one object).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's 57ec7dad (#2305) made nx2/make_game.py translate the game again when every compile failure was in a translated
file, and compare: files that came out different were changed by the PC, named, and compiled again; refused again,
the build stopped saying it is the PC's memory, processor or drive. #2286 deletes make_game.py, and the new builder
keeps no unit texts: each is made from the lift's session when the compile needs it. So the same check is in the
compile: a lifted unit whose made text the compiler refused (a compile error) has its text made again and is tried
once more alone. Compiled then: a translation_damaged warning names it and says what to check. Refused again with
another text: compile_failed says the PC changes what the build makes. The same text refused twice: the
compiler's error, as before. tests/compile_link.rs has the three cases with clang.

Main's 38500511 (#2300: a translation with a zero byte made again in the same build) has nothing left to port: there
are no translated files on disk to find a zero byte in (an in-memory text with one is refused by clang and made again
as above), the lifts' store keeps no texts, and a kept text file (LONGSHOT_KEEP_IR) with a zero byte is still refused
by the compile's zero_byte check and lifted again at the next build. tests/test_lift_zero_bytes.py and
tests/test_damaged_translation.py, which drove nx2/make_game.py, go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's 956294fd (#2331) turns the FSR 4 model row on only for an upscaler library whose SHA-256 is a row of
gpu/vk/fsr4_models.cpp's kKnown, the hash scripts/fetch.py pinned. #2286's builder fetches the runtime itself
(build-driver runtimes.rs FSR_FILES), at that same hash; a test now holds the pin to the table, and the comments and
docs name the builder's pin beside fetch.py's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's 9dd80202 (#2402) gave dev.py packs upscaler_args: make_game.py's --fsr and its --fetch-*-runtime with the
license options, from LONGSHOT_FSR, LONGSHOT_FFX_SDK and LONGSHOT_XESS_SDK, so the Test Farm's bases and packs build
with the upscalers it names. #2286's packs.py builds with longshot-builder, which takes --upscaler and
--accept-licenses: a base given no --upscaler now takes them from the same variables (env_upscalers: dlss by
LONGSHOT_NGX_SDK, fsr4 by LONGSHOT_FSR, xess by LONGSHOT_XESS_SDK; amd's and intel's licenses for the fetched
runtimes), keeps them in base.json, and passes both to each build of the base and its packs. xess joins the names
--upscaler takes. test_env_upscalers stands in for main's test_upscaler_args.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's 79d192c6 (#2373) rewrote the toolchain PPA's source to ppa.launchpad.net after add-apt-repository in
build-linux.yml, CircleCI and scripts/linux/Dockerfile: ppa.launchpadcontent.net answered 503 for hours and every
AppImage build failed. #2286's build-linux.yml and CircleCI no longer add the PPA (longshot-builder needs no GCC 13
there), but its release workflow's tools job does: it gets the same rewrite. tests/test_linux_docker_packages.py
checks every file that adds the PPA rewrites it before the update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's d02cac0f (#2319) made scripts/linux/checks.Dockerfile CI's checks environment, held to
.forgejo/workflows/ci.yml's python job by tests/test_checks_container.py. #2286 removed that job (CircleCI runs the
checks) and, with the old builder, lz4 (only nx2's tests read it) and the .NET checks. The image now follows
CircleCI's test-deps-linux: no lz4 and no .NET SDK, the same packages, pins and Ubuntu 24.04 image, and the check
reads them from .circleci/shared.yml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Main's caf690e6 (#2403) added the release-benchmark skill and scripts/release_bench.py, which build each side with its
release's AppImage. After #2286 a release ships longshot-builder instead: the skill builds with it (a .nup's romfs read
in place, so no --romfs-from), and keeps the AppImage's command for a release from before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
The preparation ran after the finish: 260 s of a 426 s first build on this PC from nothing (cold NVIDIA folder, 24
threads), 320 s of 795 s on the lab's RX 580. It needs no game code (--prepare-shaders returns before the image and
the OS layer), only the renderer, the shader list and the pipeline lists.

So the renderer's units and the preparation driver's go first; both are linked as soon as they are compiled (33 s into
the compile here), and once the finish's assets are made the driver runs in <work>/prepare/, after the memory gate has
room for it (9.5 GB), while the game's units compile. The driver is the game's executable without the lifted game
(build_compile::link_prepare: the host and the lift's runtime, the 20 lifted-game symbols the host names stood in for
by zero-filled weak data), named longshot as the game is, since NVIDIA files its shader cache by the program's name.
Its cache/ is moved into the game folder's at the shader step. Only for a folder whose caches start from nothing, on
Linux; LONGSHOT_PREPARE_EARLY=0 prepares after the finish as before.

Measured (this PC, RTX 3090, one queue job, each from nothing): first build with the shaders 426.2 s after the finish,
391.9 s beside the compile (the preparation 352 s there against 260 s alone: it shares the CPUs with the compile).
The first play afterwards: the 38,021 noted pipelines loaded from NVIDIA's cache in 3.1 s, no pipeline waits, no draws
left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Every new game folder translated all 38,809 programs again (70 s alone on this PC, 162 s beside a compile), though the
translator and its SPIR-V store were the same. A preparation that gets to its end now copies its longshot_programs.bin
and .idx beside the shader store (spirv.pack.programs-<stamp>, spirv.idx.programs-<stamp>: the launcher's Free up
space and its count take them with the store), and a folder with no program cache of this translator begins from that
copy. disk_init's own check of the file's head still drops a copy whose store was made again. Each folder keeps its
own file and lock, so a build preparing beside a game being played still has its cache.

Measured: a second game folder's first build on the same PC, 53 s with the shaders: 0 programs translated (18 s to read
them), 14 s for the pipelines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
feat(release): RecompLauncher installs and builds Longshot with longshot-builder (recomplauncher.json back, adapted)
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 18s
CI / builder/ (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
266f1fb0e6
#2286 deleted recomplauncher.json and its test with the AppImage and the Windows builder that carried it (cef93e9e,
"the AppImage, the Windows builder and its setup are gone"). It comes back, as main has it (with #2364: the saves are
the save folders, never Longshot's whole data folder), adapted to the new builder end to end:

- the release file: longshot-builder-<v>-<p>-recomplauncher.zip, the platform's full file (as longshot-builder, .exe on
  Windows) and recomplauncher.json, stored and deterministic (scripts/longshot_builder.py recomplauncher), made by the
  release's publish job before SHA256SUMS, which names it and the program it holds byte for byte;
- prepare: longshot-builder build --game <copy> --out <install>/Longshot --progress-lines. --progress-lines is
  RecompLauncher's own line protocol (progress <0..1> <step>, error <text>; the format has no event stream to read
  --json's), a new build-core Format::Lines; the rest stays text for the log. The ticks are --upscaler dlss/xess with
  --accept-licenses nvidia/intel, which now add up when given more than once. No --work: the per-user cache and its
  stores. No keeps_copy: the game reads the .nup in place, so the step needs it each time and it must stay there.
  done is the record, longshot_builder.json;
- start: the game the build made, Longshot/longshot (longshot.exe), no --play wrapper;
- the old builder's parts are gone from it: --cli/--prepare, make_game.py's options, the AppImage, the tools install.

What the format cannot say: where the program comes from (no download by checksum; RecompLauncher installs the zip it
is given, by hand, as before) and a structured event stream; docs/dev/reference/releases.md says so, with the flow.
tests/test_recomplauncher_json.py is main's, its old-builder checks replaced by the new flow's and the zip's;
longshot-builder's own test parses the manifest's build step with every tick. test_no_release_lookup names the old
builder's folders, not builder/ (the new one) or recomplauncher.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
build(rust)!: one Cargo workspace at the root, with longshot-rs, the game's one staticlib (empty)
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 15s
CI / Website build and checks (pull_request) Failing after 19s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m27s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m40s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m9s
9adf242f12
The builder's workspace (builder/Cargo.toml, its Cargo.lock and rustfmt.toml) moves to the root, so the game's crates
(game/crates) and later the host's and the renderer's join it with one Cargo.lock. longshot-rs is the one crate with
crate-type staticlib: two Rust staticlibs in one link would each carry std. The game profile (release, panic =
"abort") is what links into the game. third_party/renhdrum stays a crate of its own (excluded).

Cargo's target folder is the root's target/ now: CI's caches, the scripts and the docs that named builder/target or
builder/Cargo.lock follow; callers that run cargo in builder/ still find the workspace above it. The packs count
Cargo.toml, Cargo.lock and longshot-rs/ as build inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_lifter.py runs the workspace's tests with cargo test --release, and a release longshot-builder has no
panic-test command (it is #[cfg(debug_assertions)]): it answered exit status 2, a command line it does not take, and
a_panic_is_an_internal_error_event_and_status_1 failed. The test is a debug build's, as its command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
test: the sysroot's round trip unpacks a tool's archive as tools.py packs it now (its files at the top)
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 18s
CI / Website build and checks (pull_request) Failing after 49s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
6e8a8d33fd
tests/test_linux_update.py unpacked the packed sysroot under the prefix sysroot/, as tools.lock's zips held it.
#2286's scripts/tools.py packs a tool's files at the top of a .tar.zst (prefix -), so unpack found nothing under
sysroot/ and the check failed with "has nothing under sysroot".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
test(builder): the tests' scratch in cargo's target folder, never in the tracked tree; /builder/target/ ignored
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
PR description / Description follows the template (pull_request_target) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 13s
CI / Website build and checks (pull_request) Failing after 38s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m34s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m40s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m0s
da2f643ab7
build-compile's testdir and sites' table tests write their folders under CARGO_TARGET_DIR when it is set, else the
workspace root's target/ (ignored): not a path of their own beside the crates, which after the move to one root
workspace was builder/target/, no longer ignored, so a VCS took the tests' files for sources. The other crates' tests
use the system's temp folder or CARGO_TARGET_TMPDIR. .gitignore leaves /builder/target/ out as a safety net for a stale
one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
perf(build-compile): the game's link orders its functions with lld's hfsort, not cdsort
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
PR description / Description follows the template (pull_request_target) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 15s
CI / Website build and checks (pull_request) Failing after 58s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m36s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m10s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m34s
27b6fbcdcf
With the guest profile's call graph in the objects, lld's default cdsort took 10.6 s of an 11.4 s link of the game,
every relink (one changed unit, one changed host file). hfsort takes 0.9 s in all.

The game is the same in play (1080p native, no upscaler, uncapped, RTX 3090, the same objects linked both ways, 3
interleaved pairs, median (min-max)): Hyrule Field 124.8 (119.4-125.0) against 124.7 (124.5-125.4) fps, 1 % low
104.2 against 104.6, game time 4.01 against 4.05 ms; the Market 109.7 (108.6-109.8) against 109.8 (109.1-111.0) fps,
1 % low 78.1 against 80.7, game time 7.46 against 7.38 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
image now builds the image (image::build, image-build's code) and reads it
back (lib.rs, the lifter's key's part: key_crates.rs takes that file alone).
To keep the crates acyclic, the clash check of a mod's ExeFS patch against
the hook sites moves from game-files to build-driver's clashes.rs, so
game-files no longer depends on sites. plan is now cfg::plan, the data
discovery gives. The parity example image-build/examples/image.rs (compare
with an image the old builder wrote) goes. READMEs merged, builder/README.md's
table and graph, builder.md, architecture.md, hooks.md and mods.md follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
The game (host/mods.c) no longer imports longshot_mods.txt when there is no
mods.json, and the build (game-files patches.rs: OLD_LIST_NAME, old_list)
no longer reads it. tests/test_mods_list.py's migration check becomes
old_list_not_read: neither side reads the old file or touches it. The
launcher writes mods.json only (its Core never names longshot_mods.txt).

Stale names: the website's LongshotBuilder files, make_game.py in a test's
doc, the nup example's parity wording. The read stage's removal of a romfs
folder in the game folder stays: the builder's own dump-folder builds make
that folder, and the game reads it before the index.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
scripts/tools.py (check, install, add, missing, publish, pack, repack) is
gone: build-driver's tools/ reads and checks the lock (lock.rs: the same
rules, store URLs first, REQUIRED), makes and unpacks the archives
(archive.rs: GNU tar as Python's tarfile wrote it, byte for byte; zstd -19
--long=27; the unpack's path, link and nested-link refusals; stamps) and
talks to the store with curl (store.rs: download, the package API, PUT with
RELEASE_TOKEN by stdin, FORGEJO_UPLOAD_API). `longshot-builder dev tools`
is the command (tools_cmd.rs), `make` in place of `pack`; `repack` (a
one-time move from zips) goes. The compiler stamp reads the lock through
the same parser.

CI builds the builder before it installs tools: build-linux.yml,
build-windows.yml and CircleCI move the runner's longshot-builder step
first (it needs none of the tools); release.yml's version, tools-make and
tools-publish build one with mise.toml's Rust (scripts/ci_rust.sh);
ci.yml's and CircleCI's host-C jobs and CircleCI's version use cargo run.
deps.sh packs with `dev tools make` (LONGSHOT_BUILD, else cargo run).
dev.py installs its tools-store through the checkout's builder.
longshot_builder.py llvm-mingw keeps the Linux host only (the one CI uses).
`mise run tools` installs this system's into the checkout.

Tests: tests/test_tools_lock.py and test_unpack_links.py's tool half move to
Rust (tools/lock.rs, archive.rs, store.rs, tools_cmd.rs); test_dev_build.py,
test_no_webgpu.py, test_windows_on_linux.py and test_linux_update.py follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
scripts/longshot_builder.py's release packaging moves into the builder, as
longshot-builder dev release (builder/crates/longshot-builder/src/dev/):
- release_cmd.rs: sources, unpack, dry-run, recomplauncher (the stored zip,
  written by hand with crc32fast, byte for byte Python's zipfile's);
- release_deltas.rs: fetch-bases, deltas and the manifest, and files (the
  old `release`: stamps, fetch-bases, deltas), same names (KEEP 5,
  LONG 30), the manifest written as json.dump(indent=1, sort_keys) did.
The shared parts are build-driver's: the pack's one writer now sits beside
its one reader in sources.rs (TREE, LEFT_OUT, tracked, tree_entries,
tool_entries, group, member_bytes, pack_bytes, compress at zstd -19 -T1
--check, write, unpack_into), and the release API is read with curl in
tools/store.rs (json, download_checked). The pack, the deltas, the
manifest and the zip were checked byte-identical to the Python's.

CI runs them with the runner's longshot-builder (build-linux.yml,
build-windows.yml, CircleCI's builder jobs); release.yml's publish job
builds one from the checkout (scripts/ci_rust.sh, cargo build) before its
recomplauncher zips and SHA256SUMS: the deploy runner runs nothing another
runner built.

scripts/longshot_builder.py keeps what must run before there is a
builder: build (the pinned Rust), llvm-mingw (which links the Windows
builder) and check (the built program's headers, read before anything
runs it, as build checks its own output).

Tests: test_longshot_build_bases.py and test_unpack_links.py are now Rust
tests (release_deltas.rs, sources.rs); test_recomplauncher_json.py's zip
checks are release_cmd.rs's, its workflow checks stay; test_ship_state_list's
archive check is sources.rs's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Every variable the builder reads, classified (docs/dev/reference/build.md):
- a launcher's or a player's setting, now a flag on every command:
  --cache (LONGSHOT_CACHE), --ngx-sdk (LONGSHOT_NGX_SDK), --builder-exe
  (LONGSHOT_BUILDER_EXE); beside the flags there were already (--store,
  --root, --jobs, --language, --upscaler, --no-prepare-shaders). The three
  variables are read for one more release (the launcher sets them); a flag
  wins. build_driver::set_flag puts a flag where build_driver::env reads.
- a developer's or a test's override, kept as a variable: the tools'
  (LONGSHOT_OWN_TOOLS, LONGSHOT_LLVM, LONGSHOT_MINGW, LONGSHOT_SYSROOT,
  RX_CPM, LONGSHOT_*_HEADERS, LONGSHOT_FFMPEG, LONGSHOT_SDL2,
  LONGSHOT_SDL_DIR, EMSDK, RX_TARGET, ZSTD), the compile's (RX_HOT_OPT,
  RX_COLD_OPT, RX_VK_PGO, RX_A64_RT_O2, RX_MARCH, RX_RELEASE,
  LONGSHOT_IR_LEVEL, LONGSHOT_KEEP_IR, LONGSHOT_TRACY(_FIBERS),
  LONGSHOT_FSR, LONGSHOT_THIRD_PARTY_OBJECTS, LONGSHOT_OBJ_STORE,
  LONGSHOT_VERSION, LONGSHOT_SOURCES), the memory gate's
  (LONGSHOT_MEM_GATE, _LIMIT_GB, _RESERVE_GB), the shaders'
  (LONGSHOT_NO_PREPARE, LONGSHOT_PREPARE_EARLY, LONGSHOT_PREPARE_ENTRY_S,
  LONGSHOT_SHADER_STORE), LONGSHOT_STORE, LONGSHOT_ROOT, LONGSHOT_JOBS,
  LONGSHOT_PERF_URL, RELEASE_TOKEN and FORGEJO_UPLOAD_API (dev tools), the
  tests' (LONGSHOT_E2E, LONGSHOT_NO_CLANG, CC, LLVM_MC, LIFTER_WORDS), and
  the system's or the game's own (HOME, LANGUAGE, XDG_*, HOS_MODS,
  HOS_OPTIONS_FILE).
- dead, removed: RX_VK_ONLY and RX_GAME_ONLY (compile --only is the way).

CI passes --ngx-sdk and --cache (build-windows.yml, vulkan-dlss.yml,
CircleCI); fetch.py says the flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
A pack's runtime prepares again when its build's translator_stamp (the one
longshot-builder writes in longshot_version.txt) is not its base's:
packs.py's copy of shader_stamp.rs's file list (STAMP_DIRS, STAMP_FILES)
goes. The NGX SDK dev.py takes from LONGSHOT_NGX_SDK goes to the builder as
--ngx-sdk (build, update, lift, compile), as do the settings it already
gave as flags. Kept: base, pack, rt, run and warm, --json and
LONGSHOT_BUILD_JSON, the upscalers from the environment (#2402, in
base.json), the shared stores and warm runtimes. test_dev_packs.py checks
the stamp's comparison and the flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
fix(builder): dev tools install reads zstd's output to its end
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 18s
CI / Website build and checks (pull_request) Failing after 1m9s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m28s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m35s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m37s
b37afeb667
The tar's reader stopped at the archive's end marker and closed the pipe
while zstd could still be writing the last records: zstd died of SIGPIPE
and a whole, checked archive (tools.lock's cpm, in the queue's batched run)
was said unreadable. The rest is read and dropped before zstd is waited on.
(Item 1's, on top: the commit it fixes has other work built on it.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
#2286's kskyprqv took the host-version rule out of programs_load_decide (the renderer takes a host of its own API
version only), so the fixture's HostStub and its static host were left unused, and clang++ 23 with -Werror stopped
on "unused variable 'host'". Main still has the rule and passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
test: the prepare stall check reads the builder's status 4 as the supervised preparation says it
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 16s
CI / Website build and checks (pull_request) Failing after 37s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m35s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m37s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m39s
7186a9b99c
The #2323 port made shaders::prepare match the supervisor's (status, decision); its arm for exit status 4 is
Ok((Some(4), _)), and tests/test_prepare_stall.py looked for Ok(Some(4)) word for word. It now looks for either form
with the same sentence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
host/game/'s tables move to game/sites/ (sites.toml, <build id>/locations.toml) and its C to game/ (sites.c/h/def,
flags.c/h, phases.c/h), as they are. game_call, which is the host's (it takes a virtual core back for the call: host/
hos_thread.c), stays in the host as host/game_call.c and game_call.h.

The builder follows: the sites crate's Tables read game/ (the definitions at sites/sites.toml), the lift's host scan and
the entry hooks read game/*.c beside host/*.c, the compile plans game/*.c with the host's flags into the same game
binary (objects game_*.o), and the tree has game/. The checks that read the moved files follow their paths; no check
changes what it checks. Only comments change in the tables, so the lift is the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every host/oot_* file (area names, autoload, barrier, damage, damaged files, fov, heap retry, heart containers, high fps,
the game's menus, ocb hold, shadow, shadow fit, sites, sprint, state tap, teleport check, tex compact, text size, text
step, voice, wide sites), host/cheats.c, texts.c, game_layout.c/h, hos_wide_ui.c, the Discord status
(discord_activity.c/h, discord_rpc.c) and the cheat items' list (gpu/vk/oot_cheat_items.h) move to game/, as they are.
Only include paths change: the game's files find the host's headers through -I host, as before; the host and the menu
include the moved headers from ../game/ until they go through game.h.

host/hos_wide_size.h stays in the host: it is the output picture's size, which the host and the renderer share.

The checks that read the moved files follow their paths, and those that compile them get -I game beside -I host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/mods.c, mods_list.c and mods_list.h move to game/, as they are: what a mod may replace and in which order is the
game's. The checks that build them follow their paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/hos_main.c held the game's tools beside the generic start-up: the Debug tab's cheats (hearts, flight, the free
camera, speed), its inventory, teleports and age, the control bridge's game commands (stats, state, the map, the
destinations, teleport and age requests), the opening's skip, the save trace, Link's pose and the map line for the
performance summary. They move, byte for byte and in their order, to game/oot_tools.c; the start-up stays, and so does
its read of HOS_OOT_PROTECT_HEARTS (into the moved hos_oot_protect_hearts, until game_init has it).

The checks that cut these pieces out of hos_main.c read them from game/oot_tools.c, and the checks the earlier moves
of this branch missed follow too: scans of host/*.c cover game/*.c, and those that compile a moved file get -I game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The line between the generic host and renderer and the game, as two headers:

- host/game_host.h: what the host gives the game. The host's own headers the game's C used (the paths, hos.h's guest
  memory and Ctx, game_call, the RomFS, the size tables, the settings file, env_on, the picture's size, the input
  recordings, the control bridge's watches), and the host's functions and values the game declared one by one where
  it used them. Every game/ file includes it in place of its host includes.
- game/game.h: what the game gives the host and the renderer: game_init (the start's read of HOS_OOT_PROTECT_HEARTS,
  out of hos_main.c), the frame's and input's hooks, the control bridge's and the input recordings' game commands,
  the Mods and Cheats pages, the performance summary, the files mods replace, the Debug tab's inventory items. The
  host's files and vk_menu.cpp include it in place of the game's headers and their own prototypes.
- game/options.h: the game's option ids (Field of view, Damage taken, the cheats, the HUD's layout...), out of
  gpu/vk/vk_api.h, which includes it; every value as it was (longshot_options.ini and the recordings hold them).

The names the host used that were the game's become generic: hos_oot_{state,current_map,destination,teleport_*,
age_ask,sample*,watch,poll,live_action,flight_shortcut_ready,autoload_input} are game_*, HosControlGame's oot_* fields
game_*, HosControlOotWatch HosControlGameWatch. No behaviour changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_game_boundary.py: host/ and gpu/ include nothing of game/ but game.h and options.h; game/ includes nothing of
host/ or gpu/ but host/game_host.h and the lift's runtime (a64.h); no file of host/ or gpu/ names an oot_ or hos_oot_
symbol outside its comments and strings. Includes are followed as the build finds them. It must fail on an
#include "../game/oot_sprint.h" planted in host/nn_hid.c, and on an oot_ name planted there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pattern for porting the game's C to Rust, on one callback: game/oot_fov.c (the site camera.lens) becomes
game/crates/oot/src/fov.rs, under the same symbol, hos_oot_fov, so the site, the lift and its key do not change.

- game/crates/guest: the one crate with unsafe code. Ctx with the lift's layout (asserted), GuestPtr<T> to a guest
  address, read and written only when not null, aligned and inside the guest window, through the lift's own readers and
  writers (host/game_guest.c's hos_guest_load and hos_guest_store over recomp_load*/recomp_store*: page marks see every
  store), the vector registers as scalar writes leave them, and the host's services (rx_option) declared once.
- game/crates/oot: safe code; the callback takes Option<&mut Ctx>; the guest's addresses and offsets named.
- longshot-rs depends on it: the one staticlib.

The build: build-compile links liblongshot_rs.a into the game (rust.rs). A player's build compiles no Rust: the
release builds the library for Linux and Windows (scripts/longshot_builder.py game-rust, the pinned Rust) and carries
it at longshot-rs/prebuilt/<platform>/ with the key of its sources (longshot-builder dev rust-key), which the build
checks; the release's dry run fails without it. A tree whose Rust changed builds it with cargo (LONGSHOT_CARGO, else
the PATH's).

tests/test_oot_fov_rust.py runs the C it replaced (tests/fixtures/oot_fov.c) and the Rust over the same made-up guest
memory, case for case (every percentage from 49 to 151, the refused cameras, angles of 0, pi, NaN and the extremes),
and must fail on a clamp bound, the event check or the 100 % shortcut planted in the Rust. test_oot_fov.py checks the
site's wiring with the fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
game/README.md says what belongs in game/ and what does not, the two headers and the Rust's pattern; the architecture
page gets The game side; the lift's and the builder's pages read game/ beside host/; the control bridge's and the
input's pages name the files their code is in now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rows that change the game, not the picture, and are plain data are the game's now: Field of view, Text speed, Text
size, Skip title screen, Skip opening, Discord status and Ultrawide menus. game/menu/rows.c describes each as a
GameMenuRow (game/game.h): its key, texts, tab, kind (toggle, slider or choice), option id, range, default, choices and
hints, and its place (after or before a key, order). Keys, texts and places are as they were, so the menu reads the same
and a player's longshot_options.ini loads the same values under the same lines.

The renderer is a library of its own, so the host hands it the table: MkwVkHost's game_menu_rows (version 48,
host/rx_backend.c), and the build compiles game/menu/*.c with the game's C (objects game_menu_*). One generic module,
gpu/vk/menu/game_rows.cpp, adds the rows to the menu in place, as any module adds its own, and keeps their values, one
int by option id. The menu loads and saves them through the row's value as before; vk_replay.cpp's option callback answers
their ids from it (a Toggle's 0 or 1), in place of the Options fields, which are gone. Text speed's id, 5, is named
HOS_OPT_TEXT_SPEED in game/options.h. vk_framegen.cpp reads Ultrawide menus there, HOS_SKIP_OPENING overrides the game
row, and the Bug report takes a game row's default from the row.

Rows that need the renderer's code stay in gpu/vk/menu/: Game speed (the host's frame clock, set by the presets), Damage
taken and Autosave (the Debug tools' showing, gating and sync), the HUD layout and its placement (shown, hint and
on_change hooks, a Reset action), Game language (language.txt, its range from i18n).

The checks read the moved rows where they are: tests/menu_model_fixture.py gives the game's rows (game_rows, game_row),
counts them with the modules' and links game/menu/*.c into the built menu; test_menu_ini_keys's FROZEN is as it was, and
MOVED says which of its values a game row keeps by its id. AGENTS.md's rule and architecture.md's Insert menu say where a
game row goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SL5owjRmyLny1gUZf
feat(guest): guest words as atomics, for the host's sync objects in Rust
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 36s
CI / Website build and checks (pull_request) Failing after 2m2s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 3m13s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m26s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m27s
fefe58d751
The SDK's sync objects keep their state in the game's own words (a mutex's owner, an event's counter, a queue's count),
which the host's sync objects ported to Rust work on while the game's threads do. guest gets a view for them beside
GuestPtr: GuestPtr<u32>::atomic() and GuestPtr<u64>::atomic() give a GuestAtomicU32/U64, checked as a read is (aligned,
inside the guest window, the address taken whole), worked on in place with sequentially consistent atomics: load, store,
swap, compare_exchange, fetch_add/sub/or/and. Every write marks the word's pages as the lift's stores do, so a sync word
on a page the GPU maps is captured with its value. A 32-bit word can be slept on until it changes and woken
(WaitOnAddress, a futex on Linux through host/posix).

The host's side is host/game_guest.c's hos_guest_word, hos_guest_mark, hos_guest_wait32 and hos_guest_wake32, declared
in host/game_host.h.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SL5owjRmyLny1gUZf
game/DESIGN.md: the contract the Rust port of the game side and the mod API follows: the crates and what each owns,
the Mod trait, the threads and the MainThread token, the undo journal, settings by key, the script engine, the site
chains, the post-process interface, the native C mods removed, the bugs fixed on the way, and where each C file goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
As the full mod API (2596a0e3) vendors them, unmodified: the interpreter the script crate binds, with Longshot's one
translation unit beside it, and the usingCtx helper compiled TypeScript may import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
As Phase 5's tip (2596a0e3) has them: modapi/'s schema and shipped JavaScript moved to game/modapi/ (the layout of
the game/ boundary), assets/modding/ (docs, examples, packages, templates, the system mods) and tests/mod_vectors/.
modapi/generate.py is not taken: the schema crate replaces it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
No C mods and no wasm (game/DESIGN.md, "What was removed"): the module longshot/native and the permission native
leave the schema, with the example native-hello, the guide's native.md and the fake game's stand-in for a native
library. A mod.json that asks for native is refused by the loader. The generated files (longshot.d.ts, the reference,
the permission table) follow at the next schema-gen run; the guide's links to native.md go with the docs pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The workspace at the repository's root (the builder joins it with the game/ boundary; until then it keeps its own,
left out here), with the builder's edition, Rust and rustfmt, and clippy's pedantic group for the game's crates.
longshot-rs is the one staticlib the game links. guest is the only crate that touches guest memory: GuestPtr<T>
checks every access (the null page, alignment, the window) and marks what it writes, Pod and pod! say what a guest
address may hold, GuestCtx wraps a hook's registers and calls into the game. host-sys stands in for host/game_host.h:
its C declarations, a safe wrapper for each, and a stand-in host for game-free tests (the feature fake). The other
crates are empty for now, each with its place in game/DESIGN.md; the design names the hook-site runtime game-sites,
since the builder has a crate sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The flags and slots the lifted code names, made from game/sites.def by build.rs (with each site's form from the site
table), and the runtime behind them, ported from host/game/sites.c, phases.c and modsites.c, with #2272's
self-review fixes:

- a site's chain: handlers around the core, the core its owner and subscribers with one answerer, published whole;
  the owner alone in the slot as before (a C owner directly, a Rust one through a plain trampoline);
- the site's callee kept and put back before each handler and the core (a handler's own game calls reach other
  replace sites);
- the chain's place is the guest context's, for a C handler's hos_site_next, so a fiber that resumes on another OS
  thread goes on in its chain; a Rust handler carries its place in its SiteCx;
- a removed handler is let go only once the site's readers are seen at zero (remove_then);
- outcome sites take no owner, handler or subscriber at run time: only the engine's, installed at start;
- a live rule table published again is not retired;
- the frame phases, with the MainThread token only the acquire phase makes, and MainCell;
- the mods' slot pool and its one call.

game/sites.def is the union of #2272's list (with its outcome lines) and the mod API's sites and tables. The C
functions (hos_site_set, _add, _subscribe, hos_table_publish, game_phase_run ...) stay, for the host's own C on
sites. Vslot sites are not ported: the list has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game's C is ported from 0fc27a42, where #2272's self-review fixes already are: they are listed as ported, and
only the two Skip title bugs remain fixed on the way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The parts every service, engine and native mod builds on: Value (and ToValue/FromValue with the schema's checks:
an int's range, finite numbers, bytes and values' limits), ErrorClass (the C's status numbers kept as stable codes)
and ApiError, CallCx (the main thread's token when the call is on it, the mod, its context, what the engine lends),
Promise and the settlements queue, the Mod trait and ModCx of native system mods, the settings' declarations, the
loader's ScriptHost, and the bindings' contract, which build.rs makes from the schema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/modapi/journal.c: a mod's writes to the game's saved state (flags, items, memory, placements) with
their values before and after, following the game's saves (asked, written, loaded), undone newest first where the
game still holds the mod's value, items waiting for play, bounded with "at least" counts. New: live effects (a
handler, a rule, a row, a pass, a claim...), each with its undo, all taken down when the mod is turned off, so
system mods and script mods are undone the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
A stand-in for the header the game/ boundary writes, by what longshot-game exports: start-up and the frame phase,
the input hooks, the control bridge's game commands, the input movie's hooks, the mods' RomFS layers and sound
mix, the game's menu rows by key (laid out by the Game settings mod), and the post-process passes the renderer
draws (CRT, colour vision, a mod's shader).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The content crate's foundation: the strict JSON reader of host/mod_json.c over
serde_json (its depth, members, size, duplicate-key and NUL rules kept, the
differences documented), BYML read into a tree and written back (host/byml.c,
every limit kept), and SARC's members, puts and merge (the archive half of
host/restbl.c). miniz_oxide is added for the zip packages' and PNGs' inflate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/texts.c: HOS_TEXTS read by the switches' rule,
<game>/texts/<name> served for mals/<name>, a mod's own file wins, the first
four served are logged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/romfs_layers.c/h. Last layer wins with every copy kept, made
files, the served paths (at most 4), the map reload's opened-paths set
(lock-free, capped), dev-mode rebuilds (changes, keep, publish), dir extras.
A lookup takes the live Arc<Table> under a read lock that only a publish's
pointer swap holds for writing; a replaced table is freed when its last
reader drops it (no 16-table retired list, no leak past it). The Mods tab's
move copies the table and publishes the copy instead of writing the live one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_archive.c/h, the zip format read here instead of through
miniz's reader, with every check the C made: the end record (two records,
several disks, Zip64 and its locator, nothing between the central directory
and its record), each entry's central and local headers, methods,
encryption, UTF-8 names (Info-ZIP 0x7075 with its CRC-32), every name rule
and the case folding, overlap, a name twice and file-and-folder. Entries are
inflated with miniz_oxide's streaming core, held to their size and the
ratio, their CRC checked and archive magic refused. Also SHA-256 (whole and
incremental), the unpack into a fresh .unpack-* folder renamed into
<cache>/<sha256>, and the sweep. Without unsafe there is no openat walk:
folders are made with create_dir and checked not to be links, files with
create_new (O_EXCL / CREATE_NEW).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_patch.c/h: patch files read strictly (crate::json's
rules, then the patch rules and every message of the C), conflicts between
layers, and the ops applied to a byml::Document, with failures returned in
Applied. Texts ops are parsed here and applied by content::text. A second
read of the text keeps how each number was written (an int or a float, a
64-bit int's exact digits), which decides a new value's type as in the C.

Fixed on the way: a placement set to an array made every int in it a float
for any key (now only Translate, Rotate and Scale, as the C's comment said);
hash map keys past 64 bits were read as 2^64-1 (now refused); and past 64
reported paths a conflict could be reported twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_assets.c and the formats it needs: PNG decoded to RGBA8
(host/png_decode.c, inflate by miniz_oxide, CRC-32 built at compile time),
BFRES models read and their textures renamed (host/bfres_edit.c), and
one-texture BNTX files written from RGBA8 (host/bntx_write.c: the GOB
swizzle, NVN's block heights, the sRGB mip halving and the header bytes
kept). BC7 blocks are encoded by the host's bc7enc through a host-sys call
proposed with this port (host_sys::image::bc7_block). A skin's files come
back together, so a failure part way no longer leaves some written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_text.c at 336075ba: MSBT read and written with every
limit and message of the C; the named tags as a Tags table passed by
parameter, Tags::game() the build's seven rows (the C's global
msbt_tags_use had no caller); the tagged check, encode and text; and texts
patches applied to a text archive over sarc::put (256 MiB). Ops the C left
out without a word (a message file over 16 MiB, an archive over 256 MiB, a
created file's name the archive refused, which it even counted as applied)
are now failed with their reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_read.c/h: BYML read in place with no tree, the JSON
byte for byte the C's (its own %.9g and %.17g formatting), the table index,
row and document JSON, placements whole or in parts, text archives (32
message files kept read; a failed read no longer takes a slot), plain text,
archive codes and name checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
content::ainb::model (host/mod_ainb_model.c): behaviour trees read strictly
into their sections and written back with every offset computed again, the
same bytes when nothing changed; nodes appended, strings found or appended,
links, node comparison. content::ainb::add (host/mod_ainb_add.c): the schema
builder and its text format, new nodes added to a tree against it, and the
check of a tree that gained nodes. Schema lines are no longer cut at 511
bytes (a long tags list ran into the next line), nor shapes and values at
the C's buffers. The files join the crate with content::ainb, next.

Ported from untested C (Phase 5's behaviour-tree calls).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
content::ainb ports host/mod_ainb.c: the AINB 0x408 reader with bounds, its
JSON view laid out as the C's, the param/input/blackboard/link/root changes
(an op now given as JSON, not re-read from text), the bones a tree names,
renaming, and a content stage's tree (new nodes through ainb::add, then the
changes, then ainb::add::check). A link or table offset outside the file is
no longer read as 0 (which let a change write over the header), and a vec3
with a non-number is refused before anything is written.

Ported from untested C (Phase 5's behaviour-tree calls).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The content stage's pack builder (host/mod_content_pack.c): pack specs read
(names, donors, skin), the new or in-place ActorParam, component changes
through Work references (copied under the new name), relative changes,
add-file and add-from (with the files a donor's component needs), removals
checked against the actor's behaviour trees, two mods' clashes on one game
actor, and a component as its actor sees it. A changed game actor whose
ActorParam is no dictionary is now refused (the C wrote its Components into
the root array, or said out of memory). Every limit of the C is kept.

The tree lines (content.tree) are behaviour-tree calls: ported from
untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_content.c: each kind's checks with the C's messages,
the mod-owned names (word, placement hash, flag and tree names), plan.json
and its read-back, and every output file byte for byte as the C wrote them
(rows, texts, placements, changes, flags, typed patches, pause-menu slots,
pack specs, trees, copied assets), returned as a list in the C's order.
Values are copied out of a declaration as the mod wrote them. The cases of
tests/mod_vectors/content.json run as a data-driven test.

Fixed on the way: the C checked only the first 162 component names of a kit
for one named twice, where a kit can name 192; every name is checked now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Two host calls content needs: hos_prompts_romfs (the prompts the host builds over a RomFS path) and
game_host_bc7_block (bc7enc stays the host's third-party C). miniz_oxide joins the workspace's libraries, for
content's zip packages and PNGs, with its reason in game/DESIGN.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
discord and mod-inspector join the native system mods' place (game/DESIGN.md): their packages' paths, the fake
game's lookup of a checkout's system mods (mod-tools' systemModFolder and isSystemFolder) and the schema's notes
follow. The guide's pages follow with the docs pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The first of game.h's functions: hos_game_layout (ported from host/game_layout.c: cache/ and logs/ made, an older
build's files moved once, never over one there), the host's RomFS calls over content's layers (hos_romfs_resolve,
_file, _dir_extras, romfs_opened, and their game.h names), game_post_passes (the list the gfx service publishes,
kept until the generation changes twice) and game_free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
docs/dev/reference/hooks.md names game/sites.def and game-sites for each site's slot and what runs there, the
core's callbacks installed at start, the Rust callback's shape, the C functions kept for the host's own C, and the
tables as Rust values retired by their readers. The site tables' paths stay the host's until the game/ boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/oot_autoload.c, the game and the host behind a trait, for the system mod the API wires later:
the hook path (A on the title, the file list and the check as the game waits on each, the repeats, the 4th wait
ending it, no more once a load begins after the check's A), the fallback after 45 s and the timed path, the
newest save's lookup, and the waits the sites tell.

Fixed (game/DESIGN.md, "Fixed on the way"): the skip's clock stops while the Insert menu holds it, so a menu left
open on the title past 120 s no longer makes it give up; and a press a screen took as it opened (the fallback's A
landing as the file list opened) is counted as that screen's own, so it is not pressed again on top and the
presses match the log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/oot_area_names.c: the table, the suffixes taken off (_MQ, _Alternative, _Child, _Adult), a map
the table lacks spelt out. The export other mods call is wired with the API.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
A mod's JavaScript and TypeScript formatted by oxc's formatter (oxfmt's engine) from the game binary, so a mod's
author needs no Node to keep its sources tidy (Node stays optional, for type checking). The crate mod-format: the
author's files (.ts, .tsx, .mts, .cts, .js, .mjs, .cjs, .jsx; not node_modules, dist, dot files or the made .d.ts),
oxfmt's defaults 120 wide or the mod's .oxfmtrc.json, a file that does not parse named and left alone, --check
writing nothing and exiting 1 for each file not formatted. game.h's game_mod_format runs it for the exe's mod tool;
longshot mod's command table gets format (Node's host has none and says so), and longshot-mod forwards it to the
game. oxc does not publish its formatter: it comes from oxc's repository at crates_v0.157.0, the compiler's
release, with the shared oxc crates patched to that tag (game/DESIGN.md, "Libraries"). The guide's tools page says
how.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The design's rule: a mod's author needs the game binary alone; Node is for type checking, and for the three
commands that still need it until they move into the binary (the fake game's tests, shaders, sites port).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The strict JSON rules of host/mod_json.c (api::json, shared with the
mods.json and store readers), then serde's tree, then every check of
host/mod_manifest.c with its top-level field at fault, passing
tests/mod_vectors/manifest.json. A manifest that asks for the removed
permission native, or has a native block, is refused saying native
mods are no longer supported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::loader ports host/mods.c's list and host/modapi/loader.c: the mods
folder's emulator mods, manifest folders and packages, one row each in
mods.json's order (system mods first, a legacySwitch carried once), the
manifests resolved (api::loader::resolve, passing
tests/mod_vectors/resolve.json, Tarjan without recursion), each mod's
start prepared and made one a frame in load order through ScriptHost or
Mod, the switches that take effect at once, and the Mods tab's snapshot
and edits. api::loader::list and trust keep mods.json and
mods-trust.json byte for byte; api::loader::switch is mod_switch.c's
decision as data. api::system checks script system mods against the
build's SystemTable by their tree hash. Files go through api::disk.

Builds once api::perms and api::services land (next commits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::perms ports host/modapi/perms.c: each mod's grants (origins
normalized, at most 64; names this Longshot does not know kept as
mods.json has them), the four prompts and their caps, the menu's answer
from its own thread applied at the next acquire phase, permissions.has
and request, the page's switches and permissions.changed. The grants an
answer gives are handed to the loader to write on the main thread.
api::claims ports host/modapi/claims.c: a declared claim is kept for its
declarer, a holder is counted, a refusal names the holder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::storage ports host/modapi/storage.c: each mod's global, profile
and save data in its files (format 1, byte for byte), written by one
writer thread from shared snapshots, global and profile a second after
their last change; a newer version's or format's file refused and kept,
one that is not a store kept aside as .bad; the game's save notes from
any thread acted on at the frame (request, read, written, created,
deleted, staged, unstaged), driving the undo journal's save_asked,
saved and loaded; the title screen; storage.save.loaded; the settings'
own store beside the data. storage.save.flags is ported from untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::settings::Settings ports host/modapi/settings.c: a script mod's
declared settings kept in its settings store, read back checked
(the default when a value is no longer one of its values), changed by
the mod, the player (the Mods tab's rows, the host's $soundVolume and
$debugKey) and a save, told once a setting a frame; legacyOption taken
once from the options file; a system mod's settingSwitches for the run.
The game's own settings (native SettingDecls) live in
longshot_options.ini through the OptionsFile trait, reach the menu as a
published snapshot of rows with a setter from its thread, and site
handlers through Published<T> atomics stored on each change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::services::Services holds the journal, permissions, claims, storage
and settings typed, the manifests the loader chose and the mods that
run: a mod's start opens its storage and settings (a system mod's
legacyOption taken once), its stop undoes every live effect newest
first and frees its claims and grants; the services' events
(storage.save.loaded, settings.changed, permissions.changed) are handed
to the loader's frame to fire. ModCx now lends a ModApi: its id, its
grants, and typed accessors to settings (with Published<T>), storage
(checked against storage), claims and its journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The storage writer now keeps the job it runs where a slot's load looks
(a slot read while its write ran was read from the disk's older copy);
permissions.request lets go of its lock before it drops a promise it
could not queue; a mod.json refused as a whole says mod.json: <why>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Schema::load(root) reads game/modapi/schema/*.toml and makes every check
modapi/generate.py's load() made (keys, names, since, types, functions,
events, filters, interfaces, handles, features, the write rules, the C
names' uniqueness, every permission and unit used), each refusal a
SchemaError naming the file and the item. The schema's sha256 is
generate.py's schema_hash, byte for byte (SHA-256 written here: the
workspace has no hashing crate).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
system_mods reads the script system mods (game/mods/<name> first, then
assets/modding/system/<name>; a folder with a Cargo.toml is a native mod
and left out), hashes each as nx2/system_mods.py's tree_hash does (the
same files left out, the same order, links refused) and checks its
manifest's "system" object, permissions and "ipc" as generate.py's
emit_system_mods did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
emit makes every repository file generate.py made from the schema and
still has a reader, byte for byte as the Python made it (its wrap,
md_anchor, ts_type, json.dumps of a string, the blank line before a
brace taken out): longshot.d.ts, the fake game's schema.json, reference.md,
permissions.md, scripting.md's generated blocks and the fake game's
copies of the shipped JavaScript; and the packages' version and the fake
game's services checks. The first lines name game/tools/schema-gen and
game/modapi/schema/ instead of modapi/generate.py and modapi/schema/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
What api's build.rs writes into $OUT_DIR/bindings.rs, as api/src/bindings.rs
describes: the version and hash; Permission (name, risk, told, bit, ...),
Risk, Feature, Namespace, Phase, Thread and HandleType; one enum per
schema enum and one struct per record (ToValue, FromValue for the ones an
argument or a filter takes, valid(), a field whose feature the build lacks
read as null); one <Namespace>Api, <Interface>Api and <Handle>Api trait
for the services and ApiServices to reach them; FUNCTIONS with a thunk
each that checks the context, the permission, the feature, the handle and
every argument as emit_header's C thunks did, then the result; EVENTS
(with their filters), FILTERS, CONSTANTS, MODULES (the shipped JavaScript
by include_str!), the write rules, typed resolvers for the async
functions, and checks at compile time (and in a test) that the schema's
error classes and contexts are api's ErrorClass and Context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
What generate.py's host/modapi/system_mods.h held, as Rust for a build
script to include: each system mod's name, tree hash, flags (on, always,
required) and legacy switch, the local endpoints their "ipc" declares,
their off and setting switches, and system_switch_of.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
schema-gen [--check] [--root <repo>] loads the schema, writes every file
emit::outputs makes that differs (CR LF read as LF), or with --check
writes nothing and exits 1 naming each stale or missing file, a package
whose version is not the API's and a fake the fake game lacks, as
modapi/generate.py --check did; 2 for a schema that fails its checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The vendored interpreter (third_party/quickjs-ng: longshot_quickjs.c, libregexp, libunicode, dtoa) and
shim/qjs_shim.c compiled with the cc crate, with nx2/build.py's QUICKJS_FLAGS. qjs::sys declares the C the
crate calls; qjs wraps it in counted values (a context freed after its last value), native functions as
Rust closures, and an allocator that charges a mod's heap counter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Every limit of modrt_internal.h keeps its value (crate::limits). The accounting is game-free and tested:
deadlines on the thread's CPU time with the wall clock's hard cap, the cost line a warning or fault says,
a slow frame's numbers, the history inspect() reads, 3 faults a minute, 100 log lines a second, the
collector's plan. The watchdog's registry is the crate's one shared structure. A mod's own files are read
inside its folder, never through a link (loader.c's and files.c's rules).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
runtime.c's calls under budgets (the frame's 8 ms cut, the wall clock's cap, the 500 ms overrun stop, the
cost line, rejections, 3 faults a minute), the entry's 1 s, the collector at the frame's end; bindings.c's
API objects from api::bindings (read in one file, bind/tables.rs), values both ways with every check, the
thunks' CallHost (the call's promise, a callback called now or kept), subscriptions, events, filters'
drafts, promises' settling, handles and the prelude (unchanged JS); modules (the API's, Longshot's own
JavaScript with its native parts, the mod's files, JSON modules). TypeScript, workers and the test mode
come in their own commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
script::ts calls oxc 0.157.0 directly (host/ts's transform, same options and VERSION): no library of its
own and no C ABI; the usingCtx helper of third_party/oxc-runtime served by include_str!. The modcache/js
records (LSTS2, SHA-256 keyed), system mods' modules compiled ahead in memory and never from the cache,
the compile's time out of every budget. sourcemap.c's mapping of a fault's first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
worker.c's pool, owned by the host (no global list): a worker's interpreter charges its mod's heap,
runs its entry then one message a turn under 10 s, the longest-waiting worker first, one thread at a
time (its runtime moved whole between the pool's threads); messages as checked JSON, 1 MB each, 64 and
8 MB waiting each way, charged to the mod's heap; faults and stops told to the mod, and a worker still in
its turn when its mod goes left to end on its own thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The running mods in load order; start (the runtime made, its entry run within 1 s), the frame's begin
and end (every mod's budget, the 4 ms all-mods warning), events (a scope-mod event to its one mod, a
handle's to its subscribers), filters' rounds (exclusive last), the promises' settlements within 64 or
2 ms a frame, kept callbacks, the together source's deliveries and the workers' step, stop and reap.
Each call lends the runtimes the services and the main thread's token for its length.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
testing.c's runner: tests:<id>'s runtime, its made entry over test/'s files, longshot/testing (runner.js
over its native part: mod, save, destinations, teleport, age, result, faults, say, report, filter) and the
live run of mod_test with results.json's shape. modrt_eval_start/poll: the code compiled as a module of
the mod's folder and evaluated as one of its callbacks, its promise handled, its default export as JSON.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
FilterSpec gains check_draft (the draft read as its record, as an argument is) and gives readonly as the field
names; the script adapter reads the generated tables as they are: &dyn ApiServices thunks, EventFilter's parse,
ConstValue's Text and Record, Namespace's member and parent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The range check took abs(), which i64::MIN has none of.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
build.rs writes $OUT_DIR/system_mods.rs from game/mods (api::system::built); bindings.rs's doc says the services
take &self, a left-out options record is &R::default(), and what the filters and constants carry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The oot crate's module tree, and what every service builds on:

- mem: bounded reads and writes of the game's records (game_peek_at,
  game_guest_at), and Field<T>, a typed field offset;
- locations: the named locations of locations.def, resolved from the host
  once (a test sets its own);
- call: the Caller trait over a hook's GuestCtx and the thread's own
  context, and GameCallError;
- flags: GameDataMgr's containers (host/game/flags.c, flag_set.c), with
  game_flag_number_as_game's past-the-count-reads-entry-0 rule;
- layout:🎏 the containers' layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
video: the camera's turn-speed scale, the movie frames, the whole-frame
counters, the loops kept on one pose, the ocarina's note wait and the
game's part of the present step (nn_vi.c, nn_hid.c and their oot_sites.c
callbacks). bridge: the control bridge's oot_state, oot_sample, oot_watch
and oot_poll as typed functions (control.c).

Fixed on the way: a stale ocarina note wait no longer clears a wait a site
re-armed at the same moment (compare-exchange), and the graphics module's
and the loops' reads are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The mod API's game services of host/game/{camera,pad,player,rays,state,
texts,watch}.c, typed: the camera's last view and override under sequence
counts, the pad over the host's publish, Link and the game's state read
bounded, the rays' lock-free slots, the texts' pool and the watches of maps,
saves and flags.

Fixed on the way: a build naming no actors.vtable took any actor whose
first word is 0 for Link; a NaN replacement stick was undefined behaviour;
the texts' reads of the screen and names are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Holding the pause through DebugPause, the pause types, the 2D layers found
and hidden (host/game/pause.c). The pause-menu slots (game_pause_entry,
game_pause_row_bit, and DebugPause's camera row cleared while held) are the
mod API's Phase 5: ported from untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game parts of host/hos_main.c and host/input_movie.c: the destinations,
teleports, age switch and their ticket queue, the map lock and the
Inventory page's counts (travel); the opening skip with the mods' skips
first, the save trace and Transition autosave, loading and Link seen
(session); Link's update, flight, Movement speed and the free camera
(debug); with their engine callbacks from host/oot_sites.c. The options
they read become typed knobs the API sets.

Fixed on the way: the age switch compared an unread map name; the
teleport follow-up's log printed a map the resend had cleared; with no
hold, a controller or actor of 0 matched the flight's; ticket 0 read as
waiting; the free camera's view reads are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
oot::sysmods: everything the system mods (Field of view, text speed and
size, Damage taken, sprint, widescreen UI, Skip title, cheats, heart
containers, shadows, Voice language, area names, Discord) read, write or
call in the game, so each mod is written on the api crate with no raw
offset. The one system-mod outcome site, options.voiceWritten, gets its
engine callback here; it follows the saved option while the published
knob sysmods::knobs::VOICE_FOLLOW is on (off: the game as shipped).

Fixed on the way: a refused call in the voice callback answers "not
written" rather than a stale x0; an area name over 95 bytes is cut on a
character boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/{items,rewards,rules,skips,songs}.c, typed: the items' watch on
its own sites, give, take and the pouch's counts; the placement drops,
event gifts, shop prices and bottle fills; the damage, actor-life and
scale rules with their tables laid out as the C's; the mods' skipped
events and the song names. Caller gains stack_pointer, for the bindings
that build a frame below the caller's stack; travel takes the pouch's
counts as the service now gives them.

Fixed on the way: a build naming no life vtable took a component reading 0
named Player for Link; the song list read before the RomFS index was ready
stayed empty for the run; the items' sinks are told after the poll lets go
of its state, so a sink that gives an item no longer deadlocks; the damage
and actor-life tables are published both or neither.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/{actors,spawn,queries}.c, typed: the actors.update site's
lock-free record, the list and its generations, the mods' writes with
their tickets and lit bombs, spawning and despawning with #68's gate and
the respawn flags, and the answers to the behaviour-tree queries. Their
tables keep the C's layout; longshot-game exports the hos_* functions the
lifted rule C calls around the safe Rust.

Fixed on the way: a build naming no controller method or no actors.vtable
matched a slot or first word of 0; a write its site marked dropped was
counted as made; a list slot's generation could wrap to 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/attach.c: models bound to an actor's bones, the slots' hand-over
and generations, and the actors.binds table the bind site reads. The C's
model bind was read from the lifted code and never run in the game.

Fixed on the way: a bind whose guest cells were half written called the
game anyway; it now ends Refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_high_fps.c and its oot_sites.c callbacks: the sound job at 60 Hz,
the music's time and flags, the physics solver's steps, the horse's jump,
the floor carry, the drive target, the cloth's gate and time, the song
cues, the steering rates and the jump's takeoff, each rule a pure function
with its tests. The time slot and the cloth's clock are named locations.

Fixed on the way: the time slot, the drive controller and target and the
body's position are read bounded; an unreadable one gives the game's own
value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_barrier.c: the job threads wait for their work on the host's
wait-on-address, the protocol over traits and tested (a wake before the
arm, between the look and the wait, a stray wake, a timeout).
host/oot_heap_retry.c: the OptimizeChangeBank thread's allocations tried
again in the full heap's parents. With their engine callbacks.

Fixed on the way: an unreadable barrier word falls back to the game's own
sleep instead of faulting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_tex_compact.c, oot_ocb_hold.c (its switch now the setting
ocb_hold::set_hold_ms, 2000 ms by default as the C's) and
oot_damaged_files.c, with their engine callbacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_state_tap.c: the control bridge's samples, watches and flag
changes scan, its JSON lines kept byte for byte (tested), and the bridge
over it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_menu.c: pointing and clicking in the game's own menus, with the
menu.focus and menu.update callbacks; the input movie's menu choices go
through the host's movie.

Fixed on the way: an item key set by the mouse is written through the
bounded write, which marks its pages for the renderer's watch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
engine::install installs every HOS_SITE_ENGINE line of game/sites.def
that belongs to the core (host/oot_sites.c): the features' callbacks from
their modules, Voice language's outcome site over its knob, the host's own
features on sites (the mouse look, the button prompts, the camera
centering, the upscalers' jitter) read here and handed over through
host-sys, and the host's C callbacks for the zstd decodes, the scene
format and dynamic resolution. A test checks that every outcome site has
its engine callback and none is a system mod's. The bridge and travel
agree on the game's situation and Link's progress.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The rewrite drops the environment switches that only kept a settled fix's
C-era A/B or an experiment: HOS_FPS_CLOTH, HOS_FPS_TAKEOFF, HOS_FPS_MOVIE,
HOS_FRAME_CARRY and HOS_REALTIME_WINDOW (each now its shipped default),
HOS_OOT_TELEPORT_EVENT and HOS_OOT_TELEPORT_STARTER (the teleport's event
and starter fixed), HOS_VOICE_OPTION_FOLLOW (the Voice language mod's knob
replaces it), HOS_TEXT_SIZE and HOS_SHADOW_STABLE (the mods' settings).
travel also hands Link's progress to the player service as it takes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
bridge::sample_ask, sample_cancel and watch reach state_tap::ask, cancel
and watch, the bridge's checked Watch handed over as the tap's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game's state reads whether a movie plays from video's own record of
the movie players' updates (a quarter second, as nn_vi.c's
MOVIE_STALE_NS), not a host call; travel takes its guest strings from the
same system-region allocator as spawn, attach and texts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The Atmosphere cheat file read into its cheats (names, master cheats, words) and
each cheat's switch key, the C's "cheat_" and FNV-1a 32 of "<mod>/<name>"
with "#2", "#3" for repeats, hashed over the name's own bytes. A word is now
exactly eight hex digits: the C's strtoul also took 0x123456, +1234567 and
-1234567.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Opcodes 0 to A and C0 to C3 decoded as dmnt decodes them (C4, B, D, E and the
F.. extensions not supported), and run over a Memory trait (reads and writes of
the game's mapped ranges, the regions' bases, main's code) with the buttons
held. Registers clear per run, the static registers stay; a run stops after
1 << 20 opcodes.

Fixed on the way:
- regions 2 and 3 (alias, ASLR) were base 0 plus the offset, so a cheat of
  theirs read and wrote whatever guest address its offset happened to be;
  they now reach nothing.
- a write starting before main's code but running into it was let through
  (only its first byte was checked).
- opcodes 1 and 9 compared or computed with the whole value word at widths 1
  and 2; dmnt cuts it to the width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Each mod's cheats/<build id>.txt (any case) found through a CheatSource, its
cheats classified (heading, data, master, not supported with the reason), the
switches read from and kept in a SwitchStore, and every cheat that is on run
at each presented frame from the 60th. Errors are a thiserror enum with stable
codes; the load's log lines are the caller's to write. A file that cannot be
read or is over 4 MiB is now reported: the C passed over it silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Heart protection, No-clip flight, Movement speed and Free camera as
api::settings::SettingDecl for the mod's manifest: the menu's labels and help,
the keys its ini_key makes of their labels today, Store::Options, shown while
debug_tools is on, and HOS_OPT_CHEAT_* 32, 33, 36 and 35 as legacy_id. The
cheat action (34), a one-shot command and no row, is declared apart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The manifest, the permissions it needs (memory.read, memory.write, input.read,
and a read of other mods' cheats folders that no permission gives yet), what it
needs of the memory, input and storage services behind its traits, and its
start, frame and stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The high-fps A/Bs (HOS_FPS_CLOTH, HOS_FPS_TAKEOFF, HOS_FPS_MOVIE, HOS_FRAME_CARRY), HOS_REALTIME_WINDOW, the
teleport's experiment overrides, HOS_OCB_HOLD_MS, and the switches the system mods' settings replace
(HOS_VOICE_OPTION_FOLLOW, HOS_TEXT_SIZE, HOS_SHADOW_STABLE): the Rust game side reads none of them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
hos_rules_*, hos_rewards_*, hos_actor_{writes,binds,lights} and hos_query_answer: each casts the table the site
loaded back to oot's and calls its safe function; a null table leaves the game's value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
CallOpts (sp, x8, LR) with GuestCtx::call_with and call_own_thread_with; GuestCtx::run, the lifted call a replace
site stands in for, over a new host/game/game.c game_run; vreg/set_vreg, z(); own_thread_sp. The stand-in host runs
a fake function on a context and gives a stack pointer of the own thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host-sys fpe::{fma32, div32} over builder/rt's recomp_fpe_fma32/div32 (the stand-in host: the host's own float ops);
GuestCtx::fpe_fma32/fpe_div32 take and give a float's bits as u32. oot's steer rate passed them as u64: now u32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GuestPtr<u8|u16|u32|u64>::{load_atomic, store_atomic, compare_exchange, fetch_or}: checked as read and write are,
sequentially consistent, a write's pages marked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A weak stand-in in host/game/game.c answers none until the lift writes the table; the stand-in host's are set by
the test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
features::{mouse_camera, prompts_text_draw, prompts_text_layout, prompts_glyph, jitter_clip} over mouse_native.c,
prompts.c and rx_backend.c; sites::{zstd_stream, zstd_frames, scene_format, dynres_*, fixed_scale_*} as function
pointers for Handler::C (hos_zstd.c's decodes, oot_sites.c's renderer callbacks); no-op callbacks under fake.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mem::sys_alloc (hos_sys_alloc), romfs::{head, read_zs} (hos_romfs_head, zs.c's hos_zs_read_romfs),
files::{romfs_rel, resolve_read} (nn_fs.c), info::main_image (the generated image.c's hos_main_*), each with the
stand-in host's. On the way: romfs::stat answered a folder as a file of size 0, and romfs::list took an empty
folder for none and a missing one for an empty one (hos_romfs_stat gives 2 for a folder, hos_romfs_list -1 for none).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
input::{flight_axes, free_camera_axes, move_stick_held, stick, drag, clear_toggles} over nn_hid.c;
movie::{active, playing, action, action_taken, link, clock, menu, menu_take, menu_done, MenuChoice} over
input_movie.c; mouse::{game_menu, game_menu_gone, game_pointer, wheel_take, left_held} over display.c. Two small C
stand-ins declared in hos.h where the host had no function: hos_input_movie_clock (input_movie.c's static
movie_clock, -1 with no recording) and hos_mouse_left_held (oot_menu.c's own GetAsyncKeyState test). The stand-in
host keeps each as a test sets it and records what the code gave.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
sync::{available, wait_on, wake_all} and sched::{vcore_away, vcore_back, chain, note_slept, Chain};
paths::ab_value (hos_ab_side_now, hos_ab_value_at) and control::on (hos_control_on), the host's flags read as
atomics. C stand-ins in hos_thread.c, declared in hos.h, where the host had none: hos_wait_bound, hos_wait_on,
hos_wake_all (oot_barrier.c's WaitOnAddress binding, for any caller) and hos_note_slept (the thread-local
Breakdown counter, which Rust cannot reach).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A second context of a runtime (Context::new_realm), import() let through to
the loader, Hooks::normalize_with (attributes), ModuleKind::Own, the tools'
intrinsic (performance), resolve_module, set_import_meta and view_bytes_of. A
mod's runtime calls none of them: its behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
script::modtool runs an SDK's lib/game-cli.js main(argv) in QuickJS-ng: a
loader for files (TypeScript compiled as it loads), node:* (shim.js, the C's
subset plus structuredClone, URL and node:module's SourceMap) and longshot:*;
longshot:native (files, the process, processes, the bridge's socket, deflate,
CRC-32, SHA-256) and longshot:host (the game's parts through ToolHost, and
realms: contexts of the runtime whose modules a linker names, for the fake
game's node:vm). Errors are Node's, a time limit is node:vm's, and
process.exit stops the interpreter instead of the process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game.h's game_mod_tool(argc, argv) takes the whole command line: --help and
--version [--json] answered here, mod <command> run by script::modtool with the
game's parts (GameParts: the version, mod-format, the manifest reader,
content's BYML, SARC and MSBT readers, the BARS asset names ported from
host/audio_source.h, and the host's zstd decoder); -1 for any other line.
game_mod_format stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Both mains (Windows' and Linux') call game.h's game_mod_tool before anything
of the game starts, and return its exit code when the command line is the
tools'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The fake game's node:vm is lib/vm.js: Node's own in Node, and under the game
host-game.js's subset over the tool's realms (createContext, Script,
SourceTextModule, SyntheticModule, runInContext, runInThisContext), which the
link check and runScript use too. node:assert/strict is lib/assert.js, the same
on both hosts. The entry's exports are taken once its evaluation began (both
hosts give a namespace then); the test runner registers Node's TypeScript hooks
in Node alone (the game's loader compiles a test itself). longshot mod test
with no --game runs the fake game on either host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
bin/longshot-mod.js hands test (against the fake game) to the game the mod
belongs to when its tools run the fake game (they have lib/vm.js), else runs
it in Node as before; a checkout is now known by game/crates/script's modtool.
tools.md: test is the game's own, with lib/assert.js; Node keeps shaders and
sites port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The generated <Namespace>Api traits take &self, so the journal, permissions, claims, storage, settings and the
mods' manifests move into RefCells; the loader borrows them. A live effect's undo is given &Services, so a service can
run it from its own release as well as from a mod's stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
services.c's has() and version, and longshot/log (a line each call, controls and direction marks shown as spaces,
100 lines a second a mod, the last 200 kept for the inspector), over host-sys. The feature list of every build
(services.c, services_game.c, services_input.c) by schema name, over what oot finds in the build. The Store,
storage.save, storage.save.flags, settings and permissions traits wired to the first pass's services. A slot table
for the objects mods hold by handle (owner and generation, so a reused or another mod's handle is stale).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
services_game.c, game_events.c and text_shown.c over oot: the state and Link read once a call, the frame they
were read in; game.flags read by the game's own hash. The game's moments (map loads, save requests, watched flags,
the pause) watched only while a running mod with state.read listens, polled once a frame and fired in order; the
textShown filter over content's tagged text, a changed text handed back to the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
writes.c: game.flags.set and player.set checked in the C's order (deny list, play, the flag, its kind, its range
read now), queued and made after the frame's update listeners, each a write in the undo journal; Link's life held to
a write for four frames. The deny list and ranges are game.flags.toml's, as tables (the bindings do not carry them).
The journal's game half (UndoGame) over oot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
timers.c: time.after, every and gameStarted, and game.after in game time, called in load order at the frame's
timers point through the script host's kept callbacks. dev.c: dev.enabled and dev.keep (the init's value kept for
the next instance of the mod).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
camera.c and input.c over oot's camera, pad and pause: camera.state and the override under the claim camera,
game.pause counted over every mod's pauses, the HUD hidden while any hide is held, the projection of a world point
through the frame's view; input's actions, pad state, presses, rumble, the pointer's capture and the pad filter.
Each override, pause, hide, action and capture is a live effect in the journal: a stopped mod's are taken back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
items.c over oot's item service: items.checked and items.granted polled while a mod holds items.read or
items.grant; grants queued in longshot_mod_items.txt (queued, given, saved), one given a frame, a save loaded puts the
given ones back; held and remove. Each give and take is a write in the undo journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
rules.c: every running mod's rules made into oot's tables at the rules point, in load order then the order added,
only for a kind that changed; rewards and prices under their claims, taken with a mod's first and given back with its
last; the host's map published for rules that name one. One handle type for every kind (a slot table), each rule a
live effect in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
actors.c, attach.c and spawn.c over oot: the list watched while a mod needs it, its events and hits fired in the
schema's order, list() answered once a frame per query (result_key), writes and lights handed to the game after
update, bones bound and unbound, the mods' answers to behaviour queries published per query, spawns followed to their
key and despawns' respawns journaled as placement writes. Attachments, answer hooks and spawned actors are live
effects in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
world.c, travel.c and worldstate.c over oot's rays and travel queue: rays settled once cast or given up after 4
frames, travel and setAge settled by ticket, the world's states read and set through the game's Bool setter (each a
journaled flag write).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What only longshot-game can give the services (the memory map, the files the game is served, the post-process
passes' and the world layer's sinks, the audio output and decoder): traits here, set once at start; the services run
without them, a part missing reading as absent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
memory.c: ranges checked against the host's map (one part, never code or read-only data for a write), reads at the
call, writes queued and made after update, each journaled with the bytes it replaced; immediate in-order reads and
writes for system mods. romfs.read and size over the files the game is served (the host's index when no layer map is
given).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hooks.c: mod_sites.txt read and its slots defined and chained, listen, sites and setValue; every visit recorded
on its thread and told at the next frame's hooks point. Unlike the C, a serial site's listener no longer runs inside
the game's code on the main thread: no script runs off the acquire phase (DESIGN, Threads). A row hooking one of the
game's own sites by name is listed but not hooked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gfx.c and gfx_world.c: an effect's .glsl and its .glsl.spv read from the mod's folder, checked by the renderer's
template through PostSink and held to the source it was compiled from, its params set by name; the CRT and
colour-vision system mods' passes beside them; every pass published whole when one changed, by point, load order and
the order made. The world layer's shapes checked and capped, followed actors placed each frame, published through
WorldSink. Each a live effect in the journal. PostSink and WorldSink are implemented by longshot-game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
files.c: paths kept inside the mod's folder (no link followed, the author's dot folders and node_modules unread),
text, bytes and json read on a reader thread of their own and settled there, the sync reads at the call, list, exists
and size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content.c's declarations into content's plan for the running content module, every mod's kept for the session so
its own names resolve (items, actors, spawns, answers); content.read's calls checked and read on a reader thread
through the host's ContentReader (the layers' files and their zstd are the host's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
audio.c, audio_mix.c and audio_groups.c, ported from untested C: sounds of the mod's folder decoded on a thread
of their own (WAV here, Ogg Vorbis through the host's AudioDecode), voices with volume, pan, pitch, loop, a low pass
and a send to the mod's reverb, placed voices heard from the camera each frame, the bus's limiter, the game's groups'
gains and ducks under the claim audio.groups. The host's mixer thread runs Mixer::mix and groups_frame. Streaming is
not ported: a streamed sound is decoded whole. Sounds and ducks are live effects in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Services::frame(main, phase, frame, dt, scripts) steps every service once a phase in the events' order (frame,
storage.save.loaded, update, the items' and actors', settings and permissions changed, the actions', the game's
moments), runs the filters at their points, the journal's undos, and the frame's end (rules' tables, the world's
answers, placed sounds, passes and the world layer). The storage's own step is now save_frame. ScriptHost gains
fire_handle, filter, filter_subscribed, subscriptions, call_kept, callback_live, release_callback and deliver, each
with a default that does nothing so the script crate builds until it overrides them. Services implements ApiServices:
every accessor is the services themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
For the cheats mod and the post-process system mods, each refused to any mod that is not a system mod: memory
written and read at once (journaled), the main module's and heap's bases and the code's end, the pad as raw
HidNpadButton bits, the build id, whether mods were on at the start (not Safe start), the other mods' cheats/ files
listed, and post-process passes of their own. The loader tells the services the mods' folder and Safe start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Generated pages (permissions.md, the reference) are made again by cargo run -p schema-gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The text.letterStep site's handler, the text_speed and text_size settings
(same keys and HOS_OPT numbers), over oot::sysmods::text. Replaces
host/oot_text_step.c, host/oot_text_size.c and nn_vi.c's text scale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The camera.lens site's handler and the field_of_view setting (same key,
HOS_OPT_FOV's number), over oot::sysmods::fov. Replaces host/oot_fov.c and
oot_sites.c's hos_site_camera_lens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The player.lifeHit and player.lifeWrite sites' handlers and the
damage_taken setting (same key, HOS_OPT_DAMAGE_TAKEN's number), over
oot::sysmods::damage with the Debug tab's heart protection. Replaces
host/oot_damage.c and oot_sites.c's hos_site_life_hit/hos_site_life_write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_SHADOW_STABLE's three choices become the setting shadow_steady_fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The services are `&self` throughout (each keeps its state in a cell), so the
engine lends them as a shared borrow (`LentRef`) in place of the
once-at-a-time `LentMut`. A callback a service calls now (`call_now`) may
call the API again: the refusal "the API cannot be called from a callback the
API is calling now" is gone, as the adapter already puts back what the outer
call holds (`CallFrame`) and no service holds a borrow across a call back
into a script.

`NativeSpec::call` and `HostHooks` take the concrete `&Services` (lent
beside the thunks' `dyn ApiServices`, on the main thread only). The hooks'
defaults ask the services themselves (`ServiceHooks`, was `NoHooks`): a
filter's claim through `Services::claims`, `game.flagChanged`'s refusal
through `Services::flag_watch_refused` with every mod's live subscription to
it (the runtimes of a thread are kept weakly in `Shared` for that).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`fire_handle`, `filter`, `filter_subscribed`, `subscriptions`, `call_kept`,
`callback_live`, `release_callback` and `deliver` are the trait's now (they were
inherent methods the services never reached, or missing): handle events,
filters, timers, hooks' listeners, answer hooks and the game's watches reach
the scripts.

`call_kept` gives back what the callback returned (`undefined` as null, so a
timer that returns nothing keeps running; a result that is no value as null,
said in the log), `None` when it is gone, threw or ran out of time.
`subscriptions` lists each running mod's live subscriptions to an event with
their filters, in load order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`script::NATIVES`, the game's table: the together source's `running`,
`claimant` and `claims`, and the UI's `project` (state.read) and
`hideGameHud` (camera.write, its undo `showGameHud`), over
`api::services::Services`. The engine defines `self`, `checkPermission`,
`caller` and `callerHas` (no call between mods is made in this build, so none
has a caller) and the UI's `actorRef`.

An undo now hands the service's result back unchanged, not made the script's
and read back. The members without a service side yet are listed in the
module's documentation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`api::bindings::MODULES` carries each JavaScript module's source and path;
the adapter kept only whether it had one and embedded the three sources a
second time with include_str!. The table is the one source now (no second
copy in the binary, no list of sources by specifier to keep in step with the
schema), and a source's group is its folder (`game/modapi/ui/runtime.js`: ui).

The rest of script::bind's reading of the tables matches what
game/crates/schema/src/emit/rust.rs writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The machine's Env wired to the game: the row (skip_title_screen, legacy id 44),
the Insert menu's hold, Link in play, the loading flag, the newest save (oot's
finder: saves.rs was a copy of it), the build's two sites, the frame and A
pressed through oot::pad. Its handlers on menu.buttonWait and
menu.buttonWaitNoDecideAnim are journaled and taken off when the skip is over.
The crate is sysmod-skip-title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_OPT_CHEAT_ACTION (34) carried one action at a time and was set back to 0
once taken: no setting. It is the command cheat_action, its old number kept
for input movies (command::by_legacy_id), run from the Debug tab, the bridge's
!cheat and a movie's replay while the mod runs with the Debug tools on.

The Debug tools row (debug_tools, saved by the menu) is declared by the mod
its cheat rows hang on. The cheat rows were never saved by the menu (no value
in its table), so they hold for the run only: settings::PER_RUN, put back to
their defaults at each start. The crate is sysmod-cheats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Memory, Buttons, CheatSource and SwitchStore over memory_read_now and
memory_write_now, memory_bases, pad_hid (0 while the Insert menu is open, as
the C), cheat_files, build_id, mods_on_at_start and the mod's global storage
(the switches move out of mods.json's "cheats"). The rows set oot::debug's
knobs while the Debug tools (or HOS_OOT_CHEATS) are on; heart protection
follows HOS_OOT_PROTECT_HEARTS until its row is touched, as the C's -1 did.
The Mods tab's list and switches go through tab (for game.h's cheat_info and
cheat_set). The journal puts the knobs back and empties the list at the stop;
the cheats' memory writes stay, as the C left them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The crate's copy of the table goes: name() is oot::sysmods::area_names's. The
C showed the names only in the Discord status, which is the discord script mod
now and names places as the player's game does; a native mod cannot export to
a script yet, so the mod declares itself and changes nothing until it can.
The crate is sysmod-area-names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/oot_heart_containers.c's taken and want: the count of the
boss containers Link took, given to the game side through
oot::travel::set_heart_containers_source, for player.state()'s heartPieces
and the Discord status's pieces of heart. The ids are read once, on a thread
of their own, at the first ask; off, the count (and so the pieces) is not
known, the game as shipped. The crate is sysmod-heart-containers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A cheat rewriting a value the game keeps changing made one entry a frame, filling the journal's 4096 in about
70 s and pushing out other mods' changes. The entry keeps its first "before" and the latest bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mods' cameras' field of view and the Debug tab's heart protection no longer depend on the Field of view and
Damage taken mods running: the core serves them, and Field of view's handler takes camera.lens's place while it
runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tab's cheat rows were never saved by the menu; as Store::Options they were written to the options file
and put back at each start. Store::Run keeps them in memory, the default at every start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
ModApi::site_handler puts a handler on a site the mod's manifest lists (hooks.unsafe), journaled so the mod's stop
takes it off; ModApi::log writes under the mod's id; ModSettings::get_of and published_of read another system mod's
setting, and a row's shown_if may name one (system/<name>:<key>).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Text, Field of view, Damage taken, Skip title and Shadows put their handlers on through ModApi::site_handler, which
checks the manifest's sites, in place of each calling the chain itself; Shadows logs its fit through ModApi::log;
Damage taken is Normal, and its row hidden, while the Cheats mod's Debug tools are off, as the C had it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
PaneSizes::restore writes the game's value back into every field still holding the scaled one; the mod's journal
runs it after its handler is off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game gives api's services what only it can (Services::set_hosts): the game's memory over
hos_mem_region and the guest window, the files the game is served (a mod's layer, else the RomFS
folder), the post-process passes for the renderer (with spirv, block, enabled, revision, owner, and the
renderer's reports through game_post_report), the world layer as a list (game_world_draws), the mods'
audio mix pulled by the host's mixer (game_audio_mix, called in nn_audio.c after the game's frame),
content.read's reader (content_read.c's reads over content::read and the RomFS layers) and the loader's
packages over content::archive. fx_spirv_check and fx_spirv_source are ported (spirv.rs) for the
PostSink's check. host/nn_applet.c exports hos_game_language for the reader's default language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_init installs oot's engine callbacks and adds the runtime's step to the acquire phase (order 50);
the runtime (Services with its hosts, the loader over content and the options file, QuickJsHost) is made
at its first run, on the game's main thread, and the loader finds the mods there. Each frame: the loader's
frame, the workers, Services::frame, the control bridge's jobs. NATIVE_MODS is the compile-time list of
native system mods, empty with its spot marked. --mod-dev is read in game_mod_tool; game_shutdown writes
the stores (hos_close_finish). game.h follows what is exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The travel bridge and the state tap's exports keep their C names (hos_oot_destination, _teleport_ask,
_teleport_result, _teleport_cancel, _age_ask, _state, _current_map, _stats, _player_seen(_ns), _loading,
_flight_shortcut_ready, _sample_ask, _sample_cancel, _sample, _watch, _poll) over oot's travel, bridge,
session and debug, with game.h's game_control_* beside them. game_control_mods ports control_mods.c as one
JSON request and answer: the list, the lines, and mod_restart/mod_test/mod_eval jobs (script::eval, the live
test runner) with eval's gates. game_input_line takes "!cheat <n>" (nn_hid.c calls it in place of
hos_oot_live_action); game_movie_age, game_movie_setting (by legacy id), game_camera_scale, game_presented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_menu_* lay the settings service's rows (api::settings::MenuHandle) out as GameMenuRow, made again when
its snapshot changes, the list before kept; a set goes through the handle to the next acquire phase.
The options file's lines go through game_options_load (vk_menu.cpp's reader hands every line), and the lines
the game side read or set are written back by the renderer's save (game_options_key/_value), which leaves
them out of the file's lines it keeps (game_options_has), so no key is written twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
nn_fs.c's OpenFile keeps its call: the export takes oot::fixes::damaged_files::stand_in's answer and writes
the stand-in's host path back when it fits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_cheat_action, !cheat <n> and a movie's option 34 run the mod's command (refused unless it runs with the Debug
tools on); game_cheat_count, game_cheat_info and game_cheat_set replace host/cheats.c's hos_cheat_info and
hos_cheat_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/oot_sprint.c's hos_sprint_input and hos_sprint_step. A toggled sprint that a reset ends while
the game's menu is up is now logged as every other end is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/nn_hid.c's walk_held, walk_percent and move_keys_stick: the keyboard stays the host's, which
hands this what it read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The handlers on sprint.link and sprint.stance over oot::sysmods::sprint, the input and Walk key entry points
the host's controller reads reach through game.h, and system/sprint-walk: its manifest, its rows published to
the threads that read them, everything taken down by its journal when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows of gpu/vk/menu/widescreen.cpp with their keys, and the Custom placement's transform of a HUD group
(host/hos_wide_ui.c's place_axis and hud_transform).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The widescreen part of host/hos_main.c's boot over oot's size math, the keep mask of host/rx_backend.c's
host_wide_menus, and the picture's values the sites read on any thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_wide_ui.c's layout lists, its RULES and classify, over names given as text or as the game's strings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/hos_wide_ui.c (ozwaldorf's pane planner, NotRexed/Hookshot#2843): the node table, the shape's
numbers of each present, the plan across and up and down, the custom groups, and the game threads' side that
notes each pane as its transform is made and moves it by the plan. The panes' memory goes through a trait,
the game's over oot::sysmods::widescreen, so the planner is tested on fake panes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Its lists' widths restored and every noted pane's transform marked to be made again: the C never stopped, so
this is new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/rx_backend.c's host_wide_menus around the planner's tick, and host/hos_wide_ui.c's hos_gameplay_hud_screen
split in a begin and an end the host's wrap calls around the game's update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_wide_ui.c's hos_wide_ui_bg and hos_wide_ui_bg_draw over oot's picture record, pack and draw. No lock
is held across a call into the game, and a drawer whose pieces are being drawn is left alone at its own
draw's site, in place of the C's per-thread flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Every wide.* and ui.* site of game/sites.def handled over oot::sysmods::widescreen, and system/widescreen: its
manifest, its rows published to the presenting thread, Reset HUD placement, and everything taken down by its
journal when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Each function is declared once, with one signature, in #2411's sections (the
start, the frame, input, the control bridge, the renderer's table, files,
audio, the Insert menu's rows) plus the game side's own (settings, the options
file's lines, post-process passes, the world layer). Where the Rust replaces a
#2411 C function it takes #2411's name and signature: the control bridge's
game_state, game_current_map, game_destination, game_teleport_*, game_age_ask,
game_sample_*, game_watch, game_poll; game_flight_shortcut_ready;
game_live_action; hos_sprint_input; hos_wide_ui_tick; hos_gameplay_hud_toggle;
hos_cheat_info/hos_cheat_set; hos_perf_info/hos_perf_tracking;
hos_mods_romfs/hos_mods_file/hos_mods_dir_extras; hos_stand_in_damaged;
hos_game_layout(_log). Ours that duplicated those (game_control_*,
game_cheat_count/_info/_set with GameCheatRow, game_romfs_resolve,
game_romfs_opened, game_input_line, the second game_phase_run) are gone; the
(C) mark is on what is still #2411's C (the Mods page's list in mods.c, the
GameMenuRow data in menu/rows.c).

Kept ours on purpose:
- game_init returns int (1 made, 0 made before): the Rust start is safe to call
  twice and says so, where #2411's void one only read a switch
  (HOS_OOT_PROTECT_HEARTS, now the cheats system mod's). It is called once,
  after the RomFS index (hos_mods_init) and before the guest's first
  instruction: the mod runtime's layers and loader need the index, so the early
  call before the renderer is gone.
- The game's settings come from the system mods' declarations through the
  settings service's MenuHandle, not from static rows: a setting is its mod's,
  turned off with it and laid out by the Game settings mod. Both stay, so ours
  is renamed: GameSettingRow, GAME_SETTING_*, game_settings_generation,
  game_setting_count/_row/_get/_set/_text/_hint. #2411's GameMenuRow and
  game_menu_rows are unchanged, so gpu/vk/menu/game_rows.cpp still builds.

Call sites the header changes: hos_main.c calls game_init and game_mod_tool
through game.h; the Discord status (now the discord script system mod), the C
cheats' start and frame (now the cheats system mod) and Skip title's per-poll
presses (now the skip-title mod through the input service) are no longer
called from hos_main.c, nn_vi.c and nn_hid.c; nn_hid.c's !cheat writes
game_live_action again, as #2411 has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game exports what #2411's host and renderer already call, by #2411's
names and signatures, so the C it replaces can go without touching a caller:

- the control bridge: hos_oot_* and the game_control_* copies become
  game_current_map, game_state, game_destination, game_teleport_ask,
  game_teleport_result, game_teleport_cancel, game_age_ask, game_sample_ask,
  game_sample_cancel, game_sample, game_watch (HosControlGameWatch), game_poll;
  game_control_mods stays (the bridge's mod commands are the game side's own).
  hos_oot_stats, hos_oot_player_seen(_ns), hos_oot_loading and
  hos_oot_flight_shortcut_ready are no longer exported: their only callers were
  #2411's discord_rpc.c and oot_autoload.c, which system mods replace, and the
  shortcut is game_flight_shortcut_ready.
- the live input's !cheat: game_live_action, an exported int (AtomicI32) that
  nn_hid.c stores into as #2411 does; the acquire phase takes it and runs it
  through the Cheats mod's command. game_input_line is gone.
- the Mods tab's cheats: hos_cheat_info (texts kept for the run, as cheats.c's
  were) and hos_cheat_set, in place of game_cheat_count/_info/_set and
  GameCheatRow. game_cheat_action stays.
- the performance summary: hos_perf_info and hos_perf_tracking (new module
  perf), over oot::travel's place, with the host's hos_movie_stats and version.
- the RomFS: hos_mods_romfs, hos_mods_file, hos_mods_dir_extras(rel, all, fn,
  arg) in place of hos_romfs_resolve/_file/_dir_extras and the game_romfs_*
  copies; all 0 leaves out what the game's own folder lists, in any case (as
  hos_romfs_case found it), from the host's RomFS listing. romfs_opened is not
  exported (its C caller, romfs_layers.c's reload, is the Rust's now).
- the game's settings: GameSettingRow and game_settings_generation,
  game_setting_count/_row/_get/_set/_text/_hint.

vk_menu.cpp takes game_options_* from game.h, which it includes, instead of
declaring them again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lines the host's reads, the present and the site handlers keep (log::say,
at most 64, from any thread) are written at the mod's frame, and at its stop,
through ModApi::log, under the mod's id, as shadows does. Nothing outside the
mods takes their queues any more (log::take was waiting for longshot-game to
drain it). Reset HUD placement's failure, which runs with the API at hand,
goes to ModApi::log at once, as a warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The two system mods join the workspace (members, sysmod-sprint-walk and
sysmod-widescreen), longshot-game's dependencies and NATIVE_MODS, and
longshot-game exports what the host calls of them (new module sysmods):

- hos_sprint_input, #2411's signature (blocked: SPRINT_BLOCKED, _AWAY,
  _PAUSE), over sysmod_sprint_walk::input;
- game_walk_read(down, readable) and game_walk_stick(x, y, walking, out[2]),
  new in game.h: nn_hid.c's walk_held and move_keys_stick, with the Walk mode
  and speed the mod's settings. nn_hid.c is not switched to them here: its
  statics would be left unused, and deleting them is the lead's step;
- hos_wide_ui_tick, #2411's signature: the host's hos_wide_keep_mask (set by
  rx_backend.c's host_wide_menus just before) is the renderer's mask, forced
  when HOS_WIDE_KEEP is set (read once, as strtoul did);
- hos_gameplay_hud_toggle, #2411's;
- hos_gameplay_hud_screen, the builder's wrap of the HUD screens' update
  (not game.h: the lifted code calls it): hud_update_begin, the update,
  hud_update_end;
- game_wide_picture(want, output_w, output_h, out), new in game.h: the boot
  picture, Picture::for_screen at HOS_WIDE_MAX_PX, given to the mod's sites
  and logged. hos_main.c's start calls it in place of its own size math and
  keeps its hos_wide_* words for nn_applet.c and rx_backend.c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_guest_bytes is hos_guest_range out of line, for the game's Rust (guest::GuestPtr) to copy in and out with
volatile accesses; hos_free frees what hos_romfs_read and hos_zs_read_romfs allocated, by the C library that
allocated it. hos_guest_mark marked only the pages of a range's first and last byte (A64_MARK): a write of the
Rust's longer than a page left the pages between unmarked, so the renderer's captures missed them. It marks
every page.

hos_guest_wait32 and hos_guest_wake32 move beside hos_wait_on in hos_thread.c, on the same WaitOnAddress bound
from kernelbase.dll: game_guest.c called WaitOnAddress and WakeByAddress* directly, which on Windows needs
Synchronization.lib, which the game does not link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_site_callee is a C thread-local the lifted code's replace-site hooks store, which Rust cannot name: the site
chains (game/crates/game-sites) keep the site's own and put it back before each handler, through
hos_site_callee_get and hos_site_callee_set (host/game_call.c). The weak hos_locations_resolved's comment named
game.c, which has none: it is host/game_call.c's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What the mods' time budgets count (hos_thread_cpu_ns: Windows' GetThreadTimes, the thread's CPU clock on Linux)
and what the game side's notes of a slow call name (hos_thread_major_faults: getrusage's on Linux, -1 where they
are not counted), in host/hos_thread.c, for game/crates/host-sys's time module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_game_folder (a new host/game_host.c, for what game_host.h gives out of line) is the game folder in UTF-8,
the executable's or the one above bin/, worked out once with hos_paths.h's hos_game_path_*. The RomFS and user
folders (hos_romfs_dir, hos_user_dir: host/nn_fs.c's, set by hos_main.c at the start) and main's extent
(hos_main_base, hos_main_size, hos_main_code_end: the lift's gen/image.c) are declared in game_host.h, where
game/cheats.c and the game's Rust read them, instead of where each reader used them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_switch is getenv as longshot_env.h's env_on reads a switch (inline there), and hos_write_whole is
hos_atomic_file.h's hos_atomic_write (inline there): the game's Rust reads its switches and writes its stores and
the options' game lines through them, in host/game_host.c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A setting kept in longshot_options.ini that a mod changes, not the menu, reached the file only at the menu's next
write. hos_options_save (host/game_host.c) asks the menu's writer (gpu/vk/vk_menu.cpp save) through
rx_option_set's new HOS_OPT_OPTIONS_SAVE, a number no row has: the file is written again under the menu's lock,
the game side's lines with it (game_options_value).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tools' free camera read its keys with GetAsyncKeyState and tested the window in front and the Insert
menu itself (game/oot_tools.c); the game's Rust (its Debug tools, the mods' keybinds) asks the host instead:
hos_input_taken (the Insert menu open, or another window in front) and hos_key_down by a Windows key code, up
whenever the input is not the game's (host/game_host.c, on host/posix's keyboard on Linux).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_mouse_camera, which game/oot_sites.c declared where it called it, is in game_host.h's input part. The header's
list names what the game's Rust binds besides and where each is; hos.h's host-memory word wait says it is not the
guest word's (hos_guest_wait32).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Every extern declaration of host-sys is now a function or global the host defines: game_host_guest_range is
hos_guest_bytes, game_host_mark hos_guest_mark (in 1 GiB parts: its size is 32 bits), game_host_ctx hos_ctx, the
site callee hos_site_callee_get and _set, the clocks hos_thread_cpu_ns and hos_thread_major_faults, the present
count the host's hos_present_count, the build id hos_main_build_id, the folders hos_game_folder, hos_romfs_dir
and hos_user_dir (mods, cache and system_mods worked out from them, HOS_MODS first), switches hos_switch, the
options' write hos_options_save, files hos_write_whole and hos_free, keys hos_key_down (by a Windows key code: the
keybind names' table moves here from oot::pad, which forwards to it) and hos_input_taken. The guest-word waits
hos_guest_wait32 and hos_guest_wake32 are bound (mem::wait32, mem::wake32). The menus' mouse is Windows only, as
host/display.c is.

What game_host.h has no function for answers as a host without it: the network engine (never available, every
open refused), the mod API's controller watch, presses, rumble and pointer capture (no read, nothing applied).
BC7 blocks have no host encoder in this tree (bc7enc is not in it): image::bc7_block encodes mode 6 in Rust.
hos_wait_on and hos_wake_all stay: they wait on the job barriers' own words in host memory, which
hos_guest_wait32 cannot address. The fake host gives a guest thread a context of its own (set_own_sp), keeps
guest-word wakes, and keys folders by paths::Dir.

longshot-game's host.rs still names game_host_free: ffi keeps it as a deprecated Rust forward to hos_free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tools asked for "Page Up" and "Page Down", which are no keybind's names ("PageUp", "PageDown"):
the host's key table knows neither, so the keys read up and the free camera and the flight could not climb or
sink by the keyboard, as game/oot_tools.c's VK_PRIOR and VK_NEXT did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rebase onto #2411 kept this branch's guest (GuestPtr over Pod, GuestError, GuestCtx with calls) and left
#2411's src/host.rs and src/atomic.rs orphaned. One implementation remains: GuestPtr's atomics, which check the
address as a read does and mark every write, gain #2411's swap, fetch_add, fetch_sub and fetch_and (for u8 to
u64), and a 32-bit word's wait, wake_one and wake_all over hos_guest_wait32 and hos_guest_wake32 (through
host-sys's mem::wait32 and wake32, as every host call goes). host.rs's declarations were host-sys's already
(hos_guest_load and hos_guest_store are not needed: reads and writes copy through hos_guest_bytes), and its
option() is host_sys::options::renderer. #2411's API migrates so: Scalar is Pod, GuestCtx::read/write/read_ptr
are GuestPtr::read/write/read_non_null, GuestCtx::regs is gone (x, vreg_* and the rest remain), and
GuestAtomicU32/U64 are GuestPtr<u32>/<u64>'s own methods. Its one caller, oot::fov, is rewritten over
oot::sysmods::fov in its own commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286 made game_call refuse a null context: host code calls the game only with the calling thread's own. The
guest crate's call_own_thread and call_own_thread_with (oot's OwnThread caller: the flags, items, pause,
respawn and verb-name calls from the acquire phase) still passed null, so every one was refused. They pass
hos_ctx's context (host_sys::call::current_ctx), and refuse at once with the new CallError::NotGuestThread
(code 3) on a thread that is no guest thread. game_call.h's comment still said NULL meant the calling thread's
own: it says NULL is refused. The fake host's set_own_sp gives the test thread a context of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Field of view is a system mod (game/mods/fov, over oot::sysmods::fov::lens), but game/oot_sites.c's camera.lens
still calls #2411's hos_oot_fov, whose oot::fov and oot::options the rebase left out of the crate (and over
#2411's own guest API, gone with the merged guest crate). oot::fov is the C site's export again: the row's
percentage from the option the Insert menu row keeps (HOS_OPT_FOV, oot::options::FOV), and the mod's
lens for the rest, so the C site and the mod do one thing. oot::options keeps #2411's id, which the C site and
the parity test read.

tests/test_oot_fov_rust.py builds a library of the oot crate alone (guest, host-sys, game-sites and oot in a
workspace of its own, a staticlib over oot) instead of liblongshot_rs.a, which now holds every game crate and
the mod API, whose host calls a test program cannot give; the program links it with --gc-sections and gives
hos_guest_bytes and hos_guest_mark, which the Rust's reads and writes now go through. The planted changes move
to where the logic is (layout/sysmods.rs, sysmods/fov.rs): the clamp's bound and the event check as before,
and the row's range in place of the 100 % shortcut, which lens's second return at 100 % hides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guest and host-sys crates' parts, Field of view's pattern (the C site's hos_oot_fov over the system mod's
lens, guest memory through GuestPtr), and the stand-ins: host-sys binds game_host.h by its names, what has no
host function answers as a host without it, every host function the Rust needed and where it is, and where
hos_site_callee and oot_sites.c's hos_site_* go next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The scene format for Native HDR, the dynamic resolution's three sites and the
fixed scale's two read and write host/nn_vi.c's variables: they move out of
game/oot_sites.c into host/render_sites.c and are declared in game_host.h,
which host-sys binds them by. The core still installs them as the engine's
callbacks on their sites. test_scene_format, test_dynres_sites and
test_fixed_scale_sites cut the callbacks from their new file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_WIDE_UI, HOS_WIDE_UI_LOG, HOS_HUD_MAX_RATIO and HOS_HUD_FULL_RATIO were read by game/hos_wide_ui.c, which the
widescreen system mod replaces (its HUD layout setting, the limits as constants): GONE, 2026-11-23. HOS_DISCORD and
HOS_DISCORD_APP_ID stay: the Discord system mod's mod.json names them (offSwitch, settingSwitches), so their rows
say that now. A64_CAMERA_DIAGNOSTICS is not an RX_/HOS_/LONGSHOT_ name, so it has no row to mark GONE; its read goes
with game/oot_wide_sites.c. The other dropped switches of the reports were marked GONE already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What the game's C fed the host, or read from it, now goes through game.h's
Rust:

- nn_hid.c: the Walk key and the movement keys' tilt are the sprint-walk
  mod's (game_walk_read, game_walk_stick); walk_held, walk_percent and
  move_keys_stick go. The ocarina's note wait, which oot_sites.c wrote into
  hos_oc_wait, hos_oc_last_kind and hos_oc_beat, is read with game_note_wait,
  game_note_wait_poll (the stale wait and its log line) and game_note_kind.
- nn_vi.c: realtime_step's game part (the limiter, the engine's rate, the
  frame's seconds, the Camera and Game speed rows) is game_presented; the
  text speed's and camera's scales (hos_text_scale, hos_camera_scale) are the
  text mod's and game_camera_scale. The movie pacing reads
  game_movie_seen_ns; hos_movie_frames, the whole-frame counters and the
  loops' step (frame_whole.h, loop_step.h, carry_fractions) were only
  reached from oot_sites.c and are oot::video's now.
- hos_thread.c: GetSystemTick tells the game side who read the clock
  (game_clock_read), which finds its graphics module there; hos_gfx_module
  goes.
- input_movie.c: a replay sets the settings it recorded through
  game_movie_setting instead of answering rx_option (hos_input_movie_option
  goes), and a recording reads them with game_movie_setting_value. The
  file's option lines keep their ids.

game.h gains game_note_wait, game_note_wait_poll, game_note_kind,
game_clock_read, game_movie_seen_ns and game_movie_setting_value
(longshot-game's input.rs). game_host.h drops what only the game's C read
(hos_oc_beat, hos_text_scale, hos_frame_whole*, hos_loop_*,
hos_movie_frames).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by the Rust game/DESIGN.md's map names:

- oot_barrier.c/h: oot::fixes::barrier
- oot_heap_retry.c: oot::fixes::heap_retry
- oot_high_fps.c/h: oot::fixes::high_fps
- oot_ocb_hold.c/h: oot::fixes::ocb_hold
- oot_tex_compact.c/h: oot::fixes::tex_compact
- oot_damaged_files.c: oot::fixes::damaged_files (hos_stand_in_damaged,
  longshot-game's romfs.rs)
- oot_menu.c: oot::menus (the menus' mouse)
- oot_state_tap.c: oot::state_tap (game_sample_*, game_watch, game_poll,
  longshot-game's control.rs)

Their engine callbacks are oot::engine's; the host calls the exports by the
same names, which the C defined too (a clash at link).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by its system mod (game/DESIGN.md's map):

- oot_text_step.c, oot_text_size.c: mods/text
- oot_damage.c: mods/damage
- oot_sprint.c: mods/sprint-walk (hos_sprint_input, game_walk_read,
  game_walk_stick: longshot-game's sysmods.rs)
- oot_autoload.c/h: mods/skip-title (game_autoload_input's work is the mod's
  own frame)
- oot_heart_containers.c/h: mods/heart-containers
- oot_shadow.c, oot_shadow_fit.c: mods/shadows
- oot_voice.c: mods/voice-language, over the core's options.voiceWritten
  callback
- oot_area_names.c/h: mods/area-names
- oot_wide_sites.c, hos_wide_ui.c: mods/widescreen (hos_wide_ui_tick,
  hos_gameplay_hud_toggle, hos_gameplay_hud_screen, game_wide_picture)
- cheats.c: mods/cheats (hos_cheat_info, hos_cheat_set, game_cheat_action:
  longshot-game's cheats.rs)
- discord_activity.c/h, discord_rpc.c: the discord script system mod, which
  already did this over longshot/ipc (its test/make-golden keeps showing how
  golden.json was made from the old C, which it takes from history)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by the Rust game/DESIGN.md's map names:

- oot_tools.c (hos_main.c's game half: the Debug tab's tools, the bridge's
  game commands, the opening's skip, the save trace, Link's pose, game_init),
  oot_teleport_check.h: oot::{travel, session, debug, player} and
  longshot-game's control, input, cheats and perf (game_current_map,
  game_state, game_destination, game_teleport_*, game_age_ask,
  game_flight_shortcut_ready, game_live_action, hos_perf_info,
  hos_perf_tracking, game_init)
- game_layout.c/h: longshot-game::layout (hos_game_layout,
  hos_game_layout_log)
- flags.c/h: oot::flags

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted: game/sites.c and sites.h (the sites' flags and slots, the handler
chains, the data rules' values and tables), game/phases.c (the frame phases)
and game/oot_sites.c (the engine's callbacks). game-sites' build.rs makes
every hos_site_on_*/hos_site_fn_* and hos_table_* the lifted code names from
sites.def, its ffi.rs the hos_site_*/hos_table_*/hos_value_* functions and
game_phase_*; the mod-site pool (hos_modsite_*) is modsite.rs's; each engine
callback is installed at start by oot's engine.rs (the renderer's from
host/render_sites.c, the zstd decodes from host/hos_zstd.c).

hos_site_callee, the thread-local a replace site's hook stores, was defined
by sites.c and read by host/game_call.c's accessors: it is the host's now,
in game_call.c. sites.def stays the list; its HOS_SITE_ENGINE names are the
C's old callback names, labels for the reader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods.c's RomFS index (every mod file indexed at the start), the
resource size table's merge and its fallback, hos_mods_romfs, hos_mods_file
and hos_mods_dir_extras go: longshot-game's romfs.rs exports those names over
content::layers, which serves the mods' files, the size table with the
button prompts' entries, and the prompts' and the texts' own files. Its
cheats' part goes too (hos_mods_count, hos_mods_dir, hos_mod_cheats_dir,
hos_mod_cheat_count, hos_mods_cheat_switch, hos_mods_cheat_set): the cheats
system mod finds the cheat files and keeps its switches in its own storage;
mods.json's "cheats" is kept as the file has it.

What stays is game.h's (C) part: the Mods page's list, its order and
switches in mods.json, the ExeFS patches' state (hos_mods_init,
hos_mod_info, hos_mod_edit, hos_mods_changed). A mod's line on the page no
longer counts its RomFS files nor the files a mod lower takes (the index
that counted them is gone): it says what the mod has.

game/texts.c (the texts' PC wording, hos_texts_romfs) goes: content::texts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
With game/oot_sites.c gone nothing calls hos_oot_fov: the Field of view mod's
handler on camera.lens is the lens's one caller (over
oot::sysmods::fov::lens), and the core's engine callback there serves the
mods' cameras at the game's angle. oot::fov (fov.rs, the crate's one
no_mangle and its #[allow(unsafe_code)]) and oot::options (the option id it
read) go: oot exports nothing and has no unsafe.

fov.rs's tests move to sysmods::fov as tests of lens, with the cases of the
C check they replaced: the percentage and a zoom from its angle, the bounds,
non-lens angles, 100 and unknown percentages untouched, and another view, an
event or any broken link keeping the game's angle.

Deleted: tests/test_oot_fov_rust.py, tests/oot_fov_parity.c and
tests/fixtures/oot_fov.c. They linked an oot-only staticlib and compared the
old C with hos_oot_fov case for case; the export they drove is gone, the C
is no longer the reference (its cases are the Rust tests above), and
retargeting them to sysmods::fov::lens would need a new export from oot,
which exports nothing now. tests/test_oot_fov.py keeps the site's place and
words, and checks the core's and the mod's hold on the site and the
setting's key, range, default and old id (51) instead of cutting the C
callback from oot_sites.c and compiling the fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported, each still checking the host code it was written for:

- test_input_background, input_background_test.c, test_walk_key: nn_hid.c
  hands the Walk key and the movement keys to game.h's game_walk_read and
  game_walk_stick (the sprint-walk mod's, tested by its walk.rs); the
  fixtures give a stand-in that does what the mod does, so the cases keep
  checking the host's key reads, gates and bindings. test_walk_key's wiring
  reads the mod's settings (keys walk_mode and walk_speed, old numbers 49 and
  50, the speed's range and default) and nn_hid.c's calls instead of the
  renderer's rows.
- test_ocarina_notes: the note wait comes from game_note_wait,
  game_note_wait_poll and game_note_kind; a stand-in over the fixture's wait
  and beat keeps the cases (the stale wait itself is oot::video's NotePoll,
  tested by a_wait_nobody_ticks_goes_stale).
- test_hold_toggle: the Linux pause focus hook that drops the latch is
  oot::menus' focus; read from its source.
- test_hle_guest_ranges, test_host_guest_writes: the entries of
  game/oot_tools.c, oot_menu.c and oot_high_fps.c go with those files (the
  Rust reaches guest memory only through guest's checked, marking
  GuestPtr).
- test_no_release_lookup reads longshot-game's lib.rs for oot_tools.c.
- screensaver_test.c: a comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods.c keeps the Mods page alone (the list, its order and switches,
the ExeFS patches' state); its RomFS index, the size table's merge and its
cheats' functions are gone.

- test_mods_list.py: built from mods.c, mods_list.c and options_path.c
  alone (no romfs.c, restbl.c, romfs_index.c, nor the zs, prompts and texts
  stubs mods.c no longer reaches). The "cheat" and "switch" ops go:
  the cheats' switches are the cheats system mod's own storage now
  (game/mods/cheats), and mods.c passes mods.json's "cheats" through as
  the file has it. Each cheats check is now that check: the file's
  "cheats" (a switch, a value that is not one, a key twice, the old
  longshot_mods.txt's cheat line imported) is written back exactly, and a
  start with no change writes nothing. Every check of the list stays.
  New mods_page(), from test_mods_sizes.py: the Mods tab's lines (RomFS
  files, ExeFS patch files built in or waiting against exefs_patches.txt,
  cheats, past the last mod), a move and its move back counting as no
  change, and the order and switches read at the next start.
- test_mods_sizes.py deleted: the rest of it drove the deleted index
  (which mod serves a path, a long path left out, nothing served with no
  mods) and the size table's merge. Serving is content::layers' now, with
  its tests (the_last_layer_wins_and_keeps_the_others,
  a_folder_and_a_file_keep_the_last_alone, made_files_and_served_paths,
  lists_a_folders_extras, an_entry_the_games_folder_lists_in_any_case_is_not_added,
  keys_are_lower_case_with_slashes ...). Not ported, so this coverage is
  lost with the C: the resource size table fitted to mods' grown files
  (each served file's entry raised, the mods' own tables merged in) has
  no Rust counterpart yet (content serves a table whole or with the
  prompts' entries; RESTBL fitting is SARC parts only).
- test_mods_size_table.py: keeps merge_restbl's checks (host/prompts.c,
  which stays); its Linux fixture over game/mods.c and prompts.c (what the
  size table, the font and a mod's file are served as, and the documented
  file-mod example of docs/dev/reference/mods.md) goes with the index it
  drove.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The key that says whether the prebuilt liblongshot_rs.a is a tree's read
longshot-rs/ and game/crates/ only. The native system mods (game/mods/*) are
crates linked into it, api's build makes its tables from game/mods and the
mod API's schema (game/modapi), game-sites' build makes the sites' slots from
game/sites.def and game/sites/sites.toml, and script compiles QuickJS-ng and
includes oxc's usingCtx helper: a change to any of them left the key as it
was, so a developer's tree linked the stale prebuilt library. They are the
key's now (a script mod's node_modules and cargo's target left out). The test
tree no longer names oot's fov.rs, which is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
realtime_step's game part (the engine's limiter, its nominal rate, the frame's
seconds) is game.h's game_presented, oot::video's, and the movie pacing reads
game_movie_seen_ns.

Ported:
- test_frame_rate_cap_30: the movie's last update comes from a stand-in
  game_movie_seen_ns.
- test_pacing_policy: the host's cap, ticker, interval, acquire sleep, overlay
  and swapchain rows stay; a spy checks realtime_step hands the game the cap
  it paces at (the movie boost and its expiry too). The rows' game-step and
  nominal-rate columns go with the code that made them.
- test_video_hold_early: its note names the game side's movie.frameCount.

Deleted:
- test_realtime_rate: realtime_rate is gone; oot::video's
  the_rate_follows_the_clock_and_its_debt checks the quantizer and its debt.
- test_frame_carry_cap60: carry_fractions and the host's whole-frame and loop
  counters are gone; oot::video's fractions_are_carried_by_the_rule_of_the_c,
  a_counters_fractions_are_carried_only_when_asked,
  substeps_are_handed_out_when_carried and
  a_loop_of_one_frame_moves_in_whole_frames_and_draws_its_start cover them.
- test_frame_rate_cap_step: the step above 60 is oot::video's
  (real_time_writes_the_frames_rate_and_a_timed_cap_its_seconds,
  the_limiter_is_raised_for_the_cap_and_put_back_at_60,
  per_frame_at_60_gives_the_game_its_own_step); the frame.seconds rule's
  text is builder/crates/sites' (its MulF32 tests); the cap's selection stays
  checked by test_frame_rate_cap_30 and test_pacing_policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/DESIGN.md's "Where each C file went": every file on the left is
deleted; what is left of the game's C is the Mods page (mods.c, mods_list.c)
and the static menu rows (menu/rows.c). The rows say where hos_site_callee
went (the host), the renderer's six site callbacks (host/render_sites.c),
oot::fov and oot::options (gone with hos_oot_fov), mods.c's parts, and the
host's game parts with the game.h functions that replace them.

game/README.md: what is here now; the Rust's pattern told by the Field of
view mod's handler rather than the C site's hos_oot_fov; the stand-ins for
hos_site_callee and host_sys::sites updated, and two new ones: the two
lists of mods (the Mods page's and the loader's), and the size table's
merge for grown files that content::layers does not do.

docs/dev/reference: the mods, input, control bridge, hooks and upscalers
pages name the Rust where they named the deleted C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/input_movie.c no longer answers rx_option with a replay's rows
(hos_input_movie_option is gone): a recording reads the game's settings it holds
with game.h's game_movie_setting_value, and a replay sets the recorded ones
with game_movie_setting where the game's differ. The fixture keeps a fake
game's settings behind those two; the option lines and a recorded replay's
lines are checked as before. One check follows the new behaviour: a setting a
replay set stays after the replay ends (the old rows went back to the
player's menu then).

The wiring's game parts read the Rust that replaced oot_tools.c and
oot_menu.c: oot::menus' tick plays the recorded menu choices while a replay
plays and records the mouse's, and oot::debug gives the recording Link's
position (read only while one is active, under the tools' lock, put back
through his controller) and the Debug tools' actions before and after they are
taken. rx_option is checked not to ask the recording any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows the system mods now own leave gpu/vk/menu: crt.cpp, colour_vision.cpp, walk.cpp and widescreen.cpp go whole,
Sprint's row (sprint.cpp keeps apply_sprint_layout), Shadow resolution (detail.cpp) and their opts fields (sprint,
walk_mode, walk_speed, hud_*, crt_filter, crt_lines, colour_vision, shadow_res, damage_taken) with them. Keys are unchanged:
each is the owning mod's SettingDecl now, placed by game/mods/game-settings.

- MkwVkHost version 49 replaces version 48's game_menu_rows (game/menu/rows.c) with the game side's table: the settings
  (game_setting_count/_row/_get/_set/_text/_hint, game_settings_generation), the options file's game lines
  (game_options_*), the Debug tab's actions (game_cheat_action) and the post-process passes (game_post_passes). The
  renderer's module never names a game.h function directly: the options file's direct game_options_* calls
  (unresolvable in longshot_vk) go through it too. vk_api.h includes game.h for the types.
- gpu/vk/menu/game_rows.cpp draws every game setting in place by key (tab, section, after/before, order), as an unsaved
  row that reads the game's value before it is drawn and sets it as the player does; Sprint's controls follow the Sprint
  setting (apply_sprint_layout). It makes the Accessibility section when a row goes there.
- The Debug tab's panel keeps its layout: Heart protection, No-clip flight, Free camera and Movement speed show and set the
  cheats mod's settings by key; Debug tools and Damage taken (debug_tools.cpp) are unsaved rows mirroring the cheats and
  damage mods' settings. Option 34's plumbing goes: each action (mark, return, clock, pouch, age, teleport, inventory) calls
  game_cheat_action when pressed (cheat_action, menu_take_cheat_action, HOS_OPT_CHEAT_ACTION's answer gone), as do
  HOS_OPT_CHEAT_HEARTS/FLIGHT/CAMERA/SPEED's answers, the renderer's flight state and its HOS_OOT_PROTECT_HEARTS read (the
  cheats mod reads it).
- The CRT and colour-vision passes read game_post_passes (menu_game_passes: the CRT pass's filter and lines, colour
  vision's mode) in place of opts; the Ultrawide menus side reads the widescreen mod's setting.
- vk_replay.cpp's option callback no longer answers the game's rows (Walk, Sprint, the HUD, Shadow resolution, Damage
  taken, the cheats); the Quality preset puts Shadow resolution back to Auto through the shadows mod.
- HOS_SKIP_OPENING's override of the old Skip opening row goes: the renderer cannot set a game setting for one run.
- menu_i18n.h: the HOS_WIDE_UI hint, no text of anything now, leaves every table.
- docs/dev/reference/architecture.md: the game's rows as the system mods' settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
- test_menu_ini_keys.py: the system mods' keys count, from the Game settings mod's table (game/mods/game-settings
  LAYOUT), each held to its owner (MOVED: the old opts value to "game:<owner>"); FROZEN keeps every key, and gets
  shadow_steady_fit, the shadows mod's new line, on purpose. The cheats mod's run-only rows and Reset HUD placement save no
  line. A game/menu row from before is not counted twice.
- test_menu_modules.py, test_menu_sections.py, test_menu_slider_ends.py, test_settings_table.py: the menu built with no
  game has none of the system mods' rows (CRT, Accessibility's Colour vision, Ultrawide menus, Shadow resolution, the HUD,
  Walk, Sprint...): they are left out, and the settings page's lines for them are checked to be there by label.
- test_menu_i18n.py: the system mods' texts (game/mods/*/src) are the menu's texts too: the menu draws and translates them.
- test_damage_debug_menu.py: Damage taken is debug_tools.cpp's own int now (menu_damage_taken_row); the Debug tools'
  warning sets the cheats mod's setting. What Damage taken does while the tools are off is the damage mod's (the
  renderer's menu_damage_taken is gone), so that assert goes with it.
- test_menu_save_atomic.py: stand-ins for menu_game_options_* (save() reaches the game side's lines through them).
- test_crt_policy.py, upscale_independent_test.cpp: the CRT filter is read from the CRT system mod's pass
  (menu_game_passes).
- test_option_ids.py: Sprint's 97 stays reserved beside Walk's 49 and 50 (the sprint-walk mod's legacy ids).
- test_crt_options.py is deleted: it compiled gpu/vk/menu/crt.cpp's two rows (defaults, labels, keys, presets), which are
  gone; the rows are the CRT system mod's settings, checked by game/mods/crt's unit tests (off_makes_no_pass,
  the_slot_follows_the_rows, the_rows_keep_their_keys), and the pass by test_crt_policy.py and
  upscale_independent_test.cpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported to read the Rust that replaced game/oot_tools.c, oot_state_tap.c,
flags.c and game_layout.c:

- test_pipeline_tour and scripts/tours/route.py: the bridge's teleport and age
  actions, the hour action, the destinations (child and adult maps), the
  refusals' texts and the state tap's event, loading and age are read from
  oot's debug.rs, travel.rs (DESTINATIONS, Refusal) and state_tap.rs; the
  cache files from longshot-game's layout.rs; the switches from the game
  side's crates and mods; the options' keys also from the system mods'
  settings. The menu's actions are matched in either form
  (cheat_action.store or menu_game_action). scripts/pipeline_tour.py drops
  HOS_TEXT_SPEED, a switch gone (text_speed=3 in its options stays).
- test_cheat_items: also checks oot's travel.rs INVENTORY_ITEMS and
  INVENTORY_PROBES are the header's, in its order (the game side's copy of
  the list an edit's action indexes).
- test_bug_report (the map line, oot::travel), test_perf_report (the pose's
  gates, oot::travel's perf_pose and perf_place), test_parity_gates (the save
  trace's line, oot::session), scripts/parity_gates.py, scripts/tours/
  drive.py, control_test.c, display_startup_failure_test.cpp: the new place.

Deleted, the C they built gone:

- test_debug_tools_linux: it followed oot_tools.c's #ifdefs; the Rust tools
  have no platform condition (oot::debug, the cheats mod).
- test_game_flags, game_flags_test.c: oot::flags' tests (the_hash_is_murmur3,
  a_flag_is_found_by_probing_past_a_collision, bools_floats_and_texts,
  bool64_finds_then_remembers and the rest).
- test_game_layout: longshot-game's layout.rs
  (moves_once_renames_the_pipeline_cache_and_never_overwrites).
- test_teleport_check: oot::travel's only_a_dropped_request_is_sent_again.
- test_teleport_minimap_flag: the repair is travel.rs's teleport, through
  GameData::set_bool_queued (no unit test drives it: a gap).
- test_oot_song_inventory: oot::travel's songs_and_masks_are_counted_their_way.
- test_oot_first_night: the C it built (oot_inventory_refresh's repair of the
  first adult night's time lock, Longshot #1064) has no Rust: the repair is
  not ported, reported to the lead rather than kept as a test of nothing.
- test_perf_pose, perf_pose_test.c: the angles are oot::debug's
  (angles_stay_within_the_relays_range,
  camera_angles_come_from_the_eye_and_target); the gates (rate, event,
  stale, title) are read from travel.rs by test_perf_report.
- test_oot_state_tap: oot::state_tap's tests (the_core_line_is_the_cs_byte_for_
  byte, a_request_is_answered_by_the_next_tap, the watches' and the
  changes').

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/oot_sites.c and the core's C (oot_high_fps.c, oot_barrier.c,
oot_heap_retry.c, oot_ocb_hold.c, oot_tex_compact.c, oot_menu.c,
oot_damaged_files.c, oot_tools.c's update hooks, phases.c) are gone, and with
them nn_vi.c's whole-frame counters, loops and movie frames: the tests that
cut and compiled them go. Each site's registration is oot::engine's, checked by
its every_callback_names_a_site_of_the_def_once and
every_outcome_site_has_its_engine_callback; the behaviour by the modules'
own tests:

- test_high_fps_fixes, test_drive_target, test_floor_carry_step,
  test_horse_jump_step, test_jump_takeoff_step, test_oot_cloth_60,
  test_oot_cloth_time, test_song_note_cue, test_saved_turn_rate:
  oot::fixes::high_fps (a_driven_target_carries_last_updates_shortfall,
  a_floor_carries_in_full_on_a_short_frame,
  a_horse_step_of_the_whole_frame_is_not_slow_motion,
  a_backflip_gets_the_rest_of_its_takeoff_step,
  the_cloth_keeps_the_clock_below_60_fps, the_cloth_solves_once_a_60th...,
  a_note_flag_read_again_before_the_job_ran_is_the_same_note,
  the_steering_rate_divides_only_for_a_step_under_one, ...).
- test_oot_barrier: oot::fixes::barrier (ten, the wakes and waits).
- test_oot_heap_retry: oot::fixes::heap_retry (seven).
- test_ocb_hold: oot::fixes::ocb_hold (eight).
- test_tex_compact: oot::fixes::tex_compact (three).
- test_oot_menu_mouse, test_menu_hooks: oot::menus (seven).
- test_camera_speed, test_movie_frame_count, test_ocarina_wait,
  test_loop_step, test_frame_whole, test_scarecrow_timing,
  test_water_substeps, test_web_floor_steps, whole_sites.py: oot::video
  (a_turn_speed_is_scaled_and_left_alone_at_100_percent,
  the_camera_scale_takes_50_to_400_percent,
  a_movie_player_counts_the_frames_time_and_keeps_its_fraction,
  the_note_sites_arm_and_end_the_wait,
  whole_frames_are_cut_as_the_lifted_code_cuts,
  substeps_are_handed_out_when_carried,
  a_loop_of_one_frame_moves_in_whole_frames_and_draws_its_start, ...).
- test_camera_centering, test_oot_jitter: oot::engine
  (the_follow_yaw_skip_keeps_the_base, the_jitter_goes_to_the_third_lane_only).
- test_player_update_sites, test_movement_speed,
  test_flight_yields_to_events, test_free_view_anchor: oot::debug
  (movement_speed_scales_only_walking_speeds, the flight's and the view's
  tests).
- test_opening_skip, test_oot_transition_autosave: oot::session
  (the_opening_skip_arms_on_its_requests_and_skips_its_timelines,
  the_opening_skip_off_drops_the_arm, only_the_transition_autosave_is_dropped).

Ported, keeping what is still the host's:
- test_game_phases: the empty run's one relaxed load is read in game-sites'
  phase.rs (the phases' behaviour is its tests'); the acquire's wiring in
  nn_vi.c and nvn_native.c stays checked. game_phases_test.c goes with
  phases.c.
- test_damaged_rom_files: the stand-in's choice is oot::fixes::damaged_files';
  the test reads the table's three pairs, OpenFile's call for a read and the
  export.
- test_hos_ab: HOS_OOT_BARRIER_WAIT's reader is found in the game side's Rust
  (paths::ab_value).
- test_present_trace: hos_cheats_frame is no stub any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer draws every game setting from game.h's game_setting_* now
(gpu/vk/menu/game_rows.cpp, MkwVkHost 49), so #2411's static rows
(Field of view, Text speed and size, Skip title screen, Skip opening,
Discord status, Ultrawide menus), each a system mod's setting with the same
key, go with game_menu_rows and game.h's GameMenuRow block.
host/rx_backend.c's vk_host gives version 49's entries in their order:
game_settings_generation, game_setting_count, game_setting_row,
game_setting_get, game_setting_set, game_setting_text, game_setting_hint,
game_options_load, game_options_key, game_options_value, game_options_has,
game_cheat_action, game_post_passes. The builder's plan no longer looks for
game/menu/*.c. What is left of the game's C is the Mods page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/nn_hid.c read No-clip flight and Free camera with rx_option
(HOS_OPT_CHEAT_FLIGHT, _CAMERA) and set flight with rx_option_set: the
renderer no longer keeps those rows (they are the cheats system mod's), so
the double-tap shortcut and the free camera's input routing were off. They
read the settings by key through game.h (no-clip_flight, free_camera, -1 /
off while debug_tools is off, as the hidden rows were) and the shortcut sets
no-clip_flight with game_setting_set, made at the game's next frame.

game/options.h says what its ids are now: the system mods' settings' old
numbers (legacy ids), for input recordings, and names the mods where it
named the deleted C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The system mods' C (oot_text_step.c, oot_text_size.c, oot_damage.c,
oot_sprint.c, oot_autoload.c, oot_heart_containers.c, oot_shadow.c,
oot_shadow_fit.c, oot_voice.c, oot_wide_sites.c, hos_wide_ui.c, cheats.c,
discord_*) is gone; the tests that compiled it go, each covered by its mod's
crate and oot::sysmods:

- test_text_size, test_text_speed: game/mods/text and oot::sysmods::text.
- test_oot_damage: game/mods/damage and oot::sysmods::damage.
- test_skip_title: game/mods/skip-title (machine.rs, told.rs) and
  oot::sysmods::skip_title; test_dev_ab keeps the bench's key and screens.
- test_heart_containers: game/mods/heart-containers and oot::sysmods::hearts.
- test_oot_shadow, test_oot_shadow_fit: game/mods/shadows and
  oot::sysmods::shadows.
- test_oot_voice_option: game/mods/voice-language and oot::sysmods::voice.
- test_wide_sites, test_wide_ui, test_hud_layout, test_hud_layout_row,
  test_oot_wide_bubble, test_oot_wide_save_picture,
  test_oot_camera_clearance, test_movie_shape, widesites.py:
  game/mods/widescreen (panes.rs, hud.rs, picture.rs, names.rs, ...) and
  oot::sysmods::widescreen. (Two host checks went with them: rx_backend.c
  calling hos_wide_ui_tick each present, and hos_wide_keep_mask's narrow-screen
  rule.)
- test_discord_activity: the discord script system mod's own tests
  (game/mods/discord/test, golden.json).
- test_cheat_vm: game/mods/cheats (vm.rs, program.rs, parse.rs).
- test_prompts_size_table: it served the size table through game/mods.c's
  hos_mods_romfs and its fixture (test_mods_size_table.build_fixture), both
  gone; the serving order is content::layers' (made_files_and_served_paths).
  host/prompts.c's raised font entry has no test left: a gap.

Ported:
- test_sprint: the fake-game check of oot_sprint.c and the sites' callbacks
  go (the sprint-walk mod's machine.rs, oot::sysmods::sprint); the host's
  binding, read_input and npad_states checks stay, the Sprint row is read as
  the mod's setting (sprint=, HOS_OPT_SPRINT 97, off) with the renderer's
  apply_sprint_layout.
- test_dev_ab: the Skip title setting's key, sites and screens from the mod.
- test_native_zstd, test_mouse_native: the zstd decodes' and the mouse look's
  sites are checked by the core's registrations in oot's engine.rs and
  host-sys's bindings (the C callbacks they cut are gone).
- sitecheck.py, sitetable.py: their default source is host/render_sites.c,
  the callee the host's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test_site_chain compiled game/sites.c (hos_site_add, hos_site_remove,
hos_site_next) with a stand-in site list. The handler chains are game-sites'
chain.rs now, whose tests check the same rules:
an_owner_alone_is_called_through_the_plain_trampoline,
handlers_wrap_the_core_lowest_priority_first,
one_answerer_and_the_outranked_are_told_or_left_out,
outcome_sites_take_nothing_at_run_time,
the_callee_is_put_back_before_each_handler,
a_removed_handler_is_let_go_after_the_grace. tests/run_all_times.json drops
the one deleted test it timed; scripts/devtools' and the tour's notes name the
Rust the C became.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_oot_state_tap.py went with game/oot_state_tap.c; oot::state_tap's
own tests check the snapshots, the watches and the changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/menu/rows.c's row went with the C and no mod declared it, so oot::session's knob was never set. The mod
declares the row (same key, old number 52), sets the knob at its start and when the row changes, and puts the
game's opening back when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer builds its menu once, at its first use, which can come before the first acquire phase makes the mod
runtime; the game's rows were then missing for the run. Until the settings service publishes, the rows are the
native mods' manifests', with the options file's values, laid out as Game settings does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Mod-to-mod exports and calls, the network and IPC through game_host.h,
the UI channel and the inspector, hot reload and settling in parts,
serial in-place listeners and engine rows, Ogg streaming (lewton), the
batch --mod-tests run, the controller, and the Mods page in Rust, with
their game_host.h and game.h functions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game's host.rs declared hos_zs_read, hos_fs_save_root/_end, hos_mem_region, hos_game_language,
hos_movie_stats and hos_wide_keep_mask itself; host-sys binds them now (files::zs_read, files::save_root,
mem::region, info::{game_language, movie_stats, wide_keep_mask}), each with its fake branch, and game_host.h
declares the save root's and the language's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The design says turning a mod off undoes everything it did; the port only undid live effects and left writes for
the Mods tab's undo. mod_stopped asks the journal's undo too, which puts each write back at the next frame where the
game still holds the mod's value. The cheats mod's writes, merged by address, are undone the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/oot_tools.c's oot_first_night_fix went with the C and was not ported: a save outside Hyrule Field that
still held HrlField_isFirstNightTime_Adult could never leave night. The map refresh clears it, once, never while
an event plays; HOS_OOT_FIRST_NIGHT_FIX=0 leaves it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::travel published them for the menu, but nothing sent them on: the Switch age row and the Inventory page showed
unknown. The acquire step sends the renderer what changed (rx_option_set, OOT_CHEAT_ITEM_BASE + i and
OOT_CHEAT_AGE_ID), as oot_tools.c did; host-sys binds rx_option_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer answers HOS_OPT_MEMORY_TIER (3998) with the tier its Quality preset or Auto picked, and the Shadows mod
reads it: Auto is the game's size on Minimum and Low, Highest from High up, as menu_shadow_res chose, in place of
High everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A build's locations.toml may now hold [[location]] tables beside its sites
(the C era's format: a function = "f_<address>" or a data = <address>).
sites::named checks each against the lift's functions, main's data and the
game's list (game/crates/oot/src/locations.rs); locations_c writes the
host's hos_locations_resolved from them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The 72 names game/crates/oot/src/locations.rs reads, each its function or
datum in build e0f3ccfa, as the C era's host/game/sites/<build>/locations.toml
gave them ([[location]] tables, names and addresses only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lift checks the build's [[location]] tables (sites::named) before it
lifts anything, and writes gen/locations.c every time: the host's
hos_locations_resolved with each name and address, or none for a build
without a table. The tables' key holds the game's list
(game/crates/oot/src/locations.rs), the compile builds locations.c with
the lift's other C, and the shader preparation's driver keeps it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lift now writes gen/locations.c in every build, with the build's
named locations or none, so the host's stand-in is never the definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Points Location's doc at the lift's gen/locations.c, and checks each
variant's ident is its name with each dot an underscore, as the builder
reads the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The pads' poll plays a mod's level on both motors while it lasts, at the
Vibration strength row's scale (and a pad's own percent), and the game's
own rumble resumes after it. Ported from the mod API branch's
hos_sdl_rumble_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/game/pad.c of the mod API branch, moved to the host as hos_pad_* and
hos_pointer_* (game/DESIGN.md, "The controller"), declared in their own
section of game_host.h. npad_states calls hos_pad_hook after the frame
step's buttons: the player's read recorded when watched, then a mod's
replacement, the buttons kept and the presses. A held pointer leaves the
mouse look (nn_hid.c mouse_stick, mouse_native.c) and hos_pointer_take
hands the mod the motion at the menu's sensitivity. The mouse tests'
stand-ins gain hos_pointer_held, and mouse_stick's checks a held capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::input's pad_watch, pad_read, pad_publish, pad_press, rumble,
pointer_take and pointer_hold call game_host.h's hos_pad_*, hos_pointer_*
and hos_rumble_mod in place of answering as a host without them. HID_BITS
maps the API's button order to the HID's bits both ways and the sticks
scale between -1..1 and +-32767; the fake keeps the host's records (HID
bits, +-32767 sticks, presses by bit, the pointer, the rumbles), so the
tests see what reaches the host. native.rs's HID map is now this one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The player's read reaches the service in the API's order from the host's
HID bits, once a frame, a torn copy keeping the last; a stopped mod's
presses are let go to the other mods' end and its rumble ended, another
mod's left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mod tool's file natives (and its module loader, and host.format) now
check each path against a fence (script::modtool::fence). game-cli.js
confines the command once, before any of the mod's code runs, with
native.confine(write, read); a second confine is refused. The SDK's
folder (read only) and the run's own scratch folder in the system's temp
folder (os.tmpdir()) are always in it. A path outside, or one that
reaches outside through .. or a link, is refused with ERR_ACCESS_DENIED
and a stable .reason (modtool.fence.outside, .dotdot, .link, .loop).
A command that never confines itself is confined to its default (the
current folder, the mod's) when the mod's code could first run: a realm
made, or a module loaded from outside the SDK.

Paths are resolved as the system walks them (links followed, .. the
real parent), the roots the same way; a stat on the way to a root and a
mkdir on the way to a writable root are allowed, so mkdirSync's
recursive works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A realm's code can outlive realmDispose: QuickJS keeps a context while
its objects live, and the realm's handle stays alive while a call into
it is on the stack (a mod's code that stops its own realm). An import
then reached the module hooks with a context the tool no longer listed,
which they took for the tools' own: the tools' loader, which gives
longshot:native and every file. The hooks now give the tools' loader to
the tools' context alone and refuse any other they do not know.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
lib/fence.js works out the folders a command needs from its arguments
(its mod's folder by default; new's mod in mods/, data --out's file,
dev's copy in mods/, run's and allow's Dev profile, the game folder to
read, where a tsc, node or git was found) and game-cli.js's main
confines the command to them (host.confine) before it runs, so before
any of the mod's code. The game a command finds then is pinned
(game-find.js's pinGame): finding it again would read folders above the
mod's. Node confines nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Under the game each vm context is a realm of the tool's one runtime,
which keeps it, and its modules, until H.realmDispose: nothing called
it, so a test run's memory grew with its tests. lib/vm.js now has
disposeContext, contextMark and disposeContexts (the game's realms
disposed; nothing in Node, whose collector frees its contexts). The
test runner disposes every realm a test made at its end; the fake game
disposes a mod's old realm at a hot reload and a worker's when it ends;
the link check and runScript dispose theirs when done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The finish copies mod-tools' bin/, lib/ and package.json from the tree
(assets/modding/packages/mod-tools) into the game folder's sdk/tools/,
where the game's longshot mod looks for its entry, so it runs with no
LONGSHOT_SDK. They go in with the build's other files, each by its bytes
(a changed file is copied again), and a file of sdk/tools/ the builder
put there that the tools no longer have is taken out. A tree without
mod-tools ships none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A release's longshot-builder builds from its carried tree, which the
finish now takes the game folder's sdk/tools/ from: SOURCES adds
mod-tools' bin/, lib/ and package.json (not its tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tools.md says which folders each command reads and writes under the
game, the scratch folder, and the ERR_ACCESS_DENIED refusal and its
reasons (and that the programs a command starts are not confined).
game/README.md's stand-ins: the game folder carries the SDK's tools
alone, the processes and the bridge's socket are not confined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::paths::options_file binds host/options_path.c's hos_options_file
(game_host.h includes options_path.h): mods.json sits beside the settings
file, which the loader needs to find it as game/mods.c did (the user folder
--user names, not only HOS_OPTIONS_FILE's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::features::present lists the features of this build from
the oot probes and whether the audio mix knows the game's groups, so the
loader's resolve can be given them at game_init, before the services are
made (game/DESIGN.md, Still to port 9: Loader::scan). Services::feature
asks the same function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader's start is two parts (game/DESIGN.md, Still to port 9). Loader::scan
needs no MainThread nor services: the folders, mods.json, packages, the
system mods put first, the resolve, and the Mods tab's first snapshot (its
page rows without settings or permissions until the services are made).
Loader::start, at the first acquire phase, lists each mod's grants and
manifest with the services, declares the native mods' settings and
prepares the chosen mods with code; it scans first when nothing did.

What game/mods.c did besides the list is the loader's now:
- the game folder's mods.json copied into the user folder once, when that
  has none and it is a list (carry_state), else this run keeps the game
  folder's;
- modcache/mods_json.txt naming the list's place for the builder, taken
  away when the list is the game folder's or not there (note_state_file),
  and written again after a write makes the list first;
- longshot_mods.txt read once when there is no mods.json, written into it
  and kept aside as longshot_mods.txt.imported.
None of the three runs with a list of the run's own (LoaderConfig::own_list:
HOS_OPTIONS_FILE or HOS_MODS_LIST) or in Safe start.

The tab's snapshot gains changed (0 while the order and the switches are
the start's, else a number for them: mods.c's state_key, a live row's
switch left out since it takes effect at once), list_bad and unsaved. The
log says "mods: none in <folder>" and "mods: N mods from <folder>" as
mods.c did (scripts/parity_gates.py's gate 5 reads them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader's scan reads the build's exefs_patches.txt as game/mods.c's
exefs_status did: each patch file of a mod of the emulators' layout
(exefs/*.ips, *.pchtxt) hashed (FNV-1a, the build's third column) and
found built in, waiting for the next build, for another game version, or
not applicable with the build's reason; the files built in whose mod is
off or gone counted in the log. A row's lines say it as mods.c's mod_text
did (Row::exefs, exefs_note).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The tab's rows gain asks and warning (a manifest mod's sites.toml, its
code, waits for the player to accept the warning: docs unsafe.md) and
build (its sites accepted and not in the game's build as they are now, or
ExeFS patches of a mod that is on waiting for the next build), as
game/DESIGN.md's GameModRow has them. The code is hashed as sha256 of
sites.toml, kept as the mod's "accepted" in the trust file when the
player accepts (Edit::Accept, game_mod_edit's op 4), and found built when
the build's mod_sites.txt names the mod with that hash; until then the
mod is held back whole, and its switch is the start's (not live).

The permission prompt's answer is an edit too (Edit::Answer), made at the
next acquire phase: the menu's thread reaches the prompt through the tab's
handle, before the services are made as after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing filled content::layers since game/mods.c's RomFS index went
(92416923): hos_mods_romfs answered the game's own file for every path, so
no mod's RomFS file was served. Loader::publish_layers builds the start's
table from each mod that loads with a romfs folder, a layer each in the
list's order (a mod lower in it wins a file two have), and publishes it
whole; a package that loads with RomFS files is unpacked into the cache
first, and its start uses that folder. Links are left out, as the disk's
reads leave them (a mod's files are its own folder's); the C's walk left
out folder links only. The log says "mods: <mod>: N RomFS files" as the
C did.

Disk::meta gives a file's size and last write, which the layers keep.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game.h's new section (game/DESIGN.md, Still to port 9): GameModsSnapshot,
GameModRow, GameModPage, GameModSetting, GameModPermission, GameModPrompt
(the mod API branch's MkwVkMod* of gpu/vk/modpage.h, field for field) and
game_mods_snapshot, game_mod_edit, game_mod_setting_set,
game_mod_permission_set, game_mod_prompt_answer. longshot-game::mods_page
turns the loader's newest TabSnapshot into that C block (built again only
for a newer snapshot; the newest two kept, so a pointer stays valid until
the next call as the contract says) and queues the menu's edits by id; a
setting's value is checked against its row before it is queued.

game_init makes the loader (runtime::loader_config: mods.json beside the
player's settings file, host_sys::paths::options_file, as game/mods.c had
it; the features from api::services::features::present), runs its scan,
publishes the start's RomFS layers and hands the tab to mods_page, all
before the guest's first instruction; the runtime takes the scanned loader
at the first acquire phase and starts its mods.

game/mods.c's (C) part of game.h is still there: the renderer moves to the
new functions next, and the C goes after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
MkwVkHost's mod_info, mod_edit and mods_changed (game/mods.c's, by index)
are replaced by mods_snapshot, mod_edit_id, mod_setting_set,
mod_permission_set and mod_prompt_answer, filled by host/rx_backend.c with
game.h's game_mods_snapshot, game_mod_edit, game_mod_setting_set,
game_mod_permission_set and game_mod_prompt_answer (game/DESIGN.md, Still
to port 9). cheat_info and cheat_set stay.

gpu/vk/vk_menu.cpp's Mods tab reads its lines from the snapshot and sends
its edits by id: a picked-up mod is followed by its id once the game made
every edit sent, never moves above a system mod, and a required system
mod is not switched off; Enter on a mod whose code asks accepts its warning
(op 4); the help line says what waits for a build and which switches apply
at once. The restart question reads the snapshot's changed. The permission
prompt and a script mod's page are drawn when the branch's modpage drawing
joins, from the same snapshot.

Left out of version 50: ui_snapshot and ui_post (Still to port 3), whose
game.h functions do not exist yet; they come with that part.

Tests: test_mods_menu ported to a fake host of snapshots and edits by id
(the same checks, and the system mod, the moves by id and the acceptance);
test_hos_ab's table order and test_menu_text_field's cut of restart_values
follow the new fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Mods page's C is gone with hos_mods_init, hos_mod_info, hos_mod_edit
and hos_mods_changed (game.h's last (C) lines): the loader's scan in
game_init does what hos_mods_init did, and the renderer reads
game_mods_snapshot (MkwVkHost version 50). host/hos_main.c calls
game_init alone where it called both. One reader of mods.json is left in
the game, api::loader::list.

Tests, each with its reason:
- tests/test_mods_list.py is removed: it built game/mods.c and
  mods_list.c into a stand-in game and compared their reading of mods.json
  with the build's. The game's half is the loader's now, tested over
  MemDisk in game/crates/api/src/loader/tests.rs (where the list is, the
  carry into the user folder, the build's note, longshot_mods.txt's import,
  a list that is not one, what a write keeps, Safe start, the restart
  number); api::loader::list's own tests check the text. Its check that
  the game and the build take and refuse the same texts has no game program
  to drive any more: it needs one of the Rust reader to come back.
- tests/test_fs_links.py loses its RomFS-walk part: it cut index_romfs out
  of game/mods.c, which had not had it since 92416923 (the walk is
  Loader::publish_layers', which leaves out links, tested in the loader's
  tests). Its file system checks stay.
- tests/test_parity_gates.py reads gate 5's two log lines in the loader's
  source; tests/test_crash_dialog.py and test_low_memory_notice.py anchor
  on game_init() where they anchored on hos_mods_init(image).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: Still to port 9 says it is ported and where the port departs
from the design (MkwVkHost version 50 without §3's ui_snapshot and ui_post,
the prompt and a mod's page not drawn yet, no frame times, a native mod's
buttons, changed and live rows, a list of the run's own, the sites'
acceptance, the RomFS layers the scan publishes); the map moves game/mods.c's
Mods page and mods_list.c/h to api::loader and longshot-game::mods_page,
and says no game C is left; Fixed on the way 42: the tab's edits wrote
mods.json on the menu's thread. game/README.md: no C of the game's own,
game.h has no (C) line, the scan runs in game_init, and the Mods tab's
stand-ins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/mods.md's code table and parity-gates.md's gate 5 rows
name api::loader (Loader::scan, publish_layers, list, tab) and content's
layers where they named game/mods.c and mods_list.c; game-files' README
and its mods example say the test that compared the two readers went
with the C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_mods_snapshot moves the newest block into before in two statements
(not two borrows of the guard in one), its test checks a setting's number
within a margin (clippy's float_cmp), and runtime.rs brings AudioOut into
scope for groups_known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer hands the options file's lines over (game_options_load) when
it starts, which is after game_init now that the loader's scan runs there:
the system mods' switches from before they were mods (legacySwitch) were
not there to carry over. game_init reads the file's lines first
(options::preload, split as the renderer splits them); the renderer's own
hand-over gives the same lines again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::assets::bc7 is Richard Geldreich, Jr.'s bc7enc (the encoder host/bntx_write.c
compiled from third_party/bc7enc) in Rust: opaque blocks in mode 6 or mode 1 over the
estimated partition (the 64 patterns by use, with the filter bank), blocks with alpha in
mode 6, 5 or 7; principal-axis endpoints refined by least squares, the single-colour
tables, the perceptual YCbCr error, the uber levels. Params::for_texture is the C texture
writer's settings. Tests decode every block and compare the error with the mode-6
stand-in's on made images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mode-6 stand-in in host-sys was arithmetic, not a host call: the texture writer
encodes with content::assets::bc7 and host-sys keeps only the boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h's hos_zs_content_size, hos_zs_romfs_content_size, hos_zs_write,
hos_romfs_case and hos_prompts_font_entry, which the size table's fit needs:
host_sys::files::{zs_content_size, zs_write}, host_sys::romfs::{zs_content_size, case}
and host_sys::prompts::font_entry, each with its stand-in host's answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::restbl ports host/restbl.c and game/mods.c's fit_sizes (deleted with #2411):
the RESTBL read and written, entries raised, a mod's table merged over the game's,
the estimates and the growth in proportion; restbl::fit makes the game's table with
every mod's table for this version merged, another version's only for its own mod's
files, the prompts' font entry raised, and each served file's entry raised to its size
(in the game's case when the mod's differs). The host is a trait (HostSizes, through
host-sys), so the tests run on a made-up game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The fit is written to modcache/rsizetable.zs and served whole at the game's table's
path, where the host's opens (hos_mods_romfs) and the prompts (hos_mods_file) already
ask the layers; a rebuild drops the live table's merged one first. Without a fit the
last mod's own table is served as before, the prompts' entries merged in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h gains hos_mem_copy_out (host/game_guest.c): the guest range checked against
the window, then ReadProcessMemory on the own process on Windows, which neither faults
into commit_on_touch nor commits a page the game has not touched or gave back, and
fails for it; a plain copy where the window is mapped whole (Linux, the web). As the
mod API branch's hos_mem_copy_out. host_sys::mem::copy_out binds it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GameMemory::copy_out read the guest window directly: on Windows a read of a heap page
the game had not touched, or had given back, faulted and committed it. It is refused,
as the C's memory.read refused it ("unmapped").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Fixed on the way 42 and 43 (the fit sizes the file served; a rebuild fits again);
the stand-ins lose the mode-6 BC7 encoder and the unguarded memory read, and the size
table's says who calls the fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Spelled out where the tables of different lengths meet in one expression, so the
types never rest on inference through a tuple.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h gains the three functions game/DESIGN.md's "Still to port" names for the mods' image
thread (3) and batch --mod-tests (7): an environment switch set at the start, the game quit with an
exit code through the close's own path, and a thread run below the game's priority.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker_net.c, broker_net.h, broker_net_frame.h and ipc_endpoint.h come from the mod API
branch unchanged but for one line: bnet_ipc_allowed reads the build's system mods' endpoints
from game.h's game_system_ipc (longshot-game::net) instead of modapi/system_mods.h.

host/net_link.c holds the one link and gives the game side game_host.h's hos_net_*: opened at
the first grant or open, let go when the engine goes (no new link for 10 s), and closed with its
engine's threads waited for at hos_close_finish. broker_net.c includes broker_grants.h, which the
sandbox's port brings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::net binds game_host.h's hos_net_* (available, grant, open, send, close, poll ->
Poll::{Event, None, Gone}), its fake an in-memory engine a test scripts (fake::net); the stand-in
that answered every open "no engine" goes. host_sys::run binds hos_switch_set, hos_quit and
hos_thread_background. has("net") and has("ipc") ask the engine for their own kind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HeapCounter moves from script into api::call (script::heap re-exports it), so a service can hold
a HeapCharge of a mod's heap: bytes given back when it is dropped, from any thread. CallHost gains
charge (bytes counted against the calling mod's heap) and fault (a fault of the calling mod's,
without a throw); the engine's two hosts implement them.

ScriptHost gains, each with a default that does nothing, what the together step crosses runtimes
with: caller_left_ns, export_call (ExportCall, ExportOutcome), settle_now, charge_ns, and two the
design did not name: heap_charge (an answer queued is charged to its caller's heap, as together.c
did) and workers (the workers' messages, moved into the together step). ApiError gains mod_call
and net.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The host's half of longshot/mods (together.c in the C): load, call, listen, emit and the
registries' add, remove, list and watch, each refused in a worker; mod: imports checked against
the importer's manifest (import_ok) and linked against what the loader resolved (set_resolved);
raw_data, has_net and holds_by_name for spec 12.5 and an export's guard.

Values cross as JSON text. Calls, answers and loads are queued and run at the together step
(together_step, in Services::frame after the game's events): at most 8 rounds, each delivering
the emits in order, telling each changed registry's watchers, then running the queue through the
engine (export_call, settle_now). The caller pays: a call or an answer of a caller whose budget
is spent waits for its next frame, and what waits holds a HeapCharge of its sender's heap. An
export answering with a pending promise answers later through together_answer.

The writes, memory and actor-writes steps and the journal's frame move after the together step,
so what an export or an event's listener asks to write is made in the same frame. A stopped mod's
listens, entries and watches are journal Lives; together_gone drops what is queued of it and
answers its callers not-running.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Rust's ipc_pattern_ok was reconstructed without the C, and differed from the grammar the
manifest reader, the game's side and the network engine share (host/ipc_endpoint.h): it took one
range of single digits, no $HOME, and any printable character in a part, so a manifest the engine
would open could be refused, and one it refuses taken. It is the header's now, with the endpoint's
check and match (ipc_endpoint_check, ipc_endpoint_matches) beside it, and bnet_headers_ok and
bnet_method_ok ported as headers_ok and method_ok, for services::net.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's side of mods' WebSockets, HTTPS requests and local IPC (net.c in the C): the natives'
service halves (net_connect, net_fetch, net_send, net_close, net_limits, ipc_connect, ipc_send,
ipc_close, ipc_connected, ipc_limits, ipc_pid), each refused in a worker, with the C's checks: the
origin granted, the scheme, the headers and method (the engine's rules), the limits, and ipc held
with the endpoint declared. A mod's grant is sent before its first connection and again when its
grants change (net_regrant, from the permissions' changes).

At the together step net_step polls at most 512 of the engine's events, settles promises and
delivers the rest (net-message, net-close, ipc-open, ipc-data, ipc-closed); the engine gone ends
every connection, marks every grant unsent, and asks for no link for 10 s. net_gone closes a
stopped mod's connections and withdraws its grant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The engine's side of calls between mods (game/DESIGN.md "Still to port", 1 and 2):

- NativeSpec gains rejects: a member that answers with a promise (load, call, netConnect,
  netFetch) makes it through the mod's own call host (bind::native_call), and an error it returns
  is that promise rejected, never a throw. A native member's object or list argument is a
  structured value (a list's trailing undefineds left out); one refused reaches the service as
  Value::Text with why.
- script::NATIVES wires load, call, listen, emit, regAdd, regRemove, regList, regWatch, netConnect,
  netFetch, netSend, netClose, ipcConnect, ipcSend, ipcClose and ipcConnected to their services;
  netLimits, ipcLimits and ipcPid are the engine's own (a worker's source reads them).
- caller() is the mod whose call of an export runs now (ModState::caller), callerHas asks the
  services what it holds.
- mod:<id> resolves through Services::import_ok and loads as a module of the callee's exports,
  each a function over the call path (always a promise).
- QuickJsHost implements caller_left_ns, export_call (script::export: the export run under the
  caller's budget, its time and its faults the caller's through ModState::fault_to, its answer
  converted under at least 1 ms, a pending promise answered by reactions), settle_now,
  charge_ns, heap_charge and workers. A delivery's or a settle_now's bytes are a Uint8Array.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Before the loader's frame, the runtime gives the services the manifests a mod: import or a call
links against (every mod that loads, and the build's system mods); the workers' messages are no
longer delivered from runtime::frame: the services' together step does it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md says parts 1 and 2 of "Still to port" are ported and names each departure with its
reason, maps together.c, net.c and the network engine's files to their places, and adds two
fixes to "Fixed on the way". game/README.md names the new host functions and the engine's one
stand-in (broker_grants.h comes with the sandbox's port), and drops the network from host-sys's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
lewton 0.10.2 (with ogg 0.8 and tinyvec): pure, safe Rust that decodes
Ogg Vorbis a packet at a time, which streamed voices need, with no C to
vendor in place of the C's stb_vorbis (game/DESIGN.md, Still to port 6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/audio_dsp.h ported for the mods' bus (api::services::audio_mix::dsp):
the transposed direct form II biquad, the cookbook's low pass, and the
I3DL2-style feedback delay network reverb, with their impulse tests. The
mixer takes them in place of its Schroeder stand-in in a later commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A fade of 0 takes one audio frame instead of jumping, and a duck's
release brings the music back only when it was the lowest standing, to
the next lowest. Taken by the mixer in a later commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::audio_mix::decode: a sound's Pcm is 16-bit samples, 1 or
2 channels, at its file's rate, as audio_mix.c kept them, so a mod's 32
MB is what the guide says (the stand-in kept stereo floats resampled to
48 kHz: up to 8 times the memory for a mono 22 kHz file, and a second
resampling). The WAV reader is the C's: its checks and messages, a
refusal before a result past the mod's bytes is made, and 5.1 mixed down
without its LFE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
audio_mix as audio_mix.c: a sound loaded { stream: true } keeps its Ogg
file's bytes, each voice of it gets a decoder of its own (the new
AudioStreams and StreamDecoder traits) and a ring of 1.5 s, which the
decoding thread opens and tops up 4096 frames at a time with no lock
held, rewinding a looping one; the mixer reads the ring by the frame's
number, silent and counted on an underrun. Limits: a streamed file 32
MB, 8 streamed voices a mod, 64 in all.

The mixer's stand-ins go: each voice is resampled once from its sound's
rate by its pitch, its gains ramped across the audio frame (a change, a
placed voice's gain, a stop's fade), through its biquad low pass and
into its mod's audio_dsp.h reverb, which rings out its tail with the
mixer's gate open. Nothing is allocated or freed on the mixer thread.
The game's groups move as audio_groups.c's.

On the way: a file that cannot be read makes a failed sound, as the
guide says, instead of an ArgumentError; voice.moveTo places a voice of
play() from then on; setEffects past the mods' 8 reverbs is a
LimitError; a call of more than 1024 frames is mixed whole (the C cut
it short). longshot-game gives no decoder yet (the next commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hosts::Ogg decodes a file whole (AudioDecode) and opens streamed ones
(AudioStreams): 16-bit samples at the file's own rate, a file of more
than 2 channels mixed down in Vorbis's order, the length from the last
page's granule. A stream reads a packet at a time and rewinds by
opening its bytes again. Ogg sounds play again; the tests decode two
sine-wave fixtures made for them with ffmpeg's lavfi (nothing of the
game's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: Still to port 6 says what was built and what changed from its
draft (decoders give 16-bit samples at the file's rate, the mixer
resamples once; a stream rewinds by opening again), lewton joins the
libraries, the map gains audio_dsp.h and stb_vorbis, and the C's cut of
a long audio frame is a fix on the way. README.md: the Ogg stand-in goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker_frame.h (the broker's frames and its policies' plain checks), host/json_keys.h (the top-level keys of a JSON
document, which broker_frame.h reads) and host/dbus_proxy.h (what the broker lets through to the session bus), as the
mod API branch has them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The broker (the game's executable started again as `longshot --broker`) holds a mod's network grant to its own
mod.json and keeps a confined game's change of the trust file only when it narrows it. The C manifest, package and
trust-file readers it used are gone with the C mod runtime, so it asks the Rust's, through four functions of
game/game.h that need nothing of game_init:

- game_mod_id_valid: the loader's id rule;
- game_manifest_net: a manifest's required network permissions and a system mod's ipc patterns, when it is that id's;
- game_package_manifest: a .lsmod's or .zip's mod.json, through content::archive;
- game_trust_record: api::loader::trust::record, a request kept only when it narrows the file, written in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker.c: the process the game starts before it confines itself (`longshot --broker`), which keeps what the
confined game may not have: crash reports and performance summaries sent with the system's curl, links and folders opened,
a systemd scope, a file saved in Downloads, the session bus through host/broker_dbus.c's filter, the trust file's
narrowing, and mods' network on a channel of its own. host/broker.h is the branch's.

Fitted to this tree: the trust file's change is checked and written by the game side's reader (game_trust_record, the
request's payload made by host/broker_trust.h), and host/broker_grants.c reads manifests and packages through
game_manifest_net and game_package_manifest. Mods' network is served only once host/broker_net.h is in the tree (it
comes with the network engine); until then the net channel answers BROKER_E_NONE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/sandbox_linux.c and host/sandbox_plan.h from the mod API branch: Landlock for files and a seccomp filter that leaves
no network socket, applied in main() before any thread, the broker started first. A run confines itself whatever mods are
on (HOS_SANDBOX unset or 1); 0 turns it off, strict refuses to start unconfined. The branch's look for a script mod that is
on is gone, and with it its C readers of mods.json, packages and manifests.

Fitted to this tree's host:
- the user folder is the one main() chose before the sandbox (saves_dir's move runs there, outside it);
- the player's .nup the RomFS is read from in place is read alone, its path taken from the index's header
  (hos_romfs_index_nup_of, new);
- mods.json, mods-trust.json and the items journal where the game side keeps them (the game folder's mods.json unless
  HOS_MODS_LIST or HOS_OPTIONS_FILE say otherwise; the journal in the user folder), each made before its rule;
- the user folder's recordings/ (input recordings) written, modcache/ always made;
- language.txt made first (hos_language_txt_ensure, from the branch's host/nn_applet.c).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/sandbox_windows.c, host/sandbox_win_plan.h and host/broker_windows.c from the mod API branch: the game starts itself
again inside an AppContainer with no capability (no network), granted the game folder read, its own folders, the user
folder's and the drivers' caches written, and the outer process stays outside as its broker over a named pipe. Every run
relaunches so by default (HOS_SANDBOX=0 off, strict refusing to start unconfined); a step that fails leaves the run
unconfined, with its log lines.

Fitted to this tree: no look for a script mod (and none of the C mod readers it took); mods.json, mods-trust.json and the
items journal where the game side keeps them; the player's .nup granted read; the user folder's recordings\ written; the
trust file's narrowing through game_trust_record; mods' network served once host/broker_net.h is in the tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_main.c starts the process sandbox: Linux's main() runs the broker's own work first (`--broker`), then chooses
the user folder (user_dir_early: saves_dir's move of an older build's user/ runs before the sandbox, which lets the game
write only the folders inside the new place) and confines the process before SDL, the sound or Vulkan start a thread;
Windows' main relaunches the game in the AppContainer after the settings file is chosen. Not for --prepare-shaders.
game_main logs what the sandbox did and calls game_set_confined with whether files and the network are both confined, so
a player's script mods start in a confined game, as the game side requires.

HOS_SANDBOX (0, off, false or no turn it off; strict refuses to start unconfined) has its row in gpu/vk/switches.def, with
the broker's own LONGSHOT_BROKER_FD, LONGSHOT_BROKER_PIPE and LONGSHOT_SANDBOX_NOTE and HOS_MODS_LIST, which the sandbox
reads; longshot_env.txt sets none of the first four. The game side takes HOS_SANDBOX's off words as the host does.

From the mod API branch: a restart hands the broker's channel to the new run (hos_relaunch.c), and the crash window's
helper sends its report, opens links and asks for its scope through the broker, which it is handed a channel to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The trust file (mods-trust.json) is read-only to a confined game, and every run is confined now: a player's unsafe grant
taken back was written nowhere and came back at the next start. When its write in place fails, the loader asks the
sandbox's broker (host_sys::files::trust_set, over game_host.h's new hos_trust_set and host/broker.h's
hos_broker_trust_set), which keeps the change when it narrows the file and refuses the rest; a yes to the unsafe tier
still lasts the run alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A confined game has no network and may not write Downloads or start the desktop's browser. MkwVkHost (version 50) gives
the renderer the broker's broker_perf_send, broker_save_download and broker_open (host/broker.h), each -1 when no broker
serves the game: the performance summary is posted by the broker, and Save my pipeline list saves its zip in Downloads
and opens the folder and the issue through it, as on the mod API branch. Without a broker the renderer does each itself,
as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer keeps the SPIR-V every game folder shares in a shader store outside the game folder (gpu/vk/spirv_pack.h:
LONGSHOT_SHADER_STORE, else $XDG_CACHE_HOME/longshot/shaders or %LOCALAPPDATA%\\Longshot\\shaders), which the mod API
branch's sandbox did not know: confined, it could not open its lock and every start ran without it. It is made first and
written (a folder LONGSHOT_SHADER_STORE names only when it is narrow, on Linux). On Windows DLSS's runtime
(%LOCALAPPDATA%\\Longshot\\ngx, RX_VK_DLSS_DIR) is granted read, as Linux's rules read it already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/sandbox.md from the mod API branch, fitted to this tree: every run confined by default, what
game_set_confined tells the loader, the .nup and the shader store, mods.json and the items journal where the game side
keeps them, the user folder chosen before the sandbox, the trust file and the broker's narrowing of it (a section of its
own), the game side's readers the broker uses, and the network engine still to come. Linked from the developer docs.

The modding guides (unsafe.md, scripting.md, lifecycle.md, dev.md) no longer say the game runs unconfined with no script
mod on: a player's script mod waits only in a game the system could not confine, and the loader's row and log line say
so. An unsafe grant given lasts the run; one taken back is kept by the broker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Without host/broker_net.h in the tree, host/broker_windows.c's pipe_pair, give and the net thread, and the counters both
brokers keep for the net channel, were left unused, which a -Wall -Wextra -Werror build of the Windows files (the
sandbox's test with LONGSHOT_MINGW) refuses. They are built with the engine alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_sandbox_linux.py, test_sandbox_windows.py, test_sandbox_save_folders.py and test_broker_frame.py from the mod
API branch, fitted to this tree:
- every run confined but with HOS_SANDBOX's off words (0, off, false, no), on Linux and in the Windows relaunch decision;
- the files where the game side keeps them (mods.json the game folder's, the items journal the user folder's, the trust
  file beside the list, the game folder's own for a list in its user/), the user folder main() chose, the player's .nup
  read alone, the shader store, DLSS's runtime on Windows and the input recordings' folder;
- host/hos_main.c telling the game side (game_set_confined with both confined), and the game side's HOS_SANDBOX=0 taking
  the host's off words and no other;
- the broker's trust-file gate (the game's channel, the file named at the start, the run's limit) over a stand-in of
  game_trust_record, whose narrowing api::loader::trust's test checks; its net channel tested when host/broker_net.c is
  in the tree, else answered BROKER_E_NONE; MkwVkHost's version 50.
None of them was run here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_dbus_proxy.py as the branch has it: host/dbus_proxy.h's strict reading of the D-Bus format, its list of calls
and its authentication, and host/broker_dbus.c between a stand-in bus and a client. docs/dev/reference/sandbox.md names
it. Not run here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
broker_grants.c is the sandbox's, reading manifests through game.h; the net channel waits for the engine's files
(BROKER_HAS_NET); host-sys and longshot-game own the trust file's broker call and the broker's readers. Fixed on the way:
no host called game_set_confined, and a confined game's grant taken back was lost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A serial site reached between two phases is told through the host's InPlace
(Hosts::in_place) and Services::visit_now: a filter's sealed draft read back
at each argument's type and written into the registers, its answer the
site's. A row naming one of the game's sites adds a handler to that site's
chain at its first listener and removes it at its last (the Retired guard
kept until the grace period); an outcome site or one this Longshot lacks is
listed with the chain's note and never hooked. Clashes are said once and
noted on each mod's Mods tab row. ScriptHost gains hook_filter and fault_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The switches HOS_MOD_TESTS_ONLY, _OUT, _PLAYER_LIST and _TIMEOUT get their
rows, from the mod API branch's, with the Rust files' paths. Skip title is on
for a test run; a live mod_test is refused in the test mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/mod_watch.c and mod_watch.h of the mod API branch, unchanged but
the header's comment, which names the game side's api::watch as what
reacts. inotify on Linux, ReadDirectoryChangesW on Windows, a sleep a
wake ends elsewhere; game-free. game_host.h re-exports the header
(game/DESIGN.md, Still to port 4).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mod_watch.h's open, wait, wake, stats and close as ModWatch (closed when
dropped; wait and stats one thread's at a time under a lock, wake any
thread's), and the walk's mod_watch_hash and mod_watch_file_sig. The
stand-in host has no notices: open gives None and the walks 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/modapi/watch.c in Rust: the folder table (256 folders) under a lock,
each notice placed by its path (a script folder's reload, a served
folder's layers, the mods folder looked at again, mods.json read again,
an overflow a look at everything), a change due once its folder is quiet
0.3 s and its files' hash moved (where walked, once two walks agree), and
the thread lsmod-watch over host_sys::watch. Watch::frame hands the main
thread what is due unless a co-op room holds the mods; Watch::request,
all and hold are any thread's. Unit tests: the debounce, which changes
count, the walked mode, the requests and their limit, a hold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader owns hot reload's watch (Loader::watch), started at the end
of its start unless HOS_MODS_WATCH=0, the game's test mode or a safe
start; a folder script mod's folder is watched from its start (even when
its entry fails) until it is turned off. At the frame's end, before the
switches' stops: Shift+F8 (an edge), then what is due. Loader::reload:
dev.reloading (order 17, to the mod alone), its dev.keep values taken as
JSON as it holds them (ScriptHost::take_kept; one that cannot be keeps
its last copy, logged), what the listener asked to write dropped, its
stop without lifecycle.stopping, and a start from its files at the next
frame with the grants of now. A mod that faults in its listener stays
stopped until its next change; one that does not run starts again.

The engine hands back the same object for a key dev.keep holds
(CallHost::kept_as) and reads it back at the reload under the callback
budget. HOS_MODS_WATCH gets its row in switches.def.

Fixed on the way: QuickJsHost::stop destroyed a mod without telling the
next reap, so a script mod turned off in the Mods tab never had what it
made undone (Services::mod_stopped). The reap now tells it, as the
trait says and the loader's tests assumed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
{"cmd":"mod_reload","mod":id} answers {} once Watch::request queued the
reload (made at the next frame's end), or refused: no such mod, no
folder script mod (a package, a system mod), or 32 waiting. The watch is
taken from the loader at the bridge's first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Settlements queue Settled::{Whole, Part}: Settlements::part (and
Promise::part) take an answer in parts from any thread, pending_bytes
counts the parts not yet handed to the mods, and set_hooks tells a
reader of a promise let go (its mod stopped) and of a settle that took
answers. The engine parses each part in the mod's runtime and defines
its members on the promise's array (one settlement of the frame's 64
each); the last resolves it, a rejection drops the parts, and a part
that does not fit in the mod's heap rejects it with LimitError.

content.read's reader thread sends what ContentReader::read_parts makes
through a PartSink that waits while more than 8 MiB wait to be handed
and stops a read whose promise was let go. longshot-game's reader sends
a map's placements in parts of about 64 KiB (the C did; the whole answer
was past what a value holds for a large map). Unit tests: the queue's
bytes and hooks, the parts in order, a rejection after parts, and
dev.keep's held object read back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: section 4's Built note (the public calls, Watch::request's
signature for the inspector, where the reloads run and the order that
changed, the engine's new methods, what is not built, the host's part,
the parts' calls and where the waiting is), host-sys's and api's rows,
the C files' map, and fixed on the way 42. README.md: the stand-in line
for what the watch finds besides a folder script mod's files, in place
of mod_reload's refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Watch::start takes Option<&Path>; Some(&list) was an Option<&PathBuf>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The schema's TOML comments, its permissions' host lines and a few doc texts named host/modapi/*.c, host/game/*.h,
host/mod_manifest.c, generate.py and the C bindings' lsapi_* names. Each now names the Rust module that does it
(api::services::*, api::loader, api::manifest, oot::*, game_sites::modsite, content::*, longshot-game::*), or says
it is still to port. Doc text only: no id, name, type or permission changed. reference.md, permissions.md and
longshot.d.ts are not regenerated here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The contributors' page on the schema named the C that is gone: host/modapi/*.c and its generated headers, the
lsapi_* bindings, generate.py, the C runtime's step names and its tests. It now names the crates (schema and
schema-gen, api with its services and its build-time bindings, script with QuickJS-ng and oxc, oot, game-sites,
content, longshot-game) and the system mods under game/mods; lists what schema-gen writes and what api's build.rs
makes; says how the Rust bindings, handles, filters, interfaces and the value model map onto the schema; gives the
acquire phase's order as Loader::frame and Services::frame run it; and rewrites "Adding to the API" for a service
in api::services. The UI's host side and the inspector are said to be still to port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::writes keeps the deny list and the ranges as tables of its own (DENY, RANGES); the generated FLAG_*
tables are not read by it. Say so in game.flags.toml and api-schema.md, and that the two change together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The authors' guides and their "For contributors" sections named host/modapi/*.c, host/game/*.h, host/mods.c,
host/mod_manifest.c, host/mod_archive.c and the C runtime's functions. A guide for authors now names no source file
where one did not help (lifecycle, packages, rules, manifest, settings); a contributors' section names the Rust module
(api::services::*, api::loader, api::system, api::claims, script::worker, script::natives, game_sites::modsite,
oot::flags, content::archive, longshot-game::*). ui-channel.md says the UI's game side is still to port (its Rust
names are game/DESIGN.md's design), textures.md that the texture packs' and recipes' code is not in the Rust yet,
and system-mods.md that the inspector's service is still to port. Paths of game/modapi's JavaScript gain their game/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hooks.md said a change to host/game/'s C compiles only the host again and that game_call is host/game/game.h's: the
game side is Rust under game/crates/, and game_call is host/game_call.h's, reached through host-sys. The
architecture's texture flowchart named oot_damaged_files.c, now oot::fixes::damaged_files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
NaN-safe comparisons spelled out, iterators for index loops, the TAU
constant, const assertions for the layouts, a type alias for a test's call
log and doc lists that no longer start a line with '+'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A Safety section on each table site's function, a '?' for the runtime's
start and a doc list item that no longer reads as a link definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A type alias for the published tables' list, and the chain's next() kept
by name (every mod calls it) with an allow and its reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
One allow(unsafe_code) on the qjs module (lib.rs's) instead of two, and a
type alias for a module record's parts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
as_chunks for the build id's digit pairs, a type alias for a test's cheats
folder and a doc list item that no longer reads as a link definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
as_chunks for the MurmurHash3 words and the tree's commands, iterators for
index loops, struct update syntax in two tests and a type alias for the
message files written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Error types for a refused settings file (storage::Refused) and a setting
that is not a keybind (settings::NotKeybind) in place of (); type aliases
for the setting switches, a keybind, the reader's requests; a write's
refusal boxed and a UI undo's mount boxed; iterators for index loops; a
const assertion; and the mix-down's 0.7071 kept as a named constant (the
C's value, not quite 1/sqrt(2)) with an allow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guide and the C both refuse exports, net and ipc without "runtime" (and a
runtime needs "api" and "entry"), so the together and net tests' manifests
were the wrong side. "con~x.json" is no Windows device name (the stem ends at
the first '.'), as the C's device_name says; the test now checks "con.x/y".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/restbl.c restbl_grow gives a .bgyml or .byml file at least 8 bytes an
added byte plus 4 KiB (a ControllerSetParam grown in proportion failed to
load); the port had dropped it. The test's bfres case wanted an allowance
the C never gave a bfres (1120, not 2112); it now checks both kinds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
word_in took "liftable" in "QueryUnliftableState": after a lower-case letter
only a word starting with a capital begins (the C had the same slip).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
bc7enc's mode 6 (the C's encoder) writes alpha 254 for that cut-out's solid
pixels; the clear ones must stay 0. serde_json writes 1e300 as 1e+300 (as
JSON.stringify does). The C's put_str, which read.rs ports, escapes a byte
that is not UTF-8 as \ufffd; the docs said a bare U+FFFD.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The bridge queue's "none taken" is taking 0, so asking after ticket 0 (never
issued) said Waiting once an ask was done; it is Gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
ACTOR_SIZE is the actor's bytes checked before its fields are touched; the
serial at 0x458 is past it and read on its own, checked (the C's game_peek_at),
so the test now checks the fields the spawner does touch. The skips test's
player hold (+0xf25 from BASE + 0x3100) lay past its 0x4000 map.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
QuickJS-ng 0.18 loads and resolves a module's imports while it compiles it,
so realmModule's compile asked for every import before link() had given a
linker, and any module with an import failed ("this context links only in
link()"). realmModule now checks the syntax with oxc (Node's constructor
throws a SyntaxError at once) and keeps the source; link() compiles it with
the linker set, and a module it imports is compiled as it is loaded. The
unused Context::resolve_module goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The export test's manifests export without a runtime, which the guide and the
C refuse. A raw context has no eval until JS_AddIntrinsicEval. The runner's
entry is run([[file, ns], ...]) as the C's entry_of writes it. The fence test's
path.join took its ".." out, so the refusal was "outside", not "dotdot".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The cheat rows are Store::Run, as the module says (the menu never saved
them). The opcode C0 test's store, 0410_0000, offsets by r0, which the test
had set to 7, so it wrote heap + 0x87; it now offsets by r2 (0), as dmnt's
0TMR00AA reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mod declares two rows, Skip title screen and Skip opening (52); the test
counted one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
As hos_wide_ui_tick's ui_on, the plan runs whenever fill_x is not 1, which a
wider picture always makes; the HUD stays in the middle (ex and ey 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows the system mods took over lost the menu's value texts: Field of view showed "100" for "100% (original)", and
Walk speed and the HUD placement rows lost their "%". A SettingDecl has a Format now (its unit, and the default's own
text), which the menu's row text and the settings' spec (unit) use; the 13 "100% (original)" translations are back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Since the game's rows became the system mods' settings, kept by the game side outside opts, the report's "Changes from
the defaults" skipped them all. GameSettingRow carries its default now (MKWVK_API_VERSION 53), and the report takes each
game row's value now and default from the game side (menu_game_row_values), so Field of view at 110 reads
"Field of view: 110% (default: 100% (original))". tests/test_bug_report_defaults.py checks it is listed, from the game
side's value rather than the menu's copy, and that one at its default is not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's table of its script system mods (game/mods/<name> with no crate: Discord status, the mod inspector) is
hashed from their shipped files, and the game trusts a system_mods/<name>/ folder only when it hashes to that entry;
but no step of the build put them there, so a run logged "the built-in mod system/discord is not installed". The
finish copies each one's shipped files (the schema crate's system_mods::folders and shipped_files, the same rule as
the table's), and takes out one the build no longer ships. A test installs one and checks its hash against the
source's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A Windows game cross-built on Linux stopped at the game's Rust: the build scripts' cc looked for
x86_64-w64-mingw32-clang on the PATH, and cargo for a linker of that name. rust::cc_env gives cargo's run the
toolchain's own clang and clang++ with its target flags, llvm-ar, and llvm-mingw's driver as the target's linker (else
its clang told the target). With it the whole Windows game folder links here (longshot.exe, longshot_vk.dll, the
AppContainer sandbox and the broker's Windows C among them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The sandbox lets the game write only its own folders and the control socket's (host/sandbox_plan.h control_dir, which
says shots go there), but the client asked for shots in the run's shots/ folder or wherever the caller named: with the
sandbox on, as by default, every shot failed ("the PNG could not be written"). The client library asks the game to
write a shot into the socket's folder under a name of its own, then moves it to the asked path itself, reading it
through no link (the game can write that folder) and at most 256 MB. Game-free tests: the fake game refuses a path
outside its socket's folder, as the sandbox does, and a session's shot still lands; a link left in the stage is not
followed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A confined game hung in "loading" after its save's file list: gmd::SaveDataMgr called nn::fs::Commit again and again
(every sample of it in save_copy's flush or save_journal's directory syncs), each one refused. save_journal syncs the
user folder and the folder it is in, and the sandbox (host/sandbox_plan.h) lets the game only list the user folder and
not open its parent at all: the open failed with EACCES, the commit with it, and the game asked again without end.

Those two folders' entries are made at the start, before the game is confined: host/sandbox_linux.c now syncs them
there, and save_sync_outer counts a folder the game may not open (ERROR_ACCESS_DENIED) as one this run did not change.
The save's own folders are synced as before. tests/test_fs_save_commit.py's new case refuses the parent's open as
Landlock does (its mode 0311) and commits: it fails on the old source and passes here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
fix(bridge): the tools' game runs start with the Discord status off
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 48s
CI / Website build and checks (pull_request) Failing after 50s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m31s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 4m29s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m6s
c52a3fa3d9
A check run's Discord status system mod connected to the PC's Discord and set a live status from a headless test.
Every run a tool starts, longshot_bridge.start_session (launch, ab, the parity gates, the routes) and tours/drive.py's
start_game (the pipeline tours), now has HOS_DISCORD=0, the mod's offSwitch, unless the caller's env sets it. A
player's game is unchanged. tests/test_longshot_ctl.py checks the fake game is started with it, that a caller's own
value stands, and that drive's start drops a shell's value for the run's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Author
Owner

Tested in game: CachyOS Linux 7.3, this PC (Ryzen 7900X, NVIDIA), headless: kokiri-start booted to play in Kokiri Forest (run 3, c52a3fa3's tree less the Discord test-run switch): all 14 native system mods and the Discord script mod started, sandbox confined, settings from the profile's options file, one save commit (66 ms, no retries), ~60 s in play with stick moves, clean quit, no errors. Runs 1-2 hung at the save load (the sandbox refused syncing the user folder's parent), fixed with a game-free test. Not yet: the comparison against #2411, Windows (cross-linked only), Phase 5 in game.

Tested in game: CachyOS Linux 7.3, this PC (Ryzen 7900X, NVIDIA), headless: kokiri-start booted to play in Kokiri Forest (run 3, c52a3fa3's tree less the Discord test-run switch): all 14 native system mods and the Discord script mod started, sandbox confined, settings from the profile's options file, one save commit (66 ms, no retries), ~60 s in play with stick moves, clean quit, no errors. Runs 1-2 hung at the save load (the sandbox refused syncing the user folder's parent), fixed with a game-free test. Not yet: the comparison against #2411, Windows (cross-linked only), Phase 5 in game.
Member

Possibly related, for context:

  • PR #1958 feat(mods): the Modding API: TypeScript mods the game compiles and sandboxes, system mods, a Mods tab, hot reload, custom actors and in-game tests — Overlapping mod API/system mods; this is their Rust redesign.
  • PR #2016 WIP: fix(input): broker gamepads outside the Windows mod sandbox — Relevant Windows gamepad brokering for the sandboxed game.
  • issue #1118 Game: Windows farm sandbox check fails AppContainer write permission test — Open AppContainer permission-check concern for the sandbox-on-by-default change.
  • issue #1097 Feedback on the Modding API Spec from the code mod work (#134 and its stack) — Open design feedback about mod API and compatibility decisions.
Possibly related, for context: - PR #1958 feat(mods): the Modding API: TypeScript mods the game compiles and sandboxes, system mods, a Mods tab, hot reload, custom actors and in-game tests — Overlapping mod API/system mods; this is their Rust redesign. - PR #2016 WIP: fix(input): broker gamepads outside the Windows mod sandbox — Relevant Windows gamepad brokering for the sandboxed game. - issue #1118 Game: Windows farm sandbox check fails AppContainer write permission test — Open AppContainer permission-check concern for the sandbox-on-by-default change. - issue #1097 Feedback on the Modding API Spec from the code mod work (#134 and its stack) — Open design feedback about mod API and compatibility decisions.
Author
Owner

New head 57469dd5: HOS_START_SLOT=<n> starts a run on a chosen save slot through the Skip title mod (unset: as before; a missing or empty slot leaves the file list to the player, never a new game or another slot), and longshot_version.txt gains features=start_slot so the launcher can tell which games take it. Game-free tests and clippy pass; the save list's order is not yet confirmed in the game.

New head 57469dd5: `HOS_START_SLOT=<n>` starts a run on a chosen save slot through the Skip title mod (unset: as before; a missing or empty slot leaves the file list to the player, never a new game or another slot), and `longshot_version.txt` gains `features=start_slot` so the launcher can tell which games take it. Game-free tests and clippy pass; the save list's order is not yet confirmed in the game.
A launcher needs to know whether a game folder can take its save picker's slot without running the game, and a
version number says nothing a fork or a dev build keeps. The tree lists what its game can do in game/features.txt,
one name a line; the builder copies them into longshot_version.txt as `features=<name>,<name>` for the game it built
from that tree. The first name is start_slot (HOS_START_SLOT). Documented in docs/dev/reference/builder.md; tested in
build-driver's folder.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
feat(skip-title): HOS_START_SLOT starts a run on the launcher's chosen save slot
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 54s
CI / Website build and checks (pull_request) Failing after 1m37s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m45s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m56s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m31s
57469dd57f
The launcher's save picker sets HOS_START_SLOT=<0-99> for one run. The Skip title mod then presses through the title as
it does for the newest save, and on the file list moves the cursor from the newest save to slot_NN (d-pad down or up,
one slot a press, the list taken to show the profile's saved slots in their numbers' order) before its A. It is
followed with the Skip title row off too, and the row is never changed. A slot with no save (no progress.sav, or an
empty one), or a value that is no slot, leaves the title screen's file list for the player with a log line; with no
save at all the title screen stays, so nothing starts a new game or loads another slot silently. A build without the
button-wait sites, or a game that tells no wait in 45 s, gets no blind presses with a slot chosen.

Unset, nothing changes. In gpu/vk/switches.def (test_switch_table), docs/dev/reference/switches.md and the user docs.
Game-free tests in the mod: the slot's resolution against save folders (moves, a missing or empty slot, no slot, no
save), and the machine's presses (the row off, moves down and up, the list left, never blind). The list's order is an
assumption until a game run on a profile of several saved slots checks it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
feat(fs): HOS_SAVE_DIR keeps a run's saves in a launcher profile's folder
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 35s
CI / Website build and checks (pull_request) Failing after 1m32s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m37s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m3s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m41s
8aa8522bba
The launcher's profiles each own their saves. HOS_SAVE_DIR=<folder> (a whole path, environment only) makes the run keep
save/<uid>/ and save-work/ there instead of in the user folder; the settings, caches, recordings and mods' data stay in
the user folder. Unset, nothing changes.

- host/save_dir.h: the folder checked and made (with save/ and save-work/) and written to once; host/nn_fs.c keeps the
  run's choice (hos_save_dir_choose, chosen before the sandbox in main) and every save path from hos_saves_root(): the
  mounts, IsSaveDataExisting, the journal's outer syncs (the confined parent's refusal tolerated, as for the user
  folder) and so the control bridge's save root. A folder that is not a whole path, cannot be made or cannot be written
  stops the start (save_dir_unusable, the reason), never the user folder's saves instead.
- The sandbox gives its save/ and save-work/ the user folder's rights, the folder itself listed (Linux's
  sandbox_plan.h, made and synced before the rules; Windows' sandbox_win_plan.h).
- The game side: host-sys's Dir::Saves (game_host.h hos_saves_root); the Skip title mod's newest-save lookup, and with
  it HOS_START_SLOT's slot check, read it.
- The bridge: start_session copies a --save or --repo-save into the run's HOS_SAVE_DIR when its env names one.
- game/features.txt: save_dir, so longshot_version.txt's features= says the game can.
- The switch's row, switches.md, sandbox.md and the user docs' saves page.

Game-free tests: test_fs_save_commit (saves, work copies and the bridge's root in the folder, none in the user folder;
refused when relative, unmakeable or unwritable, each in a process of its own), test_sandbox_linux and
test_sandbox_windows (the rules, another profile's not granted), test_sandbox_save_folders (the folders nn_fs writes
there are the ones granted), oot's newest-save lookup, and test_longshot_ctl (the copied save lands there).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Author
Owner

New head 8aa8522b: HOS_SAVE_DIR=<folder> keeps a run's saves (save/<uid>/, save-work/) in a launcher profile's folder; everything that finds saves follows it (nn_fs, the commit's syncs, the bridge's save root, Skip title's newest save and HOS_START_SLOT), the sandbox grants only that folder's save trees, and an unusable folder stops the start (exit 3, save_dir_unusable) rather than falling back to the shared saves. Advertised as save_dir in longshot_version.txt's features=. Game-free tests pass (cargo 1627; the sandbox, fs and bridge checks); not yet run in the game.

New head 8aa8522b: `HOS_SAVE_DIR=<folder>` keeps a run's saves (`save/<uid>/`, `save-work/`) in a launcher profile's folder; everything that finds saves follows it (nn_fs, the commit's syncs, the bridge's save root, Skip title's newest save and `HOS_START_SLOT`), the sandbox grants only that folder's save trees, and an unusable folder stops the start (exit 3, `save_dir_unusable`) rather than falling back to the shared saves. Advertised as `save_dir` in `longshot_version.txt`'s `features=`. Game-free tests pass (cargo 1627; the sandbox, fs and bridge checks); not yet run in the game.
Author
Owner

New head 56ace9f0: with HOS_SAVE_DIR set, mods' per-save data lives in <HOS_SAVE_DIR>/modstore/save/<uid>/slot_NN (two profiles never share it; granted by both sandboxes), and an unusable save folder is a plain refused start (exit 3, start refused: save_dir_unusable, a message box unless headless) with no crash record or crash window. cargo 1629 passed; the crash and sandbox checks pass; Windows cross-links.

New head 56ace9f0: with `HOS_SAVE_DIR` set, mods' per-save data lives in `<HOS_SAVE_DIR>/modstore/save/<uid>/slot_NN` (two profiles never share it; granted by both sandboxes), and an unusable save folder is a plain refused start (exit 3, `start refused: save_dir_unusable`, a message box unless headless) with no crash record or crash window. cargo 1629 passed; the crash and sandbox checks pass; Windows cross-links.
fix(fs): a profile's mods' save data with its saves, and an unusable HOS_SAVE_DIR is no crash
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 3m12s
CI / Website build and checks (pull_request) Failing after 3m17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 6m19s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 6m42s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 8m7s
56ace9f092
Two follow-ups to HOS_SAVE_DIR:

- The mods' per-save data (modstore/save/<uid>/slot_NN) stayed in the user folder, so two profiles sharing it shared a
  mod's data for their slot 0. With HOS_SAVE_DIR it goes to <HOS_SAVE_DIR>/modstore/save/<uid>/slot_NN (api's storage
  save_root, longshot-game's runtime save_storage_root); the global and profile stores stay in the user folder.
  The folder's modstore/ is made with save/ and save-work/, and both sandboxes grant it as they do those. Unset, as
  before.
- An unusable HOS_SAVE_DIR went through hos_fatal, whose crash record made the crash window say "Longshot closed
  unexpectedly" and offer a crash report. It is now refused as a start set up wrong (hos_main.c refuse_start): a log
  line ("start refused: save_dir_unusable: ..."), the reason on stderr, a plain message unless headless, then the
  clean end and exit code 3, with no crash record; the window says nothing.

Tests: api's storage (the per-save stores under the profile's folder, never shared, unset as before), longshot-game's
runtime, test_sandbox_linux, test_sandbox_windows and test_sandbox_save_folders (modstore/ granted),
test_fs_save_commit (made), test_crash_dialog (a refused start is no crash; refuse_start writes no record and ends
clean), test_crash_record's exit inventory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HumanBean force-pushed feat/game-rs from 56ace9f092
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 3m12s
CI / Website build and checks (pull_request) Failing after 3m17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 6m19s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 6m42s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 8m7s
to 231d650ded
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 18s
PR description / Description follows the template (pull_request_target) Successful in 29s
CI / Website build and checks (pull_request) Failing after 2m39s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m28s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 4m59s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
2026-11-24 14:03:06 +00:00
Compare
Author
Owner

New head 231d650d, rebased onto #2411's 59a7b1f8 (on #2286's 02386f32). It takes in the full self-review of the earlier head (11 blocking, 25 should-fix, 43 nits), each blocking fix with a game-free test shown failing first, plus an overflow sweep of every parser of mod input. Spec gaps closed since: has() honest; the 27 unplaced mod-API sites placed (19 rule sites through new lift rules in builder/crates/edits); the content stage and typed patches run in the game (romfs_merge port, plan cache, content.sound via BWAV); texture packs and render-target recipes; save profiles, pad gyro and device kind, camera rigs; mods_api= in longshot_version.txt; the sandbox closes the session bus on kernels below Landlock ABI 9 with a private mount namespace (player scripts held only where user namespaces are blocked). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; Python 665 passed, 14 failed (13 fail identically on 59a7b1f8, the 14th fixed since); the Linux game build and the Windows cross-build (longshot.exe, longshot_vk.dll) link. Not yet run in the game; the Mods tab's per-mod page and the unsafe tier's code modules land next.

New head 231d650d, rebased onto #2411's 59a7b1f8 (on #2286's 02386f32). It takes in the full self-review of the earlier head (11 blocking, 25 should-fix, 43 nits), each blocking fix with a game-free test shown failing first, plus an overflow sweep of every parser of mod input. Spec gaps closed since: has() honest; the 27 unplaced mod-API sites placed (19 rule sites through new lift rules in builder/crates/edits); the content stage and typed patches run in the game (romfs_merge port, plan cache, content.sound via BWAV); texture packs and render-target recipes; save profiles, pad gyro and device kind, camera rigs; mods_api= in longshot_version.txt; the sandbox closes the session bus on kernels below Landlock ABI 9 with a private mount namespace (player scripts held only where user namespaces are blocked). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; Python 665 passed, 14 failed (13 fail identically on 59a7b1f8, the 14th fixed since); the Linux game build and the Windows cross-build (longshot.exe, longshot_vk.dll) link. Not yet run in the game; the Mods tab's per-mod page and the unsafe tier's code modules land next.
Author
Owner

New head 54e28eb5 (541 commits on #2411's 59a7b1f8): the Mods tab's per-mod page (the permission prompt, settings, permissions, the debug page and frame times, , and a click on a mod window no longer reaches the game); the content stage's follow-up (archives of several mods made one, skins and model checks, the AINB schema, the modcache sweep, hot reload rebuilding the layers); and the unsafe tier's build side (mods' own sites, a manifest's exefs/, data switches without a build, vslot thunks, code modules built in). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; schema outputs current; Python 666 passed, 13 failed exactly as on 59a7b1f8; Linux and Windows builds link. Still not run in the game. Next: the mods' world layer and shader effects, the registries' engine side, and longshot/capture.

New head 54e28eb5 (541 commits on #2411's 59a7b1f8): the Mods tab's per-mod page (the permission prompt, settings, permissions, the debug page and frame times, <SettingRow>, and a click on a mod window no longer reaches the game); the content stage's follow-up (archives of several mods made one, skins and model checks, the AINB schema, the modcache sweep, hot reload rebuilding the layers); and the unsafe tier's build side (mods' own sites, a manifest's exefs/, data switches without a build, vslot thunks, code modules built in). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; schema outputs current; Python 666 passed, 13 failed exactly as on 59a7b1f8; Linux and Windows builds link. Still not run in the game. Next: the mods' world layer and shader effects, the registries' engine side, <Icon item> and longshot/capture.
HumanBean force-pushed feat/game-rs from 231d650ded
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 18s
PR description / Description follows the template (pull_request_target) Successful in 29s
CI / Website build and checks (pull_request) Failing after 2m39s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m28s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 4m59s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
to 54e28eb5ae
Some checks failed
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 54s
CI / Website build and checks (pull_request) Failing after 2m19s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 5m2s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m29s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m43s
2026-11-24 14:09:38 +00:00
Compare
The renderer drew neither: gpu/vk/modui_world_off.cpp stood in for the
world layer (every World root over the picture, never tested against the
scene), the Insert menu's pass rows took only the CRT filter and colour
vision, so a mod's GAME_PASS_SHADER pass was never drawn, and nothing
called game_post_report. The C era's renderer half is brought back over
the game side's lists:

- Screen effects (vk_effects.cpp, fx_spirv.h, the fx shaders): the
  GAME_PASS_SHADER passes of game_post_passes taken when its generation
  moves (fx_list.h, their SPIR-V and params copied at once), checked
  against the template again, made pipelines and drawn before the upscale
  and after it; each one's state, GPU time and reason reported through
  game_post_report. A mod's page in the Mods tab lists its effects with a
  switch of the player's for the session, and its help gives their GPU
  time beside its script's.
- The world layer (vk_world_layer.cpp, vk_world_depth.cpp, the world
  shaders): game_world_draws copied into the renderer's primitives when
  its generation moves (world_list.h: a box its 12 edges, a circle its
  48 segments, a billboard's image copied once by an id the game side
  now gives it, GameWorldDraw.image_id), drawn on the gameplay upscale's
  picture with the scene's depth; the World roots tested at their point
  and drawn in the scene with occlude="depth" (the overlays' offscreen
  atlas in vk_imgui.cpp, the scene camera kept in vk_temporal.cpp).
- MkwVkHost version 55: game_post_report and game_world_draws, last, in
  host/rx_backend.c's table too. Switch rows RX_VK_FX, RX_VK_FX_BUDGET_US
  and RX_VK_WORLD.

With no mod's effect or shape, each poll compares one generation and the
dispatch path asks one relaxed load. Game-free tests: test_gfx_effects.py
(the template, fx_list.h, the wiring), test_gfx_world.py
(world_list_test.cpp, world_layer_test.cpp, the wiring),
test_world_depth.py (world_depth_test.cpp), and test_mods_menu.py's
effect lines; the MkwVkHost tail checks of test_broker_frame.py and
test_texture_pack.py take version 55's two members.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hosts::drawn() said the renderer drew neither a mod's shader passes nor
the world layer, so gfx.effect, gfx.world and its members were absent
(has() false, NotAvailableError). The renderer draws both now
(gpu/vk/vk_effects.cpp, vk_world_layer.cpp), so Drawn says so, and the
test that held them absent holds them present.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A World root was mounted under ui.hud, as a label drawn over the picture
with the HUD. It is drawn in the scene now, tested against its depth, as
the world layer's shapes are: the spec's 11.6 gives it gfx.world. The UI
service's grants (UiGrants.world), its surface's permission, longshot/ui's
mount(), the fake game and longshot-mod's scan ask gfx.world; enemy-names
asks for it; the schema's notes and the generated files follow. A test
mounts a World root with ui.hud alone (refused, naming gfx.world) and with
gfx.world (taken).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/README.md's stand-ins and DESIGN.md said the world layer and the
effects were not in this tree; architecture.md's rule 5 named the
stand-in. They say what is true now, architecture.md has the rules of
both again (screen effects, the world layer), and the authors' docs
(gfx.md, world.md, ui.md, ui-channel.md) say the renderer draws them, not
yet seen in a game run, with the player's switch of an effect and a World
root's permission gfx.world.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshotCheckout and trustedCheckout told a checkout by its scripts/dev.py and host/modapi/. The mod API moved
to game/modapi/ with the game side's port to Rust, and host/modapi/ is gone, so no folder was a checkout any
more: `longshot-mod test --game` on a mod inside the checkout (or with LONGSHOT_CHECKOUT set) no longer went
through the checkout's dev.py, and longshotCheckout(HERE) returned null. The mod tools' tests 67 ("the game in
its test mode, or dev.py game-tests inside a checkout") failed on its assert that the checkout is found, and 68
(audit N12) on path.join(null) when it set LONGSHOT_CHECKOUT to that checkout.

The marker is now game/modapi/. Test 68's stranger repository makes an empty game/modapi/ in place of
host/modapi/, so it still looks like a checkout and the audit N12 case (a dev.py found by walking up is never
run) is still the one tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The test that each library mod's committed mod.d.ts is what `longshot-mod types` writes now walked
assets/modding/examples/ and assets/modding/system/. The system mods moved to game/mods/, so the second
readdirSync threw ENOENT and the test (92) failed before checking anything.

It walks assets/modding/examples/ and game/mods/ now, and asserts the Discord system mod (game/mods/discord,
the system mod with exports) is among the libraries found, so a later move cannot drop the system mods
from the check without failing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's test runner (game/modapi/testing/runner.js, copied for the fake game into lib/testing-runtime.js)
lists in FAKE_ONLY the FakeGame members a test may use only in the fake game, so that the real game refuses
them with FakeOnlyError. It still listed "native", the fake game's stand-in for native C mods, which was
removed with them (feat(mods)!: native C mods removed): FakeGame has no native member. The mod tools' test 63
("the fake game's helpers the real game refuses are the fake game's own") failed on it: "native is in the
runner's FAKE_ONLY but not a FakeGame member". The list was wrong, not the test.

"native" is out of FAKE_ONLY in runner.js, and lib/testing-runtime.js is written again from it by
cargo run -p schema-gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing ran assets/modding/packages/mod-tools/test/*.test.mjs: not tests/run_all.py, not a mise task, not the
Forgejo or CircleCI workflows. The C era's tests/test_mod_tools.py did, and the test files still say it runs
them, but it did not come over to this tree. So they broke unseen when the system mods moved to game/mods/,
the mod API to game/modapi/ and the native C mods went (four of 92 failing).

tests/test_mod_tools.py runs them with node --experimental-vm-modules --test and fails when node fails, any test
fails or is cancelled, none passed, or the Node is older than 22 (the package's engines). Node is PATH's (or
--node); with none it prints "SKIP: node not installed" and exits 0, the tests/ convention for a skip found at
run time. It declares no {tool} placeholder on purpose: run_all.py's --strict fails any check whose declared
tool is missing, and no CI image has Node yet. Its docstring says CI should install the Node release pinned in
the file (NODE_VERSION v24.22.3 and its NODE_SHA256, release.yml's) once CI's migration is done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-mod test --game takes a checkout's dev.py game-tests for a mod inside the checkout its tools come
from (or with LONGSHOT_CHECKOUT naming one), as assets/modding/docs/testing.md, game/DESIGN.md and
HOS_MOD_TESTS_OUT's switch say, but this tree had no such command: the C era's scripts/devtools/gametests.py
did not come over. Once the checkout was found again (game/modapi/), that route ended in dev.py's "invalid
choice".

scripts/devtools/gametests.py is the C era's command fitted to this tree: the game's test mode is the Rust
side's (game/crates/longshot-game/src/mod_tests.rs; test files as game/crates/script/src/testing.rs
find_tests takes them: no .cts, four folders deep, no links), the bridge's start_session without the romfs it
no longer takes, and its start one job of the PC's queue in shared mode (dev.py queue run game-tests --mode
shared). Each run gets a folder of its own under the development folder's runs/game-tests/ for its reports
(HOS_MOD_TESTS_OUT), user folder and log; the shell's game switches are left out and said; the reports are
taken only whole and with the game's own exit code. The target is required: the C era's suite,
tests/game-features/, is not in this tree. A save that is not in assets/saves/ and a run folder too long for
HOS_MOD_TESTS_OUT are refused before anything starts.

tests/test_dev_game_tests.py (the C era's, ported) checks it game-free: the mods a target holds, the test
files, the plan, --dry-run, the refusals, the arguments longshot-mod passes, the queue job, and a run with the
bridge stood in for. The mod tools' game-test.test.mjs runs the checkout's dev.py with what gameCommand
builds plus --dry-run, and checks the choice of route: a system mod of the tools' own checkout goes through
its dev.py, a mod elsewhere runs the game, and a LONGSHOT_CHECKOUT that is no checkout runs the game.
docs/dev/developing.md and testing.md say how it runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The built-in registries (keybinds, hud, markers, commands) were lists mods
shared with nothing in the game reading them: no keybind conflicts, no command
palette, no marker layer, no way to move or hide a mod's HUD.

services/shared.rs is the engine's side of them:

- keybinds: every running mod's keybind settings (and its debug page's key),
  with the "keybinds" entries for keys bound another way, as one list; two
  that share a key (any case) or a chord (its buttons as a set, a setting's
  Switch labels read as PadButton's names) clash.
- commands: { id, label, help?, args? } entries, each argument a toggle, a
  choice, a number or text with a default. Services::command_run checks the player's
  arguments against the entry as the mod gave it now and delivers "command"
  to its mod at the next together step; longshot/mods' command(entry, run)
  adds the entry and hears it.
- hud: each mod's HUD roots by key (a <Hud id>, which Hud now takes with a
  title, else "#n" by mount order), labelled by the mod's "hud" entries; the
  player's place (another region, or hidden) is kept in the mod's store
  ($hudLayout, a host setting never on its page) and applied as the UI's
  snapshot is built.
- markers: { x, y?, z, map?, label?, color? } entries of running mods on this
  map, as world-layer shapes (a ring, a line up, the label), published with the
  mods' own shapes by gfx.rs; made again only when the entries or the map
  change.

The Mods tab's snapshot carries the view (TabSnapshot::shared), and its edits
run a command (Edit::Command) and move a HUD root (Edit::Hud). A malformed
entry stays in the registry and is left out of what the game resolves, counted.

Tests: chords, clashes, the strict reading of commands and markers, the HUD
layout's text; a command run reaches its mod once with its arguments; the
keybinds list and its clashes across two mods; the marker layer by map; a HUD
root moved and hidden in the snapshot and kept in the store.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The engine's view of Longshot's own registries reaches the menu: game.h's
GameModsSnapshot carries the bindings with their clashes (GameModKeybind), the
palette's commands and their arguments (GameModCommand, GameModCommandArg) and
the mods' HUD roots (GameModHudRoot), built by mods_page.rs from the loader's
TabSnapshot::shared.

The Mods tab's list has an "Across mods" part under the mods, each line a page:

- Keybinds: every running mod's keys and chords, a clash marked and named in
  the help; a keybind setting is rebound there as on its mod's page (its row's
  setting, game_mod_setting_set), an entry the mod binds itself is shown only.
- Commands: the palette, each command with its arguments under it (Left and
  Right choose a value); Enter runs it, sent as game_mod_setting_set's
  "$command" key with the arguments' JSON.
- HUD layout: each mod's HUD roots, Left and Right through its own place, the
  nine regions and hidden, sent as the "$hud" key.

The two keys go through game_mod_setting_set so MkwVkHost is unchanged; the
game side reads them as the Commands and HUD pages' edits (shared_edit). These
are the Mods tab's own lines, not the model's rows, and save nothing in
longshot_options.ini (a HUD root's place is kept in its mod's store).

tests/test_mods_menu.py walks the three pages against a fake snapshot; the
game side's tests check the C block and the edits' JSON.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Icon was the built-in vector set alone, so a tracker could not show the
game's item pictures (the Ship of Harkinian item tracker's case).

Icon takes `item`, an item's name ("Item_Bomb", a mod's new item's too). The
mod's image set reads it as a source of its own beside the mod's PNGs: on the
images' thread, the host's ItemIcons (longshot-game's textures.rs) reads the
file the game is served for UI/Tex/Icon/<item>.bntx.zs, takes its first plain
2D texture and has the renderer's decoder make level 0 RGBA8. The pixels go to
the UI snapshot alone (the renderer draws them in the Icon's square, tinted
only when the Icon gives a colour); no script sees them and nothing is kept or
written. An item with no icon, or one the decoder does not take, is drawn as
an empty place, said once in the log.

The image set's sources are now a file, an item's icon, or a thumbnail's src
(`capture:<n>`, for longshot/capture next, which fails until then), all under
its caps (64 images, 16 MiB). The types and the fake game take `item`, and the
Hud's `id` and `title` that the HUD layout page goes by.

Tests: an item's icon through a reader of made-up icons, one it has not, the
name's check, and an Icon's image in the snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The enemy editor's thumbnails (spec 18) had no way in: longshot/capture was
named in spec 9's table and not built.

capture.toml: thumbnail({ rect?, size? }) gives a Thumbnail handle (src(),
state(), failure(), save(name), release()); load(name), saved() and
remove(name) give back the ones a mod kept. Permission ui.window. A handle has
no read: its src (capture:<n>) is what an <Image> (or a Canvas's image
command) shows, and only the mod's own src resolves.

The game side (services/capture.rs) lists each ask in the mods' UI snapshot,
version 11 (MkwVkUiSnapshot.captures: an id, the part of the picture as
fractions, the size 16 to 256 a side) until the renderer answers. The renderer
(vk_modui.cpp thumbs_tick, vk_replay.cpp thumb_ask) copies the part at the
present's point the control bridge's shots are taken from (the scene, no
overlay, no menu, no mod UI), blitted into a 256 x 256 image of its own, reads
it back once the GPU is past it and posts MKWVK_UI_EVENT_CAPTURED with the
RGBA8 rows (MKWVK_UI_VALUE_PIXELS), or none when it could not. longshot-game's
game_ui_post keeps such an answer apart from the mods' events (8 at most) and
the next frame's start takes it (capture_frame); an ask unanswered for 4 s
fails. The pixels stay with the service and the mod's image set (counted in
its caps). save() writes a PNG under <user>/modstore/captures/<mod>/, which no
mod's file API reads. MkwVkHost is unchanged; rx_backend.c's and ui.rs's
layout checks hold the snapshot's new size.

Caps: 16 thumbnails a mod, 4 pending; 64 saved. has("capture") is the host's.
The fake game takes a thumbnail at the frame after it was asked (or fails it,
game.captureFails) and keeps saved ones in game.thumbnailsSaved.

Tests: the ask's checks; a thumbnail asked in the snapshot, answered through
the sink, shown, released; one unanswered failing and the pending cap; one
saved to the game's folder and loaded again; the C block's captures and the
answer's checks; the image set's thumbnail source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guides said the engine's side of the built-in registries, the game's item
icons and longshot/capture were not built.

- mods-together.md: what the game does with keybinds, commands, hud and
  markers, each entry's shape, and command() of longshot/mods.
- input.md: two mods' keys that clash are shown and rebound on the Keybinds
  page.
- ui.md: <Icon item>, thumbnails of the picture (longshot/capture), and the
  player's HUD layout by a Hud's id and title.
- ui-channel.md: the image set's two new sources, Icon's item, and the
  snapshot's version 11 with the thumbnails' asks and answer.
- game/DESIGN.md: api::services::shared in the together step's section.
- game/README.md's Stand-ins: what the pages leave out (native mods' keybind
  settings, Longshot's own bindings, a text argument), the icon's path, the
  marker layer drawn only with the world layer, and that none of it has run in
  the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder and the game each find the player's mods their own way, but a
check that the game's build still matches the mods needs both to describe
them identically. The new crate mods-stamp (game/crates/mods-stamp, no
dependency but serde) takes the facts each side found (each mod's code files,
its code hash and acceptance, mods.json's order and switches, the build's
switch table) and makes the stamp: the mods whose code a build takes, the
parts it takes (sites on or off; patches when on or a switch; code modules
when on), in mods.json's order, with a hash of the canonical list and of the
accepted set. compare() says what needs a build: a mod added, removed or
changed, a move among the mods whose order matters (patches, code modules),
or the accepted set; switching a data-only switch or a sites mod, or moving
sites-only mods, is none. SHA-256 and hex move here from api::system (which
re-exports them) so both sides hash with one code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A build left no note of which mods' code it took, so nothing could tell,
before the game starts, that a mod added, changed, accepted or reordered
since needs an update. A build now writes the stamp (mods-stamp) into the
game folder's record as "mods" (absent in an earlier builder's record), made
by game_files::code_mods::stamp from the same mods folder, list, trust file
and switch table the build read. game_files::code_mods::current_stamp(game,
user, env) is the one call the builder makes before it starts the game:
mods_stamp::compare of the record's stamp with it says what needs an update
first. A package's code is its sites.toml alone, as the game hashes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game side makes the stamp from its own scan (Loader::mods_stamp: each
manifest mod's code files and hash, each emulator-layout mod's ExeFS files and
code modules, the trust file, mods.json and the build's switch table), so the
two sides can be held to one answer. A test builds a mods folder on disk
(accepted and unaccepted manifest mods, a data-only switch, code patches with a
module, a files-only mod), and checks the game's stamp is the builder's
current_stamp, before and after switching mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
feat(mods): a restart that applies code waiting for a build goes through the builder
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
Third-party parts / As their notes say (pull_request) Successful in 21s
PR description / Description follows the template (pull_request_target) Successful in 30s
CI / Website build and checks (pull_request) Failing after 46s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m39s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m47s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m44s
f2c624a216
Turning on a mod with code patches or code modules, or accepting a mod's
code, in the Mods tab changes nothing until the game is built again, and the
menu's restart only started the same build again. The loader now names the
mods that are on and whose code waits for a build (Loader::rebuild_needed:
the existing waits-for-a-build state, ExeFS files not in the build's list, a
code module not taken), puts them in the tab's snapshot, and counts them in
the restart question's key, so accepting a mod's code asks for the restart
too. At the window's close for that restart the host asks game_restart_exit
(game.h): when such mods are waiting and the builder started the game, the
game exits with the builder's "rebuild needed" status instead of starting
itself again, and the builder updates it and starts it. Switching a data-only
switch, a sites mod, files or scripts needs no build and restarts as before.
The status is #2286's 122 (host/longshot_exit.h, named in longshot-game's
rebuild.rs until that header is in this tree) and the switch is the one the
builder sets when it starts the game, LONGSHOT_STARTED_BY=builder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Author
Owner

New head f2c624a2 (559 commits on #2411's 59a7b1f8). Added: the mods' screen effects and world layer drawn by the renderer (MKWVK_API_VERSION 55; has() says yes to gfx.effect and gfx.world); the engine side of the registries with the Mods tab's Keybinds, Commands and HUD layout pages; ; longshot/capture; the mod-tools node tests fixed and run by tests/, and dev.py game-tests ported (game runs through the queue); the mods stamp (game/crates/mods-stamp, the build record's "mods" key, the game's stamp equal to the builder's) and Restart to apply (exit 122 when LONGSHOT_STARTED_BY=builder). Checks: fmt; clippy -D warnings on Linux and Windows; schema-gen --check; cargo test; Python 672 passed, 13 failed exactly as on 59a7b1f8; the Linux build (renderer linked) and the Windows cross-build link. Still not run in the game.

New head f2c624a2 (559 commits on #2411's 59a7b1f8). Added: the mods' screen effects and world layer drawn by the renderer (MKWVK_API_VERSION 55; has() says yes to gfx.effect and gfx.world); the engine side of the registries with the Mods tab's Keybinds, Commands and HUD layout pages; <Icon item>; longshot/capture; the mod-tools node tests fixed and run by tests/, and dev.py game-tests ported (game runs through the queue); the mods stamp (game/crates/mods-stamp, the build record's "mods" key, the game's stamp equal to the builder's) and Restart to apply (exit 122 when LONGSHOT_STARTED_BY=builder). Checks: fmt; clippy -D warnings on Linux and Windows; schema-gen --check; cargo test; Python 672 passed, 13 failed exactly as on 59a7b1f8; the Linux build (renderer linked) and the Windows cross-build link. Still not run in the game.
HumanBean force-pushed feat/game-rs from f2c624a216
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
Third-party parts / As their notes say (pull_request) Successful in 21s
PR description / Description follows the template (pull_request_target) Successful in 30s
CI / Website build and checks (pull_request) Failing after 46s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m39s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m47s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m44s
to 563ca4e55b
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 30s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 25s
Third-party parts / As their notes say (pull_request) Successful in 22s
PR description / Description follows the template (pull_request_target) Successful in 52s
CI / Website build and checks (pull_request) Failing after 21s
Website / Website builds (pull_request) Failing after 20s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m51s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m23s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 8m10s
2026-11-25 00:49:02 +00:00
Compare
Author
Owner

Moved onto #2411's new head a8e25cdb on #2286 konvtvqs: new head 563ca4e5. Since f2c624a2: the leftovers (Mods tab, code-mod switching with only a restart, camera extras, glTF, automatic undo), settings stage 1, and the adaptation to #2286: profile-only start, one mod format (the builder reads the profile's manifest mods through read::manifest_mods), Restart to apply over the builder channel (no exit 122), no launcher identity, the broker's dead crash code removed. Checks: fmt; clippy -D warnings Linux and Windows; schema --check; cargo test; Python fails only test_display_startup_failure, as on the base; the Linux and Windows game builds link. f2c624a2 was smoke-tested in the game on Linux (boots in three places with the sandbox, menus, an example script mod, save and reload; fps 133.0 vs 133.3 on the base).

Moved onto #2411's new head a8e25cdb on #2286 konvtvqs: new head 563ca4e5. Since f2c624a2: the leftovers (Mods tab, code-mod switching with only a restart, camera extras, glTF, automatic undo), settings stage 1, and the adaptation to #2286: profile-only start, one mod format (the builder reads the profile's manifest mods through `read::manifest_mods`), Restart to apply over the builder channel (no exit 122), no launcher identity, the broker's dead crash code removed. Checks: fmt; clippy -D warnings Linux and Windows; schema --check; cargo test; Python fails only test_display_startup_failure, as on the base; the Linux and Windows game builds link. f2c624a2 was smoke-tested in the game on Linux (boots in three places with the sandbox, menus, an example script mod, save and reload; fps 133.0 vs 133.3 on the base).
First-time contributor

@HumanBean, about the name list game.flags relies on: its schema says Longshot ships a list of the game's flag names that the community extends (spec 9.2), and I could not find the list itself in this PR (oot::flags hashes the name, so the API is ready for any list).

I have one ready, if it helps: 9,623 of the 11,926 fields of progress.sav named, each one checked by hashing it back to its field in the game's GameDataList (MurmurHash3, seed 0; struct members checked twice, as Parent.Member and on their own, which is how collisions get caught). It is names only, strings: no addresses, no values, nothing from the game's files, which fits the schema's note. It covers PlayerStatus.*, PouchData.*, HavePlayedEvent.*, IsTreasureBoxOpen.<actor>, IsGoldSkullDead.*, DungeonRoomStep.<dungeon>.DungeonRoom<NNN>.* and so on. It is the same list I offered @mooki for the save editor in #1401, so one file could serve both.

If you want it, tell me the shape and the place (one name per line, a TOML table, with or without the kind of each flag) and I'll open a PR against this branch or main, whichever suits you. Nothing is started.

Posted by an AI agent (Claude Code) for neotoxic.

@HumanBean, about the name list `game.flags` relies on: its schema says Longshot ships a list of the game's flag names that the community extends (spec 9.2), and I could not find the list itself in this PR (`oot::flags` hashes the name, so the API is ready for any list). I have one ready, if it helps: **9,623 of the 11,926 fields of `progress.sav` named**, each one checked by hashing it back to its field in the game's GameDataList (MurmurHash3, seed 0; struct members checked twice, as `Parent.Member` and on their own, which is how collisions get caught). It is names only, strings: no addresses, no values, nothing from the game's files, which fits the schema's note. It covers `PlayerStatus.*`, `PouchData.*`, `HavePlayedEvent.*`, `IsTreasureBoxOpen.<actor>`, `IsGoldSkullDead.*`, `DungeonRoomStep.<dungeon>.DungeonRoom<NNN>.*` and so on. It is the same list I offered @mooki for the save editor in #1401, so one file could serve both. If you want it, tell me the shape and the place (one name per line, a TOML table, with or without the kind of each flag) and I'll open a PR against this branch or `main`, whichever suits you. Nothing is started. *Posted by an AI agent (Claude Code) for neotoxic.*
A handle whose release is one of its own methods (a camera override, pause, pointer capture, effect, model, world
shape, sound, duck, thumbnail, action) never got [Symbol.dispose], so `using` threw "not a function" in the game.
Its release is now its dispose too, as a namespace's release is; a test checks every such handle of the schema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
With HOS_HEADLESS on Linux the menu's Restart now (the Mods tab's too) and Quit did nothing: the menu posted only to a
window, and the main thread waited on the game's thread without looking at the asks. The menu now posts either way
and the windowless main thread takes Restart now and Quit as a window's loop does, so a scripted run can restart over
the builder's channel (restart_to_apply) or quit from the menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-builder play --safe-start (the launcher's Safe start) sets LONGSHOT_SAFE_START=1 for one start. The game reads
it at its loader config: no player mods start that run, system mods still do, and the Mods tab's last line says
"Started without mods (safe start)". The old ask, a safe_start_once file in the user folder, goes: the user folder is
not the profile, so the builder never saw it. The tab's line now only says how to ask for one. Its switches.def row,
docs and a game-free test of the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader reads mods only from LONGSHOT_PROFILE: its profile.json is the one list ("on"), its trust.json the one
trust file, its mods/ the manual mods ({id, path: "mods/<name>", on}). A source mod ({id, version, hash, on}) is
read through loader::source's ModStore/ModFiles, which the modtool's mod-store implements later; this build has
NoStore, so one is logged as not readable yet and its entry kept. LONGSHOT_DEV_MODS (mod run, and now the test
mode's tested mods) adds development mods, never written into the list. No profile: the system mods alone.

Gone: HOS_MODS, HOS_MODS_LIST, HOS_MOD_TESTS_ONLY, HOS_MOD_TESTS_PLAYER_LIST (GONE rows), mods.json and its
"enabled", <stem>-trust.json and the game folder's user/ trust rule, the carry of mods.json into the user folder,
modcache/mods_json.txt, longshot-game's profile.rs and profile_mods::expand. The sandboxes (Linux, Windows) and the
broker take the list, trust file, mods/ and the development mods from the same variables.

Hot reload follows the profile: <profile>/mods/ and profile.json by notices, LONGSHOT_DEV_MODS folders walked
(scripts, served files, shape). A profile.json change applies its switches while the game runs (the Mods tab's own
write changes nothing, so it logs nothing); a code change re-checks the mods' code against the build (Restart to
apply). The builder channel's profile_changed is not read: the game side has no event reader.

Also: the Mods tab's Has row lists what a mod has (script, hook sites, ExeFS patches, code modules, RomFS files,
patches/, textures, content module), the code warning names what the mod brings and drops Rebuild for mods, and a
confined game with no builder channel sends the player to the launcher or Longshot.exe mod to accept code (a
trust_request hook is left for the channel's request_trust). mod-tools' mod run plays <game>/dev as a profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
storage.save data has one store, <saves>/modstore/save/<uid>/slot_NN/. A mod's separate saves keep their game saves
in their own tree (save/.profiles/<p>), unchanged; their mods' data is slot_NN/.profiles/<p>/ of the one store
(StorageConfig::save_profile), never <p>/modstore. Data an older Longshot kept there is moved once at the start that
plays the profile (api::profiles::move_mod_saves: written, checked, then deleted; never over a file the store has).

Also: build-driver's verify no longer treats mods.json as the player's; docs for portal mods as source mods, the
profile's mods folder, and five dead anchors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
How the camera API works in the game, linked from the modding docs but missing: the view read at the view and lens sites through the shared records, an override and its rig (near plane, driving the player facing beside the native mouse look, colliding by rays), what is not yet there (a bone rig, hiding Link's head), and the pause manager and the 2D layer behind game.pause and hideGameHud.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but missing: the rays cast on the physics step and their slots, travel and the age switch through the one map-change queue, the world's state by name, the shapes and models handed to the renderer, and the actors' places these follow; what a game run must confirm of the rays and the states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content.md and items.md linked docs/dev/game-tests.md, which does not exist: they point at developing.md's section on a mod's own tests in the game. tools.md named four Python checks of which only test_mod_tools.py exists: it names the Rust tests that check longshot mod now, and says sites port cannot run yet (its nx2 script went with the Python lift).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but never written: the actor list and its fields, writes, bombs, answers, attaching, spawning and the rules' hooks; the packs and scripted components; the trees' changes, new nodes and calls into a mod. With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs but never written: placements, shops, bottles and rupee gains; the merged data and new flags; the asset formats and the glTF state (no BFRES conversion yet). With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but never written: the map, save, flag and pause events, textShown and the three read fields; the audio threads, sounds, streams and groups; the input frame, actions and rumble. With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The help said "Windows' volume" on Linux too. On Windows it still does; elsewhere it says the system's volume, translated
into every language of gpu/vk/menu_i18n.h.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The user's rule for the settings' contract: no CUSTOM kind. MKWVK_SETTING_CUSTOM (and its widget) goes:

- The Controls page's grid is a BINDING for each control (bind_<name>, under the bindings heading): its state's value
  says it is at its defaults, its text names its two gamepad inputs, two keys and toggle; renderer_setting_set(key,
  MKWVK_BIND(slot, code)) binds one input, taking it from the control that had it; a press puts its defaults back.
  Reset to defaults is a BUTTON.
- The Debug tools' panel's 12 rows are TOGGLEs, CHOICEs, BUTTONs and LINKs, set and pressed by key; their presses go to
  game_cheat_action as the panel's do. A CHOICE's verb is a press acting on the value chosen (Set time, Change
  quantity). Teleport and Inventory are pages of their own: a BUTTON for each place, a TOGGLE or SLIDER for each item.
- A declaration's confirm is the question asked before a press acts or a toggle is turned on (Restart, Quit, Debug
  tools, the resets): the CONFIRM flag goes (menu::Setting.confirm is the question now, translated).

The Settings mod draws a binding as a line of Choices, Keybinds, a Toggle and Reset, a choice's verb as a button beside
it, and a question as a dialog in the page's stead. tests/test_settings_decls.py makes the new rows (and fails on a
CUSTOM one); menu_rows.tsv made again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Setting a BINDING to an input another control uses no longer takes it silently. renderer_setting_text(key, value |
MKWVK_BIND_ASK) is the question ("F7 is used by Jump.", translated; "" when no other control uses it); a set of such
an input returns -3 and changes nothing, and value | MKWVK_BIND_SWAP is the player's Swap: each control that used the
input gets the slot's old input in its place. The host's rebind_control learns three flags for it: HOS_REBIND_PROBE
(report the conflicts only), HOS_REBIND_SWAP and HOS_REBIND_ONE_KEY (a key binds that slot alone, where the Controls
grid's one key cell clears the second).

The Settings mod asks the question as a dialog, Swap chosen first, Cancel beside it (sysmod-settings'
a_binding_asks_before_it_takes_another_controls_input); tests/test_settings_decls.py checks the flags are the same bits
on both sides and that binding_take takes an input in use only with Swap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A setting's declaration was the place of its row only while Game settings was off: the mod's LAYOUT table put its own in
its stead. Now the declaration is the place. The rows keep today's places on screen, so the menu looks the same:
widescreen's rows are in the Screen section (its declaration said the tab's top), Damage taken and the cheat rows sit
after Debug tools and Heart protection at the tab's top with LAYOUT's orders (theirs said Player and Camera & world).

- game/mods/game-settings goes, and with it the settings service's layout hook (ModApi::menu_layout, set_layout) and
  longshot-game's startup lay_out.
- A system mod's mod.json setting may say its "place" (tab, section, after or before, order), as a native one's
  SettingDecl section does; a player's mod naming it is refused (assets/modding/docs/settings.md).
- game/crates/longshot-game/tests/menu_places.tsv is LAYOUT's places, and longshot-game's
  every_system_mods_row_keeps_its_place checks each declaration against it (tab, section, order, anchor, owner);
  tests/test_menu_ini_keys.py and tests/test_recomplauncher_json.py read it in LAYOUT's stead.

Discord's discord_status keeps its line in the table as its mod.json's legacySwitch: no row of the menu draws it today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mods' UI had no way to keep a chosen line of a long column in view: a Scroll scrolled with the wheel and the focus
of a window, and a settings page (the Mods tab's area, soon the Insert menu's body) did not scroll inside at all, so a
line the keys reached below the area's end stayed off it.

- A Scroll takes `selected` (a child's index, MKWVK_UI_FLAG_HAS_SELECTED as Tabs' and List's): the renderer scrolls
  it the least that shows that child whole each time it changes, the wheel free between (vk_modui.cpp).
- modui_draw_settings lets the page's Scrolls and Lists scroll and its uncontrolled Tabs switch, as a window's, and
  keeps the focused control in view: its Scroll moved, else the page's own scroll, now in and out (*scroll).
- modui::reveal_delta is the one rule for both and for a window's focus.

tests/test_modui_scroll.py compiles modui_layout.cpp with a Scroll of 30 rows whose 21st is past the view's end and
checks it is brought in; api's a_scroll_takes_the_child_it_keeps_in_view checks the prop. ui.md, ui-channel.md and the
types say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The user's decision: Discord's discord_status is no row of the Insert menu and has no place. It was in
menu_places.tsv as the mod's legacySwitch though no row drew it; the line goes, and tests/test_menu_ini_keys.py keeps
the retired key from the system mods' manifests' legacySwitch instead, so FROZEN is unchanged. game/mods/discord's
README.md says so beside its manifest (a manifest holds no note), as do system-mods.md and architecture.md, whose list
of the game's rows named Discord status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system/mods-tab (longshot-game's mods_tab: it reads the loader's tab, which lives there) draws the Mods tab with the
generic elements, mounted in a slot the Settings mod puts in its Mods tab's body. Its texts are today's: the old
drawing's (vk_menu.cpp draw_mods) and the loader's (detail, note, state, warning, the Changes line).

- The list: Reload the map, Restart now (Build, then start with the builder's channel), each mod a line (its name
  opens its page, a Toggle its switch), Across mods (Keybinds, Commands, HUD layout), Safe start (the builder's: said, nothing to press); a mod picked up from
  its page moves with Move up and Move down until Put down.
- A mod's page: its switch (Off for a mod running mods need asked once, naming them), its code's warning and Accept,
  Permissions, its settings as inputs, About (Version, State, Changes, Has, Code modules, Notes), Start again, Move in
  the list. Back (@back, focused first) goes up a page to the line that opened it.
- Its edits are the loader's by id, the reload of the map and Restart now (the menu's restart row). A code mod the confined game cannot accept has its warning (the loader's) and no Accept.
- Another page joins as a view::Extra (ModsTab::add_page): a line on the list, its own nodes and events. The
  modtool's Get mods is meant to be one.

Its lines reach past the area: the settings page keeps the focused one in view (the commit before). Not on it yet: a
folder's cheats, screen effects, a mod's own settings and debug pages, a command's arguments, a key rebound on the
Keybinds page, the permission prompt. mods_tab's tests and the Settings mod's
the_mods_tab_is_a_slot_the_mods_tab_mod_fills check it; settings-declarations.md and game/README.md say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
feat(vk): the Insert menu hosts the mods' UI as its body behind the Menu drawn by mods row
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Website build and checks (pull_request) Failing after 30s
PR description / Description follows the template (pull_request_target) Successful in 41s
Website / Website builds (pull_request) Failing after 38s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m17s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m58s
7bb1387a7a
The Debug tab's Menu drawn by mods row (menu_mod_ui, off by default, a module of its own: gpu/vk/menu/mod_ui_menu.cpp,
its key in FROZEN) makes the menu draw the Settings system mod's tree as its body, the Mods tab mod's in its Mods tab,
instead of its own tabs and rows, so the two drawings can be compared in the game before the old one goes. Nothing of
the old drawing is removed; the restart and close posts are untouched.

The menu keeps its frame (the banner without its tab strip, opening and closing, the help box, the prompts) and gives
the tree its keys (menu_host_draw, menu_host_tick): Up, Down, Left, Right and Enter as on a mod's settings page, a
TextInput typed in the menu's field, the tab keys to the page's Tabs (modui_settings_tab), Back to its @no or @back
control (modui_settings_back), else the menu closes; the help box shows the focused control's help
(modui_settings_help). The page keeps the focused control in view. The row is in the hosted tree's Debug tab too.

settings-declarations.md, architecture.md, ui-channel.md and game/README.md say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HumanBean force-pushed feat/game-rs from 7bb1387a7a
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Website build and checks (pull_request) Failing after 30s
PR description / Description follows the template (pull_request_target) Successful in 41s
Website / Website builds (pull_request) Failing after 38s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 4m17s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 6m58s
to 1092fc1b57
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 26s
Third-party parts / As their notes say (pull_request) Successful in 29s
PR description / Description follows the template (pull_request_target) Successful in 34s
CI / Website build and checks (pull_request) Failing after 35s
Website / Website builds (pull_request) Failing after 36s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 5m5s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m47s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 7m38s
2026-11-25 10:33:11 +00:00
Compare
Author
Owner

Rebased onto main (with #2286 and #2411 merged) and the mod tooling folded in, so this is now the one PR for all the mod API work: new head 1092fc1b, 660 commits on main. Added since 563ca4e5: the dispose fix; headless Restart now/Quit; safe start from the builder (LONGSHOT_SAFE_START); the game's mods only from its profile; one per-slot store for mods' data; the docs pass (camera, world and nine reference pages); settings stage 2 so far (BINDING with Swap/Cancel, rows declaring their places, the Mods tab on mod UI, the menu hosted behind a Debug row); main's #2452 heap fix and #1841 title-card frame ported to Rust; and the mod tooling: Longshot.exe mod (init, types, check, pack, vendor, sources and repos, install/update/remove into a content-addressed store, test on the real script engine, run, data, publish), the game side over the builder channel, request_trust with permissions, LONGSHOT_MOD_STORE and LONGSHOT_DEV_MODS. Checks: fmt; schema --check; clippy -D warnings on Linux and Windows (workspace, and modtool on its own); cargo test; Python fails only test_display_startup_failure, as on main; the Linux and Windows game builds. Still to come: removing the old JS mod-tools and its docs pass, the remaining modtool commands, the TS Settings UI and Mods tab, self-contained system-mod folders, game runs, a cold review.

Rebased onto main (with #2286 and #2411 merged) and the mod tooling folded in, so this is now the one PR for all the mod API work: new head 1092fc1b, 660 commits on main. Added since 563ca4e5: the dispose fix; headless Restart now/Quit; safe start from the builder (LONGSHOT_SAFE_START); the game's mods only from its profile; one per-slot store for mods' data; the docs pass (camera, world and nine reference pages); settings stage 2 so far (BINDING with Swap/Cancel, rows declaring their places, the Mods tab on mod UI, the menu hosted behind a Debug row); main's #2452 heap fix and #1841 title-card frame ported to Rust; and the mod tooling: `Longshot.exe mod` (init, types, check, pack, vendor, sources and repos, install/update/remove into a content-addressed store, test on the real script engine, run, data, publish), the game side over the builder channel, request_trust with permissions, LONGSHOT_MOD_STORE and LONGSHOT_DEV_MODS. Checks: fmt; schema --check; clippy -D warnings on Linux and Windows (workspace, and modtool on its own); cargo test; Python fails only test_display_startup_failure, as on main; the Linux and Windows game builds. Still to come: removing the old JS mod-tools and its docs pass, the remaining modtool commands, the TS Settings UI and Mods tab, self-contained system-mod folders, game runs, a cold review.
A source mod was read two ways: in place through StoreDisk when LONGSHOT_MOD_STORE names the builder's store
(find_pins), else through the loader's ModStore, which the game filled with NoStore and so only ever left it out.
LoaderConfig::store, ModStore, NoStore, the unpacking into modcache/sources and the folder reader go; source.rs keeps
the entry kinds. Without the store there are no source mods, and the log says so in one line. The test of the old
path becomes one of that; mods.md and profiles.md say the one path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test(sandbox): a development mod's folder is never the home, a root, a folder above the home nor a system folder
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
PR description / Description follows the template (pull_request_target) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 22s
CI / Website build and checks (pull_request) Failing after 30s
Website / Website builds (pull_request) Failing after 34s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 5m51s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m54s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 7m40s
145b5246ed
Both platforms already hold development mods' folders (LONGSHOT_DEV_MODS) to the narrow rule: Linux through
dev_mod_dirs' sbx_folder_narrow, Windows through the plan's never list and its refusal of a drive's root, which every
grant goes through. Now each sandbox's test says it for these folders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
assets/modding/packages/mod-tools (the Node tools and their fake game) and the game binary's
`longshot mod` (longshot-game's modtool.rs over script::modtool, which ran mod-tools' JavaScript in
QuickJS) go: every command is the builder's `mod` now. The game's exe keeps --version and --help,
and `longshot mod` says to use Longshot.exe mod. With them go tests/test_mod_tools.py, the SDK's
sdk/tools/ copy (an older build's is still taken out), the release sources' mod-tools paths,
schema-gen's schema.json, fake services check and JavaScript copies, the LONGSHOT_SDK switch,
and script's QuickJS realm and loader helpers only the tool used.

The test API's declarations, longshot/testing (Tests, FakeGame, Assert, the setup API), are
game/modapi/testing/longshot-testing.d.ts now, written by mod types into types/. mod init's
tsconfig.json and .gitignore are the template's files. mod format leaves types/ and vendor/ alone.
Messages that named longshot-mod shaders say to compile with glslang (docs/modding/gfx.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each example drops its package.json (and first-mod its mise.toml); its tsconfig.json and
.gitignore are mod init's; its tests import their types from longshot/testing; its README says
Longshot.exe mod test, check --types and pack. The new-mod template's README, AGENTS.md and test
say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tools.md is every Longshot.exe mod command with its options and --output json result (run linking
the folder in, in dev mode, the game's own reload, the game's exit code; data's sources, refusal
inside a mod and notice; publish's package release or --git pin, --repo/--key/--url/--name, key
formats, --new-key, no version twice, the entry printed without --repo). testing.md: mod test on
the game's engine over a Rust fake game, longshot/testing, the strict frames() rule, the game's
test mode. publishing.md (new): sources (repos, single mods, git or release files), the
longshot-repo.json v1 format and its signature, key acceptance, the content hash, source order and
clashes, vendored npm packages. packages.md: mod vendor. The tutorial and every other guide and
dev reference name Longshot.exe mod instead of longshot-mod and the game's longshot mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Builds carry no sdk/ any more. The guides, agents.md, api-schema.md, the tutorial and the template's
README and AGENTS.md point at assets/modding/ on the forge instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/control.c passes mods and mod_* requests to game_control_mods (a new mods hook of HosControlGame) and replies
with its answer's fields, or its {code, why} refusal as the bridge's error. The game had the commands
(longshot-game::control_mods) but nothing routed them. The protocol's mods section documents them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A control bridge client (bridge.rs) and the commands that talk to the running game: status, log [--follow],
reload, restart, eval, shot, press, stick, sequence, teleport, wait, raw, stop. mod run turns the bridge on at the
profile's own address (and --eval sets HOS_CONTROL_EVAL); mod dev is mod run. mod test --game plays the profile in
the game's test mode and reads its reports, --live runs the tests in the running game. where and doctor report the
builder's paths and the bridge; allow trusts a mod through request_trust and the builder's window. A negative number
is a plain argument (stick L -1 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Longshot.exe mod shaders [folder] [--check] compiles every .glsl in a mod's folder (outside dot folders,
node_modules and dist) into a .glsl.spv beside it, as the old Node command did with glslangValidator -V -g
-S frag --target-env vulkan1.0, but with shaderc (glslang inside the builder, built from source and linked
statically), so no author installs glslang. Each module keeps its source and is checked with the game's own
api::spirv::check; a shader error names its file and line. --check compares each .spv with a fresh compile.

naga was tried first: its GLSL reader takes no combined sampler2D, the effect template's picture.

The docs, the API's generated docs and the game's messages now say Longshot.exe mod shaders instead of the
hand-run glslang command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
shaderc-sys builds glslang from source with CMake, and link-cplusplus links the C++ runtime as a shared library,
which a player's system may lack. scripts/longshot_builder.py now turns cc's C++ library off and links libstdc++.a
(Linux) or llvm-mingw's libc++.a and libc++abi.a (Windows) in; on Linux with the sysroot, C and C++ are compiled by
the bundle's clang against the sysroot (clang++ is a link to it), so glibc 2.35 and its GCC 13 libstdc++ agree.
It stops early, saying so, without cmake (or ninja on a Windows host). CI gets CMake and Ninja from
scripts/ci_cmake.sh: ci_rust.sh runs it, and the build-windows and vulkan-dlss jobs call it before
longshot_builder.py; build-linux's apt list has them. The developer docs say so.

sepia-photo's effects/sepia.glsl.spv is compiled again by Longshot.exe mod shaders, and a test keeps every
example's .spv what mod shaders --check asks. tests/test_gfx_effects.py passes on the new module unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools' types --game, ported: longshot-components.d.ts and .json (each
actor component type's paths and their BYML types, through the Work/ files
they name, and ContentComponents augmented with each reference) and
longshot-ainb-schema.txt (content's SchemaBuilder over the game's trees),
written beside mod.json from the game's files where the builder has them
(mod data's romfs and zstd dictionaries; data.rs's open_romfs and decoder are
now the crate's). The files never ship (files::LEFT_OUT). Tested on a made-up
romfs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools wrote a library's published declarations with tsc. Here each
module's declarations are oxc's isolated declarations (oxc_isolated_declarations
0.157, from the same tag as the compiler's oxc, added to the workspace's patch),
read from the AST and printed with oxc_codegen: each name of mod.json's
exports followed through export-from and export-star, its return type made
Promise<Awaited<R>>, its JSDoc and the package imports its types need kept.
What oxc cannot say of an export from its text (an unwritten parameter or
return type) is a problem naming the place, and nothing is written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools' skeleton command, ported: Model/<model>.bfres.zs read where the
builder has the game's files (mod data's romfs and dictionaries), its bones
read by content's model reader (a new bfres::skeleton: each bone's name,
parent and rest pose, a quaternion or Euler angles by its flags), written as a
glTF of nodes (Euler angles made quaternions in the old order, quaternions
made unit with anim.rs's normalize). --out must end in .skeleton.gltf, the
name files.rs never packs. content's hand-made model file is offered to other
crates' tests behind a testkit feature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools ran nx2/mod_sites_port.py, which went with the old builder. Now
in Rust on the builder's crates: the table read by sites::modsites'
parse_mod_table, the --to and --from images by the lift's image reader, and
each site looked for in main's code step for step as modsites' find_one does
(the signature once, or the place builds names among several, then the
guards). find_one is not made public: the sites crate is in the whole lift's
key (EDITS_SOURCES), so any change there makes every player's next build lift
again. A longer signature is offered from --from's words; --write puts each
found site's function into its inline builds (or a new builds line after its
signature). Tested on made-up images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
check makes the declarations again as mod types --lib does and compares them
with mod.d.ts (its first comment lines, which name the tool, aside): a stale
one, or one that cannot be made again, is a problem telling the author to run
mod types --lib.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When mod types --game wrote longshot-components.json and
longshot-ainb-schema.txt in the mod's folder, the fake content stage checks
each item's and actor's components and params, and each tree's new nodes,
against them, as the old JS fake game's checkComponents and checkTreeAdds did;
what it finds is in game.content's problems. Docs say so (and that check
finds a stale mod.d.ts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
test(modtool): every example's tests run on the fake game as a normal test
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 18s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 37s
CI / Workflow lint (actionlint) (pull_request) Successful in 38s
Third-party parts / As their notes say (pull_request) Successful in 46s
CI / Website build and checks (pull_request) Failing after 56s
Website / Website builds (pull_request) Failing after 1m1s
PR description / Description follows the template (pull_request_target) Successful in 1m6s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
ae12782756
The examples all pass on the fake game now (photo-mode's dispose included, fixed in #2434's line), so
every_example_passes_its_tests is no longer ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
manifest::native reads a built-in Rust mod's mod.json (included at compile time, parsed once) into the Manifest
the loader takes: the system mods' reader checks it first, then what is a built-in's alone: "rust", its crate,
and a setting's "native" object (store, legacyId, presetExempt, shownIf, defaultText, hints) and button type.
Every reader of files refuses "rust" (a mod's code is a script unless the build compiled it in): a game-free
test and a manifest vector. manifest.md lists description and rust.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A built-in mod's sites may be defined in its own game/mods/<name>/sites.toml: sites::Tables::definition_files finds
them in the mods' folders as a player's mod's are found, the core's table first, then the mods' by folder name, and
owned_definitions refuses a site defined twice. game-sites' build.rs reads the same files for the sites' forms, and
a lift's key covers them. A repository test checks that every site has one owner and that the sites are the one
table's before the split (site_owners.txt), sites at one instruction in the same order. hooks.md says where a
built-in mod's sites go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/fov/mod.json, in the player's format, declares the mod (its id, version, description, hooks.unsafe, the
camera.lens site it handles) and its Field of view setting with its place on the Gameplay tab; the crate reads it at
compile time ("rust": "sysmod-fov") in place of the Manifest it built in code, and a test checks that it parses
and that its setting's key is the code's. camera.lens stays the core's site: its core callback serves the mods'
cameras too (oot::sysmods::fov keeps the shared lens). test_oot_fov.py reads the manifest; test_menu_i18n.py takes
a built-in Rust mod's texts from its mod.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/text/mod.json declares the mod and its two settings with their places, read by the crate at compile time;
its site text.letterStep moves from game/sites/sites.toml into the mod's own sites.toml, and the site's callback
(the letter step, the panes' kept sizes) from oot::sysmods::text into the mod's src/hooks.rs: oot keeps the layout
it reads. A test checks the manifest and that its keys are the code's; site_owners.txt names the new owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/area-names/mod.json declares the mod (state.read, ui.hud) and its Area name banner setting with its place
on the Gameplay tab; the crate reads it at compile time in place of the Manifest and the setting it built in code.
A test checks that it parses and that its setting's key is the code's. The mod has no site of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/colour-vision/mod.json declares the mod and its Colour vision correction setting in the Graphics tab's
Accessibility section; the crate reads it at compile time in place of the Manifest and the setting it built in
code. Its tests check that it parses, that its key is the code's, and that the row's choices are the modes the pass
takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/crt/mod.json declares the mod and its CRT filter and CRT lines settings (their hints, the lines shown
only with a filter) in the Graphics tab's Screen section; the crate reads it at compile time in place of the Manifest
and the settings it built in code. Its tests check that it parses and that its keys and choices are the code's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/heart-containers/mod.json declares the mod (state.read, romfs.read; no setting, no site); the crate reads it at
compile time in place of the Manifest it built in code, and a test checks that it parses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/voice-language/mod.json declares the mod; the crate reads it at compile time in place of the Manifest it
built in code, and a test checks that it parses. Its site, options.voiceWritten, stays the core's: an outcome site,
which only the engine sets at start (oot::sysmods::voice, over the knob the mod publishes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/settings/mod.json declares the mod (ui.settings; no setting, no site); the crate reads it at compile time in
place of the Manifest it built in code, and a test checks that it parses. Its UI code is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/damage/mod.json declares the mod, the two sites it handles and its Damage taken setting (after Heart
protection on the Debug tab, shown while Debug tools are on); the crate reads it at compile time in place of the
Manifest and the setting it built in code, and its tests check the manifest against the code's keys and choices.
player.lifeHit and player.lifeWrite stay the core's sites: heart protection's core callback is on them too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/cheats/mod.json declares the mod and its Debug tab rows (Debug tools, kept in the options file; the cheat
rows, kept for the run, shown while Debug tools is on, each with its old HOS_OPT_CHEAT_* number); the crate reads it
at compile time in place of the Manifest and the rows it built in code, and puts the run's rows back from it. A
setting kept on an options line may have a - in its key (no-clip_flight), as the menu wrote it. Its tests check
the manifest against the code's keys and Movement speed's percents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/skip-title/mod.json declares the mod, the two button-wait sites it handles and its Skip title screen and
Skip opening settings with their places; the crate reads it at compile time in place of the Manifest and the
settings it built in code. menu.buttonWait and menu.buttonWaitNoDecideAnim move into the mod's own sites.toml, and
their callbacks' game access (the wait's screen, the newest save) from oot::sysmods::skip_title into the mod's
src/hooks.rs. test_dev_ab.py reads the built-in mods' settings from their mod.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/shadows/mod.json declares the mod, the three shadow sites it handles and its Shadow resolution (the
quality presets' row) and Steady sun shadows settings in the Graphics tab's Detail section; the crate reads it at
compile time in place of the Manifest and the settings it built in code. The three sites move into the mod's own
sites.toml, and their callbacks' game access (the cascade size, the steady fit) from oot::sysmods::shadows into the
mod's src/hooks.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/sprint-walk/mod.json declares the mod, the two sprint sites it handles and its Walk mode, Walk speed and
Sprint settings on the Controls tab; the crate reads it at compile time in place of the Manifest and the settings it
built in code, and its tests check the manifest against the code's keys, old numbers and Walk speed's range.
sprint.link and sprint.stance move into the mod's own sites.toml, and their game access (Link's state, the
stillness, the stance) from oot::sysmods::sprint into the mod's src/hooks.rs. test_sprint.py reads the manifest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/widescreen/mod.json declares the mod, the 23 wide.* and ui.* sites its handlers use and its settings in
the Graphics tab's Screen section (Ultrawide menus, HUD layout, the Custom placement's nine rows, Reset HUD
placement); the crate reads it at compile time in place of the Manifest and the settings it built in code, and its
tests check the manifest against the code's keys, ranges, old numbers and sites. The sites move into the mod's own
sites.toml. Its callbacks were the mod's already (src/sites.rs); oot::sysmods::widescreen stays, shared with
longshot-game's picture and present tick.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system-mods.md has the built-in Rust mods' layout (mod.json in the player's format with its rust entry and a
setting's native object, sites.toml, src/hooks.rs) as an example for authors, and notes that mod check does not yet
check a built-in mod (a hook to add: the system mods' reader for a script one, api::manifest::native for a Rust
one). game/DESIGN.md, game/README.md, api-schema.md, switches.md and oot::sysmods's docs say where a built-in
mod's sites and callbacks are now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
a_removed_handlers_guard_passes_after_the_grace counted its stand-in reader in after remove_retired, so another
test's retire::reclaim on its own thread could let the removal go in between and the guard passed too early (seen
once in a full workspace run). The reader is counted in first, as a hook that loaded the old chain is: no other
reclaim can let it go while it is in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test(modtool): every built-in mod passes mod check as the build takes it
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Website build and checks (pull_request) Failing after 26s
Website / Website builds (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 39s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 41s
Third-party parts / As their notes say (pull_request) Successful in 48s
PR description / Description follows the template (pull_request_target) Successful in 1m6s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 14m34s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 14m33s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 15m20s
3b5ef5bebb
The list was written with a stand-in moved over it. A confined game's sandbox names profile.json by its rule, so the
move was refused (and one that went through would lose the rule): a switch logged "switched on" and never reached
the file, so Restart to apply came back with the mod off. It is written in place now, as the trust file is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder wrote profile.json with a file moved over it (launcher_profile::Profile::write, modtool's Profile::write):
a confined game's grant names the file itself, so after the Mods tab's set_mods the game could no longer read the
profile (EACCES). Both write it in place now, profile.json.bak holding the text while it is written (inode test).
The game waits for the builder's answer to its last set_mods before it asks restart_to_apply, so a switch is in the
profile before the game ends. The Mods tab's batches take two id ranges in turn: a batch's reset no longer meets a
create of an id it removed (longshot/ui refused "node 1 was removed by this batch").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Insert menu's settings (the renderer's declarations, rows, texts, set/press/text and bindings) and the Mods tab's
data and edits (the list with each mod's page, cheats, keybinds, commands, HUD roots, the permission prompt; setMods,
edit, restartToApply) as two schema modules behind the system-only permissions settings.host and mods.host, so the
menu can be drawn by TypeScript system mods while Rust keeps the data. state() is { channel, why, ops }; errors
SettingsHostError and ModsHostError { code, text }; events only to holders; every API Promise now carries its call
number. longshot-game gives the tab's host part (mods_host.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system/menu (game/mods/menu) draws the menu's tabs, pages and rows from longshot/settings-host; system/mods-tab
(game/mods/mods-tab) draws the Mods tab in its slot from longshot/mods-host, now with the cheats, command arguments,
keybind rebinding and the permission prompt. The native Mods tab mod goes. The Menu drawn by mods row hosts
system/menu's page, or the engine's fallback (no mod: a UI tree of the engine's own, shown only while a menu mod does not run; resume, resolution, turn mods off, quit); a hosted Keybind waits for
its key and an @close control closes the menu. Parity tests draw the C++ menu's every row (menu_rows.json, written by
tests/test_settings_decls.py) through Longshot.exe mod test, which now reads a system mod's folder as the game does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer declares its page-5 question (Restart Needed, Keep changes? with the Output resolution preview's
countdown) as a QUESTION, @ask: its state the text and seconds, its texts the title and answers, a set the answer.
The TS menu draws it over everything while it waits, so draw_ask is not needed with the menu drawn by mods. Each
confirm dialog and a binding's question get the old drawing's title and yes (Enable Debug Tools?, Reset bindings?,
Binding already in use / Rebind) through renderer_setting_text's MKWVK_TEXT_* values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
onReset (Delete: an input's default asked for), a Slider's own value texts (options) and commitOnRelease, a multiline
TextInput, a pad Keybind (the next gamepad button, by its Switch name), Compare (a before and after split with a
divider the player drags: ReShade's comparison, and the screen effects' later), ModPage (another mod's settings page
in place: the Mods tab's page of a mod that draws its own), and a Window's dock and passInput (a strip over the live
game, for the tune bar). The menu hosts a page's mouse, Delete and pad Keybinds. The TS menu and Mods tab use them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer answers @fx:<mod id> with a mod's screen effects as it runs them (point, the mod's and the player's
switches, state, GPU time, why), read-only but for the player's switch; longshot/mods-host gives them as each page's
effects and sets the switch with edit("effect"). The TS Mods tab lists them as toggles, and shows a mod's own
settings page in place with ModPage. Read-only on gfx: vk_effects' fx_effects_of and fx_player_set only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The old menu's tune mode as the TS menu's own: each slider row has Tune, an @close: control (pressed, then the menu
closes), which mounts the row's slider in a window docked at the screen's bottom with passInput, so the game keeps
its input and its picture while the value changes; Done takes it down. The menu mod asks ui.window for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The new props took the props' table to 70, past the 64 bits a node's has held: it is 128 now. The hosted question
(page 5) gives the page no wheel, as the old drawing's question did (tests/test_rumble_menu.py). Fixed after the
full check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Fixed after the full check: longshot-game's ui test says the snapshot's new version, and the menu's question test
gives the confirm dialog's words before declaring the rows (they are read with the declarations).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
options.voiceWritten moves from game/sites/sites.toml into game/mods/voice-language/sites.toml, and its callback (the
game's question asked, the saved option followed) from oot::sysmods::voice into the mod's src/hooks.rs. The site is an
outcome site, so it takes no handler at run time: the mod lists its engine callback (hooks::ENGINE_CALLBACKS) and
longshot-game installs it at start right after the core's (NATIVE_ENGINE), whether the mod runs or not. The knob it
read (oot::sysmods::knobs, one knob) becomes the mod's own switch, FOLLOW, on while the mod runs and back off through
the journal. oot::engine::MOD_OUTCOME_SITES names the outcome sites a mod's crate answers; oot's coverage test and a
new longshot-game test keep the two lists the same. site_owners.txt names the new owner; the site list is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
camera.lens is not moved into game/mods/fov: the core's engine callback there serves the public camera API (oot::camera's
fov_hook and near_hook, under api::services::camera) whether the Field of view mod runs or not, and the mod's handler
only hands its row down the chain. The site table's comment, the mod's docs and system-mods.md (a new table of the sites
that stay the core's, and why) say so. No site moves; the shared lens logic stays in oot::sysmods::fov.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
player.lifeHit and player.lifeWrite are not moved into game/mods/damage: the core's engine callbacks there are heart
protection (oot::debug::hearts_protected, set by the Cheats mod's row, an input movie or the test runs' switch), which
must work whether Damage taken runs or not. Owned by the damage mod, the sites would make Cheats depend on Damage taken,
and heart protection would go with it when it is off; kept core, each mod uses the site it needs and neither knows the
other. The site table's comment, the mod's docs and system-mods.md's table of core sites say so. No site moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::cheats (the cheat file's name, the regions' bases, checked reads and writes) and its layout
(layout::sysmods::cheats::HEAP_BASE) had no caller left: the Cheats mod (game/mods/cheats) has its own build id and
file name (cheats::BuildId), regions (memory::Region) and memory (system_mod's ApiMemory, over the API's memory
service). The mod has no hook site, so nothing else moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::discord (what host/discord_rpc.c read from the game: the map, the place, the age, life and rupees) and its
layout (layout::sysmods::discord's flag hashes) had no caller left: the Discord status is the discord script system mod
(game/mods/discord), which reads the game through the API (state, player, content.read.mapName). The layout test's
assertion on its Life hash goes with it. oot::sysmods::area_names loses its last caller in oot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::hearts (the containers' placement ids read from the player's RomFS, their flags, the pieces' sum) had the
Heart containers mod as its one caller: it moves into game/mods/heart-containers/src/containers.rs. The mod has no hook
site, so no sites.toml; it now names host-sys (the RomFS and the log) itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::area_names (each map's place in English, the suffixes' rules) had the Area names mod as its one caller
once the Rust Discord status was removed: it moves into game/mods/area-names/src/places.rs. The Discord script mod
names the place through the API (content.read.mapName), not this table. The mod has no hook site, so no sites.toml.
oot::sysmods now holds only what the core shares with the mods: Field of view's lens, Damage taken's life writes,
the widescreen picture and the event and switch helpers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::manifest::schema builds the draft 2020-12 schema of mod.json from the
reader's own limits, permission table and key names: every field described in
manifest.md's wording, enums for permissions, runtimes, scopes and places,
patterns for ids, versions, origins, paths and dependencies, the rules between
fields (runtime needs api, content needs content.add, local multiplayer, raw
game data never with a way off the PC). Built-in-only fields (rust, a setting's
native and place, legacyOption, ipc, system) are in it, described as such.

Longshot.exe mod schema prints it; mod init and mod types write
types/mod.schema.json and name the served copy in mod.json's "$schema"
(https://longshot.magicbean.dev/schemas/mod.schema.json, planned: the site has
no route yet). Every built-in mod's and example's mod.json names it. Tests: the
schema is a valid 2020-12 schema; every built-in, example and template manifest
passes it; the shared vectors agree with the parser, but for a named list of
rules a schema cannot say. jsonschema 0.29.1 (no default features) is api's
dev-dependency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The schema is made by game/crates/api (manifest/schema.rs); `cargo run -q -p api
--example mod_schema` writes the copy in website/public/schemas/, and the test
the_website_serves_this_schema fails while it differs. public/_headers serves it as
application/schema+json, cached an hour, to any origin; npm run check checks the
built site has it at its $id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot/gfx's gfx.outputEffect (extension 1 of the built-in mods' audit): a mod's effect of 1 to 8 fragment
passes at present, after the game's HUD, frame generation's made frames and the window's scaling, before
Longshot's overlays. Each pass draws an image of a size and format the mod chooses ({ scale } or
{ lines, maxScale }, rgba16f or rgba8; the last draws the output) and samples up to four inputs (the pass
before's, the picture, an earlier pass's), nearest or linear, clamped or black outside. The renderer fills
the params named SourceSize, OutputSize, FinalViewportSize (libretro's names), hdr, paperWhite and peakNits.
On the SDR picture the passes see it as the display shows it; with hdr: true, while the game presents HDR,
linear nits (Rec. 2020): the HDR pass grades into an RGBA16F image first (hdr_encode.comp's HDR_NITS),
the effects run over it, and hdr_pq.comp encodes their image. An effect without hdr runs before the
expansion, and is bypassed (unsupported, saying so) while the game presents its own HDR.

The template's check (fx_spirv.h, api::spirv) takes up to four samplers and reports them (inputs);
gfx.effect's keep the picture alone. Built-in mods reach the same code through ModApi::gfx over the
shaders they carry. The fake game lists an output effect's passes, images, inputs and fills, and
EffectInfo.reason says why one is not drawn here. game.h's GamePass carries an output effect's passes
(GAME_PASS_OUTPUT_FX at GAME_PASS_PRESENT, GameOutStep): MKWVK_API_VERSION 58. The modding API's version
stays 0.1 (bumped when the release is cut: api-schema.md). Example: assets/modding/examples/scanlines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Extension 2 of the built-in mods' audit: each present tells the output effects whether the game drew its
3D world (vk_draw.cpp's world_drawn_at in the last 3 presents, the fact the ultrawide menu sides use, kept
in wide_sides_tick's world_now for frame generation's display thread too). A pass reads it as the param
worldDrawn the renderer fills (1 or 0), and an effect's when ("always", "world", "noWorld") draws it only
in frames with or without the world: in the others it costs nothing and is waiting. GamePass.when and
GAME_FILL_WORLD_DRAWN: MKWVK_API_VERSION 59. The fake game lists each output effect's when.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Extension 3 of the built-in mods' audit: gfx.renderer() answers { tier, hdr, nativeHdr, menuOpen }: the
memory and quality tier the Quality preset or Auto picked (1 to 5, null before it is known), whether the
renderer presents HDR10, whether that is the game's own HDR picture (Native HDR, where an output effect
without hdr is bypassed), and whether the Insert menu is open. The renderer answers one new option,
HOS_OPT_RENDER_STATE (its bits), beside HOS_OPT_MEMORY_TIER, read through the post sink when a mod asks;
built-in mods reach it through ModApi::gfx. The fake game's game.gfx.setRenderer sets what it answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The CRT system mod draws the filter itself through the public longshot/gfx (ModApi::gfx, the code a script
mod's gfx.outputEffect reaches): game/mods/crt/effects/downsample.glsl into a raster of the mod's size
({ lines: 240/480/720, maxScale: 0.5 }, RGBA8), then lottes.glsl, hyllian.glsl or zfast.glsl at the
output's size, sampled nearest (zfast linear) with a black edge. The four are the renderer's compute
adapters ported to fragment passes with the same math (the pixel centre is gl_FragCoord, SourceSize and
OutputSize the renderer's params, style a float param; the box's loops counted, 32 texels each way, the same
sums in the same order), compiled beside them by Longshot.exe mod shaders and carried in the mod's code.
The effect takes the SDR picture only, so the renderer runs it before an HDR expansion and bypasses it on
Native HDR as before; the mod reads gfx.renderer() each frame and sets the filter row's hints to the
"Bypassed: ... Native HDR" line (ModSettings::set_hints, a native choice row's hints changed at run time).
crt_filter and crt_lines keep their keys. It stays a Rust mod: a script mod's settings have no
options-file line or Insert-menu place.

Gone from the renderer: crt_policy.h, the four crt_*.comp and their headers, vk_framegen.cpp's CRT pass,
the CRT decoding and hint in menu/game_rows.cpp, GAME_PASS_CRT and PostKind::Crt, scripts/shaders.py's
crt set. tests/test_crt_policy.py checks the output effects' lines size is the old raster for every output
size, test_crt_shaders.py the fragment ports against the pinned upstream math and their .spv's sources,
test_upscale_independent.py the scaler's routing into the output effects, test_gfx_effects.py the
renderer's taking of an output effect's passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The colour-vision system mod recolours the picture itself through the public longshot/gfx (ModApi::gfx):
one pass, game/mods/colour-vision/effects/correct.glsl, the renderer's colour_vision.glsl functions word
for word, at present after the CRT filter (order 10 after its -10) and before Longshot's overlays. It
takes nits (hdr: true): on the SDR picture it decodes the display's colours, corrects them in Rec. 709 and
encodes them again, as the present's pass did; while the game presents HDR it corrects the light in nits
(Rec. 2020, up to 10,000 nits) over the HDR pass's nits image before PQ, as hdr_encode.comp did, Expanded
and Native alike. Its mode is a param, set in place when the row changes; colour_vision keeps its key.

The Insert menu's palette correction stays the renderer's (it is drawn after every output effect): it
reads the mod's colour_vision setting (menu_colour_vision_mode) while the mod's effect runs
(fx_output_ran_of). Gone: vk_colour_vision.cpp/.h, colour_vision.frag and .glsl, the correction fused into
hdr_encode.comp (its push constants keep their 48 bytes), the present's colour-vision route, the pass
decoding in menu/game_rows.cpp, GAME_PASS_COLOUR_VISION, PostKind::ColourVision, the system mods' fixed
passes (ModApi::post_pass_*) and GamePass.params: MKWVK_API_VERSION 60. game/DESIGN.md's post-process
interface says what stays the engine's and why: present and capture routing (through the output effects
generically), the HDR pass's nits stage, the menu's palette, the Native HDR bypass of SDR-only effects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_output_fx_parity.py, game-free on a Vulkan device (run_vulkan_fixtures.py runs it on lavapipe):
the renderer's old passes, kept as fixtures (tests/fixtures/output_fx_parity: crt_*.comp, colour_vision.frag
and hdr_encode.comp with its fused correction), and the mods' shipped shaders with fx.vert, hdr_encode.comp's
HDR_NITS variant and hdr_pq.comp, each recorded as the renderer records it (record_crt's compute passes and
images; fx_output_run's fragment passes, images, samplers and fills; framegen_hdr's nits stage) over the same
synthetic pictures. Every CRT filter at each lines setting at 720p and 1080p, a larger and a smaller picture
(the raster compared too); each colour vision mode on the SDR picture (same size and scaled), in Expanded
HDR at 100% and 150% contrast, and in Native HDR. One 8-bit step or one 10-bit PQ code at most.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Effect.setSplit(share | null): an output effect's last pass is drawn right of a line at that share of the
width, and left of it the picture the effect was given (fx_copy.frag, in the same rendering, a scissor
each side), so the frame itself shows before and after with nothing captured and no pass more.
longshot/ui's Compare drives it as a divider alone (ui.md, gfx.md). GamePass.split: MKWVK_API_VERSION 61.
The fake game lists each output effect's split; the scanlines example has a Before and after setting
and its test. ReShade has no such hook yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A release's risk is the riskiest of its permissions by the schema's tiers (low, medium, high, unsafe; a permission
the schema does not have counts as unsafe), with unsafe and replaces_game_files (a release that ships romfs/: a
repo says so, a single mod's is read from its files). search gives the newest release's tier for each mod and leaves
mods of the unsafe tier out unless asked (--unsafe, the op's "unsafe": true); details gives it for the mod and for
each release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release lists its dependencies as its mod.json writes them (a repo's release says so, a single mod's are read
from its manifest; checked by the manifest's own reader), and details gives them for each release. install plans
first: the release asked for, then every required dependency (and theirs) the profile does not have at a version it
takes, each the newest release its source lists that it takes; the plan installs what is needed before what needs
it, and a dependency no source can give stops the install before anything is fetched. --plan (the op's "plan":
true) only answers {plan: [{id, version, sha256, source, needed_by}], missing: [{id, needs, range, why}]}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release may give its API's minor number (api_minor, from a single mod's mod.json "api"); it fits this game when
its major is this game's and its minor no newer, or for a 0.x API the same: the loader's own rule. details gives
fits (true, false, or null when a 0.x release gives no minor) for the mod and each release, with the game's
game_api; search gives it for each mod's newest release and --fits (the op's "fits": true) keeps only those that
fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A repo's release may give its licence (licence, or license as mod.json spells it; a single mod's is its manifest's)
and withdrawn: a release its source took back is never the newest, an update or a dependency, and is installed only
when named by its version. A mod may give categories beside its tags. search shows each mod's newest release's
licence and its categories; details gives each release's licence and withdrawn, the mod's categories, and the newest
release's licence among its licences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod pin <id> <version> installs the mod at that release when the profile has another, then pins it there
("pinned": true in its profile.json entry); updates, check_updates and installed's update offer then leave it,
and an update named for it is refused saying so. mod unpin <id> lets it move again. installed gives "pinned":
the version it is pinned at, or null. Neither op is the game's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
tags (the op and mod tags [--source URL]) counts, over every mod the sources offer (each once, as search has it), its
tags and its categories, folded to lower case: {tags: [{name, mods}], categories: [{name, mods}]}, by name. The game
may ask it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
source_refresh (the op; mod source refresh [url]) fetches the named source again, or every source when none is
named, and answers the sources list (only the one refreshed when named). A failed fetch is kept in that source's
error, its listing before it kept, as sources --refresh does. Not the game's: it has sources' refresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod add replaced a mod of the profile with the same id without a word and kept what the player had granted it.
Now a replace is refused without --replace (the op's "replace": true), and one whose files are not the same
(another content hash) drops the mod's grants: its profile.json entry's granted and its trust.json acceptance and
unsafe grants, so the player is asked again. --plan ("plan": true) only answers what it would add: {id, version,
sha256, replaces, same_content, code, permissions}. The answer says {id, version, sha256, replaced,
grants_dropped, code, restart}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A .zip is read as a package is (content::archive: no entry out of its folder, no link or special file, the size and
ratio caps). mod add takes a zip of a mod's folder (its one top folder holding mod.json is the mod) and unpacks it
into the profile's mods/<owner>~<name>/; mod import unpacks a zip of emulator mods into a scratch folder of the
cache and converts what it holds, a zip that is one mod named by the zip's own name. The launcher's own unpacker is
no longer needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
An emulator's own layout keeps a mod at contents/<title id>/<name>/romfs: import now looks up to four folders below
the one given for folders in the emulators' layout (a mod's own folders, a folder with mod.json, dot folders and
links not looked in), each named by its own folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
import's --name (the op's "name") gives the one mod the path holds its name; its id is made from it (local/<slug>)
as from a folder's name. A path holding more than one mod with --name is bad_args.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
add's answer and each of import's mods carry code (true when it brings code: hook sites or ExeFS patches, which the
next start builds into the game) and restart (a running game must restart for it), as install's code does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher's ModsEmulators.Scan, in the builder: Eden and its forks (one emulator where they share a data
folder), yuzu, suyu, sudachi, citron, torzu and Ryujinx, by their data folders on Linux and Windows; each one's
mods for this game's title id (yuzu's family: load/ or its qt-config.ini's load_directory, and sdmc's atmosphere
contents; Ryujinx: mods/contents and sdcard's), with the emulator's switch (DisabledAddOns, Ryujinx's mods.json;
null when not known) and whether it holds code (exefs). Read only, no link followed. Answers {emulators: [{name,
data_folder, mod_folders, problem}], mods: [{emulator, name, folder, source, enabled, code}], looked}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Removing a mod of the profile's own folder (an add or an import) now deletes its folder or file in mods/ as well,
its read-only bits cleared first as the launcher's DeleteTree does; only a name directly in the profile's mods/ is
ever deleted, and no link is followed. --keep-files (the op's "keep_files": true) keeps them. The answer gives
"deleted": the paths deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
enable/disable (the ops; mod enable <id>, mod disable <id>) set a mod's "on" in profile.json in place, under the
profile's edit lock, the rest of the file as it was. The answer: {id, on, changed, code, restart} (code: a code
mod's switch changed, which the next start builds in). Not the game's: its Mods tab has its own switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs(modtool): tools.md and the mod operations give the launcher's new commands and their JSON
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 32s
CI / Website build and checks (pull_request) Failing after 34s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
Website / Website builds (pull_request) Failing after 35s
Third-party parts / As their notes say (pull_request) Successful in 40s
PR description / Description follows the template (pull_request_target) Successful in 48s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 8m10s
CI / longshot-builder end to end (synthetic game) (pull_request) Failing after 15m54s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 16m37s
92d6d059dd
tools.md's sources table gains tags, pin/unpin, enable/disable, emulators, source refresh [url], search's --unsafe
and --fits, install --plan, add's --plan/--replace and .zip, import's .zip, depth and --name, remove's --keep-files,
and a list of the JSON results a launcher reads (stable: keys only added). mod-ops.md's ops table, Summary and
Details follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
HumanBean force-pushed feat/game-rs from 92d6d059dd
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website preview, build (pull_request) Has been skipped
Website / Website preview, upload (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 32s
CI / Website build and checks (pull_request) Failing after 34s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
Website / Website builds (pull_request) Failing after 35s
Third-party parts / As their notes say (pull_request) Successful in 40s
PR description / Description follows the template (pull_request_target) Successful in 48s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 8m10s
CI / longshot-builder end to end (synthetic game) (pull_request) Failing after 15m54s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 16m37s
to 3509a8a9b6
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
CI / Workflow lint (actionlint) (pull_request) Successful in 43s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 44s
Third-party parts / As their notes say (pull_request) Successful in 58s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m1s
CI / What the change needs (pull_request) Successful in 1m3s
PR description / Description follows the template (pull_request_target) Successful in 1m20s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-25 18:18:43 +00:00
Compare
style(modtool): rustfmt over repo.rs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 28s
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
b7c686a368
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
request_trust's confirmed (mod allow <id> --yes --sha256 HASH [--permissions a,b]) records trust with no window,
exactly as the window's Accept does: the mod's code accepted, the unsafe tier it requires granted, and only
permissions its mod.json declares (bad_args for one the schema lacks, refused for one it does not declare). It
needs the content hash the player was shown and refuses with content_changed when the files are not it now; the
game can never send it (refused). The answer is the op's {accepted}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
order (the op; mod order <id> --up|--down|--to N) moves one mod in profile.json, in place under the profile's edit
lock, every other key kept. System mods stay first and in their place (system_mod for one; nothing moves before
them); a mod that is not there is not_found; one of up, down, to (bad_args otherwise). The answer: {id, from, to,
order} (places from 1, order the ids as they now are). Not the game's: its Mods tab moves them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
remove of a path (mods/<name>, a full path in the profile's mods/, or a bare name) that is not an installed id
deletes that folder or file, by the rules of a mod of one's own: only a name directly in mods/, no link followed,
read-only bits cleared. One that profile.json names is refused (remove it by its id); one that is not there is
not_found. The answer: {id: null, path, profiles: [], deleted}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Each mod gains romfs_files and romfs_bytes, patches (its ExeFS .ips and .pchtxt) and modules (its other ExeFS files),
cheats (its cheat files), and already: the profile's mods/ folder with the same files, by the launcher's
fingerprint (the paths and sizes under romfs/, exefs/, cheats/, and the bytes of the code and cheat files up to
1 MiB), or null. Links are never followed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher no longer checks these itself, so the builder does, for mod enable/disable and the channel's
set_mods alike (one check, switch_allowed): a required system mod cannot be switched off (system_required); a
system mod this build does not have cannot be switched (system_not_loaded); a mod the profile does not have is
not_found; and a mod whose code waits for the player's acceptance of its warning, or whose required unsafe
permissions are not granted, cannot be switched on (needs_trust). Switching off is otherwise always allowed, and a
switch to what it already is changes nothing. A refused set_mods writes nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs(modtool): order, allow --yes, removing a stray folder, emulators' details and the switch rules' codes
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
PR description / Description follows the template (pull_request_target) Successful in 1m12s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 57s
CI / Workflow lint (actionlint) (pull_request) Successful in 45s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 41s
CI / What the change needs (pull_request) Successful in 1m15s
Third-party parts / As their notes say (pull_request) Successful in 54s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m0s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m50s
CI / Website build and checks (pull_request) Failing after 38s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m1s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m38s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 6m55s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
34995d71ef
tools.md's table and its launcher results, and mod-ops.md's ops and error codes, follow the last launcher gaps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The CRT, colour-vision and scanlines shaders compiled again by the builder's own glslang (shaderc, pinned by
Cargo.lock), so mod shaders --check matches them; the scanlines example names mod.json's schema as the others do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test_gfx_effects refuses a sampler past bindings 0 to 3 rather than any second one (an output effect's pass may
sample four); test_vulkan_fixtures_ci's summary expects one passed fixture more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Colour vision's HDR parity failed with no clue where: mode-0 cases now separate the nits stage's round trip (one
code, or Native's codes kept exactly) from the correction, and a failing case prints its first differing pixels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Colour vision's HDR parity failed by up to 191 PQ codes: its correction takes small differences of large nits,
which RGBA16F lost in the dark channels of saturated colours (with no correction, the nits round trip matched).
One pass cannot avoid the image: its nits are the HDR pass's (the expansion, the contrast grade, Native's decode),
which an effect is given, not redoes. So, generically: an output effect's nitsFormat "rgba32f" makes the nits it is
given (hdr_encode.comp's HDR_NITS32) and its last pass's image full floats, allocated only while such an effect
runs; a pass's own image may be "rgba32f" too. On a small or integrated GPU (device_policy.h's low-VRAM rule,
small_vram_textures) they stay half floats, said once in the log. GamePass.hdr 2 and GAME_OUT_RGBA32F:
MKWVK_API_VERSION 62. The colour-vision mod asks for full floats; the parity test runs them so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The same generic split as Effect.setSplit, for the player's ReShade preset: left of the line the picture without
it, right of it the preset's. No pass more: ReShade's last copy back (a blit, its ping images' format not the
picture's) covers only the right part. The game side sets it through rx_option_set(HOS_OPT_RESHADE_SPLIT = 3996,
ten-thousandths of the width, -1 none: reshade::set_split); the last mod to set it holds it, and its stop clears it.
The fake game keeps the line (game.gfx.reshadeSplit); ModGfx::set_reshade_split for Rust mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
chore(gfx): the generated API files for nitsFormat and setReShadeSplit, and fmt
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 27s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 51s
CI / Workflow lint (actionlint) (pull_request) Successful in 55s
PR description / Description follows the template (pull_request_target) Successful in 1m4s
Third-party parts / As their notes say (pull_request) Successful in 1m4s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m7s
CI / What the change needs (pull_request) Successful in 1m33s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 2m48s
CI / Website build and checks (pull_request) Failing after 41s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m47s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m11s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m35s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 33s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m52s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
7f9f027e71
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The feature `runtime` (on by default) is the whole API. Without it, api is
json, manifest, settings::decl and mods::{Enabled, Manifest}, and its
bindings are their permissions' part alone (schema::emit::rust_permissions,
$OUT_DIR/permissions.rs), with serde_json and thiserror as its only
dependencies. A build script can then check a built-in mod's mod.json with
the game's own reader (api::manifest::native) without compiling the game's
crates for the build: longshot-game's registry of native mods, next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot-game's build.rs walks game/mods/*/: each folder with a Cargo.toml
is a built-in Rust mod (crate sysmod-<name>). Its mod.json is read by the
game's own reader (api without its runtime feature, a build-dependency), so a
bad one fails the build with the mod's name and the reader's error. The
generated registry (src/registry.rs) holds, for each, its folder's name, the
mod.json embedded, that text parsed once into a &'static Manifest, and its
constructor; and NATIVE_ENGINE, each crate's hooks::ENGINE_CALLBACKS. The
hand-kept NATIVE_MODS and NATIVE_ENGINE lists are gone.

No mod is made to read its manifest: the loader (its scan, its settings'
declarations, the sites a mod's handlers may use), the Insert menu's start-up
rows, the places test and the input movies' old option numbers read the
registry's. The constructor runs only when the loader starts the mod; a mod
that needs its manifest has cx.manifest() (the services keep it from the
start). Mod::manifest() is gone from the trait.

Each crate loses its MANIFEST, LazyLock, include_str, expect and manifest()
block and its parse test: its lib.rs keeps its code and one line,
api::native_mod!(<the mod>, keys: [..]), which is its pub fn new() -> impl
Mod, checks at compile time that each setting key its code reads is in its
mod.json (api::manifest::native::declares), and gives its tests manifest().
One registry test checks every built-in mod's manifest; tests/registry.rs
holds the workspace's members, its dependencies and longshot-game's to the
folders, and checks that longshot-game names a mod's crate only for its named
bridges to the host, never its constructor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The registry finds a built-in Rust mod by its folder's Cargo.toml, so its
mod.json names no code. The key goes from every built-in mod.json, from the
built-in reader (api::manifest::native) and from mod.json's schema (and the
website's copy); the readers of files no longer refuse it, so its shared test
vector goes too. modtool's check_built_in and the Python tests tell a Rust
mod by its Cargo.toml. The docs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The help box read the focused row before the page was drawn, after the overlay had cleared the settings focus: it is
read after the page now. A text row with no text shows None, as the old menu; Tune and Done have a width of their own,
so the slider gives up the room instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The 6.4 ms frame was the menu's first read of the declarations at the game's start, which waits for the upscalers' start-up
probe: the menu now reads only while it is open. Open, a row whose state did not change keeps its object and the page's
ask and open functions stay the same, so its line is not drawn again (and asks the renderer no texts). The fake renderer
counts its reads (game.menu.reads), and a test holds both: no read while closed, no line drawn again with no change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot/ui's memo(component, isEqual?) draws a component again only when its props changed by their parts (or as
isEqual says): the menu's lines use it instead of their own bookkeeping, and ui-cases' memo case tests it. The
declarations are read on a thread of their own: decls answers ready: false at once until they are, changed fires once
they are, and the menu shows Loading meanwhile (the fake renderer's hold tests it), so no system mod waits on the
renderer's lock or its list's first build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake renderer's declarations are read in decls itself unless held, as the tests expect; the memo test was put in
the wrong place in reconciler.test.ts; schema-gen's files for decls' ready.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(menu): the renderer's texts given before the page is drawn
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 26s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 48s
CI / Workflow lint (actionlint) (pull_request) Successful in 49s
Third-party parts / As their notes say (pull_request) Successful in 57s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m1s
PR description / Description follows the template (pull_request_target) Successful in 1m10s
CI / What the change needs (pull_request) Successful in 1m14s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 3m23s
CI / Website build and checks (pull_request) Failing after 36s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m29s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m24s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m51s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m44s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
c20a220fce
A value's text is read when its row is drawn (memo): the test gave them after the first drawing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The play and update paths check a game's patches against the hook sites (build-driver's clashes::refuse) through
the same Tables::load as the lift: a site defined in game/mods/<name>/sites.toml alone is read and placed, and a
location naming a site nothing defines still stops. (A builder older than the mods' own tables stopped on
menu.buttonWait this way.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game-sites' build.rs and sites::Tables::host give each built-in mod's site that is not a data rule (and has no line)
a flag and a slot from the mod's own definition, under the same identifier, so the lifted code names the same two
symbols. Text speed and size's text.letterStep loses its HOS_SITE_ENGINE line: the mod puts its handler on it by
name at start. A test checks every built-in mod site has its slot and text.letterStep has no line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
oot::layout::sysmods::text moves to game/mods/text/src/layout.rs (only this mod reads it). Comments that cited the
gone host/oot_text_step.c, oot_text_size.c and nn_vi.c's text_scale, gameplay.cpp's game/menu/rows.c and
vk_api.h's option 5 now say what is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Timed, ignored benches for extension 4's choice (in-place handlers on worker data sites): text.letterStep's
dispatcher alone, the text mod's native handler and a prototype handler language (option A) in
game/mods/text/tests/hit_cost.rs; QuickJS-ng calls of a small handler with its marshalling, bare and through the
mod runtime's budgeted call (option B) in script's runtime tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(api): mod.json's schema renders the same whichever crates are built with api
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 32s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
PR description / Description follows the template (pull_request_target) Successful in 43s
Third-party parts / As their notes say (pull_request) Successful in 38s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 43s
CI / What the change needs (pull_request) Successful in 58s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m12s
CI / Website build and checks (pull_request) Failing after 41s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m27s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m26s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m1s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m59s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m0s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 15m15s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 21m37s
a7229b13f8
The schema's objects kept their keys in serde_json's map order: sorted when
nothing in the build turns on serde_json's preserve_order, insertion order
when something does, as a workspace-wide build does. So text() depended on
the crates built together, and the website's copy (written sorted, by
`cargo run -p api --example mod_schema`) failed the_website_serves_this_schema
inside run_all's test_lifter while passing under `cargo test -p api`.

text() now sorts every object's keys before it writes (Value::sort_all_objects),
so the file is the same under either feature set. A test renders the schema
built in reverse key order and checks it is the same text, and that the top
level's properties are sorted in the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release's longshot-builder now carries liblongshot_rs.a for its own
platform the way it carries its pack: longshot-builder's build.rs embeds
the file LONGSHOT_GAME_RUST names (compressed with ruzstd), beside
LONGSHOT_SOURCES. scripts/longshot_builder.py build --sources builds the
library from the same tree first, with the pinned Rust, and from-source
does the same for the builder it makes. The library says its target: the
program's own, or LONGSHOT_GAME_RUST_TARGET's (a developer's test of
another platform's library, as a cross build of the Windows game).

A build of the tree the program carries links that library (build-driver
gives build-compile a rust::Carried for that tree alone, written to the
work folder's rust-carried/ when it changed); any other build (a
checkout, --root, another platform, a builder that carries none) builds
the tree's own Rust with cargo, as before.

Gone: longshot-rs/prebuilt/<platform>/ in the pack, its sources.key and
the key compare in build-compile's rust.rs (source_key, READ_TOO),
`longshot-builder dev rust-key`, and the release step that made them
(longshot_builder.py game-rust in build-linux.yml and build-windows.yml).
The Linux dry run still checks the program links the carried library;
the Windows one, run by the Linux builder over the unpacked pack, can't
see it, so the Windows program's own first start under Wine must say it
carries it (`sources`: "the game's Rust: carried for windows-x64").

Tests: the carried library is linked for the carried tree and its
platform, cargo builds any other (a stand-in cargo); the carried
library is written for the carried tree alone, again only when it
changed; the dry run's checks with and without --root.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A pure move, nothing in the files changed: assets/modding/docs/ is
docs/modding/, assets/modding/examples/ is docs/modding/examples/, and
assets/modding/templates/new-mod/ is docs/modding/template/ (beside
the examples, not among them: every examples walker would take its
{{id}} placeholders for a mod).
None of them is shipped by a build, so assets/ keeps only what one does.
The paths that point at them follow in the next commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
After the move: the links of every doc, README and example (relative
ones recomputed for each file's new depth), mod init's include_str!s of
its template (docs/modding/template/), modtool's examples walkers (mod
check's, mod test's every-example test, the examples' shaders and their
.spv freshness), the manifest test's folders (the template now under
none of them twice), schema-gen's outputs and what its emitters write
(reference.md, permissions.md, the guide, the d.ts's and the mod.json
schema's doc links, the C and Rust comments), the doc-anchor test (one
docs/ root now; the old place refused), api-schema.md's layout, and the
gfx tests' example paths. The website and the release's tree read none
of these folders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
assets/modding/packages/api/ (longshot.d.ts and a private package.json
whose version schema-gen checked) is gone, and with it assets/modding/:
api's build.rs writes the declarations into $OUT_DIR from the schema
(schema::emit::dts), beside the Rust bindings, and api::bindings::DTS
holds them; modtool's mod types writes that text into a mod's types/.
schema-gen no longer writes or checks the file, nor the package's
version (paths::OUT_DTS, PACKAGES, emit::check_packages). The docs say
where the declarations come from now, and the generated reference says
"included in the API's longshot.d.ts" for @longshot/api.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
refactor(mods): system mods are read from game/mods alone
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 50s
CI / Workflow lint (actionlint) (pull_request) Successful in 52s
Third-party parts / As their notes say (pull_request) Successful in 1m0s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m5s
PR description / Title and description (pull_request_target) Successful in 1m11s
CI / What the change needs (pull_request) Successful in 1m26s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m56s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 1m36s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m7s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m20s
CI / Website build and checks (pull_request) Failing after 39s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 6m55s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m40s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 19m26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 15m20s
eb59967d64
The schema crate also looked in assets/modding/system/ for script system
mods, a folder they moved out of: the mod API has not shipped, so no
build needs the old place. paths::SYSTEM_MOD_DIRS is SYSTEM_MOD_DIR,
game/mods; the system mods' table and the declarations' list read that
folder alone (no name hidden by another place's), and the generated
table's first lines name it alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Since the modding docs moved to docs/modding/, the examples and the mod template `mod init` writes
(docs/modding/examples/, docs/modding/template/) counted as docs: no --tested-in-game asked for a change to them, a
switch their code adds unseen, the Docs box suggested for them. They are mods, code a game runs: MOD_CODE is in
GAME_PATHS, and is_code() says what counts as code for the switches and the tests' reads; their .md files are docs still.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The hosted page's help box had an empty title ("", not none) and the focused control's help alone: a row with no help
text drew an empty box, and no row was named in it as the menu's own rows are. The box's title is now the focused
control's name (its label, its title, or a Button's words: modui_settings_title), then its help and the hint; with none
of them, as on a tab's strip, the box is not drawn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer's layout took the room of a row too wide back from every child without a width of its own, in proportion:
a Slider, which takes the whole room it is given, and the Tune Button beside it both shrank, and the Button showed
"T...". The menu's fixed width={96} did not help: 96 virtual px is less than the word and the Button's padding. The
inputs that fill their room (Toggle, Choice, Slider, TextInput, Keybind) now give it up first, down to kInputMinW, and
only then does the rest give up its share. The menu's Tune and Done lose their fixed width.

tests/test_modui_row.py lays out that line with the real layout (gpu/vk/modui_layout.cpp) at the menu column's widths;
it fails before this change. The fake game's tests passed because the fake game lays nothing out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The row's key stays autosave: (a saved key does not change); its label, which the TS menu and the engine's both show, is
"Autosave" now. The golden row lists, the debug tools' order test and the player docs follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The TS menu's tabs were the window style's boxed buttons, at the page's left, and its first focusable control: the focus
started on the Graphics title and stayed on it while Q and E chose other tabs (the stale ring of the in-game shots), as
nothing moved it. A Tabs on a settings page the menu shows (any mod's: drawn by modui_draw_settings) is now the menu's own
tab bar: its titles centred, the shown one light on the dark inset with the gold line, the tab keys' caps (Q and E, L and
R with a controller) at its ends. The tab keys and a click choose a tab; the arrow keys never stop on a title, the first
focus is the first control they reach, and a tab change lets go of a focus left on the bar, so the new tab's first
control has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
At the TS menu's first opening its script spent 3.0 ms in settingsHost.decls (5.3 ms in the frame, over the 2 ms a
script is warned at): the answer read off the script's thread was written as JSON on the script's thread, then read back
to be checked, then parsed by the script. It is written where it is read now, and decls hands over that text. And
Json::from_value, which every service's JSON answer goes through, checks the value itself instead of writing it and
reading it back. The menu starts the read at its start, so its first opening takes the answer ready.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The loader built the Mods tab's rows again at every frame the Insert menu was open, and stateChanged, fired for each new
snapshot, had system/mods-tab read modsHost.tab and draw the tab again at every frame (2.1 to 3.2 ms of its script a
frame, warned over and over; 4.4 ms the first time) on whatever tab the menu showed. The UI service now tells when a
mod's slot fills were all left out of the last snapshot though their owner has a UI (ui_slot_hidden: the menu on another
tab than the Mods tab); mods.host's step neither asks the loader for fresh rows nor fires stateChanged then, and fires it
only when the snapshot's content moved, not for each snapshot the loader builds. The tab's data is built when the Mods
tab is first shown, no longer in the frame the menu opens with its declarations' read. When it cannot be told (no
snapshot drawn, the owner with no UI: the fake game's tests) it is read as before. A screen effect's GPU ms on a mod's
page is the one read when the tab last moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Colour vision's HDR fallback could not be told from the log: on a small or integrated GPU (RX_VK_TEST_VRAM_MB=4096 makes
one) an effect that asks for full-float nits gets half floats, and only a line said once for all of them told it. The
line logged as each output effect is made now names its nits: "HDR nits in rgba32f", "HDR nits in rgba16f (rgba32f
asked: a small or integrated GPU)", "HDR nits in rgba16f", or "SDR only".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
In the game the TS menu's tab strip, now the menu's tab bar, sat at the top of the page column, too narrow for its seven
titles: Debug was cut off past E (l4mf-1's shots). The page's first Tabs now has its strip on the menu's banner, where the
menu's own tabs are and which the hosted menu left empty (modui_settings_tabs_away, modui_draw_settings_tab_bar), and the
layout keeps no room for it in the page (Inputs.strip_away). A Tabs drawn in a page (a mod's own settings page) fits its
titles to its room, its padding and then its letters smaller, before it cuts one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
l4mf-1: modtool's menu test ("closed, the menu reads nothing a frame") failed on the declarations' read started at
the menu's start; the read is the menu's first opening's again, and costs that opening 1.2 ms now (3.0 before), its
answer written off the script's thread. And the stateChanged condition wrapped as cargo fmt wants it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The allowance at the start (the policy's small_vram_textures, the HDR nits
fallback and the rest) and vram_usage's in play now count no device-local
heap for more than RX_VK_TEST_VRAM_MB makes it. Before, the test switch
lowered the VRAM but not the allowance, so a 24 GB card at 4096 still read
21 GB allowed and never took the small card's path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
menu_mod_ui is on by default, so F1 (or Settings) opens the TS menu with no
option set. Off brings back the C++ drawing until that drawing is deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A setting's "native" object is gone: its fields are the setting's own and any mod's, read by the one reader
(manifest::setting::read): store ("options": kept in longshot_options.ini under its id, which may hold a -;
"run": for the run alone; in place of scope), place (its row in the Insert menu), presetExempt, shownIf (one of
the mod's own settings, or <mod id>:<id>), hints (a line an option) and defaultText. A built-in Rust mod's
settings are made SettingDecls from the same SettingSpecs (settings::decl::decl_of); a script mod's are declared
into the settings service at its start and leave at its stop, so they are kept where their store says and their
rows with a place join the menu's, told to the mod by settings.changed. A mod whose options key another mod's
setting holds, or (a player's mod) one of the renderer's own rows, does not start (Settings::refused).

What only a system mod may have: a "button", and legacyOption and legacyId until input movies name settings by
key (the clean break removes both).

New: settings.setHints(id, hints | null), a choice's hints in place of its declaration's (the CRT filter's
"bypassed" lines), and the fake game's menuRow(id), optionsLine(key) and setOptionsLine(key, text) (its longshot_options.ini). The schema, the shared vectors, settings.md, system-mods.md
and DESIGN.md say the same; the built-in mods' mod.json files are flattened, their keys unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Both were Rust only because a script mod's settings had no options-file line or Insert-menu place; with one setting
format they are script system mods over the public API alone: each an output effect of longshot/gfx made from its
settings (src/crt.ts, src/correct.ts: the same passes, sizes, formats, inputs, params, order and nits format the Rust
mods gave), the shaders in effects/ unchanged, the settings in mod.json with their keys (crt_filter, crt_lines,
colour_vision), "store": "options" and their places. The CRT filter's "bypassed while the game presents Native HDR"
hints go through settings.setHints. A refused effect after a change is logged and tried again at the next change.

Their tests run on the fake game (Longshot.exe mod test; modtool's TypeScript system mods test runs them): each
filter and raster, each mode, the rows' places, the options lines read and written, the hints, turning off. The
pixels are test_output_fx_parity.py's (the same .spv files). The crates sysmod-crt and sysmod-colour-vision are gone
from the workspace, the registry finds the folders as script system mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
When a mod stopped (turned off, faulted, its start failed), Services::ui_gone took its UI away, but the test's view
(fake.js's Ui, made of the batches the game applied) kept the last tree: game.ui.hud() still showed what a stopped mod
had drawn. Each stop now hands the view a host op, "gone", which takes the mod's trees and mounts down; it is not one of
the mod's commits (game.ui.commits and lastBatch leave it out).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The banner of the place's name was Rust only for its options-file line and its Insert-menu row. Now a script system mod:
the names' table and rules (src/places.ts, the Rust places.rs case for case, the C's 95-byte key included), when it
shows, fades and goes (src/banner.ts: a new map in play, 3 s whole, 1 s fading; loads and the title screen take it
down, the title screen forgets the map), and a HUD root at the top centre holding a Canvas (src/main.tsx), drawn as the
Rust mod's ops drew it. area_name_banner keeps its key, store and place.

Its tests (Longshot.exe mod test; modtool's TypeScript system mods test runs them) step the banner alone and through
the fake game's maps, check what it draws, its row and its options line. The crate sysmod-area-names is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game/DESIGN.md says the rule and gives each mod that stays Rust its reason and what would move it: shadows' fit (in
place on worker sites, until the site runtime measures close enough), sprint-walk (a synchronous pad filter and worker
sites), widescreen's per-pane UI (game function calls, wrapped hooks, a per-present tick), voice-language (it answers
an outcome site) and cheats (immediate memory writes in its VM's order, raw HID, cheat files). The others wait for
the hooks work. system-mods.md lists the CRT filter, Colour vision and Area names among the script system mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The format's reader (table.rs, with its tests), the signatures and the host's list move from the lifter's sites
crate into site-table, which needs only toml: game-sites' build.rs can then read the tables with the lifter's own
reader instead of a second one of its own. It is a game crate, so a player's tree (which carries game/, not builder/)
has it, and the game library's source key (game/crates) holds it on both sides. sites re-exports every name it had,
so its users are unchanged; the made-up tables of the reader's tests are site-table's fixtures (feature fixtures),
for sites' tests too. The lift's EDITS_SOURCES hashes site-table's sources as well, each file by its crate's name,
and key_crates.rs says why it is not in the lifter's own key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Format 3, read by site-table for every owner: the core's game/sites/sites.toml, each built-in mod's
game/mods/<name>/sites.toml and a player's unsafe mod's sites.toml. A row is the site: its definition, what
finds it in any build (signature, signature_offset, guards, offset), and an entry for each supported build,
builds.<id> = { fn = "f_...", ... }, keyed by the build id's first 8 or more hex digits, holding where it is
there and what of the rest differs (an offset, an anchor, a vslot's slot, or the arguments in other registers:
the same names and types, checked). Long entries are a [site.builds.<id>] table of the row. The anchor key in
becomes within (in is no key now). hot = true marks the sites known to be reached many times a frame (the UI's
per-pane sites, anim.loopStep*, actors.update, heap.*, barrier.*): metadata only, to be confirmed by a hit-count
run. game/sites/<build>/locations.toml is gone: every site's entry moved into its owner's row (the mods' into
their own files), and the named locations are [[location]] tables of the core's file with builds entries too.

For each site the builder uses its entry for the build (its signature checked there), else its signature alone
(sites::find_unlocated), else: a built-in mod's required site leaves that mod out with why (logged, never a
stop), an optional site is not placed, and a required core site makes the build unsupported when no core site
names it and stops it when one does. The HOS_SITE_OUTCOME check reads every owner's rows, so a mod left out
does not trip it. A player's mod reads the same rows with the mods' rules on top (its entries hold fn, offset,
signature, signature_offset, guards and args; old format 1 tables are refused saying so), its list rows carry
the build's registers. game-sites' build.rs reads the tables with site-table: the forms, the mods' slots, and
PLACED, each supported build's placed sites by its key (the same left-out rule). The lift's key holds every
owner's file. The supported build's sites, their order and owners (site_owners.txt) are unchanged, so the lifted
output is the same.

New repository tests: a supported build's every site placed by its entry, none left out; a mod uses only the
core's sites and its own (its mod.json and sources); only game/mods/text names its site. tests/sitecheck.py reads
the new rows; the site-event example is converted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A build with no place for one of a built-in mod's required sites leaves the whole mod out (site_table::load);
the loader now holds such a mod back at the start (not available for your game version, naming the sites)
instead of starting it on hooks that never run. It asks game_sites::placed_in_build, which reads the same
tables' placed sites (PLACED) and is None for a build the tables do not name at all: nothing is held back
there, as nothing is placed. A game-free test holds a made-up mod whose second site no table has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Longshot.exe mod sites port reads a mod's sites.toml (a player's, or a built-in mod's in game/mods/<name>) with
the tables' reader and, for the --to build: says which sites already have an entry; finds each other one by its
own signature, else by another build's entry's (the --from build's first, its offset, signature and guards
carried into the new entry), else with --from by that build's code grown into a longer signature; and lists the
ones it cannot find. --write adds each found one's builds.<id> = { fn = ... } line to its row, before any
subtable of it, with a key no other of the row's starts, and reads the file back first. The search is the lift's
own (sites::modsites::find_one, now public) rather than a copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs/dev/reference/hooks.md documents format 3: every key, where it goes (row or entry) and who may use it (the
core and built-in mods, or a player's mod too), the builds entries with an example of per-build arguments, how
each site is found in a build, hot, within, the named locations, and the lift's new messages. unsafe.md and
tools.md say how a player's mod lists builds and ports them; system-mods.md and game/DESIGN.md say a built-in mod
holds its sites with their entries and is held back when a build has none, the text mod as the whole example
(and the api crate's build, not schema-gen, writes a system mod's types into longshot.d.ts); game/README.md,
setup.md and builder.md lose the per-build locations files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The header comment named the per-build locations.toml files, which are gone: it now names the core's sites.toml
[[location]] tables and their builds entries. The comment is the only change to the generated file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod sites port's entry search folds its if into the let chain (clippy), and its test's third site has a signature
found nowhere, so the written table is still one the build takes. The named locations' test writes a location with
both fn and data in one entry (two entries of one key are not TOML). test_switch_table.py reads site-table as it
reads the schema crate: its HOS_* names are game/sites.def's macros, not switches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Nothing of the site tables has shipped, so the one format every owner's sites.toml is written in is format 1,
with no history: the reader takes format = 1 alone and says so for any other, its messages name no older form
(a build's entry that is not a table, the key in), and every table in the repository (the core's, the built-in
mods', the example, the tests') and hooks.md and unsafe.md say format = 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The hooks had one permission, hooks.unsafe, for anything at a site. Power is now rated by what a write can
reach: hooks.observe (low) hears the game's own sites, hooks.change (medium) lets a filter change them, and
hooks.unsafe keeps a mod's own sites and data rules' values. Each tier holds the ones below it
(permission::HOOK_TIERS, in Grants::has), so a mod granted hooks.unsafe is unchanged.

- api.toml: the two permissions appended last, so no permission's number moves; schema-gen's docs regenerated.
- hooks.toml: listen and sites take hooks.observe; setValue stays hooks.unsafe. api::services::hooks checks
  each row's tier at listen (Row::tier).
- The build (build-driver modsites::collect) takes a sites.toml whose rows only name the game's sites from a
  mod holding hooks.observe or above (sites::modsites::table_tier); mod check says the same.
- Acceptance by content hash still applies to every sites.toml, whatever its tier (an open question).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The state a hit reads and the state it sends back, the ground for rules and the site runtime: no mutable
state is shared between a game thread's hit and the mod's script.

- game_sites::snapshot: 128 cells, one a mod that declares a snapshot. The script publishes a whole one with
  one pointer swap; a hit counts itself in, reads, counts itself out; the one replaced is retired with the
  cell's reader count, as a rule's table is.
- game_sites::capture: a buffer a capture, a lane per game thread (one writer, the script the reader, no
  lock), each a last value (under a sequence count), a count or a 16-record ring; overflow counted.
- game_sites::scratch: 16 values a mod keeps between hits on one thread, zeros for a new claim of its cell.
- mod.json's "snapshot" (names and types: f32, i32, u32, bool, or a table of up to 64), read by
  site-table's snapshot::Layout, so the manifest reader, the rules' reader and mod check share it; the
  website's mod.schema.json regenerated.
- longshot/hooks' publish(values) sets the named fields over the last snapshot and swaps it in; the mod's
  start claims its cell, its stop lets it go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod's rules change and read a site's arguments and fields at every hit, natively, from the values its
script publishes: the second of the four ways to answer a site, between events and handlers.

- site-table's rules reads rules.toml (format = 1): set, scale, add, min, max, or, and on a place by an
  operand; when (an AND of up to four comparisons); keep (f32 fields scaled from the game's own value);
  capture (up to four places and a bounded UTF-8 or UTF-16 string, as last, count or ring); answer.
  A place is an argument or a field at most two pointers deep; an operand a number or a snapshot value.
- game_sites::program checks each rule against its site's arguments and the mod's snapshot, rates it by
  what it reaches (Tier: observe, change, unsafe), and runs every mod's rules at a site in load order in
  one Program, one link of the site's chain inside the mods' listeners. keep's tables are the engine's, one
  a field of a site, so several mods' factors multiply, and a field no rule keeps gets the game's value back.
- Each site now knows its owner (core or the built-in mod whose sites.toml defines it): a mod uses the
  game's sites and its own, never another mod's.
- longshot/hooks: setRules(text) and captures(name); a mod's folder's rules.toml is put in place before
  its entry runs (the loader and mod test), and a rule past the mod's tier stops its start.
- mod check reads rules.toml with the same checks (rules, rules.permission).
- The inline value templates (table.rs Rule, the edits' site code) are unchanged: the lift is the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Hot is measured, not declared. Every hit of a site's dispatcher and of a mod's own slot is counted in the
hitting thread's own lane (game_sites::lane, shared with the capture buffers): no lock, no contention.
One hit in 16 a thread is timed and counts for the others. A site with only its owner in its slot (the
plain trampoline) counts nothing, so the game's own callbacks cost what they did.

- game_sites::stats: the counters, and Frames, which the hooks step reads once a frame: each site the
  mods' rows and rules use gets its last frame's hits and time. A site over 0.5 ms a frame for 30 frames in
  a row is said once in the log.
- SiteInfo gains hits, timeUs and overBudget. hooks.sites() lists the mod's rows, then the sites its rules
  use.
- longshot/mods' inspect() gives each mod's sites, and the mod inspector's page of a mod lists them
  (0.5.2).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The third way to answer a site: a mod's src/sites.ts, whose handlers run at the hit on the game thread
that reached it, for a decision that needs that hit's data.

- script::sites: one small QuickJS interpreter a mod a game thread, made at the thread's first hit (1 MB
  heap, 128 KB stack, no game API; its code imports only handle and fields from longshot/sites). A
  handler gets the site's arguments as a draft, the mod's snapshot (frozen, made again when it changed)
  and the thread's scratch object. With hooks.unsafe, fields.get reads a guest value and fields.set
  drafts a write.
- Drafts are applied only when the handler returns in budget, every value read back first; a throw or a
  cut-off leaves the hit untouched. The budget is 200 us a hit, asked every 64 steps: Longshot's
  longshot_qjs_poll_every sets QuickJS's step count, which upstream resets to 10,000. Eight misses in a row
  switch the handler off for that site, with a log line.
- What a handler returns is not read, and outcome sites refuse handlers: no answers on worker sites.
- api::script::SiteRuntime and ScriptHost::site_runtime (QuickJsHost makes script::sites::Sites).
  Services::handlers_start puts a mod's handlers in their chains before its entry runs (the loader and mod
  test). The tier is hooks.change at the game's sites and hooks.unsafe at the mod's own. A mod's stop
  takes them off and retires its runtime; each thread frees its interpreter at its next hit.
- Shadows' steady fit is the first measured case: game/mods/shadows/src/sites.ts ports SteadyFit, and
  tests/site_runtime.rs runs it through the site runtime on 300 written hits for parity with the native fit
  (the same boxes and basis rows), plus an ignored timing of both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod for the in-game check of rules, the snapshot, captures and per-site stats. mod.json declares a
snapshot and asks for hooks.change. rules.toml scales camera.lens's angle by snapshot.fov and captures
it. The script publishes the factor and logs each second the site's hits and time (hooks.sites()) and the
newest angle captured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
ModApi::site_handler asked whether the mod was a system mod, and for hooks.unsafe at any site. It now goes
by the tiers every mod's handlers, rules and listeners have: hooks.change at the core's sites, hooks.unsafe
at the mod's own, never another mod's. The site must still be in its manifest. No hook gate asks whether
a mod is a system mod. DESIGN.md says so, and that a native built-in mod cannot start a site runtime: it
has no script host and no shipped folder at run time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The core named mods: oot::layout::sysmods held every built-in mod's registers, fields and addresses, and
oot::sysmods::widescreen and oot::call::sysmods held Widescreen's site logic and its pause-menu calls.
For the mods l4ts doesn't port, these are now the mods' own:

- sprint-walk, shadows and voice-language each get a src/layout.rs, with the tests that check their
  addresses;
- widescreen gets src/layout.rs and src/wide.rs (the site logic, the layouts and panes, and the picture's
  pack and draw calls), and longshot-game reads the picture from sysmod_widescreen::wide;
- the replace site's own function call is the core's generic oot::call::callee.

Field of view, Damage and Skip title screen stay in oot::sysmods until their ports. Byte-identical code;
no behaviour changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
rules.toml beside the text mod says Text speed and Text size as two rules on its own site text.letterStep:
scale the step's time by the published speed, and keep the pane's text scale (two f32 fields through the
control's wrapper) at the game's own value times the published size. tests/parity.rs runs the rules
through game-sites' interpreter and the native letter_step on copies of the same panes, 360 written hits.
It goes through every speed and size, with panes the game writes between hits and a pane not set up. The
step times and pane scales match after every hit, and so do the values given back when the mod stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The text system mod was a native crate whose handler stepped the text panes at text.letterStep. It is
now TypeScript. rules.toml, which matched the native handler on written hits in the commit before, does
the work natively at every hit. src/main.ts only publishes the two settings' numbers, speed and size,
into the snapshot mod.json declares. Its settings keep their keys and rows (text_speed and text_size,
store options, legacyId 5 and 10). Its site stays its own (site_owners.txt unchanged: system/text). Turning
it off takes its rules away, and each pane's text scale goes back to the game's.

- game/mods/text: mod.json (runtime js, its snapshot; 2.0.0), src/main.ts, src/text.ts (each choice's
  number), test/text.test.ts (its rows, options lines and numbers).
- The crate sysmod-text goes: its sources, tests (hit_cost's bench too), and its places in the workspace
  and longshot-game. The repository test that nothing outside its folder names its site goes with it.
  game-sites' tests read the mod's rules.toml itself, so the parity's expectations hold the file.
- mod check reads a built-in script mod's sites.toml in the core's format (as it did for the Rust ones).
- DESIGN.md, system-mods.md and hooks.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game/mods/settings (system/settings) drew the same tree as the TS menu on its own settings page. It
goes whole: its crate, its workspace entry, longshot-game's dependency (the native-mods registry is
made from the folders, so its entry goes with the folder), its tests and its parity list
menu_rows.tsv (tests/test_settings_decls.py now writes and checks the TS menu's menu_rows.json
alone). It declared no setting, so no key moves and FROZEN is unchanged. The docs that named it
name the menu system mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A button has no value, so the menu's set of one changed nothing and its mod never heard it: a
button declared by a native system mod did nothing. A press is now told (setting_changed) each
time, though no value moved. Test: each_press_of_a_button_is_told_to_its_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Debug tab's panel was the C++ menu's code: its rows, their presses (game_cheat_action) and the
Teleport and Inventory pages, over game/oot_cheat_items.h. The cheats mod now declares them as its
settings, drawn as any mod's rows: Mark position, Return to mark, Set time (by Time of day), Change
quantity (by Pouch item and Change by), Teleport (by Teleport to), Switch age, and an item choice for each
inventory section (a choice holds 64 at most) with one Amount, the last chosen item's, which follows
the game's count and sets it. Each is kept for the run alone and shown
while the Debug tools are on. A press runs the same action as before (command::run). Turning the
tools on turns the renderer's Autosave row off, as the menu did.

The inventory's items (labels, pouch names, kinds, sections) and the teleport sections are the
mod's data, game/mods/cheats/debug.json; tests check them against oot::travel's lists and the rows'
choices. New keys are run-only, never saved: FROZEN is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Insert menu draws no row of its own now. vk_menu.cpp keeps its frame (the dimmed game, the
banner with the logo and the version, the help box, the prompts), opening and closing, the restart
question's logic (drawn by the menu mod as "@ask"), the text field a hosted TextInput is typed in,
and the routing of the keys, the gamepad and the mouse to the hosted tree (system/menu's page, or
the engine's fallback when the menu mod does not run). Gone with the drawing: the tabs and rows, the
Controls page's grid (its BINDINGs stay declared), the Debug tools' panel with its Teleport and
Inventory pages (the cheats mod's rows now) and game/oot_cheat_items.h (the cheats mod's
debug.json), the Mods tab and its permission prompt (the mods-tab system mod's), the tune bar, the
quick debug overlay and the Debug tools' own dialog. vk_menu.cpp goes from 8230 lines to 4323.

The Menu drawn by mods row (menu_mod_ui, gpu/vk/menu/mod_ui_menu.cpp) goes, and its key leaves
tests/test_menu_ini_keys.py's FROZEN: it was new in #2434 and never shipped. The renderer's
debug_tools.cpp module goes (Debug tools and Damage taken are the cheats and damage mods' game
rows, drawn in place; FROZEN keeps their keys, now game:CHEATS and game:DAMAGE); its Autosave row
is gpu/vk/menu/autosave.cpp. The Compact menu key and Command palette key rows are hidden, their
lines kept, until the mods open the tune strip and the Commands page from play.

MkwVkHost version 63: the Mods tab's seven members (mods_snapshot, mod_edit_id, mod_setting_set,
mod_permission_set, mod_prompt_answer, cheat_info, cheat_set) are mod_keys (each mod's debug page
key and keybind keys, for play) and mods_state (the waiting permission prompt, which opens the menu
for the Mods tab mod to show it, and the mods' changed number for the restart question), and
game_cheat_action goes. longshot-game's mods_page.rs (the C block) and debug_tab.rs go, the tab's
data functions move into mods_host.rs, and cheats.rs keeps only the live input's !cheat and an input
movie's action. renderer_setting_text("menu_language", MKWVK_TEXT_LANG_CODE) gives the menu's
language code, for the mods' translations.

Tests of the deleted drawing go (test_menu_tune, test_mods_menu, test_mod_prompt_keys,
test_menu_mouse_scroll, test_menu_empty_tab, test_damage_debug_menu); test_cheat_items reads the
cheats mod's data, the tour and its test read the cheats mod's rows, and menu_rows.json is the menu
without the panel's rows. Not run in the game yet.

Left for later: longshot-game still names mod-specific code in sysmods.rs (the system mods' start, which
waits on the hooks' step g) and mods_host's link to the cheats mod's tab; both want a generic extension first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod's texts in the player's language: its folder's strings/<lang>.json (a language code each,
en.json, pt-BR.json; a JSON object of texts by key, nested objects joined with '.'), looked up with
t(key, vars?) in the menu's language (renderer_setting_text("menu_language", LANG_CODE): the Menu
language row, Auto worked out to the game's), then the language's first part, then English, then
the key itself (said once when the mod's en.json lacks it too). '{name}' is filled from vars.
lang() and langs() say the language now and the ones strings/ has. No permission; the files are
read at a mod's first lookup and again when it starts again.

Longshot.exe mod check checks strings/ as the game reads it (a language code's .json, an object of
texts); a mod test sets the language with game.menu.setLang(code). settings-host's texts are
documented as English, which the menu mod translates. docs/modding/i18n.md; schema-gen outputs.
Tests: lookup and fallback, placeholders, the file and code rules, mod check's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer gives every text in English now (vk_menu_i18n.cpp's tr is the text itself; it keeps the
Menu language row's list and the game's language), and the menu system mod shows each in the menu's
language through longshot/i18n: game/mods/menu/strings/<lang>.json, the 13 languages of
gpu/vk/menu_i18n.h moved as they were (each keyed by its English text), and src/tr.ts, which also
translates a text made from a printf format ("3 of 9" from "%d of %d", src/formats.ts) through the
format's translation, as the C++ lookup did. src/host.ts is settings-host with its texts
translated as they are read; the menu's own words (Tune, Done, Cancel, Swap, Loading) are translated
too, with new entries for the four the tables lacked. What the renderer draws itself, the FPS counter
and the start-up screen, is English now.

tests/test_menu_i18n.py reads the strings files (every language of the row has one, every text is
the menu's, conversions kept); test_menu_i18n_count and test_share_message_i18n, which compiled the
C++ tables, go; test_framegen_by_row reads the strings files. A mod test checks a label and a made
text in French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
LONGSHOT_SET="<mod id>:<key>=<value>[,...]" sets mods' settings for one run, over the player's,
never written to the options file or a mod's storage: the settings service's run value
(longshot-game run_set.rs, asked after a mod test's own and before a system mod's switch table). A
value is read as the options file writes it; one the setting does not take is logged and the
player's kept, a malformed entry logged and left out. longshot-builder play --set id:key=value
(repeatable, before --) passes it.

It replaces the switches that each set one setting: HOS_OOT_CHEATS (system/cheats:debug_tools=1),
HOS_OOT_PROTECT_HEARTS (system/cheats:heart_protection=1, now with the Debug tools on, as the row),
HOS_SKIP_OPENING (system/skip-title:skip_opening=1) and HOS_DISCORD_APP_ID (system/discord:appId=<id>);
HOS_DISCORD goes too (HOS_SYSTEM_MODS_OFF=discord). Each is a GONE row of switches.def. HOS_ASPECT
stays: it takes any ratio (2.3889), which the Aspect ratio row cannot hold. The cheats mod's own
switch reads and its heart-protection-until-touched rule go; discord's mod.json names no switch, so
the offSwitch/settingSwitches table is empty (its code stays, for a later cleanup). The test runs'
scripts (the pipeline tour, ab.py, the bridge's TEST_RUN_ENV, the parity gates) and their tests use
the new ways; docs: switches, system mods, build, control bridge, the player's guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Debug tab's last line, About >, opens a page of the menu mod's own (@about): the third-party
parts Longshot ships, each with its licence and link (game/mods/menu/src/credits.ts, one a folder of
third_party/, Tracy left out as developer builds alone have it), and the mark of the upscaler in use,
NVIDIA DLSS, AMD FSR or Intel XeSS, only while the Upscaler row names it. A mod test checks the
credits and that a vendor's mark shows only with its upscaler; tests/test_menu_credits.py keeps the
list and each licence the same as third_party/*/PROVENANCE.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the C++ menu drew itself and the menu system mod could not know, now in the declarations: a
module button's own text (Apply / Applied, Start test / Stop test) comes as its state's text; a row
that takes a restart, changed from what the game started with, has "Takes effect after a restart" as
its hint's last paragraph (the old After restart tag); Sprint's binding row has the old Controls
page's help (how Sprint starts, what ends a toggled sprint). src/tr.ts translates a text of
paragraphs one paragraph at a time.

The menu's translations lose the 909 entries (of 13 languages) whose English the renderer no longer
says: the C++ Controls grid, the Debug tools' pages (the cheats mod's rows now), the Mods tab (the
mods-tab system mod's, not translated yet), the tune bar and the prompts. tests/test_menu_i18n.py
counts a paragraph as a text, and drops the checks of texts that went (the plural forms, the Controls
hint, the text field's editing bar).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The checks that read the C++ menu's drawing and keys read what took their place: a press runs in
settings_decl_tick (the bug report, the weak laptop button, Save my pipeline list, a locked button),
a button's text and a hidden row in menu_decl_state, a step in menu_setting_set's set_row (Vibration,
Vibration strength), the tab names in kTabLabels, the Mods tab's screen effects in the mods-tab
system mod, MkwVkHost's version 63 members (hos_ab), the text field's place in menu_tick. What went
with the drawing goes from them: the Controls grid's navigation and confirmations (test_menu_keys
keeps the A/B mapping, the keyboard and Esc, the options file), the slider drag (stepped sliders),
the mouse's row record (menu_hit), the prompt bar, the tab walks; test_mic_help_meter, which drew the
help box's live meter, goes. test_settings_decls no longer copies the Debug tools' and their pages'
rules (the cheats mod's rows). scripts/tours/route.py zipped the teleport names with the
destinations' texts instead of their maps' ages.

Not run here (no tests on this PC): their source parts were checked against the tree and their
fixtures compiled syntax-only; game/mods/menu/test/menu_rows.json wants test_settings_decls.py --write
once to be sure it is the menu as built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
No system mod named one since LONGSHOT_SET (any mod's setting for a run) and HOS_SYSTEM_MODS_OFF (a
system mod left out) took the switches' places. The manifest's "system" is "enabled", "required"
and "legacySwitch" again: the schema crate no longer reads the two nor emits SYSTEM_SWITCHES and
system_switch_of, api's SystemEntry and SystemTable::setting_switch lose them, switched_off is
HOS_SYSTEM_MODS_OFF's alone, and the run's settings are a mod test's and LONGSHOT_SET's. The mod
schema (website/public/schemas/mod.schema.json), docs/modding/system-mods.md and
tests/test_switch_table.py follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
scripts/screenshots/menu.cpp, capture_menu.py and check_menu_capture.py compiled gpu/vk/vk_menu.cpp's
drawing to render the settings without a game; that drawing is gone (the menu system mod's rows,
drawn by the mods' UI, need the game). The guide's README says a settings screenshot comes from a
game run with the menu open until a TS capture path exists; the manifest's menu-fixture entries keep
their fingerprints for the next review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The first step of the runtime/game-module split (#2434 runtime design): what lifted code touches on its hot paths moves
into the lift runtime, which becomes part of the game module, and the choices the IR is written with stop being a
lift's own.

- builder/rt/a64_config.h is committed and fixed (the window's base, the marks' table, the GPU page bitmap, polls).
  llvm's `abi` repeats the values (a test checks them against the header); the whole lift refuses options that
  differ, and writes the header as builder/rt holds it. The dev lift's --no-polls and --no-mark-bitmap go.
- a64_gpu_pages, read by every marked store, is defined in a64_rt.c beside a64_dirty; host/mark_bitmap.c only sets it.
- hos_site_callee, the replace sites' thread-local, is defined in a64_rt.c with its get and set (Windows cannot import
  thread-local data); host/game_call.c no longer defines it.
- A host function more than 2 GB from a64_lookup (a host call, seen from a module apart from the runtime) gets one of
  512 module-local thunks, so the call caches' 32-bit offsets stay inside the module. In one image none is used.

Tests: llvm's ABI-against-header test; the lift refusing a non-ABI lift and writing the fixed header; a64_rt.c's far
thunk and callee get/set compiled and run (A64_TEST_ALL_FAR); test_game_boundary checks the module's data is defined
by the lift runtime alone, with two crossings planted. The IR is unchanged (the llvm writer is untouched and the
defaults are the frozen values).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A new crate, game/crates/ui: the next channel's ops checked whole on the main
thread (ops, shadow), the UI thread's trees (doc), styles resolved into taffy's
Style, parley's text properties and a small visual, cached by (style ids, state
bits) (style), taffy 0.16 layout kept per root and given only what changed
(layout), parley 0.13 text with its editor and a swash glyph atlas of pages with
sub-pixel bins and LRU eviction (text, atlas), Canvas paths through lyon with AA
fringes and the built-in icons (canvas, icons), the draw list, the renderer's
contract (draw), the behaviour widgets and the old UI's controller navigation
ported (widgets, nav, paint), the synchronous Core and the UI thread ticked per
present (core, thread), and the reference CPU renderer (reference). Metrics and
size probes as examples. taffy, parley, swash and lyon_tessellation pinned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
api::services::ui2: each mod's batches checked whole by its game_ui Shadow and
sent to the UI thread through a new host part, Ui2Sink (Hosts.ui2), its images
decoded by the old channel's ImageSet and handed over once ready, its events
from the UI thread to its onEvents at the next frame, its requestFlush once a
frame, and measure() by the real text layout. With no sink (LONGSHOT_UI2 off)
every call is NotAvailableError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
runtime.js evaluated a second time for the next channel (group ui-next,
native.next): the primitives as host elements, styles() interning definitions
whose keys are taffy's, parley's and the visual's fields, state blocks, theme
tokens passed through, a virtualised List over the host's range events, and
measure(). The element marker is Symbol.for so TSX (always compiled to
longshot/ui/jsx-runtime) makes elements both instances take. The kit is
TypeScript (game/modapi/ui/kit.tsx) the game compiles at its first import. The
old channel's path is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot-game::ui2: the UI thread made at the first use while LONGSHOT_UI2=1,
the main thread's sink over it, and game.h's game_ui2_present (the input handed
over, the newest frame's C view given back), game_ui2_theme and game_ui2_font.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game runs UI2's Core at each frame: real taffy layout and parley text
with the bundled fonts, the player's presses, navigation and typing, and a
picture from the reference renderer (snapshot()).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
gpu/vk/vk_ui2.cpp gathers each present's input for the UI thread
(game_ui2_present, host version 63), takes the frame's changed atlas pages and
fresh images as kept ImGui textures (vk_imgui's user_texture_kept and
user_texture_update: only a page's dirty rect uploads), and draws the list in
the overlays' ImGui frame under the old mods' UI: rounded rects and borders,
shadows as fading rects, glyph quads, images, meshes, scissors. No pipeline of
its own: the SDF drawer of the contract comes at the renderer's swap. The C
twins of the contract are gpu/vk/ui2_draw.h. Off by default (an attempt).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs/dev/reference/ui2-draw-list.md (the renderer contract, the reference
renderer its executable spec), docs/modding/ui-next.md and the example mod,
game/DESIGN.md's UI2 sections (styles as taffy, parley and the visual; the
threads and caching; the metrics; the Later plan to port the menu mods and
delete the old path; open questions) and the architecture page's paragraph.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(vk): UI2's headers include no imgui.h, so vk_menu.cpp keeps ImGui's vector operators
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Failing after 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
PR description / Title and description (pull_request_target) Successful in 40s
CI / Website build and checks (pull_request) Failing after 40s
CI / What the change needs (pull_request) Successful in 47s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m26s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m18s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m47s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 58s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
b9ac716574
vk_ui2.h included imgui.h ahead of vk_ui.h's IMGUI_DEFINE_MATH_OPERATORS, and
vk_imgui.h named ImTextureFormat without imgui.h: vk_menu.cpp and every other
includer failed to compile. vk_ui2.h now forward-declares ImDrawList,
user_texture_kept takes its format as an int, and vk_ui2.cpp includes imgui.h
itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The second step of the runtime/game-module split (#2434 runtime design; the design's commit 3, done before the link so
the link has something to load): nothing of the runtime names a symbol of the lifted game, so the game can be a module
of its own.

- builder/rt/a64_module.c: the module's one export, ls_game_module(A64_MODULE_ABI), a table (rt/a64.h A64Module) of
  the lookup, an indirect call, the page marks and the GPU page bitmap, the replace sites' callee, the image's boot
  constants and the named locations, with a64_config.h's base and page count. gen/image.c is now one A64Image
  (a64_image) and gen/locations.c's function a64_locations_resolved.
- host/game_module.c reads the table first thing in main: linked in, ls_game_module is called directly (a weak
  reference); with LONGSHOT_GAME_MODULE=<path> the module is loaded from that path (UTF-8, widened on Windows). A
  missing file, no ls_game_module, another table ABI, another lift ABI or an incomplete table ends the start with a
  sentence; --prepare-shaders needs no module. hos_image_base, hos_main_build_id, hos_main_base ... are the host's
  copies, hos_site_callee_get/_set and hos_locations_resolved forward to the table, hos_game_lookup and
  hos_game_icall replace the host's (and game-sites' vslot) a64_lookup and a64_icall.
- The host's C is compiled with -DA64_RUNTIME: rt/a64.h's A64_DIRTY and A64_GPU_PAGES are then the table's pointers
  (rx_backend.c, hos_mem.c, mark_bitmap.c, every A64_MARK); HOS_MARK_BITMAP_ALL is applied at the load.
- a64_rt.c's weak defaults are left out of a game module (A64_GAME_MODULE): there they would bind inside it.
- The preparation driver's stand-ins are 256 bytes, as big as an A64Image.

Tests: tests/test_game_module.py loads fake modules through host/game_module.c (a fitting one, and each refusal); the
lift's tests and synthetic-game's host read the new image.c; the harnesses of test_game_call, test_libc_hooks and
test_collect_wide follow the new names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(boundary): plant game headers that exist
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Failing after 21s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 23s
PR description / Title and description (pull_request_target) Successful in 28s
CI / What the change needs (pull_request) Successful in 39s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m31s
CI / Website build and checks (pull_request) Failing after 36s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m59s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 4m52s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m28s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 6m38s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 56s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
529d1f32d1
The boundary check's planted crossings named game/oot_sprint.h, which is gone: an include of a file that is not there
resolves to nothing, so the renderer's plant (through -I gpu/vk) was not seen and the check failed on its own. The
plants name game/phases.h, a game header the host may not include.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(third-party): QuickJS's note names longshot_qjs_poll_every, our own second function, and its tree hash
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Successful in 23s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
PR description / Title and description (pull_request_target) Successful in 30s
CI / What the change needs (pull_request) Successful in 42s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m12s
CI / Website build and checks (pull_request) Failing after 18s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m49s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m38s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 41s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m28s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m47s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m28s
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
65d5181ac7
The site runtime added longshot_qjs_poll_every to longshot_quickjs.c, Longshot's
own file beside upstream's, without updating the part's note, so
check_third_party refused the tree. Upstream's files are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(builder): vk_ui2.cpp compiled with ImGui's include dir, as the renderer's other ImGui files
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
Third-party parts / As their notes say (pull_request) Successful in 30s
PR description / Title and description (pull_request_target) Successful in 36s
CI / Website build and checks (pull_request) Failing after 41s
CI / What the change needs (pull_request) Successful in 53s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m55s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m37s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m41s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 4m5s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m29s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m9s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 9m39s
827bd8b0f8
UI2's drawer (gpu/vk/vk_ui2.cpp) includes imgui.h and imgui's draw list, but the builder's renderer plan gave ImGui's
include dir and defines only to vk_imgui.cpp, vk_menu.cpp, reshade.cpp and vk_modui.cpp: the game build stopped at
'imgui.h' file not found. The list is now a const, IMGUI_USERS, with vk_ui2.cpp in it, and a test reads gpu/vk and
gpu/vk/menu so that every file including ImGui's headers, or a header of gpu/vk that does (vk_ui.h), is in it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
host/game_module.c reads LONGSHOT_GAME_MODULE (the game module's path, which the builder's play will set), and
test_switch_table wants a row in gpu/vk/switches.def for every name the source reads: a player switch, environment
only, sorted after LONGSHOT_DRIVER_ENV_SET; and its line in docs/dev/reference/switches.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(host): hos.h names the game module's types only beside the a64.h that has them
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 26s
Third-party parts / As their notes say (pull_request) Successful in 29s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 34s
PR description / Title and description (pull_request_target) Successful in 36s
CI / What the change needs (pull_request) Successful in 52s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m45s
CI / Website build and checks (pull_request) Failing after 35s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m44s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m45s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 40s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 3m5s
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
f069170ec0
hos.h declared hos_game_module_check, hos_game_image and hos_game_lookup with rt/a64.h's A64Module, A64Image and A64Fn,
so a harness that gives hos.h a stand-in a64.h (Ctx and A64_PTR alone: test_fs_save_commit's) no longer compiled:
"unknown type name 'A64Module'". The three are declared under A64_MODULE_ABI, which the lift runtime's a64.h defines
with those types; every host file that calls them includes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The TS menu reads every row's state at the start (renderer_setting_state, menu_decl_state). Its hint line is
made as std::string(hint(v, -1)), and most hints give nullptr for a value with no line: libstdc++ throws
std::logic_error ("basic_string: construction from null is not valid") and the renderer stops the game at
start. The check cuts those lines out of menu_decl_state and runs them with the real modules and model over
each row's every value, the restart tag on and off. Fails here: the fix follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(menu): renderer_setting_state no longer throws for a row whose hint has no line, so the game starts
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
Third-party parts / As their notes say (pull_request) Successful in 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
PR description / Title and description (pull_request_target) Successful in 30s
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
b50bc86b04
menu_decl_state made a row's hint line as std::string(hint(v, -1)); most hints give nullptr for a value with
no line, so libstdc++ threw std::logic_error ("basic_string: construction from null is not valid") when the TS
menu read every row's state at the start, and the renderer stopped the game ("vk: FATAL: std::logic_error came
out of renderer_setting_state"). Came with mwurlplr (the restart tag in the declarations). The hint is now taken
only when there is one; DeclList::keep takes a nullptr text as "" too, for the declarations' other texts.
tests/test_menu_decl_state_hint.py passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
api::manifest::normal is the one JSON shape of a checked manifest (format 1, every default filled in) and of a
setting in the one-setting format, so a tool shows what the game's reader made of mod.json and a launcher never
parses it itself. The loader gains Loader::offline (the start's scan alone, the API features not checked: a tool has
no game), copies() (every copy found, with the reader's ManifestError for one refused) and resolved() (what the start's
resolver was given and decided). resolve::needs says where each of a mod's dependencies stands after a resolve
(loads, wrong-version, missing, off, wont-load), with its test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The control bridge listed the renderer's rows alone, and the menu takes the game side's rows once, at its first use:
a script system mod's settings (crt_filter, colour_vision, area_name_banner), declared when the mod starts, were
"not_found". The bridge now falls back to the game side's settings, every mod's as its settings service lists them
(game.h's game_setting_*): listed once after the menu's rows, and set as the player sets them. control_test covers a
setting only the game side has, and one both have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
For the launcher (#268), so it drops its copies of the game's rules. Each runs the game's own loader scan offline over
a read-only disk (the mod store laid over the files, the game folder builds/<stamp> of the profile's code mods, the
built-in Rust mods from game/mods and the build's table of script ones) and answers a versioned document (format 1):

- installed: every mod the next start sees, with its normalized manifest or manifest_problem {field, text}, state,
  load order, code hash, trust (accepted, asks, unsafe grants), the Mods tab's warning and its build state, merged with
  the profile entry's source, pin and update;
- resolve: {order, off: [{id, reason, other, text}], needs: {id: [{dep, state, have}]}} from the game's resolver;
- build-state: the code and ExeFS patches the last build put in against what waits for one;
- settings <id>: its declared settings in the one-setting format with their values; --set and --reset write as the Mods
  tab does (the profile's settings.ini line for store options, else the mod's settings store), refused while the game
  plays the profile.

Documented in docs/modding/tools.md (What the game will do), with CLI tests over a fixture profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The code mods' stamp and the game folder it names (build_driver::play::mods_stamp, game_folder, BUILDS,
DEFAULT_BUILD) move into game_files::code_mods, which play re-exports: the builder's play and modtool's reading of
what the game will do take one rule. api gains system::table() (the build's table of script system mods, the
game's runtime::system_table gone), loader::ArchivePackages (longshot-game's packages.rs gone) and the built-in Rust
mods' mod.json list (system::native_ok, emitted with the table from schema::system_mods::native_folders, the one walk
of game/mods/<name>/ with a Cargo.toml, which longshot-game's registry build takes too). modtool's own build.rs and
native list go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The installed operation (the game's channel, mod serve) answers the same {format: 1, game, mods} document as the
command line, so the game's Mods tab and the launcher read one thing; its service tests read it by id. mod resolve
--on ID --off ID gives the resolution as if those mods were switched so (the profile's list read through an overlay
with those switches, an entry added for a mod it does not name; nothing written), for the launcher's "switch on what
it needs", with its tests. modtool reads the stamp rule, the system table and the packages from their one place.
tools.md says why settings --set refuses while the game runs: the game's own Mods tab edits them live.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A folder or package of mods/ whose name starts with - or _ is off by the player's choice: Loader::skipped lists each
one (its path under the folder, and why) beside the log's line, for the tools' installed. settings::value_text is
exported for them too (a setting's value as the menu shows it). With its loader test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
installed gains list {state: profile | none | not-a-list, path, old_lists (the game folder's mods.json or
longshot_mods.txt, read by nobody)}, skipped [{path, why}], and per mod in_profile and content {romfs_files,
romfs_more, cheats, exefs_patches, modules} for the launcher's kind chips. mod settings gives every setting its text,
read-only: a choice's value is its option's index, and --set takes the index, never the label. tools.md says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(modtool): mod settings writes a mod's settings store on the disk, and the installed test reads builds/default as built
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
PR description / Title and description (pull_request_target) Successful in 30s
Third-party parts / As their notes say (pull_request) Successful in 29s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
CI / Website build and checks (pull_request) Failing after 35s
CI / What the change needs (pull_request) Successful in 55s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m3s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m58s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m1s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 57s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m17s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 7m56s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 13m6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 9m9s
e40a12fe35
l4mt-1 found both. The tools run on the stand-in host (host-sys's fake), whose whole-file write keeps the bytes in
memory: a settings store written through the game's Storage over OsDisk never reached the disk. FileDisk makes that
write with build_core::fsx::write_atomic. The fixture has builds/default, so with no code mod taken the game folder is
there and built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The checks of where a version's members are (test_broker_frame, test_gfx_world, test_texture_pack,
test_ui2_renderer) asked that they be the last in MkwVkHost and in host/rx_backend.c's vk_host, so every new
version broke them (64's UI2 needed an exception in each; 65's engine_text broke them again). The rule they
follow now, from vk_api.h's MKWVK_API_VERSION note: vk_host fills MkwVkHost by position, a version's members
go in together after the versions before them (appended last since 54), and the renderer reads one only with
host->version at least its version. So each check names a version's members with the version's before or
after it and asks they be there together in that order (tests/vk_host_members.py in_order), in both lists;
later versions' members may follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
host/hos_main.c calls the game's _init_libc0 through the game module's table since qnvwqxko (im->entry_init_libc0,
not hos_entry_init_libc0), so test_hos_ab's start-order check no longer found its marker (ValueError). It
looks for the call as it is now; the order it checks is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(settings): Damage taken is the damage system mod's setting, placed on the Debug tab by its declaration
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
Third-party parts / As their notes say (pull_request) Successful in 26s
PR description / Title and description (pull_request_target) Successful in 32s
CI / Website build and checks (pull_request) Failing after 36s
CI / What the change needs (pull_request) Successful in 45s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m3s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m24s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 39s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m4s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m54s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m55s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m32s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m46s
1d87ae0130
The Damage taken row moved from the renderer's Debug tab into system/damage (TS-format mod.json, place debug
after heart_protection), so the menu built from the renderer's modules no longer has it and
test_damage_taken_is_listed_in_debug_player failed. The check now reads where the row is: the page's Debug line,
the mod's declaration (its tab, after Heart protection, Normal its default), and no renderer row of it on the
Debug or Gameplay tab.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(build): the shader preparation's driver links no game module table
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
CI / Workflow lint (actionlint) (pull_request) Successful in 24s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 29s
PR description / Title and description (pull_request_target) Successful in 34s
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
33d469623e
The preparation's driver is the game's executable without the lifted game, its names stand-ins of 256 zero bytes. Since
the module's table moved into the lift runtime (rt/a64_module.c), the driver linked it too: ls_game_module was then
defined, its image a stand-in, and the runtime took that table for a game. in_prepare leaves a64_module.c out, so the
driver is a runtime with no game in it, which --prepare-shaders allows (host/game_module.c). A static build's
preparation was seen to end by signal 11 within a second (l4rb2-1); this is the likely cause, to be confirmed in game.

Tests: the preparation's unit test leaves a64_module.c out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(scripts): release_bench starts each game folder as it is, without packs.runtime_romfs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
PR description / Title and description (pull_request_target) Successful in 35s
CI / Website build and checks (pull_request) Failing after 42s
CI / What the change needs (pull_request) Successful in 51s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 2m59s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m4s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 53s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m15s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 7m20s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m29s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m52s
11abc744c6
release_bench.py asked scripts/devtools/packs.py for runtime_romfs(), which packs no longer has: every run stopped with
an AttributeError before the game started. A builder's game folder knows its own romfs (its index), as dev.py ab's
runtimes do, so the session is started with no --romfs, the way ab.py starts its runs; packs is no longer imported.

Checked by importing release_bench and its run's modules (longshot_bridge, tours); the runs themselves in l4rb2-2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the engine draws itself was English since the menu's tables moved to the menu mod. It has one
strings set of its own now, game/strings/<lang>.json, in the mods' format (keyed by the English, the
same 13 languages and English), built into longshot-game (engine_text.rs, include_str!). The renderer
asks through a new MkwVkHost member, engine_text(lang, english) (MKWVK_API_VERSION 65,
host/rx_backend.c game_engine_text), as i18n::engine: the start-up screen's texts (its counts and
time left through their formats), the FPS counter's labels, the menu frame's prompts and its
"starting" line. The fallback menu reads the same set in Rust (build_in).

The frame's prompts while a text field has the keyboard are the text field's again (Caret,
Character, Add, Remove, Paste, Done, Cancel; the controller's only with a controller), as the C++
menu showed them: a player on a controller sees how to type.

Tests: every language has every text with its conversions, the lookup's fallback (region, English,
the English itself, the C entry point), the fallback menu in French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The C++ menu drew the microphone test's levels in its help box; that drawing went. The Audio tab has
a Microphone level line after Test microphone, shown while the test runs: a line declaration with a
range (0 to 1000) whose state is its level (after the gain) and the meter's text ("Testing: 12% ->
24%", then what the test hears). The menu system mod draws any line with a range as a meter, its
text and a Progress bar: a generic piece, read through settings-host like every row.

The test stopped at once with the TS menu: it ran only while the C++ menu's tab was Audio, and that
tab no longer moved. menu_on_tab is now the page whose rows the menu mod read in the last half
second (menu_decl_state notes it; the mod reads only the page it shows).

Tests: a mod test of the meter line; test_microphone_test_gain checks the line and the page-read
rule (stale, another page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
t(key, { name }) left every {name} as it was from a script: a variadic value reaches the service as
the object's JSON text, which vars_of did not read. And a mod keyed by its English words (no en.json)
got its key back unfilled. Both are filled now; a test covers the text form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The tab's own words (the list's lines, a mod's page, Permissions, Keybinds, Commands, HUD layout, the
permission prompt, Safe start, About, the switch's states and the help) go through longshot/i18n,
keyed by their English, their parts as {name}s; game/mods/mods-tab/strings/<lang>.json has the 13
languages of the menu. What the loader says (a mod's detail, note, state, warning) stays its own. A
mod test checks the tab in French, a filled-in part included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
msyuxrny dropped Row's cheat field (the Debug tools' index, -1 for every other row). The checks that
read vk_menu.cpp's rows table still looked for it: tests/menu_model_fixture.py's core headings (their
", -1, true}") found none, so the menu as built had no Resolution and upscaling, Screen or Developer
section, and every row anchored there was a diagnostic (test_settings_decls, test_settings_table,
test_menu_sections, test_menu_modules, test_upscaler_rows). Ported, none deleted:
- menu_model_fixture.py: the core headings without the field;
- test_menu_rows_model: its table without it, and a module's page row checked by its setting's
  opens (row_opens, the C++ drawing's, went);
- test_menu_env_overrides: its FSR 4 model row without it;
- test_menu_keys and test_menu_text_field: the stubs the trimmed fixtures no longer use are
  [[maybe_unused]] (clang's -Wunused).

Their fixtures were compiled syntax-only with clang here; the checks were not run on this PC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The live microphone meter came back as a row of its own (Microphone level, a line the menu mod draws as a bar
while Test microphone runs), so test_settings_table found a menu row with no line in the settings page's table.
The page lists it after Test microphone, which no longer says the levels are in the help box; the meter has no
default, as the actions have none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Mods tab now says its texts through t() (its strings/ in 13 languages), so test_gfx_effects no longer
found <Section title="Screen effects"> or the GPU time's English line. It looks for the section and the line
as they are written now, t("Screen effects") and t("{ms} ms of the GPU a frame.", ...).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
i18n::engine read MkwVkHost.engine_text whenever the pointer was there; a host older than version 65 has no such
member, and the renderer reads a member only with host->version at least its version, as every other one is
read. Older hosts get the English.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The user's decision on observe-only mods. A mod is observe-only when its code is its sites.toml alone and
it asks for hooks.observe and neither hooks.change nor hooks.unsafe (nor exefs). Its sites can then only
name the game's own (the build leaves out a site of its own without hooks.unsafe), and the game lets it
hear only events and their arguments (a filter needs hooks.change; a field or string capture stays
hooks.unsafe). Such a mod is taken with no acceptance by code hash: no warning, nothing written to the
trust file, and no new question when it is updated. Its low-risk permission is shown at install as any
mod's. The warning ("its own code changes the game's code") is left for hooks.change, hooks.unsafe and
ExeFS code.

One rule, mods_stamp::observe_only, asked by both sides: the stamp takes such a mod's sites without an
acceptance and leaves it out of the trust set; game_files::code_mods and build-driver's modsites::collect
take its sites; api::loader's code_status neither asks nor warns (Row::observe_only), and so neither does
the Mods tab; mod installed's trust says observe_only. Docs: unsafe.md, hooks.md, tools.md. Tests in
mods-stamp, build-driver, api's loader and modtool's installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test: the version folder's builds/ and builds/default are read where they are now, game_files::code_mods
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 20s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 26s
CI / Website build and checks (pull_request) Failing after 29s
PR description / Title and description (pull_request_target) Successful in 35s
CI / What the change needs (pull_request) Successful in 45s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m16s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m11s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m12s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m9s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 45s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 16m11s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 18m7s
CI / longshot-builder end to end (synthetic game) (pull_request) Failing after 20m7s
f1646dd6a3
The stamp rule moved into game_files::code_mods (vzkzlltv): BUILDS and DEFAULT_BUILD are defined there and
build_driver::play re-exports them, so test_longshot_exit and test_recomplauncher_json, which read the
constants from play.rs, failed. Both read them from code_mods.rs now, and check that play.rs takes them from
there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod can now widen or narrow the gameplay view without overriding the camera: camera.setFovScale(scale),
0.1 to 10, under camera.write. It takes no claim. Every mod's factor multiplies, and the angle drawn is
held to 5 to 140 degrees. Each factor is a live effect in the journal, so a stopped mod's goes. The API
composes the factors on the main thread into one f32 (oot:📷:lens::compose), and the core's engine
callback on camera.lens applies it with one relaxed load. No mod code runs on the game's threads for it.

- oot:📷:lens: the lens logic that was oot::sysmods::fov's (camera zero's gameplay view, events
  through state::event, broken links, s0 written only when it changes), taking a factor instead of a
  percentage. Its layout moves to layout:📷:lens.
- The core's camera.lens callback scales by the API's factor, composed with the Field of view mod's row
  while that native mod still hands it down the chain.
- A parity test runs the new lens at the factor the TypeScript port will give (the row over 100, composed)
  against sysmods::fov::lens on the same written hits: every slider value, 12 angles, with and without an
  event and a broken link (1008 hits). The 21 factors are bit for bit the f32s the native mod computed.
- The fake game's camera draws the scaled angle as the lens does. The feature camera.setFovScale is
  there when camera.lens is placed.
- Schema (camera.toml) and the generated reference, permissions and scripting pages; docs/modding/camera.md
  and docs/dev/reference/camera.md say how it works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Field of view system mod was a native crate. Its handler on camera.lens handed its row down the chain
to the core's callback. It is now TypeScript: src/main.ts sets longshot/camera's setFovScale to the
setting's value over 100 whenever the setting changes, and the core's lens (oot:📷:lens) applies the
factor at camera.lens, as the parity test in the commit before showed on written hits. The setting keeps
its key, row, range, place and default text (field_of_view, store options, legacyId 51). The mod has no
site of its own and needs only camera.write. Turning it off takes its factor away, and the next camera
update has the game's angle.

- game/mods/fov: mod.json (runtime js, camera.write; 2.0.0), src/main.ts, src/fov.ts (each value's
  factor, 1 outside the slider as the native mod had it), test/fov.test.ts (its row and options line, its
  factors, and the fake game's lens drawing the game's angle times the setting, held to 140 degrees).
- The crate sysmod-fov goes, and so does its place in the workspace and longshot-game. oot::sysmods::fov
  goes too (with_row, row_now, its layout); the core's camera.lens callback is oot:📷:lens::lens.
  The parity test goes with the native lens it compared against.
- tests/test_oot_fov.py checks the new wiring. DESIGN.md, system-mods.md, game/README.md, the camera
  reference and sites.toml's comment say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Damage taken's port needs two things the API lacked. A scale that comes after the other mods' damage rules,
as the native mod's did. And a way for a script to see the Cheats mod's Debug tools, which gate it.

- DamageRule's last (rules.damageTaken / damageDealt add({ ..., last: true })). A last rule takes the hit the
  other rules made (the game's when none matched), and the last rules combine among themselves as the
  others do: scales multiplied and rounded to a quarter heart (halves up), then adds, then min and max.
  oot::rules::apply_hit runs the two passes; LifeRule gains last in its padding (size 80 kept).
- player.lifeWrite, the game's other compare-and-swap of a life (add w12, w11, w10), never saw the mods'
  rules; only the native Damage taken scaled it. The core's engine callback there now applies Link's last
  rules over the hit that write takes off (oot::rules::life_last). It reads the published rules.life table
  with its reader count (game_sites::rules::with_live, the C's enter and leave), then heart protection as
  before. Both sites log the first 32 writes that lower Link's life, so a game run shows which write a hit
  goes through.
- A parity test runs a last rule at each Damage taken scale (0.5, 2, 4) against the native scaled_life on
  the same written hits at both writes: lives to 20 hearts, hits to 25 hearts, alone and after other mods'
  rules (147,258 hits).
- mod.json's reads ("<mod>:<id>", at most 32, only with a runtime) under the new permission settings.read
  (low risk, read only; each needs the other). settings.get("<mod>:<id>") gives the value of a setting reads
  lists, or null while that mod does not run; any other is UnknownNameError. settings.changed tells its
  changes with that id. The prompt's and the Mods page's permission rows carry the names
  (Asked/PermissionRow names, modsHost's names), and mod check prints them. Drawing them in the TS Mods tab is
  the UI2 helper's. The fake game puts the system mods a mod reads in its game, as it does its dependencies:
  systemMod(name).setSetting is what the mod reads.
- The schema (types.toml, api.toml, settings.toml, modsHost.toml), the generated reference, permissions and
  scripting pages, the website's mod.schema.json, and 4 new cases in tests/mod_vectors/manifest.json (the
  Launcher's reader needs reads to pass them). Docs: rules.md, settings.md, manifest.md, actors.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Damage taken system mod was a native crate. Its handlers scaled Link's life at player.lifeHit and
player.lifeWrite. It is now TypeScript: src/main.ts keeps one last rule of rules.damageTaken with the
choice's scale (Half 0.5, rounding up; Double 2; Quadruple 4; none for Normal). The game applies it after
the other mods' rules at both of Link's life writes, then heart protection, as the parity test in the
commit before showed on written hits. It works while the Cheats mod's Debug tools are on, read through
mod.json's reads (system/cheats:debug_tools, settings.read), as the native mod was gated on
oot::debug::tools_on. Normal otherwise, or while Cheats does not run. The setting keeps its key, row and
place (damage_taken, store options, legacyId 55, shownIf system/cheats:debug_tools). Turning the mod off
takes its rule away.

Clean break: an input movie's Damage knob (the old option 55, oot::debug::movie's Knob::Damage) is
dropped. A movie naming 55 is told no such setting, and the clean-break item (movies set settings by key)
covers it: damage_taken by key.

- game/mods/damage: mod.json (runtime js, state.write + settings.read, reads; 2.0.0), src/main.ts,
  src/damage.ts (each choice's scale, Normal with the tools off), test/damage.test.ts (its row and options
  line, its scales, and Link's hits through its rule in the fake game with the Cheats mod's Debug tools
  off and on).
- The crate sysmod-damage goes, with its place in the workspace and longshot-game. The input movie's
  Damage knob goes from longshot-game's input.rs and oot::debug; its test says 55 is refused now.
- DESIGN.md, system-mods.md and sites.toml's comment say so. oot::sysmods::damage stays for heart
  protection and the parity test until the core's leftovers move out of oot::sysmods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A launcher asks the builder for a profile's mods and sources before the
player has set up the game. With the builder's flags before `mod`, as
docs/modding/tools.md writes the line, `--profile` first was taken for a
play, which stopped with exit 120 ("Longshot isn't set up yet") for
installed, resolve, source list, emulators and tags.

- main.rs: --profile/--output/--cache before `mod` run the mod tools
  (mod_line), never a play.
- installed/resolve/build-state: `game` is null while the profile's
  profile.json names no game files.
- installed: while no game folder is built, every built-in mod is listed
  from the build's own table (api::system::table, the native registry)
  with the new state `not-built` ("not built yet"), no load order.
- build-state, the one answer that needs a build, fails with `no_game`.
- Tests: modtool's state tests on a profile not set up, and CLI tests
  (tests/mod_no_game.rs) of each command, flags before and after `mod`.
- docs/modding/tools.md: the null `game`, `not-built`, `no_game`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher kept its own copy of the permissions (names, risk, prompt
words), already behind the schema. `mod permissions` lists them from
the API crate's bindings, made from the schema's [[permission]]s at its
build (not api.toml read again): each row's name, risk, the words the
player is told, system-only, off-PC, pattern and the grants that hold
it, in a versioned document (format 1). It is the stable interface, so
tools never chase the schema's folder. Documented in tools.md, tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
feat(api): the normalized manifest has reads, the other mods' settings a mod reads
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 16s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 32s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 42s
Third-party parts / As their notes say (pull_request) Successful in 35s
PR description / Title and description (pull_request_target) Successful in 53s
CI / What the change needs (pull_request) Successful in 1m15s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5f739998e7
mod installed's manifest is the game's reading of mod.json, so a launcher never parses it itself. It lacked
"reads", which the prompt and the Mods tab name beside settings.read: a launcher could not show which settings a
mod reads. It now sits next to requires and claims; tools.md says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
- check-json leaves tsconfig.json alone: TypeScript's JSON with comments, which tsgo reads (every TS mod and example has one).
- trailing-whitespace leaves a .tsv's trailing tab (an empty last column: menu_places.tsv's "before") and the CRT
  shaders as their authors wrote them.
- end-of-file: prelude.js, longshot-together.d.ts and save-tally's test end in one newline.
- ruff: unused imports gone (shaders.py, test_game_boundary, test_menu_hit, test_settings_decls, test_switch_table),
  test_menu_ini_keys' repeated grass_distance key, test_native_zstd's unused local, pipeline_tour's loop variable
  that shadowed an import, and the one-line compound statements of test_bug_report_defaults and test_crash_record
  split.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(website): the settings page reads the game's rows from the system mods' mod.json, and the menu as it is now
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 29s
PR description / Title and description (pull_request_target) Successful in 55s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / What the change needs (pull_request) Successful in 59s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 42s
Third-party parts / As their notes say (pull_request) Successful in 31s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
57db2f5428
game/menu/rows.c went (the renderer's table hands the menu the game's settings), and the build failed reading it. The
game's rows are now the settings with a place of the system mods' manifests (game/mods/*/mod.json: toggles, sliders,
choices and buttons, their section and after/before anchor). vk_menu.cpp's Row lost its cheat field, so heading is
the 12th field; a module row built at run time (game_rows.cpp's .row(s)) is not read as a designated row. A
coverage mismatch on a tab now names the rows on each side.

The guide's table follows the menu: Area name banner (the Area names mod's row), and the conditions of the rows the
menu shows only sometimes: Microphone level while Test microphone runs, and Compact menu key and Command palette key
not shown for now (their lines kept).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(build): the shader preparation's early driver links the game's Rust
Some checks failed
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 17s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 31s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 53s
PR description / Title and description (pull_request_target) Successful in 1m3s
CI / What the change needs (pull_request) Successful in 1m1s
Third-party parts / As their notes say (pull_request) Successful in 54s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 1m50s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m42s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
e6d788f6dd
A build whose game folder's caches start from nothing (a first build on Linux: build-driver shaders::Early) links
the shader preparation's driver early, beside the compile (build-compile link_prepare). That link left out the game's
Rust (liblongshot_rs.a, linked into the game since #2411), so every Rust function the host calls was one of the
lifted game's stand-ins, 256 zero bytes of data: the driver's first call into it, before its first line of log,
stopped it with SIGSEGV twice, and the build said "The shaders were not prepared now (the game was stopped by signal
11)". The game then prepared them at its first start.

The driver now links the Rust as the game's link has it (rust_link, one function for both links: the carried library
or cargo's build). The stand-ins' log line names the first of them, so a stand-in that is called can be told apart.

Test: build-compile's the_preparation_s_driver_links_the_game_s_rust (the driver's link command carries the library
after the objects and before the system libraries).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The design's commit 2 (#2434 runtime design): a development switch that links the lifted game apart, as game.so
beside the runtime's executable, the build the boundary measurement runs on.

- RX_GAME_MODULE=1 (build-compile's GameLink): the lifted units and the lift's C but a64_fp.c (the game's Rust's exact
  float, which stays in the runtime) go into the module, compiled -fPIC, the C also -fvisibility=hidden
  -DA64_GAME_MODULE; host/nn_libc.c's guest libc hooks go in with them, built against the module's own tables
  (HOS_WRITTEN under A64_GAME_MODULE is an inline mark, not an import of hos_mem.c's). RX_GAME_MODULE=runtime-libc
  leaves the hooks in the runtime: the measurement's control. Windows is refused for now (the exe's import library
  comes later).
- The module is linked -shared with a version script (ls_game_module its one export, local: *), so lld binds the lifted
  code's calls and loads of its own symbols inside it; --gc-sections and hfsort as the one executable. The replace
  sites' thread-local stays general-dynamic there.
- The export list: link.rs reads the module's undefined dynamic symbols that name no version (a small ELF reader:
  .dynsym, its strings, .gnu.version), and the executable is linked with an EXTERN for each and
  --export-dynamic-symbol-list. Then every strong import must be among the executable's exports, or the link fails
  naming the missing ones.
- a64_unimplemented, an import stub's hook, is the runtime's own (host/hos_hostcall.c), as the OS layer's other
  hooks are: a64_rt.c's weak default is left out of a module, which imports it.
- host/game_module.c: with no game linked in and no LONGSHOT_GAME_MODULE, game.so (game.dll) beside the executable,
  so a development game folder (finished_files copies game.so there) and a future export start as they are. The start's
  log names the module loaded.

Tests: build-compile's plan of the three links (which unit goes where, with which flags; Windows refused), the switch's
parse, link_guards' export-list check with the PC's clang and lld (a module's strong, weak and libc imports; an
executable with and without the lists); test_game_module's runtime loads game.so beside it; test_game_module_imports links the module's own C (the lift's
runtime, nn_libc.c, stand-ins of gen/) as game.so is linked and finds each of its imports defined by the runtime's
sources, without a game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The runtime design's decision Q5 (2026-11-25): Longshot's runtime is built at x86-64-v3 alone, so a CPU without v3's
features (AVX2, FMA, BMI2, MOVBE ...) is told "this CPU is older than Longshot needs: x86-64-v3, about 2013 or newer"
when a build starts, before the lift. It was built at x86-64-v2 or x86-64 before. The game module stays -march=native.

- build-compile's toolchain: CPU_TOO_OLD, cpu_has_v3 (the processor's own answer, std's feature detection) and
  check_cpu, which RX_MARCH passes (a developer's build for another PC). cpu_flags refuses the same way, and the
  /proc/cpuinfo fallback that picked v2 or x86-64 is gone.
- build-driver's build checks it first.
- Docs: the requirements (AVX2 required), common issues, the RX_MARCH row.

Tests: check_cpu with and without v3 and with RX_MARCH.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The runtime design's decision Q4 (2026-11-25), in game/DESIGN.md's Deferred: no Authenticode signing yet; SHA256SUMS
stays the one signature and the builder checks the runtime against it at unpack; the certificate is chosen when signing
is built, its key a sealed release secret; the game module and the DLSS plugin, linked locally, stay unsigned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What a script needs to skip the title screen as the native Skip title mod did:
- storage.saves.start() (state.read): the most recent progress.sav the file list opens on, and HOS_START_SLOT
  resolved against the saved slots (newest, a slot with its moves from the newest, or a choice left to the list).
  The native mod's slot.rs and its newest-save search, moved into api::save_start with their tests.
- GameState.loading: the game's own load flag, at the title too, where a save's load from the file list begins
  while mode still says title.
The fake game's setState takes loading (the flag alone, as at the title).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The skip's machine is machine.rs ported line for line to src/machine.ts, and its tests are the native ones one for one
(test/machine.test.ts: its parity). The game reaches it through the public API only:
- the game's button waits: a capture rule at its own sites menu.buttonWait and menu.buttonWaitNoDecideAnim, the
  screen's name at [wait+0xe8]&~3:ptr (47 bytes, ring), read with captures() at the next frame (told.rs);
- input.press for A held 200 ms and the file list's moves; gfx.renderer().menuOpen holds the skip;
- game.state(): mode play or movie is the player running, loading the load after the check's A;
- storage.saves.start(): the newest save and HOS_START_SLOT (slot.rs, now api::save_start).
The rules are set only while the skip watches (the row on at the start, or a slot chosen) and cleared once it ends.

Skip opening is rules.skips of the opening's two events, Opening_Introduction and Opening_LoadingKokiriForest, the
same arm, timeline hold and skip answer the core's opening skip gave at the same three sites (each event starts only
its one timeline, Dm_Kokiri_0030 and Dm_Kokiri_0000). That skip, oot::session's set_skip_opening and its layout go:
the sites answer the mods' skips alone. The mod now asks state.write, so its multiplayer is "all".

Breaking: system/skip-title is a script mod (2.0.0); its settings keep their keys and places.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
With Damage taken and Skip title screen TypeScript, what was left in oot::sysmods was shared core code under a mod's
name. Heart protection, the core's engine callbacks at player.lifeHit and player.lifeWrite, is oot::heart_protection
(its layout layout::heart_protection; Link told by oot::session::is_player, the same fields); with no scale left it
keeps the life through a hit and leaves healing as the game had it. event_running, Sprint and walk's, is
oot::state::event_running over state's own event manager read (its named location, the same field). The unused switch
helpers go; the damage rules' parity test keeps the native scale it is measured against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
- romfs.load(path, { zstd?, dictionary? }): a file whole on a reader thread of Longshot's (lsmod-romfs), its Promise
  settled at a later frame; with zstd, decoded with the game's dictionaries, a frame that names none with the
  dictionary named (bcett.byml.zsdic for a map file). At most 64 MiB, 8 loads of a mod waiting. A mod's layer is read
  and decoded there too (host_sys::romfs::zs_decode_named over host/zs.c's hos_zs_decode_named); the host's index
  through host_sys::romfs::Later, which the stand-in host serves from the bytes it had at the call (its RomFS is the
  test thread's).
- game.flags.placement(id): a placement's Bool64bitKey flag by its 64-bit id, null when the game data has none; where
  each was found kept (64 ids), so a read after the first is one entry.
- player.provideStat("heartContainers", n | null): a mod gives the core a count it cannot read alone. The last given
  wins, the one before comes back when that mod stops; oot::travel's map refresh makes the pieces of heart from it
  (set_heart_containers_taken). The native mod's fn source stays beside it until that mod is ported.
- The fake game: romfs.add and romfs.remove (typed already, never there), game.stats (what the mods gave).
- The reference, the permission table and the guide regenerated; unsafe.md tells load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The eight dungeons' map files are read once, the first time Link is in play, with romfs.load (zstd, bcett.byml.zsdic
for a frame that names no dictionary) on Longshot's reader thread; src/byml.ts, the native BYML reader line for line,
finds each Obj_Heart_Container's placement id; their flags are read with game.flags.placement every 2 s and the count
given with player.provideStat("heartContainers"), which oot::travel's map refresh makes the pieces of heart from (its
native fn source goes). The log line is the native one's. Its parity: test/parity.test.ts, the native tests' cases
and fixture (test/map-file.ts is its map_file), answered as the native code answered them; test/heart-containers.test.ts
runs it on the fake game. The crate sysmod-heart-containers goes from the workspace and longshot-game; DESIGN.md and
system-mods.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(skip-title): a capture name for each of its two sites, so setRules takes its rules
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
PR description / Title and description (pull_request_target) Successful in 49s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 40s
Third-party parts / As their notes say (pull_request) Successful in 31s
CI / What the change needs (pull_request) Successful in 1m40s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
038beefa3c
Its rules named one capture "screen" at both menu.buttonWait and menu.buttonWaitNoDecideAnim, and longshot/hooks
refuses a capture name used twice: in the game the mod did not start ("setRules(): rule 2: the capture screen is
named twice"). Each site has its own now (CAPTURES: screen_a, screen_b), read the first site's then the second's
each frame. Tests: each rule's capture name is its own, and with the row on at the start the mod takes its rules and
runs with no fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(crt): lottes.glsl is as its author wrote it again, so its .spv matches its source
Some checks failed
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 39s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 41s
Third-party parts / As their notes say (pull_request) Successful in 49s
PR description / Title and description (pull_request_target) Successful in 58s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 54s
CI / What the change needs (pull_request) Successful in 1m43s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2265afc32e
The website fix's whitespace pass stripped the shader's trailing spaces, and the
check that each .spv was compiled from its source refused it. pre-commit already
leaves game/mods/crt/effects/ alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod check read every folder as a player's mod, so each built-in mod was refused for its system/ id. A
folder of a checkout's game/mods/ (beside game/crates/api/) is now checked as the game takes its own,
by check_built_in; a player's folder claiming a system/ id anywhere else is still refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(skip-title): its capture names are screenA and screenB, names longshot/hooks takes
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 24s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 47s
CI / Workflow lint (actionlint) (pull_request) Successful in 53s
Third-party parts / As their notes say (pull_request) Successful in 1m6s
PR description / Title and description (pull_request_target) Successful in 1m14s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m25s
CI / What the change needs (pull_request) Successful in 1m46s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 4m23s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m58s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m10s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 7m6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m53s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m38s
CI / Website build and checks (pull_request) Failing after 5m1s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 16m32s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 17m51s
93c7a8e8ae
The names of the commit before, screen_a and screen_b, are no capture names (a lower-case letter then letters and
digits): setRules refused them, as mod test's new test of the row on at the start showed. The test of the names
checks that form too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
## Summary

Restore Windows controller input when the Rust game runs inside the AppContainer. The broker opens the SDL devices and gives the game a dedicated controller connection. The Switch 2 Pro USB driver and its NFC reader are unavailable in the Windows sandbox.

Rebased on Rust Mod API #2434 at `b9ac71657`. This supersedes #2016. The controller connection is restricted to the game process or its same-image relaunch, and the broker carries the virtual-controller flag. The forge target is `mod-api`. [Controller-only diff](b9ac716574...f8b0c6c68c)

## Testing

**Previous hand test at `7448586ca`.** Windows 11, one 8BitDo Ultimate 2 over Bluetooth, AppContainer enabled. On the Rust API baseline there was no gameplay input. With this change, movement and L-menu input worked in Adult Kakariko.

Before the latest changes, both C fixtures compiled and passed on Windows with llvm-mingw Clang via `tests/test_pad_broker_route.py` and `tests/test_pad_broker_state.py`. They cover input routing, session ownership, snapshot bounds, disconnect and reconnect handling, and sensor recovery.

**Still to test:** Windows gameplay on the rebased head, the full project suite and Linux build. Physical reconnect, gyro and rumble remain to be exercised by hand.

The standard Windows builder at this #2434 revision misses the ImGui include flags for `vk_ui2.cpp`. The local play builds use the renderer's existing ImGui flags for that file.

## Measurements

**Verdict:** The same controller regained gameplay input with the sandbox enabled.

| Observation | Before, Rust API at `563ca4e55` | After, earlier hand test at `7448586ca` |
|---|---|---|
| Gameplay input over Bluetooth | No response | Movement and L-menu input worked |

Input latency and frame time have not been measured.

## Risks

This changes the controller broker handshake and snapshot format. Use a broker and game from the same build. Hardware coverage currently includes the reported Bluetooth controller on the previously tested revision.

## Checklist

### Ready for review

- [x] Focused change based on the Rust API revision targeted by this PR.
- [ ] Repeat the Windows in-game test on the rebased head.
- [ ] Full suite passes or baseline failures are documented.
- [ ] Performance measurements recorded.
- [x] Only source, tests and project documentation are included.

### When it applies

- [ ] Game-free controller routing and state checks pass on this head.
- [x] Controller broker documentation updated.
- [x] AI assistance recorded in commit trailers.
- [ ] Linux build confirmed.

### Ready to merge

- [ ] Review and CI complete.

Co-authored-by: snaildev99 <[email protected]>
Co-authored-by: BeanBot <[email protected]>
Reviewed-on: #2516
fix(menu): a tab or page switched to is drawn whole from its first frame
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 31s
Third-party parts / As their notes say (pull_request) Successful in 34s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 40s
PR description / Title and description (pull_request_target) Successful in 44s
CI / What the change needs (pull_request) Successful in 53s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m17s
CI / Website build and checks (pull_request) Failing after 2m22s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 4m46s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m3s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m34s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 42s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 7m17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 14m26s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 17m38s
7ad733f754
Switching tabs (or opening a page, or Back) drew the new page once with
the rows read for the page before: its toggles, choices and sliders had no
state yet and were left out, so for a frame the page showed only its
buttons and lines, a flash on every switch. The rows are read for the
page shown when it is not the one they were read for, before it is drawn.
The rows' change check holds the page too, so another page's rows in the
same states are never taken for these.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Eight 60,000-actor fixtures: read in one Promise continuation each, the BYML scan ran past the callback's 5 ms and faulted (the full check: 5.1 ms, no count on three slots).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The BYML scan compared each dictionary key and each actor's Gyaml as strings; it now looks the keys and the kind up once and compares their table numbers, and scans 512 actors a step, a frame between steps (scanActorIds, after(0)). The files are read one after another, not all at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
f_838cffb0, the whole step physics.stepped was after, is never run in play: an observe-only listener heard nothing in 60 s, and its unit (with f_838d0080's, physics.steppedOther) is cold in the shipped profile. f_838cf8e0, the manager's end of a step, is hot and releases the same world's lock ([x19 + 0xc8 + 8 * w20] + 0x88): the site is now its lock's add, before the release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test: the Skip title and Area name banner rows are their TypeScript system mods'
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 30s
Third-party parts / As their notes say (pull_request) Successful in 33s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 34s
PR description / Title and description (pull_request_target) Successful in 39s
CI / What the change needs (pull_request) Successful in 1m13s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 3m42s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m57s
CI / Website build and checks (pull_request) Failing after 1m13s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m12s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m30s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 37s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 3m56s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 15m40s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 19m58s
20085f36b0
test_dev_ab read the menu's rows from Rust built-in mods' mod.json only and the skip-title mod's lib.rs/hooks.rs, both gone since it became TypeScript: it reads every built-in mod's settings and its skip.ts and machine.ts. test_settings_table: Area name banner is the area-names system mod's setting now, one of GAME_ROWS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The game compiles a mod's screen effects from its .glsl, so the sepia-photo and scanlines examples carry the GLSL
alone; their READMEs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
scripts/shaders.py all compiles every shader of ours with the pinned glslang 16.6.0: the renderer's SPIR-V headers
(fsr3, host, and a new BUILTIN table of the other 40, whose outputs are word-identical to the old checked-in headers)
in place under gpu/vk, gitignored, and the built-in mods' effects into gen/shaders/mods. gen/shaders/STAMP names each
input's SHA-256 and each output. dev.py's builder, run_all, mise run shaders/test/ci/rust, CI (scripts/ci_shaders.sh)
and the release run it; the builder's compile refuses a tree with a missing or stale STAMP, and the pack carries the
outputs, so a player's PC compiles none. The shader tests check that each compiles (twice to the same bytes) instead of
matching a checked-in file; the host headers' notices move to <name>.notice. from-source runs shaders.py for a commit's
archive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Their .glsl.spv are no longer checked in: scripts/shaders.py mods compiles them into gen/shaders/mods, and
schema::system_mods::shipped lays them over each folder, so the table's hash (shipped_hash) covers exactly the
.spv the builder installs (build-driver's system_mod_files). A .glsl with no compiled effect is refused with the
command that makes it. The crt, colour-vision and output-fx parity checks read the compiled effects; the "compiled from
another version" check is now the build's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
build(api): a plain cargo build compiles Longshot's shaders itself, or leaves the uncompiled mods untrusted
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 23s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 52s
CI / Workflow lint (actionlint) (pull_request) Successful in 54s
Third-party parts / As their notes say (pull_request) Successful in 1m0s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m6s
PR description / Title and description (pull_request_target) Successful in 1m21s
CI / What the change needs (pull_request) Successful in 2m21s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
81202e2417
api's build script runs scripts/shaders.py all --pinned (glslang 16.6.0: LONGSHOT_GLSLANG, the development folder's
or the PATH's; nothing written when the STAMP is current), so cargo build and cargo test just work after mise install.
With no pinned glslang, a tools or tests build leaves the system mods whose effects are not compiled out of the table
(schema::system_mods::read_leaving: the game trusts none of that name) and says so in one cargo warning; a game build
(the game profile, or LONGSHOT_REQUIRE_SHADERS=1) still stops. It runs again only when shaders.py, the shaders, the
mods or the STAMP change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
feat(gfx): the game compiles a mod's screen effects at its start, cached
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 47s
CI / Workflow lint (actionlint) (pull_request) Successful in 48s
Third-party parts / As their notes say (pull_request) Successful in 57s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m2s
PR description / Title and description (pull_request_target) Successful in 1m13s
CI / What the change needs (pull_request) Successful in 1m53s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m35s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 3m4s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m37s
CI / Website build and checks (pull_request) Failing after 1m38s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m15s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 8m0s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 44s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 2m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 18m11s
5cb4fa399a
A new crate, effect-compiler (shaderc, glslang inside, linked into the game's Rust), compiles a mod's .glsl when the
mod makes the effect: the host's ShaderCompiler (api), cached by source and compiler in the shader cache folder's
mod-effects/ (longshot-game). The template check runs on the result; a compile error is the mod's ArgumentError with
its file and line, the effect off. A system mod's prebuilt .glsl.spv is used as before. Packages carry no .glsl.spv
(mod pack leaves them out); mod shaders and the fake game use the same compiler. shaderc's, glslang's, SPIRV-Tools'
and SPIRV-Headers' notices go in third_party/shaderc, the About page's credits, the README and the game folder's
licenses/. examples/compile_time times a cold compile.

shaderc is C++, so the builder's Linux game link (build-compile) now links libstdc++ statically
(-Wl,--push-state,-Bstatic -lstdc++ -Wl,--pop-state; a Tracy link already does); llvm-mingw's Windows link already
has -lc++ -lunwind. Linked cost on Linux: +7.8 MB stripped, +9.2 MB as shipped; longshot_vk.so unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
swash 0.2.10 read fonts with skrifa 0.44 while parley 0.13 shapes with skrifa 0.49: two font readers in the game. The
atlas now draws each glyph's outline with skrifa 0.49 (unhinted, at the layout's size and variation coordinates) and
rasterises it with zeno 0.3.3, the rasteriser swash itself used, in the same placement and sub-pixel buckets; faux bold
moves each contour's points out along their corners' bisectors (FreeType's FT_Outline_EmboldenXY, swash's port of it).
skrifa 0.44 stays in the lock only for Slint's crates (the builder's and launcher's UI), not the game.

A colour glyph (COLR layers, a bitmap strike) is drawn as its outline glyph, a coverage mask in the text's colour: no
font the game reads has colour glyphs (Libertinus, the game's menu fonts, the system's CJK, Arabic and Hebrew fonts),
and the RGBA8 pages and the contract's IMAGE glyph path stay for a font that has them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
taffy lays a border out a width a side, but the draw list's quad carried one (the widest) and today's drawer drew one
ImGui radius (the largest corner's) and cut to scissors only. The contract's version 2 (MKW_UI2_VERSION 2, the quad 112
bytes) carries the four widths (left, top, right, bottom): a shape's fill is the rounded rect inset by them, each inner
corner's radius its outer one less the wider of its two sides (draw::inner_radii), as the reference renderer and the
contract's GLSL now say.

vk_ui2.cpp draws the frame as convex polygons with ImGui's anti-aliased fringe: a rounded rect with its own radius at
each corner, a border as the band between its outer and inner edges (a strip with a fringe each side), images as
rounded textured polygons (AddImageRounded's way). A clip's rounded rect cuts what reaches one of its corners by
tessellation: the polygon is cut by Sutherland-Hodgman with its texture coordinates and colours carried along (a
border's band piece by piece, unfringed), so a glyph, an image, a shape or a Canvas's triangles in a rounded window's
corner are rounded too. Shadows stay a few fading rounded rects. The SDF maths stay in reference.rs for the renderer's
own drawer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The full check on b9ac7165 failed in UI2's code:
- clippy (Rust 1.99): chunks_exact with a constant size is as_chunks; the complex types are aliases (canvas::ImageOf,
  style's Blocks, text's Cut); the nested ifs collapse into let chains and a match guard; the resolver's cache holds
  Rc<Computed> (taffy's Style is neither Send nor Sync, and the resolver lives on the UI thread alone); a label's
  arguments are allowed; ui2_metrics' loop counter is a zip.
- core's tests: a Window's (and a Scroll's) children ran across, taffy's default row, so two Pressables in a window
  were 0 px wide side by side: the D-pad found nothing below and a click hit nothing. A Window's and a Scroll's
  flexDirection is column unless their style gives one (Computed::flex_direction_set); a Box keeps taffy's row.
  Hiding the game's HUD took a HUD root out of the roots shown but, nothing being dirty, made no new frame: a root
  shown no more now makes one.
- mod test's game.ui2.snapshot() gave the PNG as base64 where the guide and the tests read bytes: it is a Uint8Array.

The tests could not be run here (tests run only in the queue): the batch job runs game-ui's tests and the
ui-next-demo example's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
l4u2-1's run left two failures. A window whose first control is a List never gave it the focus as it opened: the
want-focus pick took focusable kinds alone while the D-pad's walk counts a List, so the first Down only reached the
list. It is picked as the walk picks it. The test's walk also stopped before the rows asked for could leave 0 (four
to spare each side): it walks 20 rows now.

The UI2 demo's tests walked game.ui2.tree() as nodes, but it is the roots ({ mod, root, surface, closed, node }), so
they found no rows: they walk each root's node. ui-next.md's line for tree() says that shape.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A style a mod gives as a plain object was interned for the run, so one made anew for each value of a number filled
the 4,096 a mod may hold. The reconciler now counts the host nodes that name each such style and, at the end of a
flush, sends ["unstyle", sid] for those none names (styles()'s are kept). The main thread's Shadow refuses an unstyle
while a node names it and frees its place in the cap; the main thread's resolver and the UI thread's drop the style and
the resolutions that named it. measure() measures with a style no batch has sent yet (its definition was passed and
ignored).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
UI2 gets what the old mods' UI has and it lacked (game/DESIGN.md, "Later" steps 1 and 2; contract version 3).

- Text: the input method's composition comes from the host (MkwVkHost.text_compose: SDL's text editing events,
  Windows' WM_IME_COMPOSITION through imm32, loaded when first needed, whose result is typed as code points), its
  windows are placed by the field's caret (text_area), and Ctrl+C and Ctrl+X put a field's selection on the system's
  clipboard (MKW_UI2_OUT_COPY, clipboard_put; the window's thread writes it). Ctrl+A, C and X reach a field.
- The output says the focused control's label (a new input prop) and help: the Insert menu's help box.
- World roots: a World kind mounted on "world" (gfx.world): the main thread places each a frame (its point or its
  actor, actors.read), the UI thread paints it above its point, and the frame's root groups (MkwUi2Root) let the
  renderer put it on its own picture, scale it for metres, fade it, test it against the scene's depth, or draw it in
  the scene into the world layer's atlas (occlude "depth").
- Slots: a Slot kind other mods fill by name (mount { surface: "slot", mod, name }, made a hash by the main thread),
  and ModPage (a Slot with of: that mod's settings page); a filler is laid out in its slot's width, drawn where its
  owner painted the slot, and its controls join the owner's focus.
- The hosted page: the renderer asks for a mod's settings (or debug) root laid into a rect (MkwUi2Input.host_*); the
  Insert menu hosts system/menu's this way once it shows, gives it its input (MKW_UI2_IN_HOSTED), draws its help box
  from the output and its prompt bar, typing prompts while a field is typed into; Back the page does not take and its
  @close controls come back as MKW_UI2_OUT_BACK and CLOSE.
- HUD roots take id, title, anchor and margin; the Mods tab's HUD layout lists UI2's and its places (another region,
  hidden) reach the UI thread.
- Image and Icon take tint; Icon takes item (the game's picture of an item, through the item icons' reader);
  thumbnails (capture:) are UI2 images too.
- Headless, the UI is ticked at the shots' size and drawn into each (menu_record_image).

MkwVkHost version 66 (after 65's engine_text): text_compose, text_area, clipboard_put.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the old mods use that UI2 lacked (plan step 4): a Compare kind (two children over each other, each on its side
of a divider the player drags or moves with Left and Right), a Slider's value shown at its end (its options' text of
the step, or the number and its unit), a fullscreen Window (the whole screen, never dragged), a Scroll's selected
child kept in view, a Scroll's or a List's follow "end" (it was parsed and never acted on: kept at its end until the
player scrolls back from it), and a hosted debug page's open and close events. The runtime and the types have them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
One longshot/ui, the new one (the mod API has not shipped: no alias, no shims). The UI group of game/modapi/ui/runtime.js
is evaluated with UI2's natives alone, so longshot/ui and longshot/ui/jsx-runtime are what longshot/ui/next was, and
longshot/ui/next/kit is longshot/ui/kit; the old group's members (the old channel's commit, onEvents, requestFlush) are
gone. longshot-ui.d.ts is UI2's types (with the Canvas's, the icons' and the world's that it took from the old file).
The switch LONGSHOT_UI2 goes: the UI thread is always made and the renderer always draws UI2. docs/modding/ui.md is the
guide of the new API (the old ui.md and ui-channel.md go; links follow), and the UI2 demo is the UI demo
(docs/modding/examples/ui-demo). The generated docs are regenerated.

Not yet: the mods written for the old API (the menu, the Mods tab, the inspector, area-names, discord and the examples)
are ported in the next commits; until then they do not load. The old channel's code (api::services::ui, vk_modui.cpp,
the runtime's NEXT-false branches) goes after them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A Box lays its children in a row, so the filler's Pressable, with no children and no width, was 0 wide: a hit
with no area is not shown, and the focus skipped it. The filler's root now runs down as a page does (as the
kit's pages do); the slot's measuring was right.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The old channel's game.ui goes with the old path, so a mod's tests need the same reach over UI2:
- game.ui2's tree gives each node what a test finds a control by and reads (focusKey, label, help, title,
  options, selected, disabled, autoFocus, name, of, unit, dock, passInput) and a Slider's or a Choice's number.
- game.ui2 finds nodes (nodes, find, findAll, query, text: a Text's text, a RegExp or a kind and props), hosts a
  mod's settings or debug page as the Insert menu hosts one (host), and acts at once as the player would
  (change: a Slider's, a Choice's, a Tabs', a List's, a TextInput's or a Keybind's value; activate, submit,
  reset), through Core::change and Core::act.
- game.ui2.look says how a node is drawn (its colours, text size and weight, opacity) and color() a colour as the
  theme draws it, so a test checks a look without reading styles.
- The fake Mods tab takes a mod's permissions with their names; perms::risk_name is public for it.
- The kit's Button takes label (its name for the help box) and onReset, its Toggle onReset and gives its label as
  the Pressable's: the menu's rows keep their names and Delete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The menu mod mounts one Box on "settings" (vk_menu hosts system/menu's as its body): a Tabs of the
renderer's tabs (only the shown panel drawn; the Mods tab's a Slot system/mods-tab fills), each page a Scroll
of the kit's Sections and rows. A toggle is the kit's Toggle, a choice, slider and text a Field around its
input (its label the input's name for the help box), a binding a Row of its inputs, a ranged line (the
Microphone level) its text over the kit's Progress, About and the questions Sections of the page. The focus
keys are as before ("@back", "@no", "@yes", "@close:" and each row's key), so Back presses the page's own
control and Tune closes the menu. The tests host the page (game.ui2.host) and read UI2's tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The tab fills system/menu's slot "mods" with the kit's Rows, Sections, Buttons and Toggles; a mod's own page
is a ModPage on its page. The list's first drawing is spread over frames, a part a frame (the lines above,
each 12 mods, the loose cheats, the lines across mods, the safe start's), so no frame's script runs long. A
mod's name is drawn once on its line (its switch draws none), and each permission's names (settings.read's
other mods' settings) are drawn under it on the permissions page and in the prompt. The tests read UI2's tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Canvas goes: the banner is a styled Box (a dark rounded box as wide as the name, 320 to 1200 virtual px)
holding the name in UI2's own text, mounted as the HUD root "banner" at the top centre. Its fade is the
box's opacity in 32 steps, so it interns at most 33 styles. The tests read UI2's tree and layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Their HUD and window are UI2's: named styles for the looks (a colour token, the bold of a low count), the
kit's Row, Column and Badge, a List with its row size, mount()'s surface and HUD place. Their tests read
UI2's trees (game.ui2: text, find, look, activate, submit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Three of l4u3-1's checks failed for the UI2 port itself: test_ui2_renderer still read draw.rs's VERSION as 2
(contract v3 made it 3); test_menu_text_field's cut of rx_backend.c holds the input method's composition buffer
but not hos_text_compose, which fills it, so -Werror called it unused (named once after the cut now); and
vk_modui.cpp's Canvas comment anchored the deleted ui-channel.md (ui.md's Free drawing now).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Insert menu now gives UI2 its banner with the hosted page (MkwUi2Input.bar_rect, MKW_UI2_VERSION 4): the page's
top Tabs (the first Tabs down its Boxes from its root) is laid out with no strip of its own, and its titles, with the
tab keys' caps either side, are painted into a root group of their own (MKW_UI2_ROOT_HOSTED_BAR) that vk_menu draws
in the banner after the page, outside its clip, where the menu's own tabs are; the titles are clicked there.

A mod's UI2 debug page opens in play, the menu closed: its key (mods_debug_keys, for every mod with a page and a key,
the old UI's pages still theirs) toggles it, and the Mods tab's new Open debug page line (modsHost edit "debug",
refused unless the mod mounted one) closes the menu and opens it (renderer setting "@debug:<mod id>"). vk_ui2 hosts
it in the middle of the picture with the input and draws it itself; Back, its "@close" control or its close box
closes it (a hosted page's close box now asks its host to close it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the examples' and the inspector's tests read of the old game.ui, on UI2: windows() and window(title) (Core::windows:
open, focused, the frame), close, move and resize as the player's presses on the close box, the title bar and the
grip, clickOutside at a point no window covers; canvas() (Core::canvas_of: the draw list as the game keeps it, its
colours as color() gives them); image() (the main thread's state of an image: ready with its size and bytes, failed
with the host's why, loading); debugPage(), openDebug() and closeDebug() (the page hosted as the menu hosts it); and
commits and lastBatch, each mod's batches as the UI thread got them (Change::summary).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Its tests read game.ui2: the HUD's and the window's text, the badges' looks, the batches, the window list, its focus,
a click outside and the player's close.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Its tests read game.ui2.worlds() (each World root and where the host placed it, which the fake game now keeps from
the main thread's places) and open and close the debug page as the player. longshot/ui's Window types onOpen (a debug
page's), which the runtime already heard. ui.md's debug page: the Mods tab's Open debug page line, in play.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The reconciler's own tests move to game.ui2: the batches' changes, windows by their titles, the kit's Toggle by its
label and selection, a Slot filled by a mount on it, a List's row pressed, a style out of its range refused by the
host, the Canvas's draw list as the game keeps it, an image that fails, and HUD roots mounted from an effect. The
hiding of a HUD root with the game's HUD is the host's, checked by game-ui's core tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The line shows for a live mod granted ui.settings and for no other. Pressed, it asks modsHost's edit "debug", which
the game's host refuses unless UI2 holds a debug page of that mod (Services::ui2_has_debug): the tab logs the refusal
once and the loader gets no edit. The page opened in play is the renderer's, checked in the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Each frame after a tab switch, a page opened or Back must show either the
page before (the menu not drawn again yet) or the new page with every
row. It fails while the new page's first drawing uses the old page's rows
(only its buttons and lines shown, the flash on a tab switch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
system/mod-inspector 0.6.0 is TSX on longshot/ui (src/main.tsx): a fullscreen Window mounted open with the focus,
unmounted when the player closes it (Esc, B, its close box: onClose hears it), the corner line a HUD root. The layout
is UI2's flex layout over styles() (the panes fill the screen, the table half of it), so the old body metrics and
onLayout of the Window are gone; each graph's Canvas draws at the size it was laid out at (onLayout). The bars are
its own track and fill, in the inspector's tones.

The test moves to game.ui2: windows(), window(), focused(), close, nav back, clickOutside on a fullscreen window,
canvas(), layout(), look() and color(), activate() and change(). The key closing the open window, the body sizes
and the mouse's hover readout are no longer tested: a focused UI2 window takes the mod's action, the fake screen is
1920x1080, and the game sends a Canvas only its presses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The pointer reached no row: a List is not a focusable kind, so its press found no hit and its onPress never heard a
click (link-hud's and ui-cases' tests). The row under the pointer is selected on the press (a change) and pressed on
the release over the list, as Enter presses the selected row. A core test clicks row 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The lint counted every Window as ui.window, so Enemy Names (its debug page a Window on "debug", with ui.settings)
failed every_example_passes_but_the_one_that_breaks_every_rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Minimap's styles named width and height at the top, which UI2 refuses (size: { width, height }); Link HUD's List had
no height, so one row showed and the rest were cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The permission's words on its page are the loader's (the schema's), not what the fake tab was given.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A window is as wide as what it holds and a Slot as wide as its parent; the test's Pressables had no width, so the
filler was laid out 0 wide, its control never shown to the focus, and Down stayed on the owner's control.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game has no Link until a map is entered; with none, the mod mounts no label (as "no Link, no labels"
says), so the test read 0 World roots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
In the game the tab's stateChanged listener ran past its 5 ms of CPU (modsHost.tab 22 ms on the wall clock) and the
tab was stopped: while the menu is open the loader publishes a new snapshot every frame, and the tab read and
converted the whole list on every change. modsHost.tab now keeps its answer and what it was made from (the
snapshot's contents, the builder, safe start, the cheats and the pages' screen effects) and gives it again when they
are the same; the tab reads the list in its frame callback, once for every change heard since.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
In the game system/menu's frame listener ran past its 5 ms of CPU (settingsHost.rows 12.8 ms on the wall clock in one
call for a whole page; 923 API calls in the frame) and the menu was stopped before it showed. read() now reads the
shown page's rows in passes of 16-row calls, about 1 ms of the wall clock a frame, and changes the data once a pass
is done; a tab or page switched to is drawn once its rows are all read (the page before till then), so it is still
never drawn with rows missing. The questions are read every frame. host.texts answers are kept until the
declarations' generation moves on, instead of asked again at every drawing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The rows-in-passes change drew nothing (Loading) until a pass over the first page ended, and a tab switched to only after its pass, frames later: the menu's tests found no Tabs after two frames. Now only the re-reads of the page shown go in passes; the first page and each switch read their rows whole that frame, so each is drawn whole from its first frame. Between passes the drawn view follows the current one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
list_range clamped the last row to count - 1, so a List that grew (link-hud's rupee log: 0, then 1, then 2 changes) kept the range of its old count and rendered only its first rows until a range event came back a frame or more later. The runtime already clamps by its count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
cheats, shadows, sprint-walk, voice-language, widescreen and the site-rules example failed mod test with no tests: each now starts with no fault and reads its settings back as set. Discord's test read golden.json through node:fs, which a mod's import refuses; it imports it as a JSON module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game runs other mods beside the tested one, as the loader does:
game.addMod runs a mod from its folder (its grants, off, load order by
dependency; a required mod switched off keeps its dependent off), and
game.fakeMod a stand-in with no files that the services know as a running
mod (manifest, grants, claims) whose exports and events are the test's
functions, handed to the test runtime by a ScriptHost wrapper during the
together step. game.modStats gives inspect()'s numbers (the fake times
nothing; api's InspectRow gains given numbers over the worked-out ones,
counted in the totals, nativeMs included), the stand-ins' log lines go to
the rings at their frames (LogRings::push_at), game.controls lists what
mods.control asked, and a system/... mod under test runs as a system mod
(game.system). Tests of the fake itself; mod-inspector joins the system
mods' test list; lib-and-dependent's tests run, its stopped-library line
matching the engine's real message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Mods tab's list (a settings page the Insert menu hosts) stopped Down for good on its "Mods tab" row (lead4-win,
the windowed batch: shots of RX_VK_MENU_SCRIPT's Downs). vk_modui.cpp's draw_node drew, and so recorded for the
input, only the nodes some of which was inside their clip, so a row wholly below the page's view was no control
nav_focus could move to; and the page scrolls only to keep the focused control in view, so it never came into it.

The rule is modui::drawn now (modui_layout.h), as it was. tests/test_modui_scroll.cpp lays out a page of 20 rows on a
view 300 high and asks that Down from the last row that shows reach the row after it, past the view, and that the page
then scroll it into view. It fails here: that row is not drawn, so Down has nowhere to go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
modui::drawn draws a focused settings page's nodes wholly past its view too (reach: d.page && d.collect), clipped out
of the picture and found by no click, so they are controls nav_focus can move to; the page then scrolls the one
reached into view, as it already did for the focused control. A window's nodes past their clip stay undrawn, and a
List's rows are its own (it walks them past its view itself). The Mods tab's list, which stopped Down on its "Mods tab"
row, is walked to its last mod.

Test: tests/test_modui_scroll.py passes (Down from the last row that shows reaches the row past the view).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer takes single key presses from the host's queue (MkwVkHost.take_key_press,
host/rx_backend.c). Only Windows' window procedure notes presses into it, and on Linux the
queue is compiled out and take_key_press is NULL. The check cuts the queue out of
rx_backend.c, the keys' part and the key-down case out of host/posix/display_sdl.c, and feeds
the case SDL key events: each press is taken once, SDL's repeats are no new press, Shift is
VK_SHIFT and Alt+Enter is no Enter, as on Windows. It fails on main: take_key_press is NULL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer takes single key presses from the host (MkwVkHost.take_key_press,
host/rx_backend.c). Only Windows' window procedure noted presses (host/display.c WM_KEYDOWN),
and on Linux the queue was compiled out (#ifdef _WIN32), so take_key_press was NULL: the menu
fell back to polling the keyboard's state each frame, and a key tapped between two of its
frames was lost; anything that asks the host for one press of a key got none on Linux.

The queue is now built on every platform. host/posix/display_sdl.c notes each SDL key-down
that is not a repeat, by the same scancode to virtual-key mapping the keyboard's state uses
(now one function, scancode_vk, for both): Shift and Ctrl as VK_SHIFT and VK_CONTROL, and
nothing pressed with Alt, as Windows sends those as WM_SYSKEYDOWN (Alt+Enter is fullscreen,
not Enter). The menu reads its keys from the queue alone once the host has one (its
polling is the fallback for a host without), so a press is never counted twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A test could press the controller's buttons over the control bridge but had no keyboard,
so nothing in a run could check what only keys reach: the Insert menu's key presses
(MkwVkHost.take_key_press), a binding's capture. The key command (scancode, or scancodes,
a list of up to 16 in order) puts each key's down and up on SDL's event queue
(hos_sdl_push_key, SDL_PushEvent from the bridge's thread), so it goes through the window's
own loop as a real key would. Linux only, with a window: Windows and headless runs answer
unavailable. tests/control_test.c checks the command with a fake window; the reference page
says how a test uses it (a display of its own, never the desktop).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
dev.py packs keeps the shader caches a base prepared or warmed in the development folder's stores/shaders/<translator
stamp>/<driver and GPU key>/, outside every game folder. A base built without --seed, and a runtime that lacks a cache
file, start from copy-on-write clones of it, so a new base of the same translator prepares only what changed. The store
is written only through a temporary file made read-only and moved into place; no run writes into it. A wrong cache costs
time only: the game checks every file's stamp and prepares again. LONGSHOT_SHADER_STORE_DEV=0 turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
dev.py's compile of longshot-builder shared one cargo target folder across every checkout. Cargo keys a path crate by
its place in its workspace, so two checkouts mapped onto the same units, and one checkout's build could be called fresh
while the other's edits went unseen. Each checkout now has its own folder under the development folder's cargo/. What
checkouts share is the compiler cache: when sccache is installed, that compile and the game's Rust in a build's work
folder run with it (RUSTC_WRAPPER, SCCACHE_DIR in the development folder, CARGO_INCREMENTAL=0).
LONGSHOT_SCCACHE=0 turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
`dev.py packs head --game G [--tree T] [--into DIR]` builds a checkout's clean commit once into the development folder's
heads/<commit>-<os>/, under that folder's lock. A second job for the same commit waits and then takes that build. head.json
is written only once the build is whole. --into gives one run copy-on-write clones of the build's game/ and work/, leaving
out work/rust-target, where cargo would judge the game's Rust fresh against another tree's files. Every game-run job of a
pushed head then starts from one build instead of building its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
dev.py game-tests waited for the game to quit or for its timeout, half an hour. It now reads the run's log as it grows.
A mod under test that did not start, a FATAL line or an unhandled exception stops the run at once, which then fails with
exit 2 since its reports are not whole. Once the test mode's last line has come, the game has 20 s to quit by itself
before it is stopped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The bridge's supervisor now starts a windowed game inside a shared job of the PC's queue under `gamescope --backend
headless`. That run shows on no desktop and takes no focus, so 2 or 3 non-timing runs go side by side in the queue's
shared slots. It is decided inside the job, from LONGSHOT_JOB_MODE. Timing, timing-cpu and profile runs never get it,
even when asked. LONGSHOT_GAMESCOPE=0 turns it off and =1 asks for it outside a shared job; LONGSHOT_GAMESCOPE_SIZE sets the
size. The run's manifest says display=gamescope-headless.

Fail fast: the wait for readiness now reads the run's log, and a FATAL line or an unhandled exception ends it at once with
the line, instead of after its timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Each scenario was its own game start. A scenario is now a JSON file: its repository save, an optional teleport and age,
bridge requests as steps, log expects and a screenshot. scripts/scenarios.py runs them in order, one game session per
save. A teleport does not play what a walk would, so a check that reads scene state starts from a save at that spot. Fail
fast: a scenario ends at its first failed step or expect. A fault in the log, a mod that did not start or the game's end
stops the session, and the scenarios left are reported as not run. Results go in results.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
gamescope_plan replaces gamescope_prefix and decides by what is launched: a native
executable named longshot (a built game folder's), never a fake game or a test
harness's process, whatever its environment. Without gamescope the run plays windowed
with one log line saying so; when gamescope exits or shows no present within
LONGSHOT_GAMESCOPE_TIMEOUT (60 s) the supervisor stops it and starts the game again
windowed, with one line. LONGSHOT_GAMESCOPE=0 stays the off switch; developing.md says
the rule. test_longshot_ctl no longer needs LONGSHOT_GAMESCOPE=0, and tests that a fake
game is never wrapped, a real one is in a shared job, and both fallbacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
On a window whose Scroll holds more rows than it shows, Down from the last row shown must reach the next and scroll it
in. It fails now: the walk skips every control scrolled wholly out of its view (nav_focus's shown), so Down stops at the
view's end and a long page is never walked to its end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The walk took only the controls that show, as the old renderer's did, so a control scrolled out of its Scroll's view
was never reached by the keys or the D-pad. A control in a Scroll counts as reachable now: the focus moving to it
scrolls it into view (reveal). A List's rows stay the List's own walk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game-ui posted only "down" to a Canvas with onPointer; the docs and types promise "move", "up" and "leave" too.
The inspector's hover readout over a graph needs them. Each input step now tells the Canvas under the pointer its move
(when the pointer moved or came onto it), "up" when the left button is let go over it, and "leave" when the pointer
goes off it (onto another control or window, or out of the picture).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A focused window takes the player's input, so a mod's action key (the inspector's F8) could open its window but not
close it. A Window now takes closeOn, one of its mod's keybind settings (the host refuses any other). While the input
is taken, a press of that action's key or chord goes to the UI thread as Msg::CloseOn, which closes the mod's focused
Window whose closeOn names it; the action itself does not fire. Esc, B and the close box still close it. The mod
inspector closes on its own "open" action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake took the input only by game.uiCaptures, so a mod test saw its actions fire through a focused UI2 window that
the game would have kept them from. The fake's UI2 now says its focus to the fake host after each tick (passInput
leaves the input to the game, as in the game).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test-deps fetches the pinned Vulkan and SPIR-V headers into the checkout's _deps/, but run_all looked for them
only through LONGSHOT_*_HEADERS or a CPM cache (RX_CPM, tools/cpm), so in a checkout without mise run tools
every check that needs them failed at once with "not found: vulkan_headers (--strict)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
settingsHost.rows called the renderer once a row, each taking menu_mu; renderer_setting_states reads them all at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The new test is link-hud's rupee log in core: a row, a new one before it, then none. It panics in taffy ("invalid SlotMap key used") until the List's taffy node is replaced when it loses a row. The scrolling page's rows were inserted before node i (the Window for i = 1), which the shadow refuses: each is appended now, so the test reaches Down.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
taffy keeps the out-of-flow boxes a node lays out (a List's rows are absolute) in a hoisted list of the node's own, which only that node's layout pass rewrites. A List left with no rows is laid out as a leaf, which skips that pass, so the list kept the removed rows and round_layout read them: "invalid SlotMap key used" (taffy_tree.rs:566), as link-hud's log grew and changed. A node that loses a child now gets a fresh taffy node with its style and measure; its parent loses the old one in turn, so the path to the root is fresh, the subtrees below keep their caches, and the old nodes are removed once the tree is built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A filler is laid out in its slot's width, but taffy sizes a flex root with no width of its own to its content (only a block root stretches). A Pressable with no content of its own came out 0 wide, so its hit showed nothing and nav_focus skipped it: Down stayed on the window's control. A root laid out in a definite width now fills it when its style gives it no width (a filler, the hosted page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Only the run under gamescope gets SDL on X11 and no desktop Wayland socket (gamescope_env); the bridge sets them, so a caller sets neither, and the restart windowed no longer keeps them (SDL_Init: x11 not available). developing.md says gamescope headless does not present with NVIDIA's Linux driver, so runs there fall back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The system-mods test stopped at the first failing mod (menu), hiding the rest. The test realm is QuickJS-ng's in both games, which has no structuredClone: a JSON copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
listening programs, unset variables and the platform ("unavailable"), nobody listening ("failed"), attempts and connections, as docs/modding/ipc.md and longshot-testing.d.ts say; net.rs hands each IPC open no game.discord() took to fake.js. A test of the fake covers both ways, the close and each refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
tests/vk_host_members.py reads MkwVkRenderer's members (renderer_members) and the names vk_replay.cpp's mkwvk_init sets
(renderer_table), for checks that pin a version's renderer members as they pin MkwVkHost's.
tests/test_renderer_setting_states.py checks version 67's member right after version 57's eight, set and guarded,
menu_decl_states under one hold of menu_mu through decl_state_locked, rx_setting_states and its declarations.
test_menu_decl_state_hint.py cuts the hint from decl_state_locked, where the row read now is.
settings-declarations.md lists the ninth member.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The menu read the shown page's rows pass after pass at every frame, and drew the page again whenever a pass's
JSON.stringify of all its rows differed. Its translations cost most: tr() asked longshot/i18n for the menu's language and
the text at every call, a call each to the game (which asks the renderer the language), several a row: the ~970 API
calls of the frame that read decls in l4cp's run. decls itself is read once a generation (the generation moves only when
the declarations are built or the language changes); its 2.2-2.6 ms is the one JSON text's parse at the menu's start,
which the faults then repeated (each restart reads it anew).

Now the declarations are read once a generation in a frame of their own, and the page's rows and the questions in one
rows call, only when due: a change the menu made settled, the menu opened or the generation moved on (settingsHost.changed),
or REREAD_S (0.25 s of game time) passed. A read that finds a row as it was keeps its object, so the data, the render and
the UI ops stay as they were; a changed row is a new object alone and only its memo'd line is drawn again. tr.ts reads the
language once a read (trRefresh) and keeps each text translated. A tab or page switched to keeps the page before whole for
a frame, then is drawn whole, its rows read in one call.

Tests (game-free, the fake game): an idle open menu makes no read and no UI batch, a re-read finding the rows as they
were draws nothing; a value the renderer changed is one batch on its row alone; a tab switched to shows one page whole
each frame, the new one by the second. The tests that change a row on the renderer's side wait a re-read (reread).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The tab set the snapshot host.tab() gave at every change heard, a new object each time, and every line took the whole
tab as cx: each read drew every line again (5.6-5.8 ms in longshot/ui flush in l4cp's run, 1.1 ms of it 25 i18n.t calls,
each asking the renderer the menu's language).

Now the read is shared with the tab before (view.ts share: what did not change keeps its objects), so a read that changed
nothing sets no state; ModLine is memo'd on its own props (its row, help, grab, focus, writable, language), its handlers
reading the tab's state as last drawn (cur), so a mod's change draws its line alone. tr.ts keeps each word looked up,
the language read once a drawing (langNow).

Test (the fake game): an idle tab makes no UI batch, the same tab read again none, a mod's row changed one batch on its
line alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The idle menu re-reads its rows every REREAD_S (0.25 s), which made the microphone's meter step four times a second.
A declaration now says a row is live: MKWVK_SETTING_LIVE (256; menu::Setting::live, set on audio.cpp's
microphone_level), host-sys flag::LIVE, settings-host's flags.live (schema; generated docs' hashes). Between the reads
of them all, the menu reads the shown page's live rows alone every frame, in that frame's one rows call (pageRead keeps
the page's keys and its live ones per declarations and page), and only their lines are drawn again.

Test (the fake game): the meter's row changing on three frames running is read alone each frame (one row read), drawn
each frame in one UI batch on its line alone, while the page's other row is not read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What Discord's test asks of the fake game, as longshot-testing.d.ts declares it:
- game.switches (mods.json's entries) and game.optionsFile (longshot_options.ini's lines) taken at the start, a
  system mod's legacySwitch line carried once as its entry when it is not its default, as the loader's put_systems;
- a mod switched off is not started; the mods that need it are not loaded (notLoaded "dependency-disabled: <id>"),
  one that names it optional loads; turnOn() starts it afresh, turnOff() stops it, each writing its entry;
- game.ipc.pid, what longshot/ipc's pid gives: 4242 in the fake game, settable (Services::set_fake_ipc_pid).
A game-free test of each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
vk_ui2.cpp no longer includes vk_modui.h: the pointer read once a present for both UIs, and whether an old-UI window
has the focus (MKW_UI2_IN_OLD_FOCUS), live in gpu/vk/ui_input.{h,cpp}. vk_modui.cpp's modui_tick notes its read there
and hands its focus check (now static) to ui_input_begin, so the old UI can be deleted without touching UI2. Same
behaviour; gpu/vk/*.cpp is globbed by the builder, so no list changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
menu_fallback.rs builds its page as UI2 ops (the kit's Section, Button and Field looks) and commits it through
Services::engine_ui2_commit, an engine tree's batch with the settings grant alone; its events come back through
engine_ui2_take_events (kept at UI2's frame start: an engine tree has no onEvents). game_ui::core::Host gains a
fallback, a tree hosted first while it has a root of the surface: longshot-game's ui2 sets engine:menu-fallback
for the menu's body, so the renderer hosts it on the new path as it hosts system/menu. Tests: the core hosts the
fallback first and the mod's again once it is taken down; the page's batches are ones the Shadow keeps; the real
services send it to the UI thread and hear its Quit press.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
vk_menu.cpp no longer calls the old modui settings page or debug pages: the menu's body is UI2's hosted page (the
fallback included, hosted by the game side), and a mod's debug key toggles UI2's debug page. Gone: hosted_mod,
menu_host_tick, the menu's TextInput and Keybind glue for the old page (mods_settings_*, host_listening).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
vk_modui.cpp/.h, modui_layout.cpp/.h and modui_icons.cpp/.h go: their last callers (vk_menu.cpp's tick, text
ownership, mouse release and drawing, vk_replay.cpp's held-back game input) now ask UI2 alone (ui2_tick, ui2_shown,
ui2_owns_text, ui2_window_focused, ui2_captures_input). The Keybind names a mod's keys use (the old key_name) move
into vk_menu.cpp as keybind_name; menu_mod_keys and menu_mods_debug_closed, called only by the old UI, go.

The old-focus path goes too: ui_input.cpp/.h (the shared pointer read and the old window's focus), the
MKW_UI2_IN_OLD_FOCUS bit and game-ui's flag::OLD_FOCUS; ui2_tick reads the pointer itself. Only vk_ui2.cpp
publishes the World roots' occlusion and scene labels now. vk_ui.h loses flourish and button, drawn only by the old UI.

thumb_ask (vk_replay.cpp) stays, uncalled: longshot/capture's thumbnails were asked for through the old UI's
snapshot, and UI2 has no capture path yet.

Tests: test_modui_scroll and test_modui_row go (their rules live in game-ui's tests); test_fps_overlay_order,
test_ui2_renderer, test_world_depth and test_gfx_world no longer check the old UI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer no longer reads the old snapshot, so its members go: MkwVkHost's ui_snapshot and ui_post (removed,
nothing reordered; MKWVK_API_VERSION 68), game.h's game_ui_snapshot and game_ui_post, rx_backend.c's entries and the
block's static_asserts, and gpu/vk/modui_snapshot.h. MkwVkUiImage, which the world layer's billboards still use, moves
into mod_world.h. The window's MKWVK_UI_RECT_MSG (WM_APP + 13) had no sender left: host/display.c and display_sdl.c
no longer take it, and display_pointer_test drops its cases. The renderer's thumbnail read-back for longshot/capture
(vk_replay.cpp thumb_ask) goes with that module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
api::services::ui goes: UI2 (api::services::ui2) is the only UI. Its image decoding moves to
api::services::images (with Image and image_state, which UI2 uses), and ENGINE_PREFIX, is_engine and FIRST_FLUSH_NS
to ui2.rs. inspect()'s ui numbers are UI2's (its live nodes and the ops it kept); the HUD page lists UI2's roots
alone. Hosts loses UiSink and CapturedPixels, longshot-game its block writer (ui.rs), and the fake game its
FakeRenderer, its batch mirror and fake.js's old Ui (game.ui and its uiPlaced, uiImages, uiPost and uiCaptures ops;
setDebugKey has no UI2 equivalent and goes). gameReads takes the input as UI2's focus leaves it.

longshot/capture is dropped whole (it can come back as a feature of its own): its module, schema and types, the
capture service and its tests, the capture: image source, has() of it, and its docs. runtime.js loses the old
channel's branches (native.next is gone with them), its old ButtonPrompt, SettingRow, List and Slot, and the slot
op; longshot-testing.d.ts its FakeUi and old node types. Schema outputs regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
architecture.md's "Mod UI in the renderer" rules are rewritten for UI2 (the frame from ui2_present, the focus and
the input, the World roots' depth test through vk_ui2.cpp's occlusion_tick, the images decoded by
api::services::images); game/DESIGN.md says the old channel, its ABI and longshot/capture are gone. test_world_depth
checks vk_ui2.cpp's publishing in place of the old stand-in's absence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Six empty Pressables in a 130 px Scroll were flex-shrunk to fit it (an empty control has no
min-content height), so the fourth row was in view and the test failed at its first
assert. The rows now say flexShrink 0, as a real row's text does, so Down has to scroll.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Since the declarations are read in a frame of their own and the rows the frame after, the
first page is drawn on the third frame after the menu opens; started() waited two, so every
test that looked at once saw Loading (no Tabs, no @adv, vsync, quit or @close:sharpness, no
Quitter). It now waits up to two frames more while the page says Loading.

The row-only and meter tests took a ["style", id, ...] op's id for a node's: the kit's
Progress defines its fill's width as a new style each level, which is not an op on any node.
Style ops are left out of the check.

The two-rows test set Sharpness to 2, its hi, whose text a slider asks on its first draw and
the menu keeps: the second change asked one value, not two. The sliders now run 0 to 4 and
the values set are ones not drawn before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
runtime.js's Canvas measure() (modapi/ui/runtime.js:2134) turned a regular weight into
fontWeight "regular", which longshot/ui's measure() refuses (100 to 900, normal or bold),
so the mod inspector's FrameGraph threw in its flush on the next channel. It is "normal".
The mod inspector's mod test (its frame graph) covers it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
read() asked longshot/i18n's lang() on every due read (main.tsx's trRefresh before the
declarations' check), a call into the renderer's menu each 0.25 s while the menu is open,
and in the fake game a text read that the two-rows test counted as a row drawn again. The
renderer moves the declarations' generation on when the menu's language changes, so the
language is read with the declarations, once a generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot/i18n's lang() and every t() asked the renderer the menu's language (menu_lang:
renderer_settings::text under the menu's lock); the Mods tab's drawing makes many lookups,
and i18n.lang took 4.4 ms in one of its frames. Services keeps the language read with the
frame's number (I18n::lang, Services::lang_now) and reads it again the next frame. Tested:
the_menus_language_is_asked_of_the_renderer_once_a_frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
modsHost.tab read each mod page's @fx row with its own renderer_settings::state, one hold
of the renderer's menu lock a mod, on every call (the memo's check included): the first
build at boot took 13.4 ms in one call and faulted system/mods-tab. effects_all reads them
all with renderer_settings::states, one call. Tested:
every_pages_effects_are_read_together_each_by_its_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
row_table (gpu/vk/vk_menu.cpp:509) left out every module row of kind Line ("a line or
custom row, which the Insert menu doesn't draw yet"), so the microphone_level meter never
reached the declarations, and the menu mod's LINE (its text over a Progress, read every
frame with flags.live) had nothing to draw. A line is now kept (no value, no slot in the
ini); only a custom row is left out. tests/test_menu_rows_model.py checks a module's line
is kept and not logged; menu_rows.json gains the line, as test_settings_decls.py --write
makes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The stand-in, inspector and fake-IPC tests' mods listened to update without
the permission game.toml gives it, so their starts threw PermissionError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game.time was the runner's wall clock in the fake game, so a test's frames(n, { dt })
moved it by milliseconds: Discord's rate and keep-alive were measured in them.
It is now the world's seconds, each frame's dt added (world.rs, hooks.rs "time").
read.mapName looked up the map's whole name (SunkenPeak_Adult) in Location.msbt;
the game takes its tails off first (longshot-game::reader::place_stem), so the
fake reader does too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The handshake goes at the first frame and Ready arrives at the second, so after
one frame nothing was connected yet and every later timing was a frame late.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The menu took a queued press only while its window had the desktop's focus
(vk_menu.cpp: mine && queued), and a windowed test run (gamescope's fallback)
is seldom focused, so every key the bridge pushed was dropped. hos_sdl_push_key
now marks its events (SDL3's keyboard id, SDL2's padding byte), read_event reads
the mark back as HosSdlEvent.bridge, display_sdl notes such a key as the
bridge's (hos_vk_note_bridge_key_press), take_key_press gives
MKW_VK_KEY_PRESS_BRIDGE for it, and the menu counts that one whatever has the
focus (mkw_vk_key_press_counts). A real press while unfocused is still dropped.

Tests: test_key_press_queue (the mark through hos_sdl.c's push and poll on SDL3
and SDL2; a bridge press unfocused taken and counted, a real one not) and
test_menu_keys (the menu's key poll toggles on a bridge press unfocused).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
UI2 drew boxes but no text and no images in the game. The UI thread told a frame's texture changes once: the next
present marked the held frame `same` and cleared its fresh pages, dirty rects, fresh images and drops. ui2_tick
(gpu/vk/vk_ui2.cpp) presents every frame but ui2_draw takes the textures only when the menu records (headless: only in
the shots), so a glyph page or image made in a frame no draw took was never created.

Now the renderer says which frame it took: MkwUi2Input.taken with MKW_UI2_IN_TAKEN (MKW_UI2_VERSION 5, the input 144
bytes). UiThread::present (game/crates/ui/src/thread.rs, hand_over) keeps a held frame's changes until `taken` names
it, and a newer frame that replaces an untaken one carries them forward (merge; a page dirtied in both is sent whole
from the newer frame's copy, PageInfo.whole). A new frame's serial is always above the last one's, so `taken` names one
frame. Any order of presents and draws now loses nothing and hands nothing over twice. The renderer still takes the
textures only in ui2_draw, inside the ImGui frame (after ui::begin), so the earlier ui2_tick change (qssuyvno, taking
them outside the frame) is not needed and was abandoned.

Threads, read from the code: menu_tick (ui2_tick, game_ui2_present) and menu_record / menu_record_image (ui2_draw,
take_textures, user_texture_kept, RegisterUserTexture) run on the presenting thread: headless both in do_present
(gpu/vk/vk_replay.cpp:5644 and 5674), windowed both in present_image_with_trial (vk_replay.cpp:6484 and 6716).

Test: thread.rs texture_changes_are_kept_until_taken (several presents with no take, then a take: every page and
image made since handed over, none lost, none twice) and two_untaken_dirty_rects_send_the_page_whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
With HOS_START_SLOT set and moves to make, the machine gave up whenever the file list opened within TAKEN_MS of a press: but the title's own A is what opens the list, a few hundred ms later, so every such run stopped on the list (the full check's startslot and startslot_up). These tests open the list 200 ms after the title's A, as the game does, and a check that opens before the moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The list opening just after the title's A is the title's press, not one the list took: the cursor is moved and the slot's A pressed. A list that did take an A shows as its check opening before the moves are made: then the presses end there, the check left for the player.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The full check's startslot runs showed the held A (200 ms) leaking into the file list it opened: the list took it on the newest save and its check opened before any move. With HOS_START_SLOT set, the title's A (repeated while the title waits, as before) is now pressed for exactly one game frame (TAP_FRAMES) through an input.pad.intercept filter that sets A in one frame and lets go at the next, so the game samples it once at any frame rate and it is released before the list's first frame. The list's moves and A are as they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Mods tab's Open debug page row ($debugKey) is a key the player binds; vk_menu's mods_debug_keys presses it into
ui2_debug_toggle. The old fake had setDebugKey on the old UI; this is its equivalent on UI2's hosted debug page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Grants are kept by name (profile.json, trust.json), so a permission's bit is only in-process: the others' numbers
move up, and nothing stored changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
import { stopping } from "longshot"; stopping.on(fn), with the same Stopping payload. The schema allows an event in
the module longshot (named alone, as its functions are: feature "stopping"); lifecycle.toml, its module and
lifecycle.md go, its text now scripting.md's "When the player turns your mod off". No mod imported the old module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game's ContentPatch flags type gets its saved field. gfx.textures and exefs get no script example: a texture
pack holds no script, and the fake game has neither textures nor exefs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The types had them and the fake did not: sound-cues' new test failed in l4trim-1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A pack's textures/ (PNG, KTX2) decoded as the game decodes them, an exefs/ .ips or .pchtxt parsed as the build parses
it (a pchtxt with no @nsobid, or writing nothing, refused). A texture's name being the game's, and a patch's build id
and the hook sites it must leave alone, need the game's files: a game run or a build checks those.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A relative import ending in .ts or .tsx names that source file: import { x }
from "./util.ts". The game's loader, mod check's link and the declarations
reader share one resolver (script::modules::find_module). The older forms
still load: ./x.js is x.js, else x.ts, else x.tsx (.mjs: .mts), and an
extensionless ./x is the first of x.ts, .tsx, .js, .mjs the mod has; mod check
warns (import.extension) about an older form that loads a TypeScript file,
naming its .ts form.

The template's tsconfig and every built-in mod's and example's get
allowImportingTsExtensions (with noEmit), and their imports use the .ts form.
The guide (getting-started, scripting, testing, workers) says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
turnOff() stopped the mod with no stopping, so a mod's goodbye went untested. As the loader does, the fake now
fires longshot's stopping first: { reason: "dependency", mod } to each running mod beside it that needs it (which
then stops too), and { reason: "disabled", mod } to the mod itself. stop() still fires none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
settings.changed told a mod of its own settings and, as "<mod>:<id>", of the
other mods' settings its mod.json's reads lists, so a listener had to tell
them apart. Now changed is the mod's own settings alone, and a read setting
has an event of its own, settings.readChanged { mod, id, value } (order 13,
with settings.read; the later acquire events move up one). Damage taken
listens to the Cheats mod's Debug tools with it.

changed.on() takes, first, the ids it is told of: changed.on("text_speed", fn)
or changed.on(["text_speed", "text_size"], fn); changed.on(fn) stays. An id
the mod does not declare is UnknownNameError when it subscribes (said at once,
in the game and mod test alike, where a lint would miss computed ids). The
schema marks such an event filter_ids (its ids' TypeScript type, SettingId),
which the d.ts types as IdFilteredEvent; a record field may now be a value.
The built-in mods and the settings guide use the filter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The old mods' UI is gone, so its names are free: every UI2 file, symbol, C macro, type, member, test, doc and TS
name drops the 2 (vk_ui2.cpp/.h to vk_ui.cpp/.h, ui2_draw.h to ui_draw.h, MKW_UI2_* to MKW_UI_*, MkwUi2* to
MkwUi*, game_ui2_* to game_ui_*, services::ui2 to services::ui, game.ui2 to game.ui, ui2-draw-list.md to
ui-draw-list.md, the thread lsmod-ui). Two names clashed and are renamed: the old theme header vk_ui.h is now
vk_ui_theme.h (what it is), freeing vk_ui.h; the fake game's tree node Ui2Node is UiTreeNode, beside
longshot/ui's UiNode. No member moves and no version changes. NVN's *_UI2F formats are NVN's names, kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The rename from ui2 left the offset at 4, so game.ui.tick reached the fake as "ick".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A script mod needs an "api" field now; the test's two manifests had none, so
parsing failed before the test began. They name 0.3, as the sibling tests do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The schema the api crate builds changed on this line; the website's copy had
not followed (the_website_serves_this_schema).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
menu_decl_state now takes the lock and hands a row to decl_state_locked (which
menu_decl_states shares), so its own body no longer holds the row's lines.
Five checks looked for them there and failed: they read decl_state_locked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
host/display.c's wndproc lost the script mods' window clicks and gained UI's
input method and copy; the screensaver fixture stubs the new calls and drops
the old ones (unused stubs failed -Werror). vk_menu.cpp's host_listening went
with the hosted page, so the menu-keys fixture no longer declares it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
ui_draw.h and draw.rs moved MKW_UI_VERSION to 5; the check still named 4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Headless (RX_VK_SHOT_MENU) the menu is drawn only into a shot, and the hosted page was asked for by that draw
alone (ui_host in draw_options): its first shots after Insert said "The menu is starting." however long after
the key they were taken (2.5 s and 8.5 s in the l4fj batch). The check wants ui_tick to ask for system/menu's
page itself, at the rects the draw lays it in. It fails here: ui_tick has no menu_host_ask.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The page (system/menu's) was asked of UI by draw_options and menu_host_draw alone, and the ask is dropped
each time the menu closes. Headless (RX_VK_SHOT_MENU) the menu is ticked every present but drawn only into a
shot, so after Insert nothing asked for the page until the first shot's draw, and that shot (and the next,
one present later, before the UI thread's hosted frame came back) said "The menu is starting." however long
after the key it was taken: 2.5 s and 8.5 s in the l4fj batch. Not the UI rename, nor the declarations read in
a frame of their own: the menu mod's Loading page was mounted all along, just never asked for.

ui_tick now asks for it itself while the menu is open and nothing asked yet (menu_host_ask), at the rects the
draw lays it in (host_rects, worked out from the target's size, unit and margin, no draw list): the page is
laid out from the menu's first tick, and the draw's own ask (draw_options', which asked a taller body
than menu_host_draw before) is the same rects, so it is not laid out again. In a window the menu is drawn
every present, so there this changes at most a frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
the_real_services_show_it_on_ui_while_the_menu_mod_does_not_run_and_hear_its_presses failed with "Quit asks
first": the press did reach the fallback (frame took the event and set asking), but the test ran with the
menu closed (the fake host's renderer option 1 unset, so 0), and frame builds no page again while the menu
is closed once one was shown, as its doc says. A player can only press while the menu is open, so the code is
right and the test was not: it now sets the option (MENU_OPEN, 1) on its thread's fake host first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A shot from a game in a window is the game's own picture, without the Insert menu, a debug page or a mod's
window, so a driver that sends keys (keys2's Insert, E/Q, K, F8) could not tell from its shots what they did.
status now has "overlays", read from what the renderer already knows at its last present: menu_open, hosted
(the mod whose page UI hosts and shows: system/menu in the menu, a mod's debug page in play), focus (the
focused control's label, which moves as a tab or page is switched to; the tab itself is the menu mod's
own and the renderer does not hold it) and ui_focus (a UI window such as the inspector, or the hosted page, has
the focus).

MkwVkRenderer.control_state (version 69, guarded like the rest): vk_menu.cpp writes the JSON object from
open_now and a snapshot ui_tick keeps under its own lock (ui_control_state); rx_backend.c's
rx_control_state hands it to host/control.c's new HosControlGame.overlays; without one (the fake game of
tests/control_test.c) it is null. Documented in control-bridge.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
taffy's min-content measure broke a Text at width 0, and with overflow-wrap: break-word that gave one glyph: a flex
item's automatic minimum was a glyph wide, so a button's label shrank to "Tu…". The min-content width is now parley's
own (the widest piece between soft wrap opportunities; a nowrap text's whole line), as CSS's is. A width taffy got
from the text's own size could also come back a rounding short and push its last glyph or word onto a line of its
own ("Restar/t", "Colour vision/>"): lines now break with the half pixel of slack the ellipsis check already had.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The slider rows' Field took the page's fill style, a column, so its label went above its control and the Tune button
was squeezed. Beside a button a Field now grows into the room left (st.beside) and the kit's field control, 540 wide
when there is room, narrows with its control across it when its Field is given less.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The menu gave UI the whole banner for the hosted page's tab titles, so the first and last titles and their key caps
ran under the Longshot logo and the version and build name. It now gives the middle, between the room_each each side
keeps. The column under the page was 91 % opaque, so the game's own prompts (Move, Change View) showed through its
lower part: it is opaque now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Until the menu first drew into a shot, UI was laid out at a 1920 x 1080 guess and drawn into 1280 x 720 shots, half as
large again: a HUD shot taken before the menu showed link-hud's text over the game's hearts. The replay tells UI the
shot size once it reads RX_VK_SHOT_W/H.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Mods tab's script asks modsHost.tab() as it draws. Its first answer (every
mod's rows, settings and pages, built into fresh memory) cost the script 5.6 ms
at boot, past the 5 ms of CPU a frame may, and system/mods-tab faulted.
mods_host_step now makes the answer (memoised as before) while the tab is shown,
or once before its first read, so the script's call finds it made.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
shot_dimensions_ready() now tells the UI the shots' size (ui_shot_size, vk_ui.cpp),
and the capture dimension and resource fixtures, which compile that function
alone, did not declare it. Each gives it an empty stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Since a Text's min-content is its widest word (991291bf), a label beside fixed
540-wide inputs shrank to it: the Keybinds page's rows, beside two key boxes,
read one word a line ("Menu: / Open / debug / page"). The label now goes first:
it does not shrink, its width at most half the row, and the inputs give way to
the room left. So in the Mods tab's keybind rows (the Keybinds page and a mod's
keybind setting), the menu's binding rows (pad Choices and Keybinds), and the
kit's Field (and the fallback menu's copy of its style). A Toggle's label keeps
the old style: its switch is small.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game has given game.hostLogs and read damage()'s source and owner for a while, but
longshot-testing.d.ts did not declare them, so tsgo refused the misbehaving and rock-guard
examples' tests (mod check --types).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
- lib-and-dependent/dependent: game.addMod gives an AddedFakeMod, not a FakeGame.
- ui-demo: its own Node type takes the readonly children game.ui.tree() gives.
- colour-vision and crt: OutputEffectOptions is longshot/gfx's, not longshot's.
- menu: host.binding passes on settings-host's null (a key that is no binding), which its
  one caller already checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The forward declaration put 'int decl_state_locked(' in vk_menu.cpp twice, so the source checks
that cut its body (menu_stepped_sliders, microphone_test_gain, intel_quick_compute, menu_restart,
upscaler_rows) found the declaration or refused the marker. The code is unchanged, only moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A slider's value texts are asked once a generation, all its values together, so a changed value
asks none again: the texts count was no measure of a row drawn again. The test now checks both
rows show their new values. And ["unstyle", sid] names a style, like "style", not a node: the
batches' ops on the changed row (and on the meter's line) let it through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game.time added each frame's seconds as a float, so it drifted from the host clock the
timers run on (30.033333333999998 for 30.033333334): it now keeps the nanoseconds the clock
moved and gives them as seconds. setPlayer took skulltulas and heartPieces in its type but
dropped them, so player.state() never had them; it now gives them to oot::player::progress, as
the game's 2 s count does, and a new world starts with none counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A window opening with the focus gave it to the first control with autoFocus, but only to kinds
that are focusable(), which a List is not (its rows are its own): the mod inspector's table
asked for the focus and the header's first button got it, so Down never moved the table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Two game times 15 s apart can differ by a hair under 15 as floats. Discord started while a
sweep is under way is found at the next sweep: one endpoint a frame, then RETRY_S, so the test
waits until it shows (60 s at most) instead of 17 s. The quiet-spell send says the sends when
it fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game.ui.look(text) looks at the control the text is in, here the log's List, which has the
theme's ink: the test now looks at the Text node (game.ui.find).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The status's focus came from the output's label, the help box's title. The menu's first focus is its top Tabs and
many of its buttons have no label, so the status said null with the menu open and the tab keys could not be told
apart. The output gets a focus name of its own (MKW_UI_VERSION 6, MkwUiOutput 72 bytes); the help box keeps the label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The bridge's key went on SDL's queue down and up at once, so SDL's state never showed it: a mod's action key, which
polls held keys (longshot/input, the mod inspector's F8), never fired in a test. display_sdl.c holds each pushed key
for 150 ms in hos_posix_keys, focused or not, as the bridge's presses already count unfocused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The hosted page's keys become nav bits, which keep no order: E and Q in one frame (the control bridge's one request)
went to the previous tab, as the core reads TAB_PREV first. Pressed one after the other they come back, so a pair of
opposite moves (tabs, up and down, left and right) in one present now cancels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
With HOS_START_SLOT the title's A opened the file list and the list took an A as well: its check opened on the newest
save before the cursor moved, and the skip stopped there, so the run sat in the menu (next.sh's startslot and
startslot_up). B on that check once goes back to the list, whose cursor is still on the newest save; the moves and
the list's A are made there. A second early check still leaves it to the player.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The bindings gave an event its namespace from its path's dot, and `stopping`, longshot's own, has none: its
namespace was None, the script runtime took it for a handle's event, and `import { stopping } from "longshot"`
failed ("Could not find export 'stopping'"), in the game and the fake game. The namespace is now the one that
declares it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A log line is cut at 239 bytes, so inspect()'s whole snapshot in one line was cut and would not parse. A Window
needs ui.settings: the debug page's made-up mod asks for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The builder says these three codes since the v3 refusal and the generated shaders, but build-events.md's table
never named them, so build-driver's tests/codes.rs failed. Each is now there with when the builder says it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The coordinator ruled the workaround of uwpwymqk out: the title's A should never reach the file list (the one-frame
tap). This takes its machine.ts, main.ts and machine.test.ts changes back out; the leak is fixed at its cause next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
feat(skip-title): each repeat of the title's tap logged, with a slot chosen
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 54s
CI / Workflow lint (actionlint) (pull_request) Successful in 1m0s
Third-party parts / As their notes say (pull_request) Successful in 1m6s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m11s
CI / What the change needs (pull_request) Successful in 2m21s
PR description / Title and description (pull_request_target) Successful in 58s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 6m20s
CI / Website build and checks (pull_request) Failing after 3m34s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m48s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 7m52s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m41s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 52s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m15s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 8m44s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 14m56s
22210ae9b9
The 3-slot runs showed the list taking a repeat of the title's A, but only the first tap is logged, so which tap
the title took and which one landed on the list was read from draw counts. Each repeat now logs its frame and its
number, for the diagnostic run that settles where the file list's open wait is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game.ui.pressDebugKey() looked for the mod's debug page by comparing ui.tree()'s mod (the mod's serial) with the
mod's id, so it never found it and every press opened the page again. ui.tree()'s roots now carry modId, the mod's
id, and the fake matches on that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The 70 s of changes can end with a send held back up to 15 s past their end (the hearts repeat every 8 s, so a look
every 2 s can find the sent status again when a hold ends: the 15 s and 17 s gaps). Twenty quiet seconds then left
the next change inside the hold. The mod is right; the test now waits 35 s and checks that 15 s passed since the
last send.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(ui): a window painted before its controls takes the focus when the first one shows
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 24s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 29s
CI / What the change needs (pull_request) Successful in 54s
PR description / Title and description (pull_request_target) Successful in 1m10s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m34s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m49s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m38s
CI / Website build and checks (pull_request) Failing after 1m16s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m32s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 33s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 2m20s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 12m28s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 16m16s
8efb4b3eb4
The Insert menu's page is "Loading…" for its first frame or two. Its window ask was spent on that paint, which had
nothing to focus, so the Tabs that came next never got the focus: the bridge's overlays.focus said null on the first
tab, and the tab keys and the D-pad walk started from nothing. The ask now takes the window's focus and stays until a
control shows, unless the focus went elsewhere meanwhile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 24s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 29s
CI / What the change needs (pull_request) Successful in 54s
PR description / Title and description (pull_request_target) Successful in 1m10s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m34s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m49s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m38s
CI / Website build and checks (pull_request) Failing after 1m16s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m32s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 33s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 2m20s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 12m28s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 16m16s
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/build-linux.yml
  • .forgejo/workflows/build-windows.yml
  • .forgejo/workflows/ci.yml
  • Cargo.lock
  • builder/crates/build-compile/src/lib.rs
  • builder/crates/build-driver/Cargo.toml
  • builder/crates/build-driver/src/play.rs
  • builder/crates/build-driver/src/read.rs
  • builder/crates/build-driver/src/sources.rs
  • builder/crates/longshot-builder/Cargo.toml
  • builder/crates/longshot-builder/build.rs
  • builder/crates/longshot-builder/src/from_source/mod.rs
  • builder/crates/longshot-builder/src/main.rs
  • docs/dev/reference/build.md
  • docs/dev/reference/builder.md
  • docs/dev/reference/ci.md
  • docs/dev/reference/mods.md
  • docs/dev/reference/releases.md
  • game/oot_wide_sites.c
  • game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml
  • gpu/vk/vk_menu.cpp
  • mise.toml
  • scripts/longshot_builder.py
  • scripts/screenshots/menu.cpp
  • tests/test_game_phases.py
  • tests/test_mods_sizes.py
  • tests/test_title_card_strips.py
  • tests/test_wide_sites.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/game-rs:HumanBean-feat/game-rs'
git switch 'HumanBean-feat/game-rs'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2434
No description provided.