WIP: refactor(game)!: the game's code in game/, behind game.h and game_host.h #2411

Draft
HumanBean wants to merge 386 commits from HumanBean/Longshot:game-boundary into main
Owner

Summary

Three pieces of work are about to run side by side: the mod API (and the later Rust port of the game's code), a Rust
host and a Rust renderer. Today the game's code is spread through host/ and gpu/vk/, so all three would edit the
same files. This draws one line between the generic Switch emulation (host/, gpu/) and everything that is about
Ocarina of Time (game/), with one header each way, so each track works on its own side.

It moves code and adds an interface. No behaviour changes. The C stays C, except Field of view, ported to Rust as
the pattern for the work after.

Stacked on #2286 (the builder in Rust, at 02386f32): its commits are this branch's base. The root Cargo workspace
with the empty longshot-rs is #2286's last commit now. Review from refactor(game): the hook sites, the game's flags and its frame phases move to game/ on. It merges after #2286.

What it does, one commit each:

  1. The game's C moves to game/, as it is, one area per commit:

    • the hook sites: game/sites/ (tables), game/sites.{c,h,def}, the game's flags, the frame phases;
    • the features: every host/oot_*, the cheats, texts, the game folder's layout, the HUD on wide screens, Discord,
      the cheat items' list (from gpu/vk/);
    • the mods' loader and list;
    • 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 for the performance summary): game/oot_tools.c, byte for byte. The start-up stays.

    The builder follows: the site tables, the lift's host scan and entry hooks, the compile plan (game/*.c with the
    host's flags, into the same binary), the carried sources.

  2. The two headers:

    • host/game_host.h: what the host gives the game (guest memory and Ctx, game_call, the RomFS, logging,
      options, input, the frame's clock, the recordings, the prompts). game/ includes it and nothing else of the host.
    • game/game.h: what the game gives the host and the renderer (game_init, the frame's and input's hooks, the
      bridge's and the recordings' game commands, the Mods and Cheats pages, the files mods replace).
      game/options.h: the game's option ids, out of vk_api.h, every value unchanged.
    • The host's names for the game's code become generic (hos_oot_state is game_state, and so on).
  3. The boundary check, tests/test_game_boundary.py.

  4. Field of view in Rust: game/crates/guest (the context, checked guest memory through the lift's own readers,
    the one crate with unsafe) and game/crates/oot (fov.rs, safe code, the same symbol hos_oot_fov, so the site
    and the lift don't change). game/oot_fov.c is gone. Players don't need cargo: the release builds
    liblongshot_rs.a for each platform and carries it, keyed by its sources (build-compile's rust.rs); a
    developer's build runs cargo when the sources changed. A parity test runs the deleted C against the Rust.

  5. The game's menu rows move to game/menu/, as data through game.h (GameMenuRow, through MkwVkHost), added
    to the menu by one generic module. Keys unchanged.

  6. Docs: game/README.md, "The game side" in the architecture page, the AGENTS.md menu rule, the moved paths.

  7. Guest words as atomics (guest::GuestAtomicU32/U64), for the host's sync objects in Rust (asked by the Rust
    host and renderer side): checked as a read is, worked on in place with SeqCst atomics, every write marking its
    page; a 32-bit word can be waited on and woken.

Read first: host/game_host.h, game/game.h, game/README.md, game/crates/guest/src/lib.rs,
game/crates/oot/src/fov.rs, builder/crates/build-compile/src/rust.rs.

Different from the plan, on purpose:

  • The release: the sources it carries (build-driver's sources::TREE) gain game/ and the Rust's (Cargo.toml,
    Cargo.lock, longshot-rs); scripts/longshot_builder.py game-rust builds liblongshot_rs.a with the pinned Rust;
    longshot-builder dev release dry-run fails a tree with the game's Rust and no prebuilt library of its sources.
  • game_call stays in the host (host/game_call.c): it takes a virtual core back for the call (hos_thread.c).
  • host/hos_wide_size.h stays in the host: it is the output picture's size, shared by host and renderer.
  • The frame's hooks keep their names (hos_cheats_frame, game_phase_run) rather than one game_frame; only the
    start became game_init.

Testing

Tested: not in the game yet, by the person I work for's choice: this opens with the code and its game-free checks;
the game runs follow. The checks, on Linux (this PC), on the stack on #2286's
9adf242f; on this head (on 02386f32), nothing yet: the run below is to be redone, with the boundary and parity checks made stricter by the cold review:

  • tests/run_all.py: 716 passed; the failures were #2286's own five (test_linux_update, test_no_release_lookup,
    test_pipeline_state_computes, test_lifter, test_saveload_warm_cache, failing the same on its head) and two of
    this branch's, fixed since (test_menu_env_overrides, test_pipeline_tour).
  • The host's and the game's C, every unit as a player's build compiles it (scripts/check_host_compile.py): Linux 66
    units and Windows (llvm-mingw) 65 units, none failed.
  • tests/test_oot_fov_rust.py: the Rust and the C it replaced agree on all 44,505 cases; the planted changes are seen.
  • tests/test_game_boundary.py: passes (540 files, 1,118 includes), and fails on a planted crossing.
  • rustfmt, clippy (warnings as errors) and cargo test for the workspace: the last run's findings are fixed; the run
    on this head is in the queue and its result will be added here.

Still to test:

  • Linux, this PC: gate 3 on all three saves against #2286's head, expecting the same results (by hand).
  • Linux, this PC: the per-feature checks, branch against #2286, expecting no difference; Field of view at 75, 100 and
    130 % beside the C build, expecting the same readings (by hand).
  • Windows: the game built and played through a menu and a map change, expecting the same as #2286
    (@Beanstalk build and play this branch on Windows, compared with #2286's head).

Measurements

Nothing to measure: code moves and an interface, no behaviour change (the gate and feature runs above check that).

Risks

  • A move that left a caller behind would fail to link, not misbehave; the host C compiles for Linux and Windows.
  • The lift's key changes once (the site tables moved and their comments name new paths), so the first build after
    updating lifts again; the lifted code is the same.
  • A player's build links the release's prebuilt liblongshot_rs.a; a tree whose Rust sources differ from it needs
    cargo. The release's dry run fails if it would ship without one.
  • MKWVK_API_VERSION is 48 (the menu's game rows through MkwVkHost).
  • A revert is enough.

Follow-ups:

  • hos_game_is_mkw() and the other games' leftovers: delete them, or put them behind the game interface.
  • The game's rows that stay in gpu/vk/menu/ for now, as they need the renderer's hooks: game_speed (the host's
    frame clock, set by the Quality presets), damage_taken and autosave (shown and gated by the Debug tools, a synced
    atomic, turned off by the debug warning), hud_layout, the nine hud_* placement sliders and reset_hud_placement
    (shown only for Custom, a hint from the environment, placements packed on change, an action), game_language (in
    language.txt, its range from the translations). Moved: field_of_view, text_speed, text_size,
    skip_title_screen, skip_opening, discord_status, ultrawide_menus.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Stacked on #2286.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Not yet: see Testing.)
  • mise run test passes (any failure that also fails on main is named). (The run on this head is queued: see Testing.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • 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).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • 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.ai/code/session_016o1k1SL5owjRmyLny1gUZf

## Summary Three pieces of work are about to run side by side: the mod API (and the later Rust port of the game's code), a Rust host and a Rust renderer. Today the game's code is spread through `host/` and `gpu/vk/`, so all three would edit the same files. This draws one line between the generic Switch emulation (`host/`, `gpu/`) and everything that is about Ocarina of Time (`game/`), with one header each way, so each track works on its own side. **It moves code and adds an interface. No behaviour changes.** The C stays C, except Field of view, ported to Rust as the pattern for the work after. **Stacked on #2286** (the builder in Rust, at `02386f32`): its commits are this branch's base. The root Cargo workspace with the empty `longshot-rs` is #2286's last commit now. Review from `refactor(game): the hook sites, the game's flags and its frame phases move to game/` on. It merges after #2286. What it does, one commit each: 1. **The game's C moves to `game/`, as it is**, one area per commit: - the hook sites: `game/sites/` (tables), `game/sites.{c,h,def}`, the game's flags, the frame phases; - the features: every `host/oot_*`, the cheats, texts, the game folder's layout, the HUD on wide screens, Discord, the cheat items' list (from `gpu/vk/`); - the mods' loader and list; - `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 for the performance summary): `game/oot_tools.c`, byte for byte. The start-up stays. The builder follows: the site tables, the lift's host scan and entry hooks, the compile plan (game/*.c with the host's flags, into the same binary), the carried sources. 2. **The two headers**: - `host/game_host.h`: what the host gives the game (guest memory and `Ctx`, `game_call`, the RomFS, logging, options, input, the frame's clock, the recordings, the prompts). `game/` includes it and nothing else of the host. - `game/game.h`: what the game gives the host and the renderer (`game_init`, the frame's and input's hooks, the bridge's and the recordings' game commands, the Mods and Cheats pages, the files mods replace). `game/options.h`: the game's option ids, out of `vk_api.h`, every value unchanged. - The host's names for the game's code become generic (`hos_oot_state` is `game_state`, and so on). 3. **The boundary check**, `tests/test_game_boundary.py`. 4. **Field of view in Rust**: `game/crates/guest` (the context, checked guest memory through the lift's own readers, the one crate with `unsafe`) and `game/crates/oot` (`fov.rs`, safe code, the same symbol `hos_oot_fov`, so the site and the lift don't change). `game/oot_fov.c` is gone. **Players don't need cargo**: the release builds `liblongshot_rs.a` for each platform and carries it, keyed by its sources (`build-compile`'s `rust.rs`); a developer's build runs cargo when the sources changed. A parity test runs the deleted C against the Rust. 5. **The game's menu rows move to `game/menu/`**, as data through `game.h` (`GameMenuRow`, through `MkwVkHost`), added to the menu by one generic module. Keys unchanged. 6. **Docs**: `game/README.md`, "The game side" in the architecture page, the AGENTS.md menu rule, the moved paths. 7. **Guest words as atomics** (`guest::GuestAtomicU32/U64`), for the host's sync objects in Rust (asked by the Rust host and renderer side): checked as a read is, worked on in place with SeqCst atomics, every write marking its page; a 32-bit word can be waited on and woken. Read first: `host/game_host.h`, `game/game.h`, `game/README.md`, `game/crates/guest/src/lib.rs`, `game/crates/oot/src/fov.rs`, `builder/crates/build-compile/src/rust.rs`. Different from the plan, on purpose: - The release: the sources it carries (`build-driver`'s `sources::TREE`) gain `game/` and the Rust's (`Cargo.toml`, `Cargo.lock`, `longshot-rs`); `scripts/longshot_builder.py game-rust` builds `liblongshot_rs.a` with the pinned Rust; `longshot-builder dev release dry-run` fails a tree with the game's Rust and no prebuilt library of its sources. - `game_call` stays in the host (`host/game_call.c`): it takes a virtual core back for the call (`hos_thread.c`). - `host/hos_wide_size.h` stays in the host: it is the output picture's size, shared by host and renderer. - The frame's hooks keep their names (`hos_cheats_frame`, `game_phase_run`) rather than one `game_frame`; only the start became `game_init`. ## Testing **Tested:** not in the game yet, by the person I work for's choice: this opens with the code and its game-free checks; the game runs follow. The checks, on Linux (this PC), on the stack on #2286's `9adf242f`; on this head (on `02386f32`), nothing yet: the run below is to be redone, with the boundary and parity checks made stricter by the cold review: - `tests/run_all.py`: 716 passed; the failures were #2286's own five (`test_linux_update`, `test_no_release_lookup`, `test_pipeline_state_computes`, `test_lifter`, `test_saveload_warm_cache`, failing the same on its head) and two of this branch's, fixed since (`test_menu_env_overrides`, `test_pipeline_tour`). - The host's and the game's C, every unit as a player's build compiles it (`scripts/check_host_compile.py`): Linux 66 units and Windows (llvm-mingw) 65 units, none failed. - `tests/test_oot_fov_rust.py`: the Rust and the C it replaced agree on all 44,505 cases; the planted changes are seen. - `tests/test_game_boundary.py`: passes (540 files, 1,118 includes), and fails on a planted crossing. - rustfmt, clippy (warnings as errors) and `cargo test` for the workspace: the last run's findings are fixed; the run on this head is in the queue and its result will be added here. **Still to test:** - Linux, this PC: gate 3 on all three saves against #2286's head, expecting the same results (by hand). - Linux, this PC: the per-feature checks, branch against #2286, expecting no difference; Field of view at 75, 100 and 130 % beside the C build, expecting the same readings (by hand). - Windows: the game built and played through a menu and a map change, expecting the same as #2286 (`@Beanstalk build and play this branch on Windows, compared with #2286's head`). ## Measurements Nothing to measure: code moves and an interface, no behaviour change (the gate and feature runs above check that). ## Risks - A move that left a caller behind would fail to link, not misbehave; the host C compiles for Linux and Windows. - The lift's key changes once (the site tables moved and their comments name new paths), so the first build after updating lifts again; the lifted code is the same. - A player's build links the release's prebuilt `liblongshot_rs.a`; a tree whose Rust sources differ from it needs cargo. The release's dry run fails if it would ship without one. - `MKWVK_API_VERSION` is 48 (the menu's game rows through `MkwVkHost`). - A revert is enough. Follow-ups: - `hos_game_is_mkw()` and the other games' leftovers: delete them, or put them behind the game interface. - The game's rows that stay in `gpu/vk/menu/` for now, as they need the renderer's hooks: `game_speed` (the host's frame clock, set by the Quality presets), `damage_taken` and `autosave` (shown and gated by the Debug tools, a synced atomic, turned off by the debug warning), `hud_layout`, the nine `hud_*` placement sliders and `reset_hud_placement` (shown only for Custom, a hint from the environment, placements packed on change, an action), `game_language` (in language.txt, its range from the translations). Moved: `field_of_view`, `text_speed`, `text_size`, `skip_title_screen`, `skip_opening`, `discord_status`, `ultrawide_menus`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (Stacked on #2286.) - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (Not yet: see Testing.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (The run on this head is queued: see Testing.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [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). - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. - [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) https://claude.ai/code/session_016o1k1SL5owjRmyLny1gUZf
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
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
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
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
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
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
- 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
- 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
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
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/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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
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
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
- 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
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
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
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
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
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
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
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
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
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
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
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
- 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
`--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 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
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
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
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-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
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
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
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
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
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
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
- 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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
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
- 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
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
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
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
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
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
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
- 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
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
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
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
- 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
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 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
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
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
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 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
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
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
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
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 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 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
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
- 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
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
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
- 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
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
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
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
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
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
- 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
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
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
- 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
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
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
- 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
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
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
docs(skills): the release benchmark builds with a release's longshot-builder, as main's #2403 left it for AppImages
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 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 19s
PR description / Description follows the template (pull_request_target) Successful in 21s
CI / Website build and checks (pull_request) Failing after 2m10s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 3m0s
CI / builder/ (rustfmt, clippy, cargo test) (pull_request) Failing after 3m8s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m37s
e651934e88
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 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]>
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]>
refactor(game): the game's Insert menu rows move to game/menu/, exported as data through game.h
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 12s
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 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Website build and checks (pull_request) Failing after 26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m53s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m55s
0550227861
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
HumanBean force-pushed game-boundary from 0550227861
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 12s
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 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Website build and checks (pull_request) Failing after 26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m53s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m55s
to 072bc50f50
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 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 17s
CI / Website build and checks (pull_request) Failing after 29s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m46s
2026-11-23 21:43:31 +00:00
Compare
HumanBean force-pushed game-boundary from 072bc50f50
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 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 17s
CI / Website build and checks (pull_request) Failing after 29s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m46s
to f79e6c57c6
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 13s
CI / Website build and checks (pull_request) Failing after 38s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 56s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m54s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m56s
2026-11-23 21:48:48 +00:00
Compare
HumanBean force-pushed game-boundary from f79e6c57c6
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 13s
CI / Website build and checks (pull_request) Failing after 38s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 56s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 1m54s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m56s
to 7f9fe0170c
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 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 18s
CI / Website build and checks (pull_request) Failing after 47s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m43s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m15s
2026-11-23 22:54:36 +00:00
Compare
HumanBean force-pushed game-boundary from 7f9fe0170c
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 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 18s
CI / Website build and checks (pull_request) Failing after 47s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m43s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 1m57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m15s
to fefe58d751
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
2026-11-24 01:48:53 +00:00
Compare
HumanBean force-pushed game-boundary from fefe58d751
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
to 9df487e4cf
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
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 27s
CI / Website build and checks (pull_request) Failing after 3m39s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m4s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 5m5s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m7s
2026-11-24 05:33:06 +00:00
Compare
HumanBean force-pushed game-boundary from 9df487e4cf
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
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 27s
CI / Website build and checks (pull_request) Failing after 3m39s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 5m4s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 5m5s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 5m7s
to 3adc0449c5
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 12s
PR description / Description follows the template (pull_request_target) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 14s
CI / Website build and checks (pull_request) Failing after 54s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m12s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m17s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m32s
2026-11-24 06:38:54 +00:00
Compare
fix(game): the cold review's findings: main's changes put back, the boundary and the parity checks harder to fool
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 12s
CI / Website build and checks (pull_request) Failing after 34s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m23s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m8s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m9s
2c45672d34
Put back what the rebase onto #2286 lost or undid:
- build.rs's read stage stages the game's name and icon in finish/ again (main's 88a42a18), not the game folder;
- patches.rs: OLD_LIST_NAME, which main removed, is gone again;
- test_skip_title, test_opening_skip and test_text_speed use tests/sitecheck.py again (sitetable.py is retired),
  test_game_phases leaves plan.rs's line to build-compile's own test, and the sites README's line is main's;
- site_hooks.rs's test reads the tables at game/.

The boundary: host/game_host.h now gives every host symbol game/ declares (the wide screen's sizes, Camera speed,
the fixed resolution, the ocarina's note controls, the sleeps' counter, the player's folder, main's image, the named
RomFS read, the mouse camera, the recordings' clock), and tests/test_game_boundary.py fails on a side door: a host
symbol game/ declares that the header does not give. It also follows <...> includes and the renderer's -I gpu/vk and
-I host/posix, skips includes in comments, and plants a crossing on each side.

Field of view's parity: the made-up memory counts a read outside it (a null followed, where the C would crash),
new cases cover each null pointer and no EventMgr, and two more planted changes (no EventMgr taken as an event, a null
first camera followed) must fail.

The game's Rust: mise installs x86_64-pc-windows-gnullvm (a developer's llvm-mingw build compiles the Rust), setup.md
and game/README.md say so; a tree without builder/ (a player's) asks for the release's sources instead of failing in
cargo; a missing target is named; the release's dry run requires the prebuilt library whenever its output speaks of
the game's Rust, wherever it runs; game-rust's remap flag survives a path with a space.

game_rows.cpp takes the game's rows again when asked before the host is set, and an out-of-range value shows the
first choice as before. Five checks scan game/ too (switch reads, option users, doc anchors), CircleCI maps game/ to
the tests, and the comments name game/oot_tools.c, host/oot_fov.c and game/mods.c where the code is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SL5owjRmyLny1gUZf
HumanBean force-pushed game-boundary from 2c45672d34
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 12s
CI / Website build and checks (pull_request) Failing after 34s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m23s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m8s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m9s
to 59a7b1f86d
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 13s
CI / Website build and checks (pull_request) Failing after 55s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m25s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m27s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m43s
2026-11-24 07:50:24 +00:00
Compare
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 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 13s
CI / Website build and checks (pull_request) Failing after 55s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m25s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m27s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m43s
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_dev_packs.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 'game-boundary:HumanBean-game-boundary'
git switch 'HumanBean-game-boundary'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!2411
No description provided.