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 945 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 53: a renderer built for an older version refuses to load, as it should.

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 53:** a renderer built for an older version refuses to load, as it should. ## 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.
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
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/release.yml
  • docs/dev/reference/ci.md
  • tests/test_appimage_package_retry.py
  • tests/test_crt_options.py
  • tests/test_dev_packs.py
  • tests/test_flat_map.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
2 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.