feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full #3044

Merged
HumanBean merged 1 commit from HumanBean/Longshot:renhdrum-071 into main 2026-12-04 03:53:50 +00:00
Owner

Summary

Updates the vendored RenHDrum from 0.5.0 to 0.7.1 and wires up what 0.6.0 and 0.7.x added, plus the features of upstream's own Longshot fork (integrations/recomp-c/reference/longshot-reference.patch, GPL-3.0-or-later, credited in the source). See #2945. See #3036. Fixes #3003.

On by default:

  • Game-aware DualSense triggers (needs DualSense HD Haptics): R2 follows the item on ZR (bow and slingshot, Hookshot and Longshot, Megaton Hammer, Din's Fire) and releases in menus, loads, the pause menu and while the ocarina plays. Out of ammunition, R2 does nothing. L2 keeps the vibration-driven kickback.
  • DualSense light bar and mic light: red flash on a hit, orange breathing at one heart or less, mic light breathing at 20% battery or less. The controller's own settings come back on off and on exit.
  • Crisp notes in a DualSense's fine haptics.
  • Controller speaker over Bluetooth, with DualSense HD Haptics on. Sync above 0, half vibration and gain stay cable-only.
  • Several DualSenses, cable or Bluetooth, each with its own stream, triggers and director, and each playing the Controller speaker's sounds (with some on a cable and some on Bluetooth, the cabled ones).
  • L2 pulses when Link takes damage (with game-aware triggers).
  • The Controller speaker over a cable on Linux (#3003): the sound card is found by its name, as that issue suggested. With several cards the headphone jack is not used.
  • Vibration strength above 100 % on a Bluetooth DualSense and a Steam Controller, through RenHDrum's Intensity.
  • Mod rumble (input.rumble) now plays on RenHDrum's pads; it was silent there (on main too).
  • Controller speaker volume is halved, over a cable and Bluetooth: 100 % is half of what it was, 200 % the old maximum (both controller testers found 100 % too loud).

Off by default:

  • Hookshot: squeeze to fire and Hookshot: let go to cancel: both change what the game's input receives.
  • Touchpad opens Map and Pause: the touchpad then no longer opens the Insert menu.
  • Lift weak rumble and Xbox direct rumble with its three sliders.
  • Switch 2 Pro HD Rumble 2 (HOS_SWITCH2_HD) and the Windows controller volume pin (HOS_PAD_VOLUME_PIN).
  • Switch Pro Detailed (5 ms) mode (HOS_SWITCH_DETAILED), RenHDrum's own default: a thread of the game's writes the pad's HID device under the rules of upstream's SDL patch, so no patched SDL is needed. Never run on a controller. Without it the Pro takes the settings RenHDrum's store gives, with the transport ones off.

RenHDrum is built into the game, not shipped as renhdrum.dll / .so beside it:

  • game/crates/renhdrum builds third_party/renhdrum's sources, unmodified, into liblongshot_rs.a (the pattern oxc-formatter uses). Its Opus encoder is the libopus the game already compiles; compiling RenHDrum's own copy would define every opus_* twice.
  • host/rumble_renhdrum.c calls it directly, so the compiler checks each signature against the header. The loader and the "no RenHDrum" status are gone.
  • scripts/renhdrum.py is gone; what longshot_builder.py used of it is scripts/rust_toolchain.py. The builder no longer builds, carries or copies a library.
  • third_party/rustfmt.toml keeps cargo fmt out of third-party sources, which it now reaches as a path dependency.
  • The release workflow must change first (see Risks).

Checked against upstream's integration guides: also a Bluetooth DualSense's HD Haptics taps are silent with headphones in, an Xbox pad SDL cannot classify is paced as Bluetooth, svcExitProcess lets the controllers go, and the "no sound card" hint says what Windows needs.

Also: the builder reports a pad's battery and touchpad finger and writes HID reports on one thread per pad. 0.7.1 instead of the issue's 0.7.0: an ABI-compatible patch release.

Left out:

  • Upstream's SDL3 patches: they need new SDL builds published to the team's package registry. Not decided.
  • A shield-block push on L2 and resistance while shielding or charging: upstream's patch has neither, and L2 is only felt while pulled.
  • The three-way rumble type selector, "controller in use" rows and separate strength settings: the existing toggles, status line and Vibration settings cover them.
  • Quieting by sound class during ocarina song playback. Free play is covered.
  • Demo patterns.

Read first: host/rumble_renhdrum.c, host/pad_sdl.c, host/pad_speaker.c, game/crates/game-core/src/{triggers,pad_light}.rs, builder/crates/build-core/src/{pads,switch2}.rs.

Testing

Tested: Linux 7.3 (CachyOS), RTX 3090, driver 620.70.06, with no DualSense, Xbox pad or Switch 2 Pro; and a tester's run on Windows with a DualSense, below.

  • In the game: Linux runtime built from head dcb564ea2b, base main f577a1aeab, and dev.py smoke passed (kokiri-start, 900 frames, menu opened). No controller on this PC, so RenHDrum's paths did not run.

  • RenHDrum built in, Windows (before the review fixes and the later rebases): liblongshot_rs.a built for x86_64-pc-windows-gnullvm and linked by llvm-mingw with a test program and the game's own libopus sources: no missing or doubled symbol; under Wine it reports RenHDrum 0.7.1 and builds a Bluetooth speaker report. Not a game build.

  • host/{pad_sdl,rumble_renhdrum,hos_sdl}.c pass a llvm-mingw syntax check, with the review fixes in.

  • Without the game, on the previous head (the same RenHDrum sources, as a library): a script got trigger-director effects for bow and hookshot draws and a hammer strike, none in a menu, and a Bluetooth report carrying the pushed audio.

  • mise run test on this change rebased on main f577a1ae: 878 passed, 13 skipped, 7 failed. Six are renderer cache checks that fail on plain main (test_program_cache_cleanup, test_loaded_modules_drop, test_fsr_uniform_ownership, test_program_cache_one_variant, test_linux_pressure, test_state_list_give_back). The seventh, test_lifter.py, found a manifest schema rule of this change that main now has its own version of; it is dropped from this change. Then cargo test --release --workspace --no-fail-fast: build-driver's the_repository_s_lock_and_the_table_agree fails (the compiler stamp it pins is not the one of main's tools.lock) and longshot-builder's one_copy fails (a mods_recorded line in profile.json, from main's mods code); this change touches neither, and neither was run on plain main. Two targets that ran stale binaries from a temporary checkout of mine pass rebuilt.

  • Clippy and cargo test of build-core, game-core and longshot-game pass. The changed host files pass a llvm-mingw syntax check. New tests/test_pad_endpoint_linux.py. Cold reviews of earlier rounds, and the automated review on c6184395 (L1 to L4 fixed: cable slots read under their lock, mirroring adds only the game's sounds, speaker volume, the test honours CC); these last fixes had no further review.

  • On a controller, by trzz1214 on head 8e666392d (comment above): Windows 11, RTX 4060, DualSense over USB and Bluetooth. HD Rumble, the game-aware triggers (slingshot, bow, empty ammunition, Hookshot, Longshot, Din's Fire, hammer, menus, ocarina), the light bar and the Bluetooth speaker work. Reported: the speaker is too loud (halved since, not heard on a pad); Link often did not move or drifted: the tester found it was Debug cheats' no-clip double-tap, not this change.

  • On a controller, by Jer9 on the previous head 02944239 (comment above): Windows 11, AMD Radeon 860M, DualSense over Bluetooth. renhdrum.dll and the game built with llvm-mingw; the Controller speaker played from the pad; R2 resisted with the slingshot on ZR. Feedback: that resistance feels strong, and the speaker's default 100% is loud over Bluetooth. The second round's features were not in that head.

  • A cold review of the second round found 7 problems (a stalled pad starving the others, volume pin not restored after unplug, touchpad dead without builder pads, stale R2 and touch values, multi-cable speaker and gain, Xbox direct toggle, ZR re-pressed after pause); all fixed. No second review of the fixes.

  • A second cold review (two readers, runtime and build) of the version before this one. Fixed: the light bar painted blue with nothing to show; Bluetooth headphones never detected; "accent each note" claimed for Bluetooth, where RenHDrum has no setting for it; a refused Switch 2 HD report flapping between modes; lights, speaker and touchpad state left behind when a pad changed role or the builder session ended; the old library and no RenHDrum licences in an upgraded game folder. The fixes had no further review, and none has run on a controller.

Still to test:

  • DualSense: the L2 pulse on damage; the other triggers again on this head (by hand).
  • Controller speaker volume at 100 % and 200 %, cable and Bluetooth (by hand).
  • Two cabled DualSenses: the second plays the speaker's sounds and keeps its own haptic taps (by hand).
  • Linux, DualSense on a cable: a Controller speaker sound from the pad, and headphones in its jack (by hand).
  • Two DualSenses, both cabled and both on Bluetooth: both play the speaker; one unplugged leaves the other playing (by hand).
  • DualSense over Bluetooth and Steam Controller: Vibration strength 150 % and 200 % (by hand).
  • Xbox One or Series on Windows and Linux: all four motors (by hand).
  • DualSense: the light bar keeps its colour until a hit or one heart, then goes back to blue; mic light at low battery; both restored on exit (by hand).
  • DualSense, Bluetooth: headphones in its jack, expecting its sounds on the TV and no taps from the pad (by hand).
  • DualSense or DualShock 4: touchpad halves press Minus and Plus (by hand).
  • Analog triggers: squeeze to fire and let go to cancel with the Hookshot (by hand).
  • Two DualSenses: each trigger follows and releases; one unplugged leaves the other working (by hand).
  • Xbox One or Series: Xbox direct rumble and its sliders; switching it off while rumbling (by hand).
  • Switch Pro, USB and Bluetooth: the default mode, then HOS_SWITCH_DETAILED=1: rumble that starts and stops with the game's, no input lag (by hand).
  • Switch 2 Pro over USB with HOS_SWITCH2_HD=1: vibration that stops with the game's (by hand).
  • Linux, with a pad: the log names RenHDrum 0.7.1 and the pad plays through it (by hand).
  • Windows: a game build of this head; HOS_PAD_VOLUME_PIN=1 pins the controller's volume and restores it (by hand).

Measurements

Verdict: not measured. The added work is one game-state read per input poll, a 47-byte light report when the light changes, one writer thread per HID pad, and Opus encoding for the Bluetooth speaker; none has numbers.

Risks

  • Decided to keep: the Bluetooth speaker is on by default, so a Bluetooth DualSense with HD Haptics now plays the "Controller only" sounds (Navi's voice and others) on the pad instead of the TV.
  • Decided to leave off by default, with their limits: "let go to cancel" knows only that the Hookshot is on ZR, not that Link is aiming, so it can give B while riding or swimming; "squeeze to fire" reads the physical right trigger whatever ZR is bound to, and a squeeze faster than the game's input reads does not fire; HOS_PAD_VOLUME_PIN remembers one volume for all pads.
  • Release workflow: longshot.yml builds the RenHDrum library only for sources that have scripts/renhdrum.py, pushed to MagicBeanAdmin/Release (d5925467). No release has run with it.
  • HOS_SWITCH_DETAILED writes HID reports beside SDL's driver; the builder now also lets the game write report 0x10 (rumble only) to a Switch Pro Controller.
  • Vibration strength above 100 % on those two grows the weaker vibration only; the strongest was already full.
  • Not done: the Controller speaker over Bluetooth with HD Haptics off (RenHDrum lets sound through only with its speaker level above 0, which also changes the motors' play), and headphones over Bluetooth (RenHDrum has no report for them).
  • Linux: HD features need access to the controller's HID device (steam-devices); the Controls page and the user docs say so.
  • Left as it is, against upstream's guide: a Steam Input DualSense is not excluded (it would drop to motors), and a hung pad poll at exit skips the controllers' release.
  • A RenHDrum panic now stops the game (panic = "abort", as all the game's Rust); as a library it was caught at its boundary.
  • RenHDrum can no longer be missing or swapped: no renhdrum.dll to remove or replace. HOS_RUMBLE_BACKEND=hd or motors still leaves it out.
  • The builder-to-game pad protocol is now version 3: builder and game must be from the same build.
  • The light bar setting is on by default, so a DualSense's colour changes for everyone who has one.
  • RenHDrum 0.7.1 changes the vibration curve for Switch Pro and Xbox pads: light rumble is weaker.
  • Switch 2 HD: upstream's report header byte (0x70) and band order differ from what the builder measured (0x50). Unverified, hence off.
  • HOS_PAD_VOLUME_PIN is Windows-only, untested, off.
  • A wrong ZR-item offset (player 0x358 + 0x7d0, from upstream) would give R2 the wrong feel or none, and the Hookshot options would not engage. Turn off with "DualSense game-aware triggers"; otherwise revert.
  • New longshot_options.ini keys. New labels and help in the 12 non-English languages are not native-reviewed.
  • Fixes a bug of this PR's first version: the triggers row showed as locked Off whenever HD Haptics was on.
  • The third_party/ formatting file is outside every vendored part.
  • Linux: with several DualSense sound cards, which card is which pad's is a guess; every cabled pad plays the same, so it is not heard.
  • The next RenHDrum release halves the Bluetooth speaker itself (trzz1214); re-vendoring it must drop that half here, or Bluetooth gets quartered.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Boots in the game. No pad used on my PC; a tester ran part of an earlier head.)
  • mise run test passes. (It fails on main too, as Testing says.)
  • Measured against main, or Measurements says why there is nothing to measure. (Not measured.)
  • No game files, build output or hand-edited generated files; third_party/ changed only by re-vendoring RenHDrum 0.7.1 (PROVENANCE.md, check_third_party.py passes); nothing GPL-incompatible.

When it applies

  • A switch added or changed: HOS_SWITCH2_HD, HOS_PAD_VOLUME_PIN and HOS_SWITCH_DETAILED ship off, untested on hardware, with their rows in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: full build by a tester on an earlier head; since then only the game's Rust built and link-tested, before the review fixes, and a syntax check after them. Linux builds.)
  • 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_017vw8e45fvvxoZWKqwHUVeM

## Summary Updates the vendored RenHDrum from 0.5.0 to 0.7.1 and wires up what 0.6.0 and 0.7.x added, plus the features of upstream's own Longshot fork (`integrations/recomp-c/reference/longshot-reference.patch`, GPL-3.0-or-later, credited in the source). See #2945. See #3036. Fixes #3003. On by default: - **Game-aware DualSense triggers** (needs DualSense HD Haptics): R2 follows the item on ZR (bow and slingshot, Hookshot and Longshot, Megaton Hammer, Din's Fire) and releases in menus, loads, the pause menu and while the ocarina plays. Out of ammunition, R2 does nothing. L2 keeps the vibration-driven kickback. - **DualSense light bar and mic light**: red flash on a hit, orange breathing at one heart or less, mic light breathing at 20% battery or less. The controller's own settings come back on off and on exit. - **Crisp notes** in a DualSense's fine haptics. - **Controller speaker over Bluetooth**, with DualSense HD Haptics on. Sync above 0, half vibration and gain stay cable-only. - **Several DualSenses**, cable or Bluetooth, each with its own stream, triggers and director, and each playing the Controller speaker's sounds (with some on a cable and some on Bluetooth, the cabled ones). - **L2 pulses when Link takes damage** (with game-aware triggers). - **The Controller speaker over a cable on Linux** (#3003): the sound card is found by its name, as that issue suggested. With several cards the headphone jack is not used. - **Vibration strength above 100 %** on a Bluetooth DualSense and a Steam Controller, through RenHDrum's Intensity. - **Mod rumble** (`input.rumble`) now plays on RenHDrum's pads; it was silent there (on `main` too). - **Controller speaker volume is halved**, over a cable and Bluetooth: 100 % is half of what it was, 200 % the old maximum (both controller testers found 100 % too loud). Off by default: - **Hookshot: squeeze to fire** and **Hookshot: let go to cancel**: both change what the game's input receives. - **Touchpad opens Map and Pause**: the touchpad then no longer opens the Insert menu. - **Lift weak rumble** and **Xbox direct rumble** with its three sliders. - Switch 2 Pro HD Rumble 2 (`HOS_SWITCH2_HD`) and the Windows controller volume pin (`HOS_PAD_VOLUME_PIN`). - **Switch Pro Detailed (5 ms) mode** (`HOS_SWITCH_DETAILED`), RenHDrum's own default: a thread of the game's writes the pad's HID device under the rules of upstream's SDL patch, so no patched SDL is needed. Never run on a controller. Without it the Pro takes the settings RenHDrum's store gives, with the transport ones off. **RenHDrum is built into the game**, not shipped as `renhdrum.dll` / `.so` beside it: - `game/crates/renhdrum` builds `third_party/renhdrum`'s sources, unmodified, into `liblongshot_rs.a` (the pattern `oxc-formatter` uses). Its Opus encoder is the libopus the game already compiles; compiling RenHDrum's own copy would define every `opus_*` twice. - `host/rumble_renhdrum.c` calls it directly, so the compiler checks each signature against the header. The loader and the "no RenHDrum" status are gone. - `scripts/renhdrum.py` is gone; what `longshot_builder.py` used of it is `scripts/rust_toolchain.py`. The builder no longer builds, carries or copies a library. - `third_party/rustfmt.toml` keeps `cargo fmt` out of third-party sources, which it now reaches as a path dependency. - **The release workflow must change first** (see Risks). Checked against upstream's integration guides: also a Bluetooth DualSense's HD Haptics taps are silent with headphones in, an Xbox pad SDL cannot classify is paced as Bluetooth, `svcExitProcess` lets the controllers go, and the "no sound card" hint says what Windows needs. Also: the builder reports a pad's battery and touchpad finger and writes HID reports on one thread per pad. 0.7.1 instead of the issue's 0.7.0: an ABI-compatible patch release. Left out: - Upstream's SDL3 patches: they need new SDL builds published to the team's package registry. Not decided. - A shield-block push on L2 and resistance while shielding or charging: upstream's patch has neither, and L2 is only felt while pulled. - The three-way rumble type selector, "controller in use" rows and separate strength settings: the existing toggles, status line and Vibration settings cover them. - Quieting by sound class during ocarina song playback. Free play is covered. - Demo patterns. Read first: `host/rumble_renhdrum.c`, `host/pad_sdl.c`, `host/pad_speaker.c`, `game/crates/game-core/src/{triggers,pad_light}.rs`, `builder/crates/build-core/src/{pads,switch2}.rs`. ## Testing **Tested:** Linux 7.3 (CachyOS), RTX 3090, driver 620.70.06, with no DualSense, Xbox pad or Switch 2 Pro; and a tester's run on Windows with a DualSense, below. - In the game: Linux runtime built from head dcb564ea2bf4, base `main` f577a1aeabdb, and `dev.py smoke` passed (kokiri-start, 900 frames, menu opened). No controller on this PC, so RenHDrum's paths did not run. - RenHDrum built in, Windows (before the review fixes and the later rebases): `liblongshot_rs.a` built for `x86_64-pc-windows-gnullvm` and linked by llvm-mingw with a test program and the game's own libopus sources: no missing or doubled symbol; under Wine it reports RenHDrum 0.7.1 and builds a Bluetooth speaker report. Not a game build. - `host/{pad_sdl,rumble_renhdrum,hos_sdl}.c` pass a llvm-mingw syntax check, with the review fixes in. - Without the game, on the previous head (the same RenHDrum sources, as a library): a script got trigger-director effects for bow and hookshot draws and a hammer strike, none in a menu, and a Bluetooth report carrying the pushed audio. - `mise run test` on this change rebased on `main` f577a1ae: 878 passed, 13 skipped, 7 failed. Six are renderer cache checks that fail on plain `main` (`test_program_cache_cleanup`, `test_loaded_modules_drop`, `test_fsr_uniform_ownership`, `test_program_cache_one_variant`, `test_linux_pressure`, `test_state_list_give_back`). The seventh, `test_lifter.py`, found a manifest schema rule of this change that `main` now has its own version of; it is dropped from this change. Then `cargo test --release --workspace --no-fail-fast`: `build-driver`'s `the_repository_s_lock_and_the_table_agree` fails (the compiler stamp it pins is not the one of `main`'s `tools.lock`) and `longshot-builder`'s `one_copy` fails (a `mods_recorded` line in `profile.json`, from `main`'s mods code); this change touches neither, and neither was run on plain `main`. Two targets that ran stale binaries from a temporary checkout of mine pass rebuilt. - Clippy and `cargo test` of build-core, game-core and longshot-game pass. The changed host files pass a llvm-mingw syntax check. New `tests/test_pad_endpoint_linux.py`. Cold reviews of earlier rounds, and the automated review on c6184395 (L1 to L4 fixed: cable slots read under their lock, mirroring adds only the game's sounds, speaker volume, the test honours `CC`); these last fixes had no further review. - On a controller, by trzz1214 on head `8e666392d` (comment above): Windows 11, RTX 4060, DualSense over USB and Bluetooth. HD Rumble, the game-aware triggers (slingshot, bow, empty ammunition, Hookshot, Longshot, Din's Fire, hammer, menus, ocarina), the light bar and the Bluetooth speaker work. Reported: the speaker is too loud (halved since, not heard on a pad); Link often did not move or drifted: the tester found it was Debug cheats' no-clip double-tap, not this change. - On a controller, by Jer9 on the **previous head** 02944239 (comment above): Windows 11, AMD Radeon 860M, DualSense over Bluetooth. `renhdrum.dll` and the game built with llvm-mingw; the Controller speaker played from the pad; R2 resisted with the slingshot on ZR. Feedback: that resistance feels strong, and the speaker's default 100% is loud over Bluetooth. The second round's features were not in that head. - A cold review of the second round found 7 problems (a stalled pad starving the others, volume pin not restored after unplug, touchpad dead without builder pads, stale R2 and touch values, multi-cable speaker and gain, Xbox direct toggle, ZR re-pressed after pause); all fixed. No second review of the fixes. - A second cold review (two readers, runtime and build) of the version before this one. Fixed: the light bar painted blue with nothing to show; Bluetooth headphones never detected; "accent each note" claimed for Bluetooth, where RenHDrum has no setting for it; a refused Switch 2 HD report flapping between modes; lights, speaker and touchpad state left behind when a pad changed role or the builder session ended; the old library and no RenHDrum licences in an upgraded game folder. The fixes had no further review, and none has run on a controller. **Still to test:** - DualSense: the L2 pulse on damage; the other triggers again on this head (by hand). - Controller speaker volume at 100 % and 200 %, cable and Bluetooth (by hand). - Two cabled DualSenses: the second plays the speaker's sounds and keeps its own haptic taps (by hand). - Linux, DualSense on a cable: a Controller speaker sound from the pad, and headphones in its jack (by hand). - Two DualSenses, both cabled and both on Bluetooth: both play the speaker; one unplugged leaves the other playing (by hand). - DualSense over Bluetooth and Steam Controller: Vibration strength 150 % and 200 % (by hand). - Xbox One or Series on Windows and Linux: all four motors (by hand). - DualSense: the light bar keeps its colour until a hit or one heart, then goes back to blue; mic light at low battery; both restored on exit (by hand). - DualSense, Bluetooth: headphones in its jack, expecting its sounds on the TV and no taps from the pad (by hand). - DualSense or DualShock 4: touchpad halves press Minus and Plus (by hand). - Analog triggers: squeeze to fire and let go to cancel with the Hookshot (by hand). - Two DualSenses: each trigger follows and releases; one unplugged leaves the other working (by hand). - Xbox One or Series: Xbox direct rumble and its sliders; switching it off while rumbling (by hand). - Switch Pro, USB and Bluetooth: the default mode, then `HOS_SWITCH_DETAILED=1`: rumble that starts and stops with the game's, no input lag (by hand). - Switch 2 Pro over USB with `HOS_SWITCH2_HD=1`: vibration that stops with the game's (by hand). - Linux, with a pad: the log names RenHDrum 0.7.1 and the pad plays through it (by hand). - Windows: a game build of this head; `HOS_PAD_VOLUME_PIN=1` pins the controller's volume and restores it (by hand). ## Measurements **Verdict:** not measured. The added work is one game-state read per input poll, a 47-byte light report when the light changes, one writer thread per HID pad, and Opus encoding for the Bluetooth speaker; none has numbers. ## Risks - Decided to keep: the Bluetooth speaker is on by default, so a Bluetooth DualSense with HD Haptics now plays the "Controller only" sounds (Navi's voice and others) on the pad instead of the TV. - Decided to leave off by default, with their limits: "let go to cancel" knows only that the Hookshot is on ZR, not that Link is aiming, so it can give B while riding or swimming; "squeeze to fire" reads the physical right trigger whatever ZR is bound to, and a squeeze faster than the game's input reads does not fire; `HOS_PAD_VOLUME_PIN` remembers one volume for all pads. - Release workflow: `longshot.yml` builds the RenHDrum library only for sources that have `scripts/renhdrum.py`, pushed to MagicBeanAdmin/Release (`d5925467`). No release has run with it. - `HOS_SWITCH_DETAILED` writes HID reports beside SDL's driver; the builder now also lets the game write report `0x10` (rumble only) to a Switch Pro Controller. - Vibration strength above 100 % on those two grows the weaker vibration only; the strongest was already full. - Not done: the Controller speaker over Bluetooth with HD Haptics off (RenHDrum lets sound through only with its speaker level above 0, which also changes the motors' play), and headphones over Bluetooth (RenHDrum has no report for them). - Linux: HD features need access to the controller's HID device (`steam-devices`); the Controls page and the user docs say so. - Left as it is, against upstream's guide: a Steam Input DualSense is not excluded (it would drop to motors), and a hung pad poll at exit skips the controllers' release. - A RenHDrum panic now stops the game (`panic = "abort"`, as all the game's Rust); as a library it was caught at its boundary. - RenHDrum can no longer be missing or swapped: no `renhdrum.dll` to remove or replace. `HOS_RUMBLE_BACKEND=hd` or `motors` still leaves it out. - The builder-to-game pad protocol is now version 3: builder and game must be from the same build. - The light bar setting is on by default, so a DualSense's colour changes for everyone who has one. - RenHDrum 0.7.1 changes the vibration curve for Switch Pro and Xbox pads: light rumble is weaker. - Switch 2 HD: upstream's report header byte (0x70) and band order differ from what the builder measured (0x50). Unverified, hence off. - `HOS_PAD_VOLUME_PIN` is Windows-only, untested, off. - A wrong ZR-item offset (player 0x358 + 0x7d0, from upstream) would give R2 the wrong feel or none, and the Hookshot options would not engage. Turn off with "DualSense game-aware triggers"; otherwise revert. - New `longshot_options.ini` keys. New labels and help in the 12 non-English languages are not native-reviewed. - Fixes a bug of this PR's first version: the triggers row showed as locked Off whenever HD Haptics was on. - The `third_party/` formatting file is outside every vendored part. - Linux: with several DualSense sound cards, which card is which pad's is a guess; every cabled pad plays the same, so it is not heard. - The next RenHDrum release halves the Bluetooth speaker itself (trzz1214); re-vendoring it must drop that half here, or Bluetooth gets quartered. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (Boots in the game. No pad used on my PC; a tester ran part of an earlier head.) - [ ] `mise run test` passes. (It fails on `main` too, as Testing says.) - [ ] Measured against `main`, or Measurements says why there is nothing to measure. (Not measured.) - [x] No game files, build output or hand-edited generated files; `third_party/` changed only by re-vendoring RenHDrum 0.7.1 (`PROVENANCE.md`, `check_third_party.py` passes); nothing GPL-incompatible. ### When it applies - [x] A switch added or changed: `HOS_SWITCH2_HD`, `HOS_PAD_VOLUME_PIN` and `HOS_SWITCH_DETAILED` ship off, untested on hardware, with their rows in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: full build by a tester on an earlier head; since then only the game's Rust built and link-tested, before the review fixes, and a syntax check after them. Linux builds.) - [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_017vw8e45fvvxoZWKqwHUVeM
The game side (between the C host and the lifted game) moves from C to Rust (game/crates). A mod API lets script mods,
in TypeScript or JavaScript run by QuickJS in the game, read and change the game with the permissions the player
grants; file mods load as before. Every game setting and feature becomes a system mod on that API (game/mods, Rust or
TypeScript), the Insert menu and the Mods tab included. longshot-builder becomes the game's only entrypoint, its
sandboxer (Landlock and seccomp on Linux, an AppContainer on Windows) and its broker over one framed channel. The former
#2434, squashed.

Co-authored-by: Chloe Christley <[email protected]>
Co-authored-by: Jer9 <[email protected]>
Co-authored-by: snaildev99 <[email protected]>
Co-authored-by: SqueezyLemonade <[email protected]>
Co-authored-by: flashman4 <[email protected]>
Co-authored-by: dyst <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
## Summary

**Why.** On the mod API branch ([#2822](#2822)) a headless run's screenshots (`RX_VK_SHOTS`, `RX_VK_SHOT_MENU=1`) drew the mods' UI with a copy of the window's draw order of their own, without Colour vision, and laid the hosted debug page out at the window's size instead of the shot's. This makes the shot and the window draw the overlays through one function, so a headless shot shows what a window would: mods' HUDs, windows and world labels, then the Insert menu (the menu system mod) and its page.

**What changed**

- `gpu/vk/vk_menu.cpp`/`.h`: `draw_overlays` draws the mods' UI, then the menu and its hosted page; `menu_record` (the window) and `menu_record_image` (a shot) both call it, and the shot takes the window's Colour vision mode.
- `gpu/vk/vk_replay.cpp`: the shot path passes Colour vision as the window does.
- `gpu/vk/vk_ui.cpp`: the hosted debug page is laid into the shot's size when headless.
- `gpu/vk/switches.def`: `RX_VK_SHOT_MENU`'s row says what it draws (default off, unchanged).
- Docs: `docs/dev/developing.md` (screenshots on a timer), the guide images README.
- `docs/dev/reference/control-bridge.md`: `menu_key` works headless only with `RX_VK_SHOT_MENU=1`, which ticks the menu there.
- Tests: `tests/test_fps_overlay_order.py` runs both record paths with stubs and checks they make the same draws and colour mode; `tests/test_ui_renderer.py` follows `draw_overlays`.

## Testing

**Tested:** Linux (CachyOS, Linux 7.3, RTX 3090, NVIDIA 620.70.06), on bfa15b49 (before the rebase onto mod-api 4cc50ca1; f32312f8 compiles and passes the changed checks), a headless run through the job queue with the sandbox on, 1920x1080 shots every 20 presents, `RX_VK_MENU_SCRIPT` opening the Insert menu and stepping through its tabs, and the `link-hud` example loaded through `LONGSHOT_DEV_MODS`: the shots show the menu system mod's Graphics, Audio, Gameplay, Controls and NFC tabs as a window shows them, and link-hud's HUD (hearts and rupees, top left) and its label over Link with the menu closed.

**Still to test:**
- A shot after a mod is switched off in the Mods tab, expecting its HUD gone (by hand, or a menu script that turns it off)

## Measurements

**Verdict:** nothing to measure: the change is in a diagnostic switch's path (`RX_VK_SHOT_MENU`, off by default); a window's present calls the same draws as before, in the same order.

## Risks

- A window's overlays now go through `draw_overlays`; the test checks the window and shot paths make the same draw sequence. No switch to turn it off: the window path's order is unchanged.

## Checklist

### Ready for review

- [x] One topic, on current `main`; the title is a Conventional Commit. *(On the mod API branch, the base of this PR.)*
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named). *(The two checks this changes pass; the rest is the mod API branch's.)*
- [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 switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`.
- [x] A check under `tests/` that reads changed source is updated, not weakened.
- [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.
- [ ] Approved in review, every comment answered.
- [ ] CI passes on the head.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #2837
## Summary

Fourteen of the game-free checks (`tests/run_all.py`) failed on `mod-api`, on the old head (816d2354) as on the one rebased on main 46291934: each fixture copies real code out of the tree and had not followed it. While they fail, CI's game-free checks on [#2822](#2822) cannot pass. Test fixtures only; no game, renderer or builder code changes.

- **Video** (catch-up, hold early, input limit, vcore acquire): a `movie_now` stand-in, host/nn_video.c's clock without the background hold.
- **Shader cache and memory** (program cache cleanup and one variant, loaded modules drop, Linux pressure): the shader store held as a pointer, as `vk_progcache.cpp` holds it.
- **Present source crop**: `drain_framegen_sets`. **Guest holes**: `UploadLayoutGuard` and the transfer layout.
- **Windows display startup and screensaver**: the window icons and DPI, and `WM_NCDESTROY`.
- **Controller in background**: read through `PADS_IN_BACKGROUND_SETTING` (off while Pause in background is on); the fixture takes that macro from host/nn_hid.c.
- **Text keyboard policy**: newer clang's `-Wunused-but-set-global` on the fixture's counter.
- **Windows on Linux**: the renderer job runs `dev compile`.

Read first: tests/test_input_background.py (the only check whose reading changed, not just its stand-ins).

## Testing

**Tested:** Linux (CachyOS, clang and gcc): the 14 checks pass with `tests/run_all.py --exact`; before this change each failed on the old `mod-api` head and on the rebased one. Nothing the game runs changes, so no game run.

**Still to test:** None (CI's game-free checks run them on Linux and Windows).

## Measurements

Nothing to measure: test fixtures only.

## Risks

None for players: only tests change. A fixture's stand-in could hide a real change in the code it copies; each stand-in mirrors the code's own behaviour as named above.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named).
- [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] 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)

Reviewed-on: #2848
feat(modapi): nav.closest, the closest point on the game's navmesh, made after its navmesh update

## Summary

A first `longshot/nav` module: `nav.closest(position, { radius })` settles with the point on the game's own navmesh
closest to a position (and its distance), or null. A mod can now put a spawned actor where a character could stand,
check that a spot is walkable, or snap a marker to the ground, as the game's AI does (its
`QueryGetClosestNavMeshPoint`). It is the first of the navmesh calls: paths, line of sight along the navmesh and a mod's
own cuts come next, on the same site (`docs/dev/reference/nav.md`, "What comes next").

- **`game-core`**:
  - `nav` (new) asks the game's closest-point call (`nav.closest`, `f_80542dc0`). The request is built on the guest
    stack, as the game's callers build it (`layout::nav`), for the map's first character type, with the default
    filter and no navmesh object of the asker's own.
  - The manager comes from its variable (`nav.manager`, `0x84eaedb0`); 0 means no navmesh now.
  - Fixed slots hand queries over without a lock, as `rays` does.
- **One site**: `nav.updated`, the return of the navmesh manager's update job (`f_80781b00`, which holds the manager's
  lock exclusively while it steps the Havok AI world). Queries are made there, on that job's thread, once every lock is
  released.
  - This is the reason the main thread never asks itself: the call takes the same lock shared, and the update may wait
    on jobs the main thread runs, which is the reason `world.ray` is cast after the physics step.
  - The site is off while nothing is asked.
- **`api`**: `services::nav` (new). It allows at most 64 queries a frame for a mod, and nulls a query that has waited 4
  frames (a pause, a load). Answers settle at the next serial point. It needs `state.read`.
  - The feature is `has("nav.closest")`.
  - Schema: `nav.toml`, plus `NavPoint` and `NavOptions` in `types.toml`.
- **Docs**:
  - `docs/modding/nav.md`, the guide.
  - `docs/dev/reference/nav.md`: what was read of the game, the request's layout, the threading, and the run.
  - The generated reference.

Read first: `game/crates/game-core/src/nav.rs`, the `nav.updated` site in `game/sites/sites.toml`, and
`game/crates/api/src/services/nav.rs`.

## Testing

**Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24, build `e0f3ccfa`.

**Game-free tests:**
- `game-core` `nav`: 6 new tests, run with `host_sys::fake`.
  - Asked, made and taken.
  - Cancelled.
  - Every slot taken.
  - The request in guest memory, byte for byte as the game builds it, against a fake call.
  - Nothing near, no manager, a bad ask.
  - The feature needs the call, the manager and the site.
- `api` `services::nav`: 2 new tests (a point read as a `NavPoint` with its distance, and the radius rules). The settling
  and the limit are covered by the in-game run.
- `game-core` (all), `game-sites`, and the builder's `sites` (the new site's owner line) pass.
- `schema-gen --check`, `tests/test_doc_anchors.py`, and `cargo check --workspace` are clean.

**In the game:** a probe mod's in-game test, `dev.py game-tests`, sandboxed and headless. Link starts in Kokiri Forest
at (-46.09, 118.44, 15.39).
- `has("nav.closest")` is true.
- From Link: the point 0.05 m below his feet.
- From 1.5 m above him (radius 3): the ground below, 1.55 m away.
- From 30 m above (radius 2): null.
- 40 queries in one frame along a 20 m line, 1 m up (radius 4): all settled, 34 points and 6 null, where the line left
  the walkable ground.
- 70 asked in one frame: 64 asked, the other 6 thrown as a `LimitError` at the call.
- The test: `ok - test/nav.test.ts: the closest navmesh point is under Link, found from above, and none 30 m up`, 1
  passed, exit 0.
- Run again on this branch's head, rebased on the squashed `mod-api` (`eaf4a48b9`), with the builder confining the
  game: the same numbers, and the test passed (exit 0). It was merged locally with #2726 and #2747, which a sandboxed
  test run on the new `mod-api` needs; that merge was not pushed. The first runs were on the earlier `mod-api`, before
  the rebase and BeanBot's batch-bounding commit.

**Still to test:**
- @Beanstalk: Linux, in the game: `dev.py game-tests` of a mod calling `nav.closest` at Link in Kokiri Forest.
- By hand: Hyrule Field's tiled navmesh, and a map with none.
- By hand: a query across a load, which should be null after 4 frames.

<details><summary>The 118 checks that fail on Windows on mod-api (`eaf4a48b9`) too</summary>

`test_antilag.py`, `test_astc_decoder_gpu.py`, `test_async_safe_frees.py`, `test_audio_output_devices.py`, `test_audio_source_load.py`, `test_auto_handheld.py`, `test_bc_copy_layer_pitch.py`, `test_builder_channel.py`, `test_builtin_compute_unoptimized.py`, `test_capture_dimensions.py`, `test_capture_readback_visibility.py`, `test_capture_resources.py`, `test_coopmat_probe_failures.py`, `test_crash_record.py`, `test_desc_counts.py`, `test_dev_ab.py`, `test_dev_build.py`, `test_dev_migrate.py`, `test_dev_packs.py`, `test_dev_update.py`, `test_device_policy.py`, `test_draw_binds.py`, `test_draw_stream_visibility.py`, `test_drs.py`, `test_dummy_views.py`, `test_dump_readback.py`, `test_fallback_pipeline_state.py`, `test_float_add_subgroup.py`, `test_framegen_resources.py`, `test_framelog_sink.py`, `test_fsr3_release_frees.py`, `test_fsr3fi_hud_mask.py`, `test_fsr4_bind_dispatch.py`, `test_fsr4_tune.py`, `test_fsr_image_retirement.py`, `test_fsr_uniform_ownership.py`, `test_game_menu_mouse_buttons.py`, `test_gcn_mesh_shared_warp.py`, `test_image_view_retry.py`, `test_import_buffer_binding.py`, `test_import_log.py`, `test_import_reach.py`, `test_inline_write_order.py`, `test_input_background.py`, `test_input_movie.py`, `test_job_queue.py`, `test_lifter.py`, `test_linux_pressure.py`, `test_loaded_modules_drop.py`, `test_longshot_builder.py`, `test_longshot_ctl.py`, `test_lost_wait_said.py`, `test_low_vram_texture_mips.py`, `test_menu_hooks.py`, `test_mesh_fallback_strict_fmul.py`, `test_mesh_first_types.py`, `test_pads_after_menu.py`, `test_parity_gates.py`, `test_pass_barrier.py`, `test_pass_hazard.py`, `test_pcache_header_read.py`, `test_pipeline_key_values.py`, `test_pipeline_state_portable.py`, `test_pipeline_states.py`, `test_present_probe.py`, `test_present_queue_default.py`, `test_present_sites.py`, `test_present_source_crop.py`, `test_program_answer_domains.py`, `test_program_cache_cleanup.py`, `test_program_cache_one_variant.py`, `test_push_state.py`, `test_queue_priority.py`, `test_recorder_own_idle.py`, `test_recorder_parts.py`, `test_recorder_sync.py`, `test_recording_admission.py`, `test_replay_write_order.py`, `test_reshade_fx.py`, `test_run_all_mingw.py`, `test_same_draw.py`, `test_same_dyn.py`, `test_sampler_admission.py`, `test_seed_reader.py`, `test_shader_store.py`, `test_sparse_bind_failure.py`, `test_sparse_bind_ranges.py`, `test_split_ub_flush.py`, `test_staging_burst.py`, `test_taau_typed_dispatch.py`, `test_table_track.py`, `test_target_layouts.py`, `test_target_reuse_memory.py`, `test_temporal_present_bandwidth.py`, `test_texel_buffer_ownership.py`, `test_texture_init_barrier.py`, `test_texture_staging_publication.py`, `test_ub_snapshot_default.py`, `test_ub_update_batch.py`, `test_ui_record.py`, `test_ui_texture_upload.py`, `test_vcore_video_acquire.py`, `test_vendor_fixes.py`, `test_vertex_bind.py`, `test_vertex_bind_range.py`, `test_video_catchup.py`, `test_video_hold_early.py`, `test_video_input_limit.py`, `test_vk_occlusion_queries.py`, `test_vulkan_clear_mip.py`, `test_vulkan_copy_span.py`, `test_vulkan_copy_span_gpu_compile.py`, `test_wb_diff_observations_gpu.py`, `test_widen_alpha.py`, `test_windows_on_linux.py`, `test_windows_stop.py`, `test_wmma16_zero_c_kchain.py`, `test_xinput_thread.py`

</details>

## Measurements

Nothing to measure: the site is off while no mod asks, and a query is one call of the game's own on its navmesh job's thread.

## Risks

- **Safety of the call.** It is made on the navmesh job's thread once the job has released its locks, while the game's
  own readers take the same lock shared from their threads. The call is a reader too.
- **Wrong answers.** If the game changed its request layout, a query would answer wrong, not crash: the request is the
  game's own, fully written and zeroed. The site's signature pins the build.
- **Reverting** is enough: nothing is written to saves.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named): Windows, this branch: 669 passed, 120 failed, 47 skipped. The same 118 fail on mod-api; the other two (`test_host_alloc_wait`, `test_mesh_args_cleanup`) pass on rerun, flaky under the full run.
- [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] 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)

Co-authored-by: BeanBot <[email protected]>
Reviewed-on: #2745
Reviewed-by: HumanBean <[email protected]>
## Summary

[Your first mod](docs/modding/getting-started.md) was written for someone typing every step themselves. It now opens with two ways to make a mod: **by hand**, through the steps, or **with a coding agent**, with an example of what to tell the agent and a list of what stays the player's (the game's questions, new permissions, playing it, which save tests may use, nothing of the game leaving the PC). Step 5 now shows how to watch the running game from a terminal (`mod status`, `mod log --follow`, `mod shot`), which is also how an agent sees what a mod does.

The page is also shorter and plainer: a "You should see" after each command, numbered sub-steps where there are several, the launcher's folder layouts moved to a "Finding `Longshot.exe`" section at the end, and the side notes (plain JavaScript, no Node) gathered under "Good to know". Every command, manifest field and code example is unchanged.

[agents.md](docs/modding/agents.md) said the control bridge's commands were gone. They are in the builder's mod tool (`game/crates/modtool`, `cmd::live`), so that section is now "Watching the running game" with the commands, the loop says to run `mod run` in the background and watch it, and the page names `types/longshot.d.ts` as the API as this Longshot has it.

A second commit is an accuracy pass over docs/modding against the code. A mod is now shared mainly from git: step 9 is "Check and share it" (push the folder, tag versions; players add the repository as a source and `mod install` it; `mod publish` for a signed repo; `mod pack` last, for one file to hand out or host), and agents.md, README.md, scripting.md and packages.md say the same. Also fixed: `mod check`'s expected output (the `local` owner's hint), the real-game tests (`mod test --game`), the log's place (`diagnostics/logs/`, found with `mod where`), the example count (48), examples.md's lists, `#:schema` (not `"$schema"`), trust.json's wording, and scripting.md's stale "not in the builder's tools yet".

Read first: docs/modding/getting-started.md, "Two ways to make a mod" and "Make it with a coding agent".

## Testing

**Tested:** Linux: `tests/run_all.py --exact` on the checks that read docs/modding (test_doc_anchors, test_check_pr_description, test_dev_check, test_gfx_effects, test_gfx_world, test_world_depth) pass; pre-commit on both files passes. The running-game commands were checked against `game/crates/modtool/src/lib.rs` (the fallthrough to `cmd::live`) and docs/modding/tools.md.

**Still to test:**
- Any PC: follow "Make it with a coding agent" with an agent from an empty folder, expecting it to make, test and run a mod while the person answers the game's questions (by hand).

## Measurements

Nothing to measure: docs only.

## Risks

None for players: docs only. The agent prompt links agents.md on `main`, which has this page only once mod-api is merged.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named).
- [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] 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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2852
## Summary

With **Mouse camera: Native**, walking through a loading zone with forward held swings the camera 45 to 90 degrees after
the load, and further the more the view was turned away from Link as he left
([#1728](#1728); the controller reports there fit too when Native
is on, since it acts without the mouse moving).

The native mouse look (`game_core:📷:mouse`) keeps its own yaw and pitch and puts them back into the player camera
at every update, so the game's follow camera never drifts the view. It starts again from the game's angles only for a
new camera, a stick turn, a camera state other than 3 or 4, or 150 ms without an update. A map change can pass none of
those, so the new map's camera, which the game puts behind Link, was turned back to the angles the mouse held in the map
left: a swing by however far the view stood from Link's facing as he went through.

Now, while a map loads, while its arrival's events play and for 30 updates after them, the camera's angles are the
mouse's start at each update. The mouse still turns them, and the new map's camera stays where the game put it. An event
with no load (Navi's words as Link walks, which this game plays during normal play) leaves the mouse's angles held, so
the follow camera's drift that the hold prevents does not come back.

On `mod-api` ([#2822](#2822)), where the mouse look is the game
side's Rust. Read `MouseLook::settling` in `game/crates/game-core/src/camera/mouse.rs` first.

Fixes #1728

## Testing

**Tested:** On this PC (CachyOS Linux, RTX 3090), on `mod-api` @ aea64d3a.
- In the game, headless, `HOS_MOUSE_NATIVE=1`, from the `market-entrance` save: Link walked out through the Market's
  gate into Hyrule Field, with the player camera's fields read from memory each sample (`HOS_CONTROL_MEM=ro`). Before
  (`mod-api`) and after (this PR) the camera came out behind Link (the view's yaw 0 with his facing 0). After, it
  followed the game for the settle window and was held again after it. No faults in either log.
- What those reads showed, and why this walk does not swing here: the player camera is the same object before and after
  the load. Its yaw (+0x1a4) is kept in the map's own frame: the Market's view at -180 had yaw 0, and Hyrule Field's view
  at 0 had -180. The camera kept updating in state 3 through the departure event. On this PC the camera then missed more
  than 150 ms of updates during the load, which already resets the hold. A load over within 150 ms (a fast PC, as the
  reporter's Ryzen 9 9900) keeps the old map's yaw, which points another way in the new map: the swing. That case is what
  `a_load_seen_only_by_the_map_changing_is_a_new_start` checks, and why the map's name is watched as well as the flag.
- `cargo test -p game-core`: 355 passed. The two new tests (`a_new_maps_camera_is_the_games_not_the_last_maps_mouse`,
  `a_load_seen_only_by_the_map_changing_is_a_new_start`) fail on `mod-api` (the camera held at the mouse's 90 degrees
  instead of the new map's -30 and -180) and pass here. With the fix's `|| settling` taken out they fail again.
- `cargo clippy -p game-core --all-targets` and `cargo fmt --check`: clean.
- `mise run test` (before the rebase onto #2848): 821 passed, 17 failed, 11 skipped. Run one at a time after the
  rebase, the 17 give the same results here as on `mod-api` @ aea64d3a: 14 pass, and `test_lifter.py`,
  `test_present_source_crop.py` and `test_text_keyboard_policy.py` fail on both. None of them reads the mouse look.
- Not tested here: the reporter's case (forward held, the mouse turned at the exit). A headless run gets no mouse
  motion, and this PC's loads leave the camera stale. It is in Still to test.

**Still to test:**
- Windows or Linux, keyboard and mouse, Mouse camera Native: hold W through a loading zone, straight and with the mouse
  turned as you pass, expecting the camera behind Link after the load with no swing (by hand).
- The same with W let go during the transition, and with Disable camera centering on and off, expecting no change from
  `mod-api` (by hand).

## Measurements

Nothing to measure: a fix in the mouse look's decisions; its cost is one flag read and the map's name per player camera update while Mouse camera is Native.

## Risks

- During a load's arrival and for about half a second after it (30 updates), the game's own camera moves (its follow,
  its placement) count, as they do while the stick turns the camera; the mouse still turns the view throughout.
- A load the flag does not show would keep the old behaviour. A revert is enough to undo it.
- Nothing changes for Mouse camera As the stick or Off, saves or `longshot_options.ini`.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named). (3 fail on `mod-api` too, named in 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 fix: a game-free test that fails on `main` and passes here.
- [x] A check under `tests/` that reads changed source is updated, not weakened. (`test_mouse_native.py` and `test_input_movie.py` read it: both pass unchanged)
- [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)

Reviewed-on: #2851
## Summary

[#2745](#2745) (nav.closest) was merged into `mod-api` with three rustfmt diffs, in game/crates/api/src/services/mod.rs (`pub mod nav;` out of order) and game/crates/game-core/src/nav.rs (two places). CI's Rust job runs `cargo fmt --check`, so it fails on `mod-api`, which blocks [#2822](#2822). This is `cargo fmt -p api -p game-core`, nothing else.

## Testing

**Tested:** Linux: `cargo fmt --check -p api -p game-core` reported the three diffs on mod-api (aea64d3a) and passes here.

**Still to test:** None.

## Measurements

Nothing to measure: formatting only.

## Risks

None: formatting only.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named).
- [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] 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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2855
## Summary

The Insert menu's layout used to be written down twice. `game/mods/menu/src/layout.ts` listed every row of every tab in order (200 keys). The system mods' `mod.toml` files also gave 245 rows a `place`, but the menu read a `place` only for a row the layout did not name. So 184 rows had two places, and the one in `mod.toml` was ignored.

Now there is one rule, the same one a player's mod already uses: every row goes where its declaration's `place` says. `layout.ts` keeps only the tabs, the pages, the headings, and the menu's own links and lines, down from about 300 lines to about 100. Each row is laid out by `view.ts` `laidOut`:
- If the place names a row or link (`after` or `before`), the row goes next to it, in that row's section.
- Otherwise it goes at the end of its `section`, or at the end of the tab's untitled top when it names no section.
- Rows at the same spot go by `order`, then in the order they were declared.
- An anchor that is not on the tab is ignored, and so are anchors that loop back on each other.

The layout's links and lines are placed by the same rule.

Every row stays where it was. To get there, 14 place lines changed across the graphics, interface, developer, cheats, controls and damage mods. Layout preset and Button prompts are now placed on the Controls page, which is where they were already drawn.

The settings table in `docs/user/graphics-and-controls.md` listed six rows in a different order from the menu. Those lines now follow the menu's order.

Removed:
- the row lists in `layout.ts` and `view.ts`'s `panelKeys` and `LAID_OUT`;
- `tests/test_system_settings_placed.py`, a Python re-implementation of `laidOut`;
- `game/crates/longshot-game/tests/menu_places.tsv` and the test that read it.

Read first: `game/mods/menu/src/view.ts` (`panelLines`), `game/mods/menu/src/layout.ts`, and `game/mods/menu/test/menu.test.ts` (`PLACED` and the layout tests).

Part of the mod-api cleanup (area 5).

## Testing

**Tested:** On Linux with an RTX 3090:
- **Snapshot.** Before changing anything, I ran the old `laidOut` on the old manifests (the recordings rows included) and the new `laidOut` on the new manifests. Every tab and page matches in order and in each row's section. That snapshot is now `PLACED` in `menu.test.ts`, and the menu's layout tests are held to it.
- **Menu tests.** They pass on the fake game: `cargo test -p modtool the_typescript_system_mods_pass_their_tests`, run through the queue. That covers each tab drawn in `PLACED`'s order and every system mod's place naming a tab, heading and anchor the menu has (these checks used to be in `test_system_settings_placed.py`). It also covers each section keeping a row on every PC, `laidOut`'s rules on rows made up for the test, and the docs table in the menu's order.
- **Other checks:**
  - `cargo test -p longshot-game menu` passes.
  - `cargo clippy -p modtool -p longshot-game --all-targets` is clean.
  - `schema-gen --check` passes.
  - `run_all --exact` passes for `test_menu_ini_keys`, `test_pipeline_share`, `test_audio_volume`, `test_pad_speaker`, `test_upscaler_rows` and `test_menu_i18n`.
- **Full `tests/run_all.py`:** 732 passed and 2 failed, and neither failure is from this change. `test_lifter`'s `cargo fmt --check` trips on `api/services/mod.rs` and `game-core/src/nav.rs` from #2745, which is already on mod-api. `byte_compile_tracked` looks for the deleted Python test because the jj workspace's git index is stale; it passes on a checkout of the commit.
- **Game run.** I ran a headless game from the kokiri-start save through the queue. The Insert menu opened, hosted by `system/menu`, and all seven tabs were stepped through with no script error. The bridge's screenshots show the game picture without the menu, so they say nothing about the rows' order.

**Still to test:**
- Any PC: open the Insert menu and look through every tab and page, expecting the same rows in the same order as on mod-api (by hand).
- Any PC: switch the cheats mod off on the Mods tab, expecting Damage taken to stay on the Debug tab under Input recording (by hand).

## Measurements

Nothing to measure: no game code or rendering changed. The menu's own cost test still passes (see Risks for its tab-switch ceiling). Measured outside the game, `laidOut` for the Graphics tab takes 0.32 ms against 0.50 ms before.

## Risks

- **Rows in a different place.** A place that does not match the old layout would move a row. `PLACED` fails on any such move with all of Longshot's mods on.
- **Optional mods off.** Some rows sit in a slightly different place than before:
  - With the Damage mod off, Mark position goes last on the Debug tab. Before, the old algorithm put it next to Return to mark. With every mod on it is last, as it was, so `order = 120` keeps it there.
  - With the Grass mod off, the shadow rows now stay under Detail. Before, they fell to the end of the tab.
- **Players' mods.** A row whose place gives only `tab`, or names an anchor that is missing, now goes to the end of the tab's untitled top, before its first heading. Before, it went to the end of the tab. The docs already said "the tab's top"; the code now matches them. The mod API is not shipped yet.
- **Cost test.** It now declares every system row, not only the rows the layout named: 58 on the Graphics tab where it was 38. So its tab-switch ceiling goes from 4.5 to 5.5 ms. It measured 4.49 ms with a quiet queue and 5.35 ms while a game ran beside it, which is close to the new ceiling on a busy PC.
- **Translation.** Game queue priority was already untranslated on mod-api, which made the menu's translation test fail. It is now on `UNTRANSLATED`.
- **Reverting.** A revert is enough. Nothing changes in players' files.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [ ] `mise run test` passes (any failure that also fails on `main` is named). (`run_all`: 2 failures, both named above as not from this change.)
- [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.
- [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. (The bridge's screenshots do not include the menu: a by-hand look is in Still to test.)
- [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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2861
## Summary

A mod can now add a **game language**: a new choice on the Game language row (Gameplay tab), beside the game's 16,
with the game's own text translated. The ask came from the USenRT retranslation (an "English (Retranslation)" next to
ordinary English), but nothing here is specific to it.

```toml
[[gameLanguages]]
id   = "en-US-x-retold"     # a language code none of the game's has: what the settings keep
name = "English (Retold)"   # the row's choice
base = "en-US"              # the game's language it is played in
```

The texts are `languages/<id>/<message file>.json`, one JSON object of texts by label (the shape of `longshot/i18n`'s
`strings/<lang>.json`), tags written as `content.text` writes them. No code and no permission.

Chosen, the next start:
- tells the game the base (`host/nn_applet.c` asks the game side, `hos_mod_language`);
- serves the base's text archive with the mod's texts in it: the language folder becomes texts patches made in
  memory, `"replace": true` (a label the game's file lacks is skipped and logged, never added), applied by the
  existing merged-file step and cached in `modcache/`.

Every other language, the base included, stays the game's. The settings keep the id, so an update keeps the choice.
If the mod is off, the game falls back to the id's first part when that is one of the game's (`en-US-x-retold`:
English (US)), else English (US). The setting is kept, so turning the mod back on brings the language back.

**For a launcher:** `Longshot.exe --profile P --output json mod languages` lists the row's choices: the game's 16, then
the languages the profile's mods add. The launcher change that uses it is a separate PR. A launcher that never asks
still shows the 16, as now.

Read first:
- `game/crates/api/src/game_languages.rs`: the list, the code rule, the run's languages;
- `game/crates/api/src/loader/language.rs`: the folder made into patches;
- the `game_init` change in `game/crates/longshot-game/src/lib.rs`: the languages published after the scan, and the
  settings opened after them;
- `host/nn_applet.c`;
- `docs/modding/i18n.md#game-languages`.

## Testing

**Tested:** Linux, RTX 3090, a pack on this PC's shared base, three headless runs from `kokiri-start`, with a local
pack of the USenRT retranslation (2,109 texts in 384 message files; it stays on this PC):
- **The mod's language chosen:**
  - the log shows `oe: language en-US-x-usenrt, a mod's, played in en-US` and the mod's 384 texts patches;
  - the merged `Mals/USen.Product.110.sarc.zs` matches, message by message, the archive the retranslation's own
    repacker builds from the same game files, on 21,137 of 21,138 messages;
  - the one difference is the microphone hint, which Longshot rewords for the PC (the merge starts from that wording,
    as every texts patch does).
- **English (US) chosen, mod on:** `oe: language en-US`; no texts patches applied.
- **The mod's language chosen, mod absent:** `... is not one the game has, nor one a mod on adds: en-US`; the setting
  is left as it is.
- **Checks:** `cargo test` for content, api, modtool, longshot-game and build-driver; clippy and fmt; schema
  regenerated; `tests/test_game_language.py`, with new cases for a mod's language, its fallback, `HOS_LANGUAGE` and the
  renderer's Auto. `nn_applet.c` syntax-checks with llvm-mingw and Linux clang.

**Still to test:**
- Any PC: open the Insert menu with the language chosen, expecting the Game language row to show its name. The control
  bridge's `option get game_language` reads 0 here for every language, a stock `ja` too, so it couldn't settle this
  (by hand).
- Windows: one start with a mod's language chosen, expecting the same log lines (`@Beanstalk`).
- A dialogue the retranslation changes, read in game (by hand).

## Measurements

Nothing to measure for a player without a mod's language: no new work runs. With one chosen, the cost is the
merged-file step's existing work for one text archive (about 2.4 MB) at the first start, then the cached file. Not
timed here.

## Risks

- **Mod-api only:** the manifest field, `"replace"` on texts patches and `mod languages` are new API, so nothing
  shipped changes.
- **Settings order:** the settings are opened slightly later in `game_init` (after the mod scan, still before the
  renderer loads). The host reads its language line from its own early copy, so it's unaffected.
- **A launcher with its own fixed list** shows a mod language's id rather than its name until it asks `mod languages`.
- **To undo:** a revert is enough.

## Checklist

### Ready for review

- [ ] One topic, on current `main`; the title is a Conventional Commit. (On `mod-api`, where the mod API lives.)
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [ ] `mise run test` passes (any failure that also fails on `main` is named). (Only the touched crates' tests and
      `test_game_language.py` ran.)
- [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.
- [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux built; Windows syntax-checked only.)
- [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_016o1k1QvyUwMcv8kvCNXuco
Reviewed-on: #2881
## Summary

The Insert menu's rows moved to the system mods' `mod.toml` and the TS menu mod, but the renderer and the host still carried the old C++ menu: `#ifndef MENU_LAYOUT_ONLY` guards around code that always built (the macro is defined nowhere), empty and write-only modules, 32 `Options` fields only an applier wrote, helpers only the old rows called, option ids nothing answers, `HOS_SETTING`'s ignored id, `MkwVkHost` slots no renderer code calls, and `host->version` gates that can never be false. This deletes them (area 1 of the mod-api cleanup survey, 1a and 1b together). It changes no behaviour except one bug:

- **Fix: the `-` and `=` keys did nothing.** They called `rx_option_set(7, …)`, which only moved the renderer's `opts.mouse_sens` (read by nothing); at the next read `host/nn_hid.c` took the game's value back. They now set `system/controls`' `mouse_sensitivity` through `game_setting_set`, as the flight shortcut does, rounded to the setting's steps of 10 (the game refuses a value off them). A press not at the end moves at least one step (at 10 %, `=` gives 20 %, where 125 % would round back to 10 %). On `main`/mod-api: in play with the mouse captured, press `=`; Controls' Mouse sensitivity stays at 100.

What went, by area:
- `gpu/vk/menu/`: the guards; `camera`, `motion`, `controller_speaker`, `volume`, `headset`, `autosave`, `detail`.cpp; the write-only appliers in `menu_settings`, `controller`, `gpu`, `gameplay`, `threads`, `audio`; `apply_preset`/`apply_auto`; `output.cpp`'s walkers; `Dlss5Preset`.
- Helpers: `upscaler_rows.h`'s steppers and fixed-stop block, `framegen_rows.h` down to `fixed_top`, `vk_menu_hit.h` down to what the ReShade bar uses, `vk_ui_theme.h`'s prompts, banner, paragraphs, shadows and unused palette, `i18n::plural`, `fmt_into`, the transition autosave's dead copy, `resolution_auto`, `mods_now_ns`, `kMicLevelHelp`, `env_release`; `hos_reset_binding`, `host_guest_alloc`.
- `HOS_SETTING(field, otherwise)` (49 call sites); every option id but the jitter's and the host's four notices; `game/options.h`.
- `MkwVkHost`: `tex_layout`, `guest_alloc`, `gyro_status`, `nfc_dir`, `reset_binding`, `rebind_control`, `binding_is_default`, `game_settings_generation`, `game_setting_text`, `game_setting_hint` (`MKWVK_API_VERSION` 82); `vk_host` filled with designated initialisers (every member maps to the function it did); the game's exports only those named (`game_settings_generation`, `game_setting_hint`, `game_camera_scale`, `game_movie_age`).
- The `host->version >= N` gates: the renderer takes a host of its own version only (`vk_main.cpp` `init_body`), as architecture.md already said.
- Website: the settings table's restart wording for Upscaler and Frame generation by matches their declarations (they change at once; only with Streamline running DLSS FG does a change wait for the next start); Volume and the Simulated turf link have help. The settings page reads the mods' declarations and the menu mod's own layout (`view.ts` `laidOut`) instead of parsing C++ rows that no longer exist.
- Docs: architecture.md's Insert menu part and AGENTS.md's menu rule describe settings declared in system mods.

Kept, being live: `hos_rebind_control`, `hos_binding_is_default`, `hos_sdl_gyro_status`, `hos_nfc_dir`, `hos_guest_word` (the game's Rust calls them); `game_setting_text`/`_row`/`_get`/`_set` (host and renderer); `upscaler_rows.h`'s step tables (`snap`, Auto's tuning); `Map`/`Hit` for the ReShade comparison bar; `aspect_started`; `kTierResolution`.

Read first: `host/nn_hid.c` `mouse_sens_set`, `host/game_settings.h`, `gpu/vk/vk_api.h`'s ids, `host/rx_backend.c` `vk_host`, `tests/area_settings.py`, `tests/vk_host_members.py`.

See #2822.

## Testing

**Tested:** in the game on this PC (Linux, RTX 3090), a pack and runtime of this branch on cb37f5ab (rebased since onto 12f42db5, #2861: the conflicts were docs, `layout.ts` and a website test's expected order, no C/C++), under gamescope: reached play from kokiri-start; the control bridge read `mouse_sensitivity` 100, after `=` 130, after `-` `-` 80 (`option get`); Insert opened the menu on Graphics (`menu_open: true`, hosted `system/menu`). Game-free: `tests/run_all.py` 834 passed, 3 failed; `test_lifter.py` fails on mod-api@origin too, `test_drs.py` and `test_stick_inversion_rest.py` were this branch's and are fixed (re-run through the queue: all three pass). `cargo test`/`clippy -D warnings`/`fmt --check` on `longshot-game`: pass. Windows: renderer `dev compile --only renderer` with llvm-mingw: pass; host C with llvm-mingw: 79 of 80 units, `host/nn_video.c` failing on `libavcodec/avcodec.h` not found (FFmpeg not on this PC's Windows tools; the file is untouched). `tests/test_mouse_settings.py` runs `mouse_sens_keys` over a stand-in game that refuses off-step values: it fails on mod-api@origin ("- and = hand the sensitivity to the renderer…") and on each mutation (off the steps, 70 % for `-`, another key, the call removed). Its ends case (10 % `=` gives 20 %, 20 % `-` gives 10 %) fails at 95dcd124 and passes at 433d3b2b, with gcc and clang (`--cc` now defaults from `CC`); `host/nn_hid.c` at 433d3b2b passes `-fsyntax-only` with llvm-mingw and gcc. Every rewritten check was run against its mutation. Website (after the rebase): `node --test` 97 pass, 1 fail (`publication.test.ts`, a fixture unrelated to this); `astro build` passes; `check-site.ts` passes (the Debug tab's ammunition lines reworded to name no game items).

**Still to test:**
- Windows: the game starts, the menu opens and `=`/`-` change Mouse sensitivity (`@Beanstalk` smoke on Windows NVIDIA).

## Measurements

Nothing to measure: deletions, and a fix shown by its test above.

## Risks

A renderer and host from different commits no longer start together (82), as before for any layout change. Input recordings name settings by the declarations' `legacyId`s, which this does not touch (`test_option_ids.py` now holds them distinct). Players notice only that `-` and `=` work, in steps of 10 %. A revert is enough.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named): `test_lifter.py` fails on mod-api@origin too.
- [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 fix: a game-free test that fails on `main` and passes here.
- [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. (Windows host: every unit compiles at this head with the pinned FFmpeg 9.0.2 headers from tools.lock, queue job ffm-hostwin2)
- [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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2877
## Summary

The players' mods page, `docs/user/using-mods.md`, still said "Nothing downloads or unpacks mods for you", and it
only described emulator-style folders put in `mods/` by hand. Players can now add sources (a git repository, a signed
`longshot-repo.json`, an `.lsmod` URL) in the launcher or with `Longshot.exe mod source add`, and install, update, pin
and remove mods from them. The page now covers both ways to get mods:
- **from a source**: the launcher's Mods > Repositories / Discover, or `mod source add`, `search`, `install`,
  `update`, `pin`, `remove`. It also covers repo keys, the store and `mod gc`;
- **a mod of your own**: an `.lsmod` or `.zip`, a Longshot mod's folder or an emulator mod, put in the profile's
  `mods/` or copied in with `mod add` / `mod import`.

What it said about file mods (romfs/exefs, the Mods tab, the order, the size table, the log) is kept.

The README that `mod init` writes ended with "`mod pack` makes its `.lsmod`". It now says how to share the mod, as
getting-started.md's step 9 does: push to git and tag each version, `mod publish` for a repo, `mod pack` for one
file. Its test checks this text.

`docs/modding/template/AGENTS.md`, `CLAUDE.md` and `README.md` were stale and read by nothing (`mod init` writes its
own README; the builder only hashes the folder). They are removed. api-schema.md's list of the template's files now
includes `.gitignore`.

Read first: `docs/user/using-mods.md`, then `game/crates/modtool/src/cmd/init.rs`.

**`mod init --test`** (second commit). `mod init` still writes no test; `--test` also writes `test/main.test.ts`, from `docs/modding/template/test/main.test.ts` (kept), which `mod test` passes as written. Help, tools.md, agents.md, testing.md, getting-started.md step 6 and api-schema.md say so.

## Testing

**Tested:** Linux. No game run: docs, plus a string the builder's `mod init` writes.
- `cargo test -p modtool --lib cmd::init` (through the job queue): 2 passed
- `python3 -I tests/run_all.py --exact tests/test_doc_anchors.py tests/test_check_pr_description.py tests/test_dev_check.py`: 3 passed
- `pre-commit run --files` on the changed files: passed
- A fresh reviewer checked every claim against modtool (USAGE, service.rs, sources.rs), mod-store and the launcher's
  labels. Its three wording fixes are in.

- Review fixes (a0b07a96): the source example adds with `--yes` before searching; `pin` says it installs the version.
- `tests/run_all.py`, the whole suite, once through the job queue on a0b07a96: 734 passed, 1 failed, 114 skipped: the only failure, `tests/test_lifter.py` (build-core's `control::tests::the_socket_is_made_private_and_a_client_handed_over`, control.rs:428), fails the same way on mod-api @ 12f42db5.

**Still to test:**
- None

- `cargo test -p modtool --lib cmd::init` (through the job queue) on the second commit: 3 passed, including the new `init_test_writes_a_starter_test_that_mod_test_passes` (runs `init --test` then `mod test`: 2 passed) and plain init writing no `test/`.

## Measurements

Nothing to measure: docs and an opt-in `mod init` flag; nothing the game runs changed.

## Risks

Nothing a player notices except the new README text in a mod made with `mod init`. If the launcher's Mods page labels
change, the page's names for them (Mods, Repositories, Discover, Add mods) will need updating.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, as Testing says (no game run needed).
- [x] `mise run test` passes (any failure that also fails on `main` is named). (`tests/test_lifter.py`: build-core's socket hand-over test, failing on mod-api @ 12f42db5 too.)
- [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 (init's test checks the README).
- [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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2868
## Summary

The development builds had two incremental build systems. The Rust builder is incremental by content: its object
store, the lifts by key, the game's Rust by key, and a shared shader cache. Over it, `scripts/devtools/packs.py`
(1,328 lines) and `build.py` kept a second one: a base, packs made of the files that differ from it, and runtimes
assembled from both. To do that, the Python guessed at the builder's insides:
- the link lists, the sources that carry the version, and which paths reach a link;
- `kProgramCacheFormat`, read with a regex;
- the renderer's cache file names, kept as a copied list.

`shadercache.py` was a second shared shader cache, with a key of its own. On mod-api nearly every change reaches the
game's Rust, so a pack was the whole module anyway.

This replaces both with one builder command and keeps only the policy in Python.

- **`longshot-builder dev runtime <dir>`** (new, `build-driver/src/dev_runtime.rs`) has four modes:
  - **With `--game` (a build):** it is `dev build`. Every file whose bytes are the base's (`--base`) is a hard link of
    the base's file. The install still stages each file and renames it in, so nothing ever writes through a link.
  - **Without `--game` (a copy):** a copy of the base. The builder's files are linked, the rest cloned, and the play
    state is left out. It is refreshed in place, and the runtime's settings and env file are kept.
  - **`--prepare-only`:** the shaders prepared, only when the caches it has are not known to be this translator's,
    program-cache format's and shader list's.
  - **`--give-back`:** what a run added to the runtime's caches goes into the base and the PC's shared cache.
- **The caches:**
  - Seeded as copy-on-write clones from the base and from the builder's own shared shader cache
    (`<cache>/shaders/<translator>f<format>/<drivers>/`).
  - Shared by name from an allowlist, checked against the renderer's source by a test, never its per-folder fault list
    or play markers.
  - Recorded per folder (`cache/longshot_runtime_caches.txt`).
  - Published back only when a preparation got to its end, never shrinking a file, under the renderer's locks.
- **The build** writes `program_cache_format=` into `longshot_version.txt`.
- **`longshot-builder info`** lists a new capability, `dev_runtime`.
- **`dev.py`:**
  - `rt`: this checkout over the nearest base, in its own warm work folder. Two queue jobs under the base's lock: the
    build (`build` mode), then `--prepare-only` (`shared` mode, the GPU).
  - `pack` is gone, folded into `rt`.
  - `rt --empty` is a copy of the base.
  - `ab` keeps a runtime that is current.
  - `check`'s builds and its cache harvest use the same steps.
- **`dev.py packs base|pack|rt|warm`** keep the Test Farm's command lines and files:
  - `base.json` (`commit`, `game_source`, `upscalers`);
  - `pack.json` (`generated`, `deleted`);
  - `dev_packs.busy`, and the work folders' `build_times.json`.

  A pack is now a game folder of its own over the base. `packs base` still refuses a tree with uncommitted sources.
- **`dev.py builder -- ARGS`** replaces `packs run`; `mise run build` and `build-dev` run it. `packs head`, which
  nothing ran, is gone.
- **New `dev.py smoke`:** one headless queue run of a runtime. It plays from a save, presents 900 frames, opens the
  Insert menu, takes a screenshot and checks the log, then says PASS or FAIL. Every agent here kept its own script for
  this.
- **New `dev.py disk [--prune]`:** what the development data uses on the disk, and what is safe to remove: never a
  store, never a runtime a process uses. It replaces `dev.py bases --prune`.
- **New `dev.py tools`**, which `mise run tools` now runs: tools.lock's build tools installed once in the PC's shared
  tools-store, with the checkout's `tools/` a link to them. Before, every checkout unpacked its own.
- **Removed:** `shadercache.py` and its test, and about 700 lines of packs.py. packs.py went from 1,328 lines to 629.

Read first:
- `builder/crates/build-driver/src/dev_runtime.rs`;
- `folder::install`'s `base` argument;
- `scripts/devtools/packs.py`;
- `build.py`'s `cmd_rt`;
- docs/dev/reference/build.md, "A runtime for development".

## Testing

**Tested:** Linux (CachyOS), RTX 3090.
- **One build job:**
  - this branch's builder compiled;
  - `tests/run_all.py`;
  - the old flow (mod-api's `dev.py pack --own-work` + `rt`) against the new (`dev.py rt`): a first build, a small C
    change (`host/hos_main.c`) and a small Rust change (`game/crates/longshot-game/src/cheats.rs`), over the shared
    base 462919343e, with the same builder program.

  In the new flow, 46 of the runtime's 54 files were hard links of the base's. A C change then put 2 files in and kept
  52, and a Rust change put 1 file in.
- **Then one shared job:**
  - `dev runtime --prepare-only` prepared the new runtime in 97 s and published 7 cache files into the shared cache;
  - `dev.py smoke` on it: **PASS**. In play from kokiri-start, 900 frames, the Insert menu opened with its page, no
    FATAL line.
- **Checks:**
  - `cargo test -p build-driver -p longshot-builder` passes (queue);
  - clippy `-D warnings` is clean;
  - `cargo fmt -p` is clean for both crates.
- **`tests/run_all.py`:**
  - 734 passed, 2 failed, 114 skipped.
  - `test_lifter.py` fails on `cargo fmt --all --check` of `game/crates/api/src/services/mod.rs` and
    `game/crates/game-core/src/nav.rs`. Those are mod-api's own (#2745), not touched here, and they fail on mod-api too.
  - `test_dev_packs.py` failed because the job's `LONGSHOT_BUILD` leaked into one test. That is fixed here, and the
    test passes with `LONGSHOT_BUILD` set.
- **The light checks:** test_dev_packs, build, ab, check, disk, smoke, game_tests, update, migrate, mise_build,
  job_queue, doc_commands and doc_anchors pass; pre-commit is clean on every changed file.
- **The review's fixes (2d99edab..2006d19c)**, one build job: `cargo fmt --check` and clippy `-D warnings` of
  build-core and build-driver clean; `cargo test` of `dev_runtime` 11 passed (new: a unit taken whole and never to shrink
  a cache, a give-back skipping a unit a running game holds); test_dev_smoke, test_dev_disk, test_dev_packs,
  test_doc_anchors and test_doc_commands pass.
- No host, renderer or other C/C++ file changed, so no llvm-mingw compile was needed.

**Still to test:**
- **Test Farm** (it runs main's `packs.py`): a run on this branch once it has a base. Expecting `packs base`, `pack pr`
  and `rt` to work as before, with `base.json` and `pack.json` read as before (`@Beanstalk` after the Farm's changes
  in Risks).
- **Windows** (`dev.py rt`, `rt --empty`): expecting the hard links, the CoW-or-copy clones and `dev.py tools`'
  junction to work (by hand).
- **This PC** (`dev.py disk`): a real dry run over the development folder. Expecting a listing with sizes and nothing
  removed (by hand).
- **Any GPU** (`dev.py packs warm` and `dev.py check`): expecting `--give-back` to copy grown caches back (by hand).

## Measurements

**Verdict:** the tools' own cost per change went from minutes to seconds. A runtime takes no disk beyond its own
files, and the old flow's 1.5 GB per checkout is gone.

Setup:
- this PC; one queue build job;
- the same builder program on both sides, `LONGSHOT_NO_PREPARE=1`;
- each side run in its own new checkout over the same base;
- each step's wall time, from its log's timestamps;
- disk as btrfs exclusive bytes (`btrfs filesystem du`).

| | Before: mod-api @ cb37f5ab (`dev.py pack --own-work` + `rt`) | After: this PR @ dbc97d8b (`dev.py rt`) |
|---|---|---|
| First build in a new checkout | 211 s for the pack (the change over the base), plus rt | 27 s |
| Small C change | 118 s (pack 32 s, then rt about 86 s) | 8 s |
| Small Rust change | 94 s (pack 40 s, then rt about 54 s) | 9 s |
| Disk of the change's own folders | 1,534 MB (pack-work.d 1,378, rt 156, the pack 0) | 1,151 MB (the work folder; the runtime 0) |

**Caveat:** the new side ran second. It took the objects and the game's Rust for the very same edits from the shared
store, which the old side had just compiled; the old pack's compile was its "done in" (0 to 1 min). So the
like-for-like number is the tooling's cost outside the compile: old rt about 54 to 86 s plus pack overhead, against new
about 8 s in all. A second run with distinct edits per side was not made, to keep to one queue job.

**Switches:** no new switch. `LONGSHOT_JOBS` (the builder's compilers at once) is not changed here and ships at its
default, unset: one compiler per CPU thread but one, so the PC stays usable while it builds (the launcher's Automatic
does the same). `LONGSHOT_BUILD` (a ready-made `longshot-builder` for dev.py, already on mod-api) is a development
tool's variable, unset by default: each step uses the tree's own builder. Neither is read by the renderer or the host,
so neither has a `gpu/vk/switches.def` row.

**The review's fixes (2d99edab..2006d19c)** change no timing: give-back and publish choose and lock differently, smoke and disk
judge differently. Nothing there to measure.

## Risks

- **The Test Farm, which must change three things:**
  1. It starts `<runtime>/longshot` directly. On mod-api the game is `longshot-game`, and only the builder starts it.
  2. Main's `packs.py` will need each side's builder to have `dev runtime`. A PR builder from before it exits 2 with
     "older than this dev.py". Check for `dev_runtime` in `longshot-builder info`'s `capabilities.builder`, and use an
     older tree's `packs.py` for such a builder.
  3. A pack is now a whole game folder, `packs/<name>/game`, whose unchanged files are hard links of the base's; there
     are no loose files over the base any more. `pack.json`'s `generated` and `deleted` are always empty.
- **Existing runtimes and bases on this PC keep working** (copy and build mode accept folders the old Python made).
  But they hold no `program_cache_format=` line and no caches note, so:
  - each runtime prepares once, incrementally over its caches, after this lands;
  - an old base gives its runtimes no caches until it is built again with this builder.
- **Removed commands:** `dev.py pack`, `packs run` (now `dev.py builder`), `packs head` and `bases --prune` (now
  `dev.py disk --prune`). Scripts calling them get an argparse error.
- **`dev.py ab`'s "current" check** does not notice a change to `tools.lock` or the build tools alone.
- **Players:** the only player-visible change is the build's new `program_cache_format=` line in
  `longshot_version.txt`. A revert is enough.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named). Run as `tests/run_all.py`; its one
  failure, `test_lifter`'s `cargo fmt --all --check` of `game/crates/api/src/services/mod.rs` and
  `game/crates/game-core/src/nav.rs`, is mod-api's own (#2745) and fails there too, as Testing says.
- [x] Measured against `main`, or Measurements says why there is nothing to measure (against `mod-api`, this PR's
  base).
- [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] Docs updated.
- [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2869
## Summary

Switching to a tab of the Insert menu with many rows did all its reading at once. The first frame read the tab's declarations and laid them out. The next frame read every row's state and also drew the first rows. That second frame was the heaviest of the switch. With every system row in the menu (#2861: the Graphics tab has 58), it went over the menu's 4.5 ms budget in the debug cost test.

This change does three things:
- **Keeps each page's layout.** The menu keeps each page's declarations, laid out, until their generation moves on: a mod starts or stops, the language changes, or the renderer's lists change. A tab shown again reads nothing to lay itself out.
- **Reads the rows earlier on a page shown again.** Its rows are read in the frame that takes its kept declarations, the frame before it is drawn, so its first drawing frame reads only the rows that changed since. A page's first showing reads as before: declarations in one frame, rows with its first drawing, never both reads in one frame (putting both in one frame made the debug first showing 5.7 ms).
- **Fixes the generation.** It only counted each row's key, label and kind. Now it counts every field the menu gets from a declaration (help, kind and choices, place, flags, native use, a slider's unit, display scale and default). So a mod declared again with other choices or another place is read again. This change was needed for the kept layouts to be safe.

`laidOut` also builds the menu's own lines more cheaply: one shared flags object, and no set to follow an anchor's chain.

Profiling (stack samples of `mod test` on the release fake game) showed where a switch's time goes. Per frame, it is about 24 components drawn and their commit. The rest was the reads: about 0.2 ms to read the rows and 0.3 ms for the declarations and their layout, all landing on the switch's first drawing frame. With the reads moved, the heaviest frame is now an ordinary drawing frame.

Files to read: `game/mods/menu/src/main.tsx` (`declsOf`, the `laid` read in `Menu`), `game/crates/api/src/services/settings_host.rs` (`generation_of`), `game/mods/menu/test/menu.test.ts` (the cost test and the new reads test).

## Testing

**Tested:** Linux, RTX 3090.
- **Queue jobs:**
  - `cargo test -p modtool the_typescript_system_mods_pass_their_tests` (debug) passes, every menu test included.
  - `cargo test -p api settings_host` and `cargo clippy -p api` pass.
  - `dev.py pack` and `dev.py rt` pass.
- **Smoke run, headless (shared queue):** kokiri-start, then Insert, then all seven tabs stepped through. Status showed `menu_open`, hosted by `system/menu`, and the log has no script error. One 3.7 ms warning for the menu's first open came while the PC was paging. The bridge's screenshots do not include the menu.

- **New test:** "a page switched to again reads no declarations until they change; its rows are read with them". It fails on #2861: the rows were read a frame after the declarations.
- **Cost test, made stricter:** a tab shown again is held to `SWITCH_MS` 4.5 ms again, with every system row. A tab's first showing is timed apart, under `FIRST_MS` 5.5 ms (the switch's ceiling in #2861). For it, the rows are declared again with a label changed, which gives a new generation, and the test asserts that the declarations were read again.
- **Generation test:** `a_row_declared_again_with_another_format_or_default_moves_the_generation_on` (`cargo test -p api`): another unit, display scale or default each move the generation on (review L1).
- **Revisit test, frame by frame:** the Audio tab shown again has its rows read in a frame before the one that first draws it, and none in that frame (review L2).
- **Queue job on 656c1a57:** `cargo test -p modtool` (228 passed), `cargo test -p api --lib` (452 passed), clippy `-D warnings` and rustfmt pass.
- **Release fake game:** all 34 menu tests pass on `mod test` (release builder).

**Still to test:**
- Any PC: open the Insert menu, switch between tabs, and open and close the pages. Expect every row drawn as before and the switch a little quicker (by hand).
- Any PC: change the menu's language, then switch tabs. Expect every label in the new language (by hand).

## Measurements

**Verdict:** in the debug test, a tab shown again now costs 1.61 ms in its heaviest frame, against 4.49 ms before. A tab's first showing is as before.

Setup: Linux, RTX 3090; the menu's cost test (`LONGSHOT_COST_REPORT=1`), its heaviest frame of script CPU while a tab or page is switched to, the least of 5 samples (#2861: every switch read the declarations again; here, a tab shown again). Each side is the least of 5 samples in one job, the two sides from separate jobs, not interleaved. 656c1a57 after it changes only the generation's hash (once per declarations' list, not per frame) and the tests, so the numbers hold for the head.

| | Before: mod-api @ 12f42db5 | After: this PR @ 1dcf4b82 |
|---|---|---|
| Graphics switch, debug `cargo test -p modtool` (the test's ceiling) | 4.49 ms (#2861's job; 5.35 under load) | 1.61 ms (shown again; first showing under 5.5, asserted) |

## Risks

- **A stale layout.** A kept page's declarations would go stale if they changed without the generation moving on. The generation now covers every field a declaration gives the menu, and the menu's language and the renderer's lists already moved it. A revert is enough to undo this.
- **More re-reads.** A mod restarted or declared again with other help or choices now moves the generation, so the menu reads every page again. That happens rarely: when a mod starts or stops.
- **The rows read a frame earlier.** The page shown is still the one before until the next frame, as it was.
- **Nothing for players to notice** apart from the speed. Their files and saves are unchanged.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named). On 656c1a57: 836 passed, 1 failed: `tests/test_lifter.py` (the builder's `control::tests::the_socket_is_made_private_and_a_client_handed_over`), code this PR does not touch; mod-api's own CI fails run_all at 12f42db5.
- [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] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.

### Ready to merge

- [ ] Everything in Still to test has run, its results in Tested.
- [ ] 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_016o1k1SQVyAWsujjFVd8Wuc
Reviewed-on: #2874
What fires settingsHost.changed, what an idle open menu still costs, which Insert menu rows are settings and where
they come from; stale references to the old menu's code removed. Reviewed in #2888, rebased onto mod-api 1f49aeec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The renderer reads settings only from the game's snapshot and reports facts; the screen's shape is known before the first settings read (Windows and Linux), device ids reach the host whole or not at all, and the game language is chosen once under a lock (MkwVkHost.game_language, MKWVK API 83). Reviewed in #2882.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
145 choice switches become hidden settings in five system mods (renderer, memory, thread, upscaling, host settings); their old switches still set them, LONGSHOT_SET and --set win. switches.def's SETTING rows, checked against the mods. Reviewed in #2894.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
HOS_FRAME_COST=1 counts the frame's cost and the acquire phase's CPU time (MKWVK API 84); the acquire phase's per-frame scans cut; a lone function handler on the plain trampoline is counted in its site's readers, so its removal waits for it. Reviewed in #2880.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
game.h is generated by cbindgen from longshot-game's exports and ffi.rs from host/game_host.h by ffi-gen; both --checked in CI with schema-gen. Reviewed in #2896.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Rows' hints and states are hintWhen/textWhen/lockedWhen/... data in the area mods' mod.toml (renderer_lines.rs and game_state removed); the settings service pushes rowsChanged with the rows that changed, only to the mods that read them (no polling); longshot/ui gains useSyncExternalStore and longshot/settings-host/store gives useRow/useDecls/useRows/useStatus; the Insert menu is plain components on it, split into files, its hand-made caches gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The builder is the only entrypoint, sandbox and broker: restarts, the environment, the control bridge (one command set), crash records and bug reports, log redaction, the Linux files service, the player's folders as the builder's roots, the Steam Deck's sensors and the Switch 2 Pro controller with its NFC reader, one start message (MKWVK API 85). Reviewed in #2898.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
## Summary

Finding a new hook site meant reading lifted code by hand. This adds three development-only tools that take a behaviour
of the game to the function and instruction a site goes on, and a page on how to use them
(docs/dev/reference/reverse-engineering.md, with a worked synthetic example and how the site's signature or
fingerprint is then written):

- **A code index.** `longshot-builder dev facts` writes what the lift's own discovery knows of each function (calls past
  PLT stubs, virtual-call slots, string and data references, constants and floats, function pointers and vtables,
  exports, guest stores), and `dev disasm` decodes a range. `scripts/re.py index` loads the facts into SQLite under
  `~/.cache/longshot-dev/re`. It then answers callers/callees, xrefs, strings, const, float, vtable, vslot, vcalls,
  path, dis and ir queries, as text or `--json`.
- **A function-hit trace.** The guest profile's instrumented build counts the functions. The control bridge's new
  `trace` command marks a window; `re.py trace diff` lists the functions that ran in one window and not in another.
- **A write-watch.** With `LONGSHOT_WATCH_STORES=1`, the lift tests every guest store against a watched range. The
  bridge's new `watch` command sets the range and writes what hit it: each writing function and instruction, the
  values and the frames. `watch` needs `HOS_CONTROL_MEM`.
- `dev.py rt --re` builds both into `build-linux/rt-<checkout>-re`, from a work folder of its own.

Read first: `builder/crates/llvm/src/lib.rs` (`watch`), `host/re_watch.c`, `host/control.c` (`cmd_re`),
`builder/crates/longshot-builder/src/dev/facts.rs`, `scripts/re.py`.

Everything the tools make (the index, the traces, the watches) is made from the game and stays on the PC, under
`~/.cache/longshot-dev/re`. Nothing of it is in this PR; the tests use synthetic images, facts and windows.

## Testing

**Tested:** Linux, RTX 3090. Tested in game: the index on the real game (built from this PC's game, every query
answered). In one shared run of the `--re` runtime, the trace windows diffed (walking against idle, rolling
against walking, each naming the functions only in the second), and a write-watch on the player's position named one
writer with its three stores, a hit every frame while he walked; 12 more watches on other objects named their writers.
The game-free parts of trace and watch are also covered by the tests below.

Checks, in one build-mode job (retools-check), all pass:
- `dev.py rt`: the normal runtime builds over the base.
- `scripts/check_host_compile.py`: 82 host units, 0 failed.
- `cargo test` and `cargo clippy -D warnings` for llvm and longshot-builder. llvm has a new watch-IR test, compiled by
  clang; with the option off, nothing of it is emitted.
- `run_all --exact`: test_re, test_re_dev, test_control (the control and re_dev C tests, and control.c's llvm-mingw
  compile), test_doc_commands, test_doc_anchors.
- `host/re_watch.c` and `host/guest_profile.c` compiled with llvm-mingw (`-Wall -Wextra -Werror`).

Earlier, outside the queue: `cargo test -p lift`, `-p build-driver`, test_guest_profile_write, test_switch_table,
pre-commit.

**Still to test:**
- This PC (Linux, RTX 3090): `dev.py rt --re`, then two trace windows and a watch of a known field, expecting a short
  diff and the field's writers named (by hand, in the first site-finding session).

## Measurements

Nothing to measure: with the switch off the lifted IR is unchanged (a test checks it), so normal builds and fps are unchanged; the `-re` build is development only. Every lift cache is rebuilt once, as with any change to the lifter's sources.

## Risks

Development only. `LONGSHOT_WATCH_STORES` is off unless set to `1`, and `trace` and `watch` answer `unavailable` in a
normal build. A revert is enough. Players notice nothing, apart from the lift rebuilding once after the update.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [ ] `mise run test` passes (any failure that also fails on `main` is named). (the tests that read the changed files pass in retools-check; the whole suite is not run)
- [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] 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_016o1k1SQVyAWsujjFVd8Wuc

Reviewed-on: #2924
The missing mod APIs that need no new hook site (docs: Longshot-notes/missing-mod-apis-plan.md, the non-RE split).

- camera: a rig's `roll` (setRoll, angles().roll), turned where the view site writes an override's matrix, and an
  off-centre `lens` ({ zoom, x, y } or { tile: { grid, col, row } }, setLens), put on the gameplay projection's rows in
  the registers at the jitter sites, before the jitter, so the game culls with its whole view; its window is kept
  inside the picture. Features camera.override.roll and .lens (Preview). The fake game's view shows both.
- gfx.screenshot({ name? }) (new permission gfx.capture, low): the next frame shown, at the picture's own size, as a
  PNG under <user>/screenshots/<publisher>/<name>/, the Promise settling with its path. Renderer: shot_full
  (MKWVK 86) on the control bridge's shot path, sized per shot, a .part of its own; host: hos_mod_screenshot and a
  ticket ring.
- gfx.effect({ ..., inputs: ["depth"] }) at beforeUpscale: the scene's depth at binding 1, at render size, moved to
  read-only as the upscalers sample it, and a renderer-filled depthModel param with linearDepth in the template
  (gpu/vk/fx_depth.h, vk_effects.cpp, vk_temporal.cpp; GAME_OUT_FROM_DEPTH, GAME_FILL_DEPTH_MODEL). Preview.
- items: each grant belongs to the save slot it was asked in and is given only there; slots deleted, made anew or
  copied hand their grants on; an older journal's keys are known in every slot; nothing is given between a reload
  and storage seeing its slot.
- stats.modTime() (no permission) and stats.mods() (mods.inspect): each mod's script time, as the inspector shows it.
- actors.spawn: 64 a mod, 32 asked in 60 frames, 128 for all mods.
- builder: the user folder's screenshots/ is one the game writes (USER_SUBDIRS), so gfx.screenshot works in the sandbox.
- audio: a game run showed the game's music has no sub mix of its own (every voice goes through splitters into the
  master's input mix); recorded in docs/dev/reference/mods-audio.md, setGroupVolume/duck stay absent.
- Examples: photo-mode rolls, shoots and takes 2 x 2 tiles; a colour-filter kit over gfx.outputEffect.
- Docs: camera (tiled photos), gfx (screenshots, the scene's depth, a colour filter), the sandbox's folders, actors (re-attaching after a load
  or a map change), items, system-mods, the dev references; generated reference, permissions, scripting, .d.ts,
  game.h, ffi.rs and the served mod schema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
- builder: the sandbox reads the test mode's folder (--mod-tests, else HOS_MOD_TESTS): the game names its mods in
  LONGSHOT_DEV_MODS only once started, after the plan, so dev.py game-tests found no mod since #2898; and writes
  its results' folder (HOS_MOD_TESTS_OUT, SWITCH_DIRS), where it wrote no results.json.
- runner: game.press/hold take a PadButton or a replay's name, any case; another throws at the call (a name the
  sealed pad draft lacked threw "object is not extensible" in the filter every frame).
- runner: a mod's tests hold the mod's grants, as they change, no more; the setup API holds the runner's own beside
  them for its calls alone (native.setup), and what it subscribed to is delivered with them (Perms::runner_of,
  delivers). A pad filter has the controller read by itself.
- gfx.effect, outputEffect, programs.afterDraw: a shader's compile is work no budget counts (CallHost::uncounted);
  a call's time, the frame's and its cost leave out every such compile (TypeScript's too).
- menu: a binding row's Reset resets that control in the host (hos_binding_reset) and its Toggle, instead of a press
  the renderer does not have (unknown_row).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The rebase of mod-api onto main left these out of the stack, since each needs a system mod-api made. Here they are
in that form, with no old one carried:

- #2903, the occlusion heightfield rasterizer and Hi-Z pyramid on host code: the new crate game/crates/occ-raster
  (AVX2 + FMA at run time, a scalar path otherwise), hooked as the cloth is (occ.raster, occ.rasterEnd); kill switch
  HOS_NATIVE_OCC_RASTER (on, 0, check). Rust tests against main's reference model, both paths.
- #2902, the unmapped descriptor and event pools CPU_NO_ACCESS: sites pool.descFlags and pool.eventFlags, Rust
  callbacks in game-core's engine; kill switch HOS_POOL_FLAGS_SITES.
- #2900, no neighbouring map preloaded during play: the hidden setting system/host-settings:ocb_preload
  (HOS_OCB_PRELOAD=1 the game's preload), off by default as on main; fixes/ocb_hold.rs.
- #2843's hold: the hidden setting system/memory-settings:target_pool_hold beside target_pool_mb
  (RX_VK_TARGET_POOL_HOLD), Auto 128 presents.
- #2876's cores: host_cores' Auto is 8 where the PC reports at least 8 logical processors, else 6.
- #2926, DLSS FG through: a setting of the graphics mod (dlss_fg_through, Streamline or NGX), placed with the frame
  generation rows, its lines and lock as data; the renderer reads it from the settings and reports its state.
- #2884, Restart now on Windows: the builder starts the game again on the game's channel restart, on every system;
  a play test of main's cases. No exit status or relaunch of the game's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Mods read an actor's skeleton and pose its bones, and hold an actor still:

- `pose(actor)` (actors.read): the bones of the actor's model, each its name, index, parent and local transform.
- `poseBone(actor, { bone | index, rotation?, translation?, scale?, mode? })` and `clearPose(actor)` under a new
  permission, `actors.pose` (low: only the picture changes): a standing override written every frame, on top of the
  game's animation (`add`) or in its place (`set`), until cleared, the actor gone or the mod stopped. One mod poses an
  actor at once; Link may be posed.
- `setPose(actor, list<BonePose>)`: a whole pose in one call, taken in one frame. The schema and its bindings take a
  list of options records as a parameter now (schema-gen, the thunks, the script side's conversion, the .d.ts).
- Link's main bones have stable aliases of the API's own (`head`, `neck`, `spine`, `hips`, `armL/R`, `forearmL/R`, `handL/R`,
  `weaponL`, `weapon`, `thighL/R`, `shinL/R`, `footL/R`, `toeL/R`), all read back in a game run, which the pose calls take and `pose` reads as each bone's `alias`.
- `freeze(actor, frozen)` (actors.write): the game skips the actor's whole update from its next frame, while it is
  still drawn in its last pose. Not Link; several mods' holds stand together.

Hot inline table rules (game/sites/sites.toml): `actors.pose` and its four siblings at the entry of each skeleton step method that makes its
bones' world matrices from their local transforms (`skeleton_pose`), and `actors.hold` in GameActor's per-frame
method right after it rebuilds the frame flags, before it tests the flag that skips the update (`actor_hold`). With
nothing posed, read or held, each is one relaxed load. The main thread publishes the tables `actors.poses` (keyed by
the model's world matrices, the pointer that ties a skeleton to its actor) and `actors.holds` (game_core::pose); the
sites write on the actor's own thread. An added pose starts from the transform found under the site's last write when
the game did not write the bone again, so it never adds up; a cleared bone is put back.

Confirmed in game runs: setPose of three bones by alias in one frame (screenshot); (kokiri-start): Link's 309 bones read by name, his head turned and scaled and his arm raised
in the screenshot, put back on clearPose; a rolling rock held for 2 s kept its place and rolled on when let go, and
Navi held for 2 s stayed drawn in one place and wing pose. The step has five sibling methods (one per kind of skeleton: Navi's and the plants'
go through another than Link's); the same rule is on each.

The fake game gives every actor a three-bone skeleton (`game.bones(key)`), and the example mod `statues` freezes the
enemies near Link and tilts his head. Docs: docs/modding/actors.md (Posing, Holding an actor still),
docs/dev/reference/actors.md, hooks.md's rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The rebase onto main added pool.descFlags and pool.eventFlags to game/sites/sites.toml without their lines in
builder/crates/sites/tests/site_owners.txt, so the sites repository test failed on mod-api.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
## Summary

For [#2822](#2822) (into `mod-api`). Every fix a Windows test of `mod-api` turned up, in one pull request, as asked: the eleven open pull requests below, rebased onto `mod-api` @ 5740a5df with their commits as they were reviewed, and the Windows bugs found since. Each commit is one fix or one check, a fix after the test that shows it. They close in favour of this one.

**Carried over** (each pull request's description says how to see its bug on `mod-api`):

| Was | What |
|---|---|
| [#2824](#2824) | `longshot_builder.py build`: the release's C++ runtime link-args reach rustc whole (they went in one character at a time) |
| [#2826](#2826) | Five game-free checks that fail only on Windows: their stand-ins follow the branch's host code (tests only) |
| [#2829](#2829) | Switching one mod off while the game runs no longer stops every other mod the start turned on |
| [#2830](#2830) | The workspace passes clippy for Windows' target (three lints behind their `cfg`, one new: `GAME_BUILDER_E_FAILED` imported on Unix only) |
| [#2832](#2832) | Windows: a changed folder mod's content module runs again while the game runs |
| [#2834](#2834) | Two builder checks that fail only on Windows: their fixtures name Windows' programs and whole paths (tests only) |
| [#2835](#2835) | Windows: an unchanged link is not run again (a drive's colon is no option's separator, in every argument: `main`'s [#2872](#2872), now in `mod-api`, skips the output's own argument, and `compile_link`'s unchanged rebuild still linked again with it alone) |
| [#2838](#2838) | Windows: a confined game reads a profile past 260 characters (the file layer takes `\\?\`), the builder's file rules keeping every refusal |
| [#2842](#2842) | While the menu starts it says so, never that it could not start, and not over its page |
| [#2844](#2844) | longshot-game's integration tests link on Windows (the version text through host-sys) |
| [#2845](#2845) | Four game-side checks that fail only on Windows: whole paths, a file system that folds case (tests only) |

[#2827](#2827) and [#2847](#2847) are not here: [#2898](#2898) covers them (their closing comments say how).

**New** (each found by running `mod-api`'s checks on Windows; how to see it is in its commit):

- **fix(sandbox): the file service opens what the game asks to write, and the folders it makes.** After every open the service checks it is no link (`GetFileInformationByHandleEx(FileAttributeTagInfo)`), which Windows answers only for a handle with `FILE_READ_ATTRIBUTES`; a handle that cannot be told is taken as a link. The service opened with the game's own access, so on Windows every file a confined game opened to write only (`GENERIC_WRITE`) was refused, and every folder it made was made and then reported not made. Wine does not check the right, so `files_windows`' check passed there. `open_in` now adds the right to the service's own handle; the game's handle carries what it asked and the attributes' read every CreateFileW handle has (the next fix), which the check asserts.
- **fix(sandbox): the game's handle from the file service reads its attributes, as CreateFileW's does.** Windows' CreateFileW gives every handle `FILE_READ_ATTRIBUTES` and `SYNCHRONIZE` beside what was asked; the service gave the confined game only what it asked. Rust's `std::fs::metadata` (and `is_dir`, `is_file`) opens with access 0 and reads the attributes by the handle, so every one of those calls on a file or folder the builder serves failed: the save list found no save, and `dev.py smoke` stayed on the title screen ("skip title: there is no saved game"). The rules decide on what was asked, as before; a STAT already tells the attributes of any path they let the game open, so the handle reads nothing more.
- **fix(bridge): a shot to a path is staged on Windows too.** `longshot_bridge.py` and `Longshot.exe mod shot` asked the game on Windows to write the path itself (a pipe has no folder to stage beside), which a confined game cannot: `dev.py smoke`'s menu shot failed ("the PNG could not be written"). On Windows a shot to a path is now staged in the game's `temp/` as on Linux and moved by the client, read through no link (`FILE_FLAG_OPEN_REPARSE_POINT` in Rust; in Python the name is no reparse point and the file opened is the one looked at). With no path, the game writes its own default, as before.
- **fix(builder): an older build's user folder moves to the new place.** `settle` flushed each copied file through `File::open(...).sync_all()`: Windows' FlushFileBuffers refuses a read-only handle, so every copy failed and the saves stayed in the game folder at every start.
- **fix(builder): a game file extracted before is checked whole, never taken as damaged.** `file_damaged` read the zstd magic with `read_at` and hashed the rest from the file's position: Windows' `seek_read` moves it (Unix's pread does not), so every `.zs` a second extraction checked was counted damaged.
- **fix(builder): importing earlier saves never replaces a file at the profile's saves place.** Linux's rename refuses a folder over a file and the import fails, leaving the earlier saves to try again; Windows' rename replaced the file and said it was done.
- **fix(mods): a mod whose id has a device's name takes screenshots.** A part of the id that is `nul` (or `con`, `aux`, `prn`, `comN`, `lptN` on Windows 10) was a screenshots folder Windows cannot make: it gets `_` first, as the mods' stores' files do.
- **docs(dev): on Windows, run the confined game from a shell outside a packaged app.** A Store (MSIX) app that keeps AppData virtualized (the Claude desktop app is one) puts its processes' writes there in a copy of its own, and the tools it starts inherit that; the confined game sees the real folders, so the run folder and a staged shot are not where it looks. `reference/build.md`, Where dev data lives.
- **fix(builder): an older user folder's read-only file moves with it.** The move flushes each copy through a handle that may write it, and Windows' copy keeps the read-only attribute: one read-only file kept the whole move back, tried again at every start. Such a copy is made writable for the flush, then read-only again (BeanBot's review, L2).
- **fix(dev): `re.py` closes the index it opened**, so Windows can delete or replace it (`test_re.py` failed in its cleanup).
- **fix(builder): a base's file swapped for another is not linked into a runtime.** A game folder's note keeps each file's (size, time, id); the id was 0 on Windows, and Windows' copy keeps the time, so another file of the same bytes was still linked. The note records Windows' file id now. A note written before (id 0) is taken only when the file's bytes are its SHA-256 too, read once, and the install that keeps it notes the id (BeanBot's review, L1), so no game folder copies its files again after the update, and no file swapped in meanwhile is kept, taken as the builder's or linked into a runtime.
- **fix(builder): the same source compiles to the same object.** clang wrote the compile's time into each COFF object's header; the llvm-mingw route's compiles now take `-mno-incremental-linker-compatible`, as the link already takes `/Brepro` (`compile_link`'s byte-for-byte check failed whenever two compiles fell in different seconds).
- **fix(dev): `dev.py ab`'s report, and every `dev.py` tool's, to a pipe or a file is UTF-8** (cp1252 has no Δ: the report raised UnicodeEncodeError), and **`dev.py migrate` leaves no base marked busy** (it deleted its marker while it was open, which Windows refuses).
- **Tests only, from `main`'s PRs the re-squash brought in:** the host cores check (#2876) stands in for `GetActiveProcessorCount`, the count `hos_cores` asks Windows for; the profile symbols check leaves its ELF reader (Linux's) out on Windows, as where its tools are missing.
- **Tests only:** the control pipe's check waits for the builder's instance (`WaitNamedPipeW` returns at once on Windows while there is none); `user_of`'s check takes the game folder as `user_of` does (never `\\?\`); the screenshot check compares the settled path, not its debug text; `prepare_only`'s check names the game program by this system's name; a package's second extraction expects the case pair written again where the file system folds case; the audio output devices' fixture takes the start's settings from the shared stand-in.

Read first: `builder/crates/build-core/src/files_windows.rs` (`open_in`, OPEN's `give_access`), `scripts/longshot_bridge.py` (`take_shot`, `Bridge.request`), then `user_folder.rs` (`copy_tree`), `build-driver/src/folder.rs` (`stat_of`, `stat_matches`), `build-driver/src/play.rs` (`carry_saves`), `game-files/src/nup.rs` (`file_damaged`), `build-compile/src/toolchain.rs` (`reproducible_object`).

## Testing

**Tested:** On this PC: Windows 11 Pro (build 26300), RTX 5080 (NVIDIA 621.40), Ryzen 9 9900X3D. Everything built and run without MSVC: Rust 1.99.1 on the `x86_64-pc-windows-gnullvm` host, `tools.lock`'s llvm-mingw for C and C++ and as linker; the builder and the runtime import no MSVC runtime (`llvm-objdump -p`).

- **In the game, confined (the log's `sandbox: in the AppContainer`), `dev.py smoke`: PASS** (from `kokiri-start`: in play, 900 frames, the Insert menu open with its page `system/menu`, the bridge's shot staged in the game's `temp\` and moved to the run folder; no FATAL line, every system mod started; `files: 237 served by the builder` at the first frame in play). Runtime made by `dev.py rt` at ee7b1726 with the builder at 545f97c6 (the file service's fixes); the shot's fix is the client's (`longshot_bridge.py`, at the head). On `mod-api` without them the same run stays on the title screen (`skip title: there is no saved game`), and with the first alone fails its shot (`the PNG could not be written`). A windowed run of the same runtime with the Insert menu opened over the bridge shows the menu over the game.
- **Game-free, Windows** (`mise run test`'s `run_all.py --strict`, 12 at once) at 13cf57a6 (the head but its docs note): 797 passed, 10 failed, 49 skipped. The 10: the nine renderer checks Risks names (they fail on `main` too) and `test_lifter`, whose workspace tests had one intermittent `longshot-game` failure (Risks; 187 of 187 in 8 runs alone). The skips are the checks whose tools this PC lacks (gcc, Linux-only ones). Rust: `cargo fmt --check`; clippy `-D warnings` for the workspace and `modtool`; tests of `build-core` (148), `modtool` (221), `sites`, `longshot-game` (187), and the workspace's earlier.
- **Game-free, Linux** (WSL Ubuntu 24.04, an export of the branch): `mise.toml`'s `rust` task's commands and `run_all.py --strict` at 809cbd68 (only environment failures, no glslang, spirv-val, llvm-mc or dav1d, and the nine renderer checks); for the last commits, fmt, clippy and the tests of `modtool` (243) and `build-core` (183), `test_longshot_ctl` (55), `test_pipeline_tour`, `test_job_queue`.
- **The sandbox's checks at the head:** on Windows `build-core`'s `files_windows` and `files_rules` tests (21) and `sandbox_windows`' with the crate's 148; on Linux `test_sandbox_windows.py` (19 checks: the start decision, the path form, the file service handing no more than the access decided), `test_sandbox_linux.py`, `test_builder_files_linux.py`, `test_sandbox_profile.py`, `test_sandbox_save_folders.py`, `test_pad_appcontainer.py`. `test_builder_files_wine.py` skipped there (no llvm-mingw in WSL); the same `files_windows` code's tests run natively here, where Windows checks the access rights Wine does not. The rules' normalizer refuses the plain form of every `\\?\` path its test refuses (checked once, by hand), so the file layer's taking the prefix off opens no way around a rule.
- **The review's fixes** (at 319bdf5e): each test fails before its fix and passes after; with the zero-id entry's hash check taken out, its test fails again. Windows: `build-driver` (219) and `build-core`'s `user_folder` tests, fmt and clippy `-D warnings` for both crates. Linux: `build-driver` 244 of 244 in three whole runs, fmt and clippy for both crates. Builder code only (an install's note, the user folder's move): not run in the game since.
- **The reproducible-object flag** (review L4): tools.lock's llvm-mingw clang, the 31 host C files that compile alone, -O2, without and with `-mno-incremental-linker-compatible`, through the queue: the objects the same bytes but the header's 4-byte time (335,411 bytes both ways); one file's compile 301 ms without, 279 ms with. The whole set's times are noise on this PC today (9 to 34 s a round, other builds running, no order by the flag); a quiet PC's numbers: by hand.
- **A Windows account that may not make links** (this one makes them through Developer Mode alone, without `SeCreateSymbolicLinkPrivilege`): `test_longshot_ctl.py`'s `ShotStaging` run with `os.symlink` refusing as Windows refuses such an account (`WinError 1314`): its two session tests pass, the link test is skipped saying why (`no symbolic link can be made here: [WinError 1314] ...`), its plain take and `staged_at` checks before the skip passing. `modtool`'s `windows_tests` now takes its plain file before the link (e2d9c75a), so such an account runs that half: passing here with links, and with the link refused (a local edit, not committed, making the link fail with `ERROR_PRIVILEGE_NOT_HELD`): the plain file taken, then `skipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314)`. Not run from a real account without the right.
- **Each fix:** its test (the commit before it) fails on `mod-api` for the bug's reason and passes here; with the fix's key line taken out, it fails again.

**Still to test:**
- Linux in the game, confined (Landlock): none of these fixes is Linux's, but the shot's clients changed for both; no Linux PC here: `@Beanstalk dev.py smoke on Linux, confined: in play from the save, the menu open, its shot taken`.
- Windows on AMD and Intel GPUs: the file service and the shots are no GPU's, but the in-game run is one card's: `@Beanstalk dev.py smoke on Windows with an AMD and an Intel GPU, confined: in play from the save, the menu open, its shot taken`.

## Measurements

Nothing to measure: fixes and checks. The file service's handles gain the attribute read (its own checks, and the game's handle as CreateFileW's has it), and a bridge shot on Windows is moved once by the client; nothing on a path the game runs every frame changes. No switch is added: `LONGSHOT_NO_CLANG` in the diff is the tests' own variable `mod-api` already has (with no clang, a check that needs one passes over it, as `a64`'s llvm-mc check does), which the object check follows.

## Risks

**The sandbox:** as tight as `mod-api` has it, and checked. The file service's own handle can now read attributes, which its checks after every open need; the handle the game is given carries the access the request was allowed (or less, for a folder) and the attributes' read every CreateFileW handle carries, which a STAT already gives of any path the rules let the game open: the rules decide on what was asked, unchanged. The shot change is the clients' (outside the sandbox): the game writes only its own `temp/`, which it could already, and the client takes a plain file there through no link, on Windows as on Linux. Every refusal of the service's rules is unchanged; [#2838](#2838)'s `\\?\` paths keep every refusal (`files_rules/windows.rs` checks it). Nothing here touches the sandbox's plan or its grants. The sandbox is `mod-api`'s only; `main` has none.

For players on Windows: an older build's `user\` folder beside the game now does move to `%APPDATA%\Longshot` at the first start, as the move was meant to; a screenshot folder of a mod whose id has a device's name is named with `_` first; an earlier saves' import with a file where the profile's saves go now fails and says so, and leaves the file. A revert is enough for each. On a drive that gives Windows no file ids (FAT32 or exFAT, some network shares), a game folder's note has none to record, and its entries are compared by size and time alone, as `mod-api` compares them now: a different file of the same size and time put in such a game folder could still be kept by a build, or linked into a runtime (a build after it is changed or removed puts it right). Hashing every file at every build there would close it, at a cost each build: not done.

Named, not changed here (as `mod-api`'s rules have them): on a Windows PC with tools.lock's llvm-mingw alone (no gcc), the checks whose `RUN_ALL_ARGS` name gcc or g++ are skipped, or fail with `--strict`, as `tests/run_all.py` says of a compiler that is not there; about ten checks' own test programs pass a path through the ANSI code page and fail from a temporary folder whose path has a letter outside it (both on `main` too). `modtool`'s `the_typescript_system_mods_pass_their_tests` failed once on this PC with two builds beside it and passed alone and in two whole runs (its cost checks read the wall clock on Windows): not changed, watched. Two tests are intermittent on Windows with their crate's other tests beside them, never alone (40 runs each): `game-core`'s `fixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread` (2 of 40: the waiter can see the OR itself before `wake`, which then finds no one) and `game-sites`' `phase::tests::callbacks_run_by_order_then_by_when_added_and_stop_after_removal` (1 of 40: `on_thread` reads the process-wide phase thread, which another test's run of the same phase moves): test races, not changed. One more, seen once in a whole run under load and never alone (187 of 187, 8 runs): `longshot-game`'s `settings_now::tests::a_new_installs_output_resolution_is_the_size_the_run_started_at`, whose new install's size is skipped when the process-wide `AT_START` was first filled by a test whose settings are the Handheld profile's (`set_up_for_a_weak_laptop_is_a_preset_of_the_games`, `a_preset_chosen_in_the_game_sets_its_rows_and_a_row_changed_makes_it_custom`): test order, not changed. And on Linux, `build-driver`'s `dev_runtime::tests::a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_place` fails now and then with the whole crate's tests beside it, on `mod-api` too (3 of 6 runs at 5740a5df: `game_folder_busy`, the runtime's folder lock still held at its next copy), never alone; `a_give_back_skips_a_unit_a_running_game_holds` failed once so: not changed. Nine renderer checks fail on every system on `main` @ 4908cc6d and on `mod-api` alike (`test_blocks_at_start`, `test_draw_stream_visibility`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_readback_timeout_reuse`, `test_recording_admission`, `test_target_retention`, `test_tex_desc_memo`, `test_vram_compact`: their cuts of `gpu/vk` no longer match it), `main`'s to mend, not this pull request's.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit. (One topic: `mod-api`'s Windows fixes, in one pull request as asked; on `mod-api` @ 5740a5df.)
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `mod-api` is named).
- [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 fix: a game-free test that fails on `mod-api` and passes here (each fix's key line taken out, its test fails).
- [x] A check under `tests/` that reads changed source is updated, not weakened.
- [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (the checks whose test programs take a path through the ANSI code page are named in Risks).
- [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.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #2938
longshot/ui's runtime: a host whose element is kept (the same props) is not looked at again, nor a component's; a
frozen style given again keeps its ref; a Canvas's drawing methods are one shared set (no closures a canvas), a flat
path's points checked in one loop, and two draw lists told apart by their commands' own values before any points.
The FPS counter of ef2d111d at Dev/Large: 2.9 ms a redraw before, 1.7 after (fake game).

Box shadows are drawn per pixel, the Gaussian in closed form (the draw list's contract, reference.rs), dithered: no
bands, any blur the same cost (was four stepped rects). New on the Canvas: d.text's shadow (an outline the game
draws) and d.path's fillTo (a fill fading down the shape).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Reads an actor's animation slots and the states its animation graph has; plays a state on a slot by the game's own
request (made at the actor's own update, the name kept by the engine for the session); holds a slot's speed every frame
at the controller's advance, after the game's own reset; sets the controller's named variables; stops a slot; and tells
and rules the game's own plays (cancel, another state, cross-fade, speed) through an engine callback on the central play.

New: permission actors.animate (medium); sites actors.animPlay (engine, can return), actors.animAdvance and
actors.animate (inline table rules anim_advance and actor_animate); game_core::anim; services/animations.rs; the fake
game's controllers (game.animation, setFaces, playAnimation); the expressions example. Preview: docs/dev/reference/
actors.md#animations says what a game run confirmed and what it did not.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
mod-api took all of oxc 0.157.0 from oxc's repository by tag, so its formatter, which oxc does not publish,
shared one copy with the compiler. A tag can move, a release vendored crates.io's crates only, and cargo's
checkout of oxc's whole repository passes Windows' MAX_PATH (a player's pull request build stopped on it).

- oxc_formatter and oxc_formatter_core come from GitHub by rev (the commit of tag crates_v0.157.0); every
  other oxc crate is crates.io's 0.157.0, patched in for the formatter's, so one copy of each.
- scripts/renhdrum.py vendors a git package pinned to a full commit on github.com or git.magicbean.dev with
  cargo vendor of that commit, kept by commit; the release's offline cargo home replaces the git source with
  it, so no build checks the repository out.
- tests/test_cargo_lock_sources.py refuses any other source: a tag, a branch, another host.
- Windows from-source tells git and libgit2 core.longpaths for a git dependency's checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
pr-builder.yml (pull_request_target, so the base branch's workflow and scripts) builds both platforms'
program from a non-draft pull request's head, and from each push to main or mod-api, with the base's
scripts/longshot_builder.py program over the head's tree fetched as data (LONGSHOT_SOURCE_TREE). The
compile, which runs the pull request's code, runs as an unprivileged user with an empty environment; its
processes are killed after it and its programs read back with its rights. describe writes
builder-<platform>.json; scripts/pr_builders.py, base code alone with the job's token, checks them, splits
each program into parts the forge's tunnel takes, publishes the pre-release builder-<commit> and prunes.
Unsigned: the launcher checks the SHA-256s (integrity) and keeps its warning for unreviewed code.

Also: the Windows builder's header check takes the controllers' System32 DLLs (hid, setupapi, winusb), and
game-rust links a cdylib dependency with llvm-mingw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The first pr-builder run (mod-api 74c7f3bb) stopped twice: Python 3.10's backported tar "data" filter
resolves a relative link from the destination (gh-107845) and refused llvm-mingw's
<arch>/include -> ../generic-w64-mingw32/include, and the container had no cmake, which shaderc-sys (the
packager's) builds with. helpers.extract takes its own filter before 3.12 (the same rules, links resolved from
their own folder); the container installs cmake and ninja; the llvm-mingw step fails when the unpack does; `program` runs its steps in the tree it builds, where the packager finds tools.lock (the job's own folder holds base/ and src/).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
pr-builder.yml is now "Builders for the launcher": a Linux builder and a Windows builder job run side by
side (each as before: the base's scripts, the build unprivileged), then Publish, base code alone with the
job's token, takes both through artifacts and publishes. The downloads and cargo's target folder are cached,
restored by every run, saved only by pushes to main and mod-api, the target's unchanged files dated back
(ci_source_times). glslang (mise.toml's pin) compiles the colour-vision and crt effects the builder left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
The Longshot Launcher now compiles each commit's own longshot-builder on the player's PC (the commit's source, the Rust and
tools it pins, CMake and Ninja), and that builder makes the version with `from-source --archive`. Removed: the
"Builders for the launcher" workflow (.forgejo/workflows/pr-builder.yml), scripts/pr_builders.py and its tests,
`longshot_builder.py describe` (its json was only the launcher's download check), LONGSHOT_SOURCE_TREE (only the
workflow built another tree as data), and the docs of the CI route, rewritten for the local one (releases.md, build.md).
Kept: `longshot_builder.py program` and the rest of its steps, the oxc pins, the git vendoring, the Cargo.lock guard and the
extract fix.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Installing a package, a folder or a source's mod that has a mod.json and no mod.toml now says: This mod uses an older
mod format (mod.json): its author needs to republish it for this version. The Mods tab says the same for such a
package or folder in a profile's mods/. Tested by a modtool unit test (and mod-manifest's name check).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
## Summary

The pin half of a tool bump (docs/dev/reference/releases.md, "Bumping a tool"): tools.lock's trimmed llvm-mingw for Windows keeps `llvm-ar.exe` and llvm-mingw's two x86-64 drivers (`x86_64-w64-mingw32-clang.exe`, `x86_64-w64-mingw32-clang++.exe`), and `LLVM_MINGW_TRIM` goes to 2, a new package version (a version's files never change).

Why: the trimmed llvm-mingw has no archiver. A developer's game build on Windows archives the game's Rust's C, C++ and CMake objects (shaderc's among them, whose paths pass 260 characters) with whatever `ar` the PC has: none on a clean PC, or MinGW's, which cannot open those paths. #2961 hands the toolchain's `llvm-ar` to cargo and CMake when there is one, and for now names rustup's `llvm-tools` in setup.md. `llvm-ar.exe` loads `libLLVM-<n>.dll`, which the trim keeps already.

The drivers: `scripts/longshot_builder.py`'s Windows build names `x86_64-w64-mingw32-clang.exe` as its linker and C compiler and `x86_64-w64-mingw32-clang++.exe` as its C++ one, in the llvm-mingw it is given. A build from source on Windows (the launcher's, #2961) gives it the source tools' trimmed llvm-mingw, which has `clang.exe` and `clang++.exe` only, so the builder could not be made. They are llvm-mingw's small drivers (14 KB each, running `clang-<n>.exe` as `clang.exe` does).

Read first: `builder/tools/windows-x64/llvm-mingw.sh` (`trim_llvm_mingw`), `builder/tools/pins.sh`.

Once tools.lock names the new version, a player's from-source build on Windows changes too: `from_source::archiver` finds `tools/llvm-mingw/bin/llvm-ar.exe`, so RenHDrum is compiled from the source instead of `renhdrum_not_built` (the running builder's library). docs/dev/reference/build.md's "with none (a Steam Deck, Windows)" then goes stale: that line changes with tools.lock's line, in the third pull request.

See #2961.

## Testing

**Tested:** the recipe itself not yet: it runs in Ubuntu 22.04 (`builder/tools/docker.sh` or the Check tools workflow), which this Windows PC does not have. Its files, on Windows 11 (the three added by hand from llvm-mingw 20261104's UCRT x86-64 release to tools.lock's `20261104-x64-1`):
- `scripts/longshot_builder.py build --target windows --profile release` with that llvm-mingw as `LONGSHOT_MINGW`: the builder is made (the drivers as linker, CC and CXX).
- That builder's `from-source --archive` of #2961's head under the launcher's data folder, with that llvm-mingw as the source tools' and MinGW's `ar` first on the PATH: done in 349 s; shaderc's CMake took `tools/llvm-mingw/bin/llvm-ar.exe` (its toolchain file); RenHDrum built from the source (`renhdrum.dll`, no `renhdrum_not_built`); the version's `Longshot.exe` answers `--version`.

**Still to test:**
- The Check tools workflow on this branch: `windows-x64/llvm-mingw`, expecting the archive made the same twice, `bin/llvm-ar.exe` and the two `bin/x86_64-w64-mingw32-clang*.exe` in it, a new version `20261104-x64-2` (by hand: someone with write access dispatches `tools-check.yml`).
- Windows, with the archive in a checkout's `tools.lock` (make.sh's `add.sh`): `tools\llvm-mingw\bin\llvm-ar.exe --version` runs; `dev.py rt` then `dev.py smoke` with no other `llvm-ar` on the PATH, expecting PASS (by hand).
- Windows, a from-source build with it (`longshot-builder build --source ...`): RenHDrum compiled, no `renhdrum_not_built` warning (by hand).

## Measurements

Nothing to measure: a build tool's archive gains one small program; the game is built as before.

## Risks

- The archive grows by `llvm-ar.exe` and the two drivers (small programs over the DLL and `clang-<n>.exe` it already carries).
- With the new tools.lock line, a Windows from-source build compiles RenHDrum where it took the running builder's library before.
- Nothing changes until tools.lock names the new version; revert is enough before that.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. Not yet: the recipe needs Ubuntu 22.04 (Still to test).
- [ ] `mise run test` passes (any failure that also fails on `main` is named). Not run for this branch: it changes two shell recipes, which `tests/test_tools_pins.py` checks on Linux (CI).
- [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

- [ ] A check under `tests/` that reads changed source is updated, not weakened. `tests/test_tools_pins.py` reads `pins.sh`; nothing in it needs a change (CI runs it).
- [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)

Co-authored-by: neotoxicfr <[email protected]>
Reviewed-on: #2963
## Summary

Opening a small chest above 60 fps could hold Link in the award scene for seconds longer than it should. At 144 fps the
scene took 7.9 s of game time instead of 4.1 s, and at 240 fps 13.2 s. With this change it takes 4.1 s at both.

**Why:** the scene waits for Navi to finish turning. Each frame the game turns her level heading by the frame's step,
which is right, and then projects it onto the plane of her banked up vector. That projection swings the heading a fixed
angle (2.4 degrees in the orientation she was seen stuck in), whatever the step. At 144 fps the swing outweighs the
turn, so she never comes within the 5 degrees that end it, and the event goes on only at its own 360-frame limit.

**The change:** a site before the projection, `navi.turnHeading` (`f_808b5ff0`), gives the game a heading that already
lies in up's plane and has swung by the step's part only, so the projection keeps it. At a frame-rate cap of 60, or on a
frame of a 60th or longer, the game's own heading is used.

**To see it on mod-api:** set the cap to 144 or higher and reach it, then open a small chest (Kokiri Forest, Mido's
house). Link holds his pose while Navi hangs banked short of the chest. At 120 fps it did not show.

Read first: `navi_heading_rule` in `game/crates/game-core/src/fixes/high_fps.rs`, then `navi.turnHeading` in
`game/sites/sites.toml`.

This is for `mod-api` (#2434). See #2579 (its chest delay; its item rotation and spawn cutscene are not covered), and
#2561, which may be the same wait for its chest (its sign is not covered, and nothing here was checked against it).

## Testing

**Tested:** Windows 11, NVIDIA RTX 3080. The in-game runs were on mod-api `5c1cd9f5b` with these two commits, before the
rebase onto `4c498c8aa`, which had no conflicts. **The rebased head has not run in the game.**

- A small chest in Mido's house, opened by a script. A local test switch (not in this branch) held each frame's step to a
  fixed size, so the times are in game time and don't depend on how fast the PC ran. Results in Measurements.
- The large Kokiri Sword chest was not slowed on mod-api: 1600, 1567 and 1568 sixtieths at 60, 120 and 240 fps.
- On the rebased head: game-core's `high_fps` and `every_` tests (34), the `sites` crate's (46 and 6), `cargo fmt` and
  clippy (`--lib`) pass. `navi_turns_as_far_in_a_second_at_144_fps_as_at_60` fails on the first commit, whose rule does
  nothing, and passes on the second.
- `test_patch_hooks_defined`, `test_thread_locations`, `test_game_fov` and `test_dev_check` pass.
  `test_present_sites` fails on this PC (`unsetenv` undeclared under llvm-mingw), and fails the same way on mod-api
  `4c498c8aa`. The rest of the suite has not run.

**Still to test:**
- Windows, the rebased head: a small chest at a real cap of 144 or more (the PC tested on could not hold one), expecting
  the same length as at 60 (by hand)
- Windows, the rebased head: a small chest at a cap of 60 and at 90 or 120, expecting no change from mod-api (by hand)
- Windows: Navi's flight and turns in ordinary play above 60 fps, such as calling her and targeting, expecting nothing odd
  (by hand)
- Linux: a small chest at 144 fps or more, expecting the same length as at 60 (by hand)

## Measurements

**Verdict:** the small chest's event is as long at 144 and 240 fps as it is at 60.

Setup: Windows 11, RTX 3080; the small chest's event in Mido's house, in sixtieths of a second of game time, each frame's
step fixed. **One run each.** The "mod-api" column's 60, 120 and 240 rows are from an earlier build. The 144 row's two
numbers are from one build with the rule on and off, and the earlier build gave the same 476.

Baseline: mod-api @ 5c1cd9f5b, which this is for, not main: the fix's Rust site layer is on mod-api only. The After
column is these two commits on it, before the rebase.

| Frame step | Before: mod-api @ 5c1cd9f5b | After: this PR @ f3952c489 |
|---|---|---|
| 1/60 | 248 | 273 |
| 1/120 | 247 | not run |
| 1/144 | 476 | 244 |
| 1/240 | 795 | 245 |

The 273 at 1/60 is not explained. The rule does nothing there (it returns before changing anything at a whole step), and
the run was not repeated. No frame-time cost was measured: the site runs only while Navi turns, and it is a few
trigonometric calls.

## Risks

Navi's turning above a 60 fps cap is the only thing that changes. A revert is enough, and a cap of 60 turns it off. A
player notices nothing after updating except the shorter scene. The site is for the e0f3ccfa build's `f_808b5ff0`, with
a signature. Other callers of `f_808b7510`, the turn it uses, were not looked at.

## Checklist

### Ready for review

- [ ] One topic, on current `main`; the title is a Conventional Commit. (One topic, but on `mod-api`, its tip on 2026-11-29.)
- [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (Run before the rebase; the rebased head is owed.)
- [ ] `mise run test` passes (any failure that also fails on `main` is named). (Only the tests named in Testing have run.)
- [ ] Measured against `main`, or Measurements says why there is nothing to measure. (One run each; 60 fps is to be repeated.)
- [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible.

### When it applies

- [x] A fix: a game-free test that fails on `main` and passes here.
- [x] A check under `tests/` that reads changed source is updated, not weakened.
- [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)

Reviewed-on: #2809
- Lint: the whitespace and end-of-file fixes of host/hos_report_run.h, docs/modding/ui.md and gpu/vk/vk_api.h; unused
  imports and several statements on a line in the checks mod-api touched.
- Website: the publication check's test makes its own dist/, which the mod manifest's schema check (check-site.ts) reads
  schemas/mod.schema.json from; the test gives it one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
feat: main's #2795, #2807, #2909, #2929, #2930, #2962, #2964, #2972, #2976 and #2983 in mod-api's systems
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
bff521bd74
The rebase of mod-api onto main left these out of the stack, since each needs a system mod-api made. Here they are in
that form, with no old one carried:

- #2962 and #2964, the mouse in the game's menus: game-core's menus.rs turns the panel's pages with the wheel on Key
  Items and over the tab bar (one turn and one waiting, dropped when the panel closes), and the item carousel has the
  mouse with no button focused and tells the host it is shown. Rust tests of main's cases; game_menu_input from the
  controller's read, hos_mouse_item_choice_shown through the generated C–Rust line.
- #2972: the widescreen mod leaves the map page's dungeon map, drawn in the page's root, unfitted. A Rust test.
- #2983: game-core's high_fps runs the sound job's phase 0 on every frame with no step on held ones, and skips the two
  modules that count runs; sites sound.moduleUpdate and sound.moduleUpdateLate. A Rust test in place of the C one.
- #2929: the grass mod scales the second program's radius too.
- #2795: Frame generation's Auto by DLSS FG. The rows' names and lines are data in the graphics mod's mod.toml, from
  three new bits of the renderer's status (LS_FG_AUTO_*); the texts in the menu mod's strings. menu_fps_cap reads the
  game's snapshot on any thread, so main's published copy is gone. Auto aims for the Visual FPS target where it is
  below the display's refresh, as mod-api's own Auto does.
- #2909: the shaders astc_texels and bc3_from_texels are built by scripts/shaders.py (nothing compiled is checked in).
- #2807: the pause's close reads the game's setting. #2930: its test is in the renamed format check.
- #2976: the mirror heat cap is the setting mirror_heat_cap_kb in the new header too; the grass reach guard has nothing
  to guard, since Grass distance is a constant hook looked at only where a mod holds one.
- main's guide images' source reviews are of the old menu's page, which mod-api does not have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
The Insert menu is redrawn in the Longshot Launcher's style and becomes a thin user of parts any mod can use.

Engine (game/crates/ui):
- Hover is kept apart from the focus and never moves it.
- Input modes: pointer, keys or pad, set by the last input.
- The focus shows as :focus-visible does: never after a click, so a clicked tab no longer flashes its ring.
- A Choice opens as a dropdown under the pointer, with keys and pad support inside it.
- Tabs are sized by their labels. Left and Right on the bar keep the focus there; a new tab focuses its first control.
- Scrolling runs in the engine (scroll.rs). Revealing the focus is a critically damped spring with a one-row margin.
  - A wheel notch glides 100 px and stops within 0.3 s; notches add up but never compound.
  - A touchpad moves 1:1 and glides gently.
  - Past an end, a rubber band springs it back.
- A new $surfacePanel token. The Atkinson Hyperlegible Next font. Chevron icons.

Engine, added in this pass:
- The highlight follows the input mode. In keys and pad mode the focus lights its whole row, a `focusRow` Box. In
  pointer mode only the hovered control is lit.
- Dropdown rows fit the popup's corners.
- A slider drag is exact: the thumb stays under the cursor.
- Scroll and List have a launcher-style scrollbar, shown in pointer mode only, dragged 1:1.
- No overscroll.
- The hosted page's room ends at the hint bar's top, easing with its slide, and starts at the header's edge.
- A click on a tab leaves the focus on the tab bar.
- W, A, S and D act as the arrows on a hosted page.
- Pages can give the controller bar their own hints with a `hints` prop.

Kit (longshot/ui/kit): Checkbox, the launcher's checkbox (Toggle is now an alias), Link (with back and inline variants), Page and PageBody, and a menu-styled Section (its rule is
now optional).

Frame (menu_frame.rs, its geometry in game-ui's menu_layout.rs, shared with the hosted page and the fake game):
- The page sits in a rounded card over the live game ($card, 80% opaque, the launcher's side card), the help card right
  beside it, their bottoms level. Box shadows are cut out under their box, so the opacity is the card's own.
- Compact (Right Shift or Right Ctrl by the Compact menu key row, let go alone; a pad's Y): the card a quarter of the
  window wide and half as high, 70% opaque, everything at a density of 0.625, eased, kept for the run. The engine's
  density is a Window's and a HUD root's prop too.
- The header's tabs are the launcher's buttons. Q before the first tab and E past the last reach the power menu.
- The hint bar is right from the menu's first frame; the frame restyles its nodes instead of resetting them.

Kit and engine: Section shuts and opens, animated, its chevron turning (`rotate`), its rows `inert` while shut; Card
`over`; the cheats are on a page of their own.

Menu mod: Tune is removed; the rows and the Back link now use the kit's parts. The mods tab uses the kit's Link too.
The remapped Esc is now read by keysym.

There is a new example, docs/modding/examples/settings-page, with fake-game tests. Docs: docs/modding/ui.md "A settings page".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
feat(fps-counter): the old counter's look, a smooth graph, a cheap frame
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
f792fa4e81
No plate again: the renderer's old layout and colours, every text outlined by the game (d.text's shadow), the number in
even digit cells and held on the edge between two rates. The graph slides by the renderer's fractional scroll every
frame with a translate the game paints; its layers (the line with its area fading to the floor, the Breakdown's bars
in two halves, the render thread's lane) are drawn again only when the columns move on, one a frame, each a few paths
from preallocated arrays; the texts four times a second (the legend's names only when what shows changes), the body
a frame after the head. Its budget test runs Dev at Large with the columns moving and fails at 2 ms a frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
build: tools.lock is the one list of what builds Longshot, and a commit builds from source with nothing installed
Some checks failed
PR description / Title and description (pull_request_target) Successful in 36s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
582b6a1abf
tools.lock now names Rust, glslang and shaderc beside the compilers and libraries, upstream's own releases included
(static.rust-lang.org, glslang's GitHub releases: an allowlist per tool, every archive checked by its size and SHA-256).
One crate, builder/crates/build-tools, reads, installs and packs it for the builder, developers and the launcher.

A build from source compiles the commit's builder once, as the release does, and that builder packs itself
(from-source --self). It needs no CMake, Ninja, Python, git, zstd or archiver: shaderc is a prebuilt static library, the
shaders are compiled by the gen-shaders crate (scripts/shaders.py goes), oxc's formatter is an unmodified copy in
third_party (no git dependency, and Cargo.lock refuses one), and llvm-ar is LLVM's. Its cache is kept to 8 GB.

Windows' cpm is ffmpeg and headers now, the same names on both systems: Linux's compiler stamp is unchanged, Windows'
changes once. On Windows dev.py's cargo builds for x86_64-pc-windows-gnullvm with tools.lock's llvm-mingw, and Longshot's
own crates refuse MSVC, saying so; a builder that imports libc++.dll or another C++ runtime is refused.

The end-to-end test's synthetic tree has host/hos_file_linux.c, which the link's file wraps go to (it linked no game).

The three Windows test fixes (testdir's path, the MSVC link check's lld-link, the version tag's git config) are #2961's.

Co-authored-by: neotoxic <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
perf(vk): the shader store keeps its SPIR-V zstd-compressed (#3023)
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5934a4650a
## Summary

The shared shader store keeps every program's SPIR-V once, but uncompressed: 3.7 GB for one translator's shaders, and 5 to 7 GB on a PC that has been updated a few times. SPIR-V compresses well, so each blob is now one zstd frame (level 1), or the words as they are where that would not be smaller. The same shaders take 0.99 GB.

On top of `mod-api` ([#2822](#2822)). See [#1649](#1649) (its "compress each stage", applied to the store from [#1809](#1809)).

Read first: `gpu/vk/spirv_pack.h` (format, `put`, `read_words`, compaction), then `kProgramCacheFormat` and `open_recorded` in `gpu/vk/vk_progcache.cpp`, and `store_bounds` in `builder/crates/build-driver/src/shader_cache.rs`.

- **New files, `spirv.zpack` and `spirv.zidx`, format 2.** An older build takes a head of another version for damage and makes the store again, so the old names are left to the builds that read them.
- A blob's third head word, and the index's fourth, now hold the word count (low half) and the stored bytes (high half). Hashes are still of the words, checked after decompression.
- Compression runs with the store's lock released. Compaction copies frames as stored.
- `kProgramCacheFormat` 3 → 4, so a program cache naming an old store starts over.
- The builder's receipt check and `scripts/validate_spirv.py` read the new format.

Related: [#2153](#2153) changes `Store::read`'s file handles. Whichever lands second needs a small rebase.

## Testing

**On the current head** (08ca00bc, rebased onto `mod-api` 582b6a1a with no conflicts): the renderer builds on Linux (`dev.py vk`). `mise run test`: 824 passed, 35 failed, 12 skipped. The same 35 all fail on untouched `mod-api` 582b6a1a: `test_astc_upload_chunking`, `test_async_astc_upload_chunks`, `test_bind_memo`, `test_blocks_at_start`, `test_direct_buffer_writes`, `test_drawn_page_map`, `test_draw_stream_visibility`, `test_early_split_before_draw`, `test_flat_map`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_import_reach`, `test_late_fix_build`, `test_lifter`, `test_menu_i18n`, `test_mirror_bookkeeping`, `test_pass_barrier`, `test_present_acquire_ahead`, `test_present_image_free`, `test_readback_timeout_reuse`, `test_recorder_sync`, `test_recording_admission`, `test_report_words`, `test_staging_burst`, `test_target_retention`, `test_tex_desc_memo`, `test_text_keyboard_policy`, `test_ub_snapshot_default`, `test_ub_snapshot_gpu_writes`, `test_vk_wb_cpu_words_fast`, `test_vram_compact`, `test_wb_diff_stale_shadow`, `test_wb_pending_capture`, `test_wrote_regions`. `cargo test -p build-driver`: 239 pass in the library tests, and `a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_place` fails with `game_folder_busy`, as it does on that base. The game runs below were made before the rebases and not repeated.

**Tested:** Linux, RTX 3090, NVIDIA 620.70.06. (before the rebases)
- `dev.py rt` over base d193d12d: the shader preparation filled the new store, 39,173 noted pipelines built, 0 not made.
- `dev.py smoke` twice: PASS both times (in play from `kokiri-start`, 900 frames, menu opened). In both, the confined dev game could not reach the builder's store and used a fallback program cache with the player's default store (an earlier smoke log from 29 November, without this change, shows the same). The second run loaded the 544 programs the first had written there (56.6 MB of SPIR-V read from compressed blobs), with no read failures.
- `mise run test`: 836 passed, 10 failed, 12 skipped. The same 10 fail on `mod-api` at f53e1c42: `test_blocks_at_start`, `test_draw_stream_visibility`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_lifter`, `test_readback_timeout_reuse`, `test_recording_admission`, `test_target_retention`, `test_tex_desc_memo`, `test_vram_compact`.
- `cargo test -p build-driver` (244 passed in the library tests), `cargo clippy -p build-driver --all-targets -D warnings`, `cargo fmt --check`, pre-commit.
- `tests/spirv_pack_test.cpp` has new cases: a frame is smaller and read back by another start; a damaged frame is refused and written again; format 1's files are untouched; compaction keeps a frame readable.

**Still to test:**
- Windows (llvm-mingw): build and start, expecting the store made and read (CI for the compile; the start by hand or @Beanstalk). Not compiled for Windows here.
- A game that plays from a store the preparation filled (the launcher's Play, which sets `LONGSHOT_SHADER_STORE`): programs load with no "did not read" lines (by hand).

## Measurements

**Verdict:** the same shaders take 3.7x less disk. Load time and fps were not measured.

Setup: Linux, RTX 3090. The store a preparation of this PR wrote (50,898 blobs); the sizes are the word counts and stored bytes in its index. `main` was not run: its store (format 1, the same `spirv_pack.h` as `mod-api`'s before this PR) keeps these words uncompressed, so the first column is their size. Measured on the head before the rebases, which did not change the format.

| | Before: main @ dec32f72 | After: this PR @ a18747be |
|---|---|---|
| SPIR-V | 3.706 GB | 0.993 GB |

Cost, from a one-thread Python and libzstd microbenchmark over 3,061 sampled blobs (rough, not a timed run): decompression about 67 µs for an average shader (91 KB) at about 1.35 GB/s, compression about 550 MB/s. LZ4 on the same sample decompressed about 3.5x faster but stored 1.7x as much.

## Risks

- **One more shader preparation after updating:** the old store is not converted.
- **Disk goes up before it goes down:** `spirv.pack` and `spirv.idx` stay for older builds until the player deletes them.
- **The Launcher needs [LongshotLauncher #397](MagicBeanDev/LongshotLauncher#397)** before this reaches players: without it, "Free up space" neither counts nor frees the new files.
- **A play shader cache shared with a build of format 3:** the builder's `shaders/<translator>/<driver>/` folder is not keyed by `kProgramCacheFormat`, so a player who alternates an older build and this one with the same translator has each start replace the other's program cache (as with earlier format bumps). The store itself is not affected.
- `scripts/validate_spirv.py` reads the new store only: a format-3 cache's stages in `spirv.pack` need that tree's script.
- Reading a blob now costs a decompression on the loading thread.
- A revert is enough: the old files are never written by this build.

## Checklist

This PR's base is `mod-api`: read `main` below as the base.

### Ready for review

- [x] One topic, on current `main`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named).
- [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] Docs updated.
- [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #3023
fix(builder): decode the Steam banner with a BSD AV1 decoder, from the movie's keyframe 1284
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
d6b5bd5123
rav1d-safe (AGPL-3.0-only or a commercial licence, since #2353) is replaced by re_rav1d (BSD-2-Clause, dav1d in
Rust, without its assembly: no nasm or C compiler). Its new dependencies are MIT, BSD or Apache-2.0 choices. Frames
are the same to the byte as the old decoder's on the fixture, on SVT-AV1 and libaom test movies and on the old banner
frame. A movie that panics the reader or the decoder is an error and no banner, not a stopped builder.

The banner is now keyframe 1284, decoded alone, with the mark centred. Frame 829 was 188 frames from its keyframe:
4.8-5.1 s with rav1d-safe and 6.7 s with re_rav1d; the real-dump test, which reads, decodes and writes the PNG, now
ends in 1.1 s.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
feat(menu): the Controls tab in General, Controller and Keyboard + Mouse sections (#2993)
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
34bd814bc4
## Summary

The Insert menu's **Controls** tab listed controller, keyboard and mouse rows mixed together in one list, so it was hard
to tell which input a row changes. Walk speed is the example that prompted this: it sets how far the keyboard's movement
keys tilt the stick while Link walks, but it reads as if it changed a controller too.

The tab now has three sections, by the input a row changes:

- **General** (every input): Controls (the bindings page), Camera speed, Disable camera centering, Sprint.
- **Controller**: Controller in background, Stick dead zone, Stick range, Invert camera X and Y (these flip a
  controller's right stick only: `host/nn_hid.c`, `host/pad_sdl.c`), Vibration, Vibration strength, Test vibration,
  DualSense HD Haptics, Motion, Controller menu button.
- **Keyboard + Mouse**: Keyboard, Mouse camera, Mouse sensitivity, Invert mouse vertical and horizontal, Walk mode,
  Walk speed, Menu shortcut, Compact menu key, Command palette key.

Every row keeps its key, its label, help, values and defaults; only its place changes. The two new headings' names
(General, Keyboard + Mouse) are translated in all 13 menu languages, by me, not checked by speakers. The settings table in
`docs/user/graphics-and-controls.md` follows the new order, and its Controls section says what each section is for.

This was first made for `main`; it is remade here for `mod-api`'s menu, at a maintainer's request.

Read first: `game/mods/menu/src/layout.ts` (the three headings, with the Controls and Motion links), then each row's
`place` in `game/mods/controls`, `interface`, `sprint-walk` and `camera-centering`'s `mod.toml`, then PLACED in
`game/mods/menu/test/menu.test.ts`.

## Testing

**Tested:** Windows 11, in the game: RTX 5080, driver 621.47, 1280x720 window, at the title screen with a fresh profile, sound off, the sandbox on; this change on `mod-api` 582b6a1ab. All 25 rows of the Controls tab were seen under General, Controller and Keyboard + Mouse, in the order above. Through the control bridge, `walk_speed`, `controller_in_background`, `invert_camera_x`, `menu_shortcut` and `command_palette_key` read their defaults, and Walk speed set to 50% was saved as `walk_speed = 50` in the profile's `settings.toml`. No FATAL line, and no system mod that did not start, in the log.

- Since then rebased onto `mod-api` d6b5bd512: the same diff (same patch-id). The game was not built again on it.
- `mod test game/mods/menu` on d6b5bd512: 52 passed. The updated layout tests fail on 582b6a1ab without this change (2 of 7) and pass with it.
- `cargo test` on 582b6a1ab, llvm-mingw: modtool 224 passed, sprint-walk 31, camera-centering 4, api 497; none failed. The rest of the Rust workspace was not run.
- `mise run test` (Windows, 12 at once) on 582b6a1ab: 782 passed, 39 failed, 50 skipped. The same 39, run without this change: all 39 fail. Some may come from this PC's setup. They are: `test_astc_upload_chunking`, `test_async_astc_upload_chunks`, `test_bind_memo`, `test_blocks_at_start`, `test_direct_buffer_writes`, `test_draw_stream_visibility`, `test_drawn_page_map`, `test_early_split_before_draw`, `test_flat_map`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_game_menu_mouse_buttons`, `test_helpers_extract`, `test_image_reaper_threads`, `test_import_reach`, `test_input_movie`, `test_late_fix_build`, `test_lifter`, `test_longshot_builder`, `test_menu_i18n`, `test_mirror_bookkeeping`, `test_pass_barrier`, `test_present_acquire_ahead`, `test_present_image_free`, `test_readback_timeout_reuse`, `test_recorder_sync`, `test_recording_admission`, `test_report_words`, `test_staging_burst`, `test_target_retention`, `test_tex_desc_memo`, `test_text_keyboard_policy`, `test_ub_snapshot_default`, `test_ub_snapshot_gpu_writes`, `test_ui_keys_by_keycode`, `test_vram_compact`, `test_wb_diff_stale_shadow`, `test_wb_pending_capture`, `test_wrote_regions`.
- `mise run lint`: passes. `scripts/check_guide_screenshots.py --review-sources`: the same as without this change.
- `dev.py smoke` on 582b6a1ab: FAIL, only because its screenshot was not taken ("the PNG could not be written"); the game was in play and the Insert menu opened. Whether it fails without this change was not checked.

**Still to test:** None.

## Measurements

Nothing to measure: the rows' order and three headings on one menu tab, no rendering or game code.

## Risks

A player sees the Controls tab's rows in a new order, under three headings; their saved settings are unchanged (no key
changed). A mod that places a row `before` or `after` `controls_page` now gets it under General. One with a place in the
Controls tab and no section gets it above General. A revert is enough.

## Checklist

### Ready for review

- [x] One topic, on current `mod-api`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `mod-api` is named).
- [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] Screenshots of the same spot on `mod-api` and here, for a change that shows on screen. (Here only, in a comment: the row names, with the background made black so no game art is in it. No picture of `mod-api` without the change was taken; its order is the old `controls` list in PLACED, `game/mods/menu/test/menu.test.ts`.)
- [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)

Reviewed-on: #2993
Pages are drawn whole and kept, so switching tabs is immediate. Compact is a saved setting at the bottom left. Cards
are 90% opaque, submenus have a title with a back button, each page keeps its scroll, the help card follows the
mouse, Page Up and Down step by section and Home and End switch tabs. Cheats show one switch until on, Autosave and
the FPS counter are on Debug, built-in mods are in a shut section with each mod's state, and the permissions page is
rewritten. A checkbox's whole row toggles it, with a fill and no edge under the pointer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
feat(ui): the mouse cursor shows what a click does: a hand over what is pressed, an I-beam over text fields
Some checks failed
CI / What the change needs (pull_request) Successful in 6s
PR description / Title and description (pull_request_target) Successful in 35s
CI / Third-party parts and guide screenshots (pull_request) Successful in 10s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
b9bf697bb3
The UI engine works out the cursor's shape for what is under the pointer each present (MkwUiOutput.cursor, in the
old pad slot: MKW_UI_VERSION 10): a hand over Pressables (buttons, links, checkboxes, section titles, Back), Choices
(the power menu), Sliders, Keybinds, Tabs' titles, List rows, dropdown options, a window's close box and a row's name
that presses its checkbox; an I-beam over a TextInput; left-right over a Compare and while a slider is dragged; move
and corner-resize for a window's drag and grip; the arrow over disabled controls, a Canvas, a Scroll, anything else,
in the keys' and controller's mode and with the pointer away. A `cursor` prop (CSS's names) on what the pointer finds
sets a node's own shape.

The renderer hands a change to the host (MkwVkHost.cursor, MKWVK_API_VERSION 88); the window's thread sets the
system cursor, each made once: SDL_CreateSystemCursor/SDL_SetCursor on Linux, WM_SETCURSOR and IDC_* on Windows,
the arrow while the cursor is hidden or the mouse captured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
- The renderer filled the bar left of a picture narrower than the window with the old settings column's colour while
  the menu was open (vk_ui.cpp ui_draw): gone, so nothing is painted outside the cards and the banner.
- Compact: the card sits at the bottom margin (the left one's) while the controller bar is hidden, and the bar pushes it
  up while it shows, the help card level with it; the hosted page moves with it (Host::lift), eased with the bar.
- A close: the game side hands the menu frame's messages to the UI thread with the present's own input
  (UiThread::present_with), so its Gone is never applied with an older input that still hosts the page; ui_tick reads
  whether the menu is open once, so a close mid-tick no longer clears the page's ask under it.
- A safety net: with the menu closed, ui_draw draws a hosted root, or what goes over it, only for the debug page in
  play; one dropped for more than two presents in a row is logged once (its root, the frame's serial, the ask, the
  menu's state), so a stuck page names its path in the game's log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
fix: mod-api's failing checks
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2220db70c5
- test_menu_i18n: the two stale texts (Compact menu's old "bottom right" help, the old Debug tools help) dropped from
  the menu's tables; the field's words are None and Cancel (it has no Done).
- test_text_keyboard_policy: clang's pragmas only under clang (GCC's -Wall called them unknown), the fixture's stand-in
  for hos_scene_rgba16f and display_sdl.c's ui_key_vk.
- The website's graphics settings: #2993 put a Keyboard link and a Keyboard row on the Controls tab; a card matches the
  link or the row by its "Opens ..." line, the link's id gets "-page", and the Keyboard and Controller links have help
  (translated), so every card has the menu's description.
- settings_now's own start state for its test (228d07e92f40), its thread_local's doc comment inside the macro (clippy's
  "unused doc comment").
- Cost tests in a debug build: the debug script engine is several times slower than the release's, which cpuScale does
  not measure. The fake game says `game.optimized`; fps-counter's and the menu's ceilings hold only in an optimised
  build (their numbers still logged), the release ceilings unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
fix(modapi): the #2822 review's saves, security, menu and effect findings
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
528a79a191
Fixed, each with a game-free test unless said:
- B1: the game's save moments reach the mods' storage and the undo journal. The save
  trace's request comes through game_core::engine::Wiring, a required struct at
  install (no setter left to forget); host/nn_fs.c tells game_save_note of a slot's
  progress.sav read (a load), written and closed (staged), its Commit (written), a
  slot folder made or deleted. (save_notes.rs tests; the host hooks compile on Linux
  and llvm-mingw, unproven in a game run.)
- B2: Autosave: Off drops the Transition autosave: the save trace reads the settings
  snapshot itself, so no knob can be left unset (session.rs test).
- B3: Enable cheats asks first, Cancel chosen first, with its 13 translations; the
  manifest allows confirm on a toggle (asked before it turns on).
- B4: undo keeps what a give or take changed, not what it asked (a song known adds
  0, nothing held takes 0, a part-full pouch and the key clamp count what moved).
- B5: a new game made or the title screen drops every journal entry.
- B6: removing a mod forgets its trust grants (all profiles); a new id in a profile,
  an install, and an import over other files forget leftovers too.
- B7: open, perf_send and remove check a game-named path by its text (no UNC or
  device form, under the allowed root) before it touches the file system; refusals
  count against open's rate limit.
- B8: folders are opened as the Folder class with a trailing separator
  (ShellExecuteExW, SEE_MASK_CLASSNAME). Unverified: not compiled or run on Windows.
- B11: an effect that ran forgets the draw path's bound pipeline as well as its
  pushes, inside the effect runner (draw_state_disturbed), for every caller.
- B14: a gamepad slot lists None first and can be unbound.
- B15: an old discord_status=0 keeps system/discord off until the Mods tab says
  otherwise; the user docs no longer say the old discord_* lines are read.
- B16: Longshot's own effects are never stopped by the GPU budget, and one slow
  sample stops none (3 in a row far over, or the average).
- B17 (part): the profile's old settings.ini is copied into settings/, not moved.
- Open question 1: memory writes are not made lasting by a save.
- Open question 6: a hot reload's new write stands over the old instance's waiting
  undo, and keeps the first "before".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
perf(vk): the pipeline notes are stored without their zeros (#3027)
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
7d5f971833
## Summary

A pipeline note is the draw state as it lies in memory, about 27 KB of which about 105 bytes are not zero. After a preparation `longshot_pipelines.bin` is about 1.05 GB (38,774 notes here), 99.7% of it zeros. Each note is now stored as its runs of non-zero bytes.

On top of `mod-api` ([#2822](#2822)). See [#1649](#1649): with [#3023](#3023) this covers what it proposes, so it can be closed once both are in.

Read first: `gpu/vk/note_pack.h` (the format, the walk, the append and the conversion), then `notes_pack_file`, `notes_open_locked`, `pipe_notes_refs` and `pipe_note_at` in `gpu/vk/vk_draw.cpp`.

- The head's second word is the note size with its top bit set for a packed file; records are `[length][runs]`.
- An existing file is converted once, before it is first read or opened to add to, keeping its notes and stamp: no new preparation. If the new file can't be written, the old one is read and added to as before.
- The conversion writes a staging file of its own and replaces the notes only if they did not change meanwhile. A note that is not written whole is rolled back and none is added again that run. A file that can't be walked is left alone and not added to.
- A reference's place carries a bit saying its record is packed, so the by-position readers are unchanged.
- No new library. `PipeNote` and `kNotesFormat` are unchanged.

## Testing

**Tested:** Linux, RTX 3090, NVIDIA 620.70.06, head 355a203bc9 on `mod-api` d6b5bd5123.
- A runtime with an existing 1,052,481,472-byte notes file (38,774 notes). `dev.py smoke` PASS twice: the first start logs `stored without their zeros, 1003 MB made 7 MB`, and both find `38774 noted pipelines`. Those two confined runs had no kept programs, so built nothing from the notes.
- One play run with `HOS_SANDBOX=0` (in play, then the Market): 38,774 notes found, 9,346 graphics pipelines made at load from the packed records (0 not in a cache), 5,196 loads, no read failures.
- The game run found a bug the tests did not: the preparation's state list opens the file to add to before anything reads it, so it was never converted. Fixed, with a check in `test_pipelines_outlive_cache_format`.
- A harness over `note_pack.h` on a copy of a real file: all 38,774 records read back byte for byte, 1052.5 MB to 7.6 MB, converted in 1.36 s.
- `mise run test` (before that last fix): 825 passed, 35 failed, 12 skipped; the same 35 names fail on untouched `mod-api` 582b6a1a (not rerun on the newer base): `test_astc_upload_chunking`, `test_async_astc_upload_chunks`, `test_bind_memo`, `test_blocks_at_start`, `test_direct_buffer_writes`, `test_drawn_page_map`, `test_draw_stream_visibility`, `test_early_split_before_draw`, `test_flat_map`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_import_reach`, `test_late_fix_build`, `test_lifter`, `test_menu_i18n`, `test_mirror_bookkeeping`, `test_pass_barrier`, `test_present_acquire_ahead`, `test_present_image_free`, `test_readback_timeout_reuse`, `test_recorder_sync`, `test_recording_admission`, `test_report_words`, `test_staging_burst`, `test_target_retention`, `test_tex_desc_memo`, `test_text_keyboard_policy`, `test_ub_snapshot_default`, `test_ub_snapshot_gpu_writes`, `test_vk_wb_cpu_words_fast`, `test_vram_compact`, `test_wb_diff_stale_shadow`, `test_wb_pending_capture`, `test_wrote_regions`. After the fix: the note tests, 15 passed. `dev.py vk` builds the renderer.
- New `tests/test_note_pack.py`: round trips, damaged runs, conversion, a part record, a length no record has, a write that fails.

**Still to test:**
- Windows and Steam Deck: build, an existing notes file converted, a preparation, a restart and play that adds notes, with the same note count each start (by hand or @Beanstalk).

## Measurements

**Verdict:** the notes take 139x less disk. Frame rate was not measured.

Setup: Linux, RTX 3090. Size and conversion: the harness above on a copy of one file. The start's walk of the notes: the log's `the notes' file walked 1 times this start, in N ms`, from different runtimes and not interleaved, so rough. `main` itself was not run: the first column is the unpacked format, which `main` and this PR's base share, measured on builds of the base.

| | Before: main @ b40214d2bb | After: this PR @ 355a203b |
|---|---|---|
| `longshot_pipelines.bin` | 1052.5 MB | 7.6 MB |
| the start's walk of the notes | 483 and 610 ms | 51 ms |
| conversion, once | | 1.4 s |

## Risks

- **A build from before this that shares the folder** takes a packed file for another layout and starts its notes again (the state list brings many back).
- The start's walk reads and unpacks every record (measured above).
- A wrong reader here means pipelines not prepared, and draws left out while they compile in play.
- A revert alone does not read a converted file: it starts the notes again.

## Checklist

This PR's base is `mod-api`: read `main` below as the base.

### Ready for review

- [x] One topic, on current `main`; the title is a Conventional Commit.
- [x] Tested on my own PC, in the game for a change the game runs, as Testing says.
- [x] `mise run test` passes (any failure that also fails on `main` is named).
- [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.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #3027
The builder serves the pads on every start it makes, and its protocol carried only the two motors and the sensors, so
Switch Pro HD rumble, all of RenHDrum's output, DualSense HD Haptics and trigger kicks, the pad speaker's effects and
the headphone jack were lost for everyone (#2822 review, B12).

A pad's other outputs are now messages of their own on the pads connection (type 16, build_core::pads::Out): SDL's
effect call (a Switch pad's rumble packet, a DualSense's effects block), an Xbox pad's trigger motors, output reports
written on the builder's own HID handle (a DualSense's Bluetooth haptics 0x32/0x36, a Steam Controller (2026)'s grips
0x88/0x86), that handle's close, a DualSense's headphone jack and its device container (Windows, to find its sound
card). The builder checks each against its form and the kind of pad it goes to, before any device is touched; no path,
feature report or report read crosses. HID reports are written by a builder thread, so neither the game nor its polls
wait for a Bluetooth write. host/hos_sdl.c routes the calls; RenHDrum and the speaker open a pad's HID device by pad, not
by path. The "Motors: sandbox" status is gone.

Q8: a pads greeting that gets no answer keeps the pads the builder's and is tried again after a backoff (1 s doubling to
30 s, a new end from the builder each time), instead of being remembered as "no" for the run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
test(builder): a refused open counts toward the one a second
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
acf87e31b1
The review's fix made refusals count, and the old test and docs still said they did not.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
fix(modapi): the #2822 review's code-mod, network, keybind, SPIR-V and items findings
Some checks failed
PR description / Title and description (pull_request_target) Successful in 37s
CI / What the change needs (pull_request) Successful in 7s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
b15d47e303
Fixed, each with a game-free test that fails without it:
- B9: which of a profile's mods bring code is one shared crate, code-mods: the
  walk of mods/ (folders and packages), the store pins of profile.json, the merge
  of two copies of an id, the code files (sites.toml; ExeFS from a folder or a
  pin, never a package) and their hash. The builder (game_files::code_mods,
  modsites, its stamp) and the game's loader both use it, so a packaged or
  store-installed mod's hook sites are built and both stamps agree (api loader
  test: a package and a pin, both stamps equal; code-mods and game-files tests).
- B10: one rule for the network: ModManifest::network (the required network
  permissions). The game sends a running mod's grants within it (an optional origin
  granted in the game is not sent); the builder's engine judges each part apart
  (Bound::clip): a part outside is left out with why, the rest kept, an open there
  says why. A grant refused before the player's yes is judged again before the next
  open once the bounds move (GrantBounds::generation, moved by Bounds::stale on a
  confirmation or a mods change). (net-broker engine tests, api net test)
- B13: one key-name table, the key-names crate (the UI's Keybind, the manifest's
  keybind check and schema, host-sys's key reads and the Controls grid's names);
  the renderer gets codes from game_mod_keys and keeps no table. New names:
  CapsLock and the mouse's buttons (MouseLeft, MouseRight, MouseMiddle, Mouse4,
  Mouse5). A listening Keybind says so (MKW_UI_OUT_LISTENS) and the renderer then
  sends Shift, Ctrl and Alt too; it takes a mouse button pressed after it began;
  Delete while it listens clears it. (game-ui test)
- SPIR-V check: the C (gpu/vk/fx_spirv.h) and the Rust port (api::spirv) are both
  kept and share one set of cases, tests/data/spirv_cases.json (made by
  tests/spirv_cases.py), each judged alike word for word. Holes closed in both:
  the loop's counter stored in its header block; a pointer copied or chosen
  (OpCopyObject, OpSelect, OpPhi); a store judged by the memory its pointer points
  into, through any access chain; every type operand and result type a type; the
  C's push-constant offset check done in 64 bits and a decoration of 0xFFFFFFFF
  refused as the port refuses it.
- Q5: a give or take of a pouch item inside the pouch's own add on the same thread
  (a mod's items.pouchAdd listener calling items.remove or items.give) is "not
  now" before the game is called: the add would run inside itself and the outer
  add's tag be lost. A nested hook visit was already missed, not run (in_place's
  lending guard, the runtime's try_lock): no recursion or deadlock there.
  (game-core items test)

Not in this commit: B6's binding of grants to a mod's source and id, and Q4 (Skip
title must not load an unchosen save on a failed pick), which needs a game run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
feat(mods): a mod says what it does and where its source is: manifest description and sourceCode, carried by a repo's index and search/details
Some checks failed
PR description / Title and description (pull_request_target) Successful in 39s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 1m14s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 2m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m8s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 11m47s
CI / Website build and checks (pull_request) Successful in 2m11s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
72711731c5
The launcher shows a selected mod's description and links to its source above its licence. mod.toml's
description (1 to 1024 bytes) is now read for every mod, and sourceCode (an https:// page) is new; both are in the
normal manifest (installed), and mod publish copies them into the index's description and source_code, which
search and details return. A repo index with them is refused by older builders (deny_unknown_fields).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
feat(pads): RenHDrum 0.7.1 with game-aware DualSense triggers and the speaker over Bluetooth (#2945)
All checks were successful
PR description / Title and description (pull_request_target) Successful in 32s
02944239c8
- third_party/renhdrum: v0.5.0 -> v0.7.1; the host takes any later 0.x (RENHDRUM_ABI_COMPATIBLE).
- R2 follows the item on ZR through RenHDrum's trigger director (bow and slingshot, Hookshot, hammer,
  Din's Fire), let go in menus, loads and ocarina waits. Row dualsense_hd_triggers, on by default.
  The game's input is not changed.
- The Controller speaker plays over Bluetooth with HD Haptics on (game_audio_push into report 0x36).
- HOS_SWITCH2_HD=1 (experimental, untested on hardware): a Switch 2 Pro on USB plays RenHDrum's HD
  Rumble 2 reports through the builder, which limits their power and silences the pad when they stop.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

Tested in game: Linux, RTX 3090, driver 620.70.06: runtime built and dev.py smoke passed (kokiri-start, 900 frames, menu opened), before the final rebase. No DualSense or Switch 2 Pro used and no renhdrum.so beside the runtime, so the new controller paths have not run in the game.

Tested in game: Linux, RTX 3090, driver 620.70.06: runtime built and dev.py smoke passed (kokiri-start, 900 frames, menu opened), before the final rebase. No DualSense or Switch 2 Pro used and no renhdrum.so beside the runtime, so the new controller paths have not run in the game.
Member

Tested on Windows 11 (AMD Ryzen AI 7 350 / Radeon 860M, 02944239c) with a DualSense over Bluetooth:

Build

  • scripts/renhdrum.py build + check succeeded cleanly on Windows (renhdrum.dll v0.7.1, 930,816 bytes, SHA-256 bc24ca3352187bdd983d830edf2e2bd1f47c0b0df89f1934979dcee00119d385, usable).
  • Host C / longshot-game.exe compiled and linked cleanly on Windows (llvm-mingw, Rust 1.99.1).

DualSense (Bluetooth) results

  • Controller speaker over Bluetooth: Works — game sounds play through the DualSense speaker wirelessly (pad speaker: playing on the DualSense over Bluetooth (RenHDrum's reports)).
  • Game-aware R2 trigger (Slingshot on ZR): Works — resistance engages on R2 (vibration: R2: RenHDrum item 1 on ZR, ammunition 36).

Feel / tuning feedback (non-blocking)

  • Trigger resistance: R2 resistance on the Slingshot feels quite strong at the current level.
  • Bluetooth speaker volume: Default controller speaker volume (100%) is quite loud over Bluetooth.

Both work well overall — I'd recommend landing this PR as-is and re-evaluating those default levels in a follow-up PR.

Not tested in this pass

  • DualSense over USB, other ZR items (Bow, Hookshot/Longshot, Megaton Hammer, Din's Fire), two DualSenses, and Switch 2 Pro (HOS_SWITCH2_HD=1).
Relevant log lines
[hos host] longshot v3.2.0-267-g02944239c (source 7a40e1f2)
[hos host] hid: controller "DualSense Wireless Controller" connected (SDL in the builder), with a gyroscope
[hos host] vibration: RenHDrum 0.7.1 loaded
[hos host] vibration: the DualSense's voice coils over Bluetooth (report 0x36, HD Haptics)
[hos host] vibration: "DualSense Wireless Controller": fine haptics over Bluetooth (RenHDrum)
[hos host] pad speaker: playing on the DualSense over Bluetooth (RenHDrum's reports)
[hos host] [debug] vibration: R2: RenHDrum item 0 on ZR, ammunition -1
[hos host] [debug] vibration: R2: RenHDrum item 1 on ZR, ammunition 36
[hos host] pad speaker: no longer over Bluetooth (the game is closing)
Tested on **Windows 11** (AMD Ryzen AI 7 350 / Radeon 860M, `02944239c`) with a **DualSense over Bluetooth**: ### Build - `scripts/renhdrum.py build` + `check` succeeded cleanly on Windows (`renhdrum.dll` v0.7.1, `930,816` bytes, SHA-256 `bc24ca3352187bdd983d830edf2e2bd1f47c0b0df89f1934979dcee00119d385`, `usable`). - Host C / `longshot-game.exe` compiled and linked cleanly on Windows (`llvm-mingw`, Rust 1.99.1). ### DualSense (Bluetooth) results - **Controller speaker over Bluetooth:** Works — game sounds play through the DualSense speaker wirelessly (`pad speaker: playing on the DualSense over Bluetooth (RenHDrum's reports)`). - **Game-aware R2 trigger (Slingshot on ZR):** Works — resistance engages on R2 (`vibration: R2: RenHDrum item 1 on ZR, ammunition 36`). ### Feel / tuning feedback (non-blocking) - **Trigger resistance:** R2 resistance on the Slingshot feels quite strong at the current level. - **Bluetooth speaker volume:** Default controller speaker volume (`100%`) is quite loud over Bluetooth. Both work well overall — I'd recommend landing this PR as-is and re-evaluating those default levels in a follow-up PR. ### Not tested in this pass - DualSense over USB, other ZR items (Bow, Hookshot/Longshot, Megaton Hammer, Din's Fire), two DualSenses, and Switch 2 Pro (`HOS_SWITCH2_HD=1`). <details> <summary>Relevant log lines</summary> ```text [hos host] longshot v3.2.0-267-g02944239c (source 7a40e1f2) [hos host] hid: controller "DualSense Wireless Controller" connected (SDL in the builder), with a gyroscope [hos host] vibration: RenHDrum 0.7.1 loaded [hos host] vibration: the DualSense's voice coils over Bluetooth (report 0x36, HD Haptics) [hos host] vibration: "DualSense Wireless Controller": fine haptics over Bluetooth (RenHDrum) [hos host] pad speaker: playing on the DualSense over Bluetooth (RenHDrum's reports) [hos host] [debug] vibration: R2: RenHDrum item 0 on ZR, ammunition -1 [hos host] [debug] vibration: R2: RenHDrum item 1 on ZR, ammunition 36 [hos host] pad speaker: no longer over Bluetooth (the game is closing) ``` </details>
HumanBean force-pushed renhdrum-071 from 02944239c8
All checks were successful
PR description / Title and description (pull_request_target) Successful in 32s
to 49f7a5b91e
All checks were successful
PR description / Title and description (pull_request_target) Successful in 37s
2026-12-03 05:22:44 +00:00
Compare
HumanBean changed title from WIP: feat(pads): RenHDrum 0.7.1 with game-aware DualSense triggers and the speaker over Bluetooth to WIP: feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full 2026-12-03 05:22:49 +00:00
Author
Owner

Second round, force-pushed (was 02944239) and rebased on current mod-api: the rest of upstream's Longshot features (light bar and mic light, Hookshot trigger options, touchpad Map/Pause, several DualSenses, weak-rumble lift, Xbox direct rumble, crisp notes, volume pin), new options translated, seven problems from a cold review fixed, and the manifest schema's 64-setting cap now applies to player mods only. Description rewritten. None of the controller behaviour has run on hardware yet.

Second round, force-pushed (was 02944239) and rebased on current `mod-api`: the rest of upstream's Longshot features (light bar and mic light, Hookshot trigger options, touchpad Map/Pause, several DualSenses, weak-rumble lift, Xbox direct rumble, crisp notes, volume pin), new options translated, seven problems from a cold review fixed, and the manifest schema's 64-setting cap now applies to player mods only. Description rewritten. None of the controller behaviour has run on hardware yet.
Author
Owner

@Jer9 thanks, your run is now under Testing, and it corrects my last comment: the Windows build, the Bluetooth speaker and the slingshot trigger had run on hardware (on 02944239). The current head adds more on top, none of which has been on a controller. Your two notes (strong slingshot resistance, loud speaker default over Bluetooth) are recorded there; defaults are unchanged for now.

@Jer9 thanks, your run is now under Testing, and it corrects my last comment: the Windows build, the Bluetooth speaker and the slingshot trigger had run on hardware (on 02944239). The current head adds more on top, none of which has been on a controller. Your two notes (strong slingshot resistance, loud speaker default over Bluetooth) are recorded there; defaults are unchanged for now.
HumanBean changed target branch from mod-api to main 2026-12-03 05:48:42 +00:00
HumanBean force-pushed renhdrum-071 from 49f7a5b91e
All checks were successful
PR description / Title and description (pull_request_target) Successful in 37s
to 8e666392d5
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-12-03 07:00:50 +00:00
Compare
Author
Owner

Pushed: rebased on main, and RenHDrum is now built into the game (no renhdrum.dll/.so). Not yet built and run on Linux at this head; that is running next. Note the merge order under Risks: the release workflow has to change before this merges.

Pushed: rebased on `main`, and RenHDrum is now built into the game (no `renhdrum.dll`/`.so`). Not yet built and run on Linux at this head; that is running next. Note the merge order under Risks: the release workflow has to change before this merges.
First-time contributor

Thanks a lot for taking the whole HD Haptics+ set upstream, and for the careful Risks list. Some notes from my side, plus an offer to help test.

Testing: I have a DualSense (USB and Bluetooth) and can go through most of "Still to test": R2 with each ZR item, light bar and mic light, Bluetooth speaker, touchpad halves, analog-trigger Hookshot, and the pad log if useful. I've built and tuned these on my fork, so I can tell quickly whether each one feels the way it should. I'll build your branch and report back here.

R2 strength and speaker volume (Jer9's feedback): rather than lowering the defaults, I'd suggest exposing them as levels (for example trigger strength 25 / 50 / 75 / 100 %, next to the existing speaker volume setting). With this many players, one number won't suit everyone. For context, my defaults weren't picked at random: I tuned them by playing PS5 games with similar moments (bows, grapples, heavy weapons) and comparing, and by reading what's published about how those developers set up DualSense trigger effects. I'm happy to add a strength setting to the RenHDrum core so it's one option for every host.

Hookshot squeeze / let-go: could it be on by default? It's the feature I'm most proud of, and I think it's the most "only on DualSense" moment in the build. R2 has two stops: the first puts you into aiming, the second is heavier and ends with a kick from the trigger as the Hookshot fires. Every shot feels physical. It does change the controls a little (a two-step pull), so I understand if you prefer it off, but I'd love it to be the default experience.

Switch Pro (1): why light rumble is weaker in 0.7.1. OoT here is a Switch 2 game, and Switch 2 games write rumble for the Switch 2 Pro's stronger motors. On a real Switch 2, the console rescales that rumble when you hold an older Pro controller. Nintendo's patent describes the shape of that rescaling but not the numbers, so RenHDrum's numbers were tuned by feel. A user comparing against a real console reported that light rumble was too strong (https://github.com/trzz1214/RenHDrum/issues/15). In 0.7.0, light hits were boosted up to ~5x; 0.7.1 is gentler (0.1 → 0.17 instead of 0.24), and heavy hits stay strong. So it's intentional and closer to the console, but still a best guess until someone measures a real Switch 2, and it may change again in 0.7.2.

Xbox direct rumble: I'm reworking it. The current approach doesn't feel good enough yet, so I'm trying a different one. Keeping it off by default is right for now; if the new version is ready in time I'll let you know so it can come along.

Switch 2 Pro header 0x70 vs 0x50: pro2_build_report follows 101Leafy's measurements (Frizti/Fritchii#6). I don't own a Switch 2 Pro myself and I don't know what the high nibble means, so your 0x50 capture may be a different packing rather than an error on either side. If you can share the bytes you measured, I'll compare and fix the core if mine is wrong. Keeping it behind HOS_SWITCH2_HD=1 makes sense.

panic = "abort": RenHDrum's C ABI wraps every entry point in catch_unwind, so a bug only silences rumble instead of taking the host down. Built in with panic = "abort", that safety net is gone. I'll go through the core and remove panics that bad input could reach, so it's safe either way.

Thanks a lot for taking the whole HD Haptics+ set upstream, and for the careful Risks list. Some notes from my side, plus an offer to help test. **Testing:** I have a DualSense (USB and Bluetooth) and can go through most of "Still to test": R2 with each ZR item, light bar and mic light, Bluetooth speaker, touchpad halves, analog-trigger Hookshot, and the pad log if useful. I've built and tuned these on my fork, so I can tell quickly whether each one feels the way it should. I'll build your branch and report back here. **R2 strength and speaker volume (Jer9's feedback):** rather than lowering the defaults, I'd suggest exposing them as levels (for example trigger strength 25 / 50 / 75 / 100 %, next to the existing speaker volume setting). With this many players, one number won't suit everyone. For context, my defaults weren't picked at random: I tuned them by playing PS5 games with similar moments (bows, grapples, heavy weapons) and comparing, and by reading what's published about how those developers set up DualSense trigger effects. I'm happy to add a strength setting to the RenHDrum core so it's one option for every host. **Hookshot squeeze / let-go: could it be on by default?** It's the feature I'm most proud of, and I think it's the most "only on DualSense" moment in the build. R2 has two stops: the first puts you into aiming, the second is heavier and ends with a kick from the trigger as the Hookshot fires. Every shot feels physical. It does change the controls a little (a two-step pull), so I understand if you prefer it off, but I'd love it to be the default experience. **Switch Pro (1): why light rumble is weaker in 0.7.1.** OoT here is a Switch 2 game, and Switch 2 games write rumble for the Switch 2 Pro's stronger motors. On a real Switch 2, the console rescales that rumble when you hold an older Pro controller. Nintendo's patent describes the shape of that rescaling but not the numbers, so RenHDrum's numbers were tuned by feel. A user comparing against a real console reported that light rumble was too strong (https://github.com/trzz1214/RenHDrum/issues/15). In 0.7.0, light hits were boosted up to ~5x; 0.7.1 is gentler (0.1 → 0.17 instead of 0.24), and heavy hits stay strong. So it's intentional and closer to the console, but still a best guess until someone measures a real Switch 2, and it may change again in 0.7.2. **Xbox direct rumble:** I'm reworking it. The current approach doesn't feel good enough yet, so I'm trying a different one. Keeping it off by default is right for now; if the new version is ready in time I'll let you know so it can come along. **Switch 2 Pro header `0x70` vs `0x50`:** `pro2_build_report` follows 101Leafy's measurements (Frizti/Fritchii#6). I don't own a Switch 2 Pro myself and I don't know what the high nibble means, so your `0x50` capture may be a different packing rather than an error on either side. If you can share the bytes you measured, I'll compare and fix the core if mine is wrong. Keeping it behind `HOS_SWITCH2_HD=1` makes sense. **`panic = "abort"`:** RenHDrum's C ABI wraps every entry point in `catch_unwind`, so a bug only silences rumble instead of taking the host down. Built in with `panic = "abort"`, that safety net is gone. I'll go through the core and remove panics that bad input could reach, so it's safe either way.
HumanBean force-pushed renhdrum-071 from 8e666392d5
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
to f2bca051ea
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 09:05:33 +00:00
Compare
Author
Owner

Pushed: rebased on main, with the fixes from a second cold review (listed under Testing). Open points kept as they are are under Risks. None of it has run on a controller since Jer9's run.

Pushed: rebased on `main`, with the fixes from a second cold review (listed under Testing). Open points kept as they are are under Risks. None of it has run on a controller since Jer9's run.
First-time contributor

Tested head 8e666392d on Windows 11 (RTX 4060) with a DualSense, both USB and Bluetooth.

RenHDrum / DualSense: all good. HD Rumble and the game-aware triggers behave exactly as designed: slingshot and bow tension, running out of ammo, Hookshot / Longshot, Din's Fire and the Megaton Hammer, and the trigger releasing in menus and while playing the ocarina. The light bar and the speaker over Bluetooth work too.

Speaker is too loud (same as Jer9's note), over both USB and Bluetooth. 100% should be about half of today's level. I've changed this in the RenHDrum core for the next release: the controller speaker volume's 100% now equals half the old level (200% still reaches the old maximum), with no change to rumble or haptics. That covers the Bluetooth path, which goes through game_audio_push. The wired speaker goes through host/pad_speaker.c, so it would need the same halving on your side.

Outside RenHDrum: I also often had Link not moving or drifting on his own. That looks like a general input issue in this build rather than anything rumble-related, so I'm only mentioning it in case it's not already known.

Happy to test again on the next round.

Tested head `8e666392d` on Windows 11 (RTX 4060) with a DualSense, both USB and Bluetooth. **RenHDrum / DualSense: all good.** HD Rumble and the game-aware triggers behave exactly as designed: slingshot and bow tension, running out of ammo, Hookshot / Longshot, Din's Fire and the Megaton Hammer, and the trigger releasing in menus and while playing the ocarina. The light bar and the speaker over Bluetooth work too. **Speaker is too loud** (same as Jer9's note), over both USB and Bluetooth. 100% should be about half of today's level. I've changed this in the RenHDrum core for the next release: the controller speaker volume's 100% now equals half the old level (200% still reaches the old maximum), with no change to rumble or haptics. That covers the Bluetooth path, which goes through `game_audio_push`. The wired speaker goes through `host/pad_speaker.c`, so it would need the same halving on your side. **Outside RenHDrum:** I also often had Link not moving or drifting on his own. That looks like a general input issue in this build rather than anything rumble-related, so I'm only mentioning it in case it's not already known. Happy to test again on the next round.
HumanBean force-pushed renhdrum-071 from f2bca051ea
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 43d68a7093
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 16:34:34 +00:00
Compare
HumanBean force-pushed renhdrum-071 from 43d68a7093
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to f60d52b7d7
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 16:35:35 +00:00
Compare
Author
Owner

Pushed f60d52b7d7, rebased on main 1c91b18f. New since the last push:

  • L2 pulses when Link takes damage; mod rumble now plays on RenHDrum pads.
  • Switch Pro Detailed (5 ms) mode behind HOS_SWITCH_DETAILED, off, never run on a controller. The builder now lets the game write that pad's rumble report to its HID device.
  • Bluetooth headphones silence the HD Haptics taps; fixes from checking against the integration guides; a clearer "no sound card" hint.

Boot check passed on Linux; none of the new paths has run on a controller. The speaker volume and the drifting reported above are not addressed in this push. The release workflow change this needs is on MagicBeanAdmin/Release (d5925467).

Pushed f60d52b7d73d, rebased on `main` 1c91b18f. New since the last push: - L2 pulses when Link takes damage; mod rumble now plays on RenHDrum pads. - Switch Pro Detailed (5 ms) mode behind `HOS_SWITCH_DETAILED`, off, never run on a controller. The builder now lets the game write that pad's rumble report to its HID device. - Bluetooth headphones silence the HD Haptics taps; fixes from checking against the integration guides; a clearer "no sound card" hint. Boot check passed on Linux; none of the new paths has run on a controller. The speaker volume and the drifting reported above are not addressed in this push. The release workflow change this needs is on MagicBeanAdmin/Release (`d5925467`).
HumanBean force-pushed renhdrum-071 from f60d52b7d7
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to c6184395cc
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 18:12:38 +00:00
Compare
Author
Owner

Pushed c6184395cc, rebased on main 1780f597e7. New since the last push:

  • The Controller speaker on Linux over a cable (#3003), found by the card's name.
  • Every DualSense of one connection kind plays the speaker.
  • Vibration strength above 100 % now does something on a Bluetooth DualSense and a Steam Controller.
  • Fixed a release-script call that main's #3094 added to the renamed scripts/renhdrum.py.

Boot check passed on Linux. None of this has run on a controller. Testers wanted, with the controller and system in your reply:

  • Linux, DualSense on a USB cable: set a Controller speaker sound to "Controller only"; does it play on the pad?
  • Two DualSenses: do both play it?
  • Switch Pro: rumble as it is, then with HOS_SWITCH_DETAILED=1 in longshot_env.txt: any difference, any input lag?
  • Xbox One or Series, Windows or Linux: do all four motors, the triggers' too, play?
  • Any controller: did Link move or drift on his own, as reported above?
Pushed c6184395cc68, rebased on `main` 1780f597e7af. New since the last push: - The Controller speaker on Linux over a cable (#3003), found by the card's name. - Every DualSense of one connection kind plays the speaker. - Vibration strength above 100 % now does something on a Bluetooth DualSense and a Steam Controller. - Fixed a release-script call that `main`'s #3094 added to the renamed `scripts/renhdrum.py`. Boot check passed on Linux. None of this has run on a controller. **Testers wanted**, with the controller and system in your reply: - **Linux, DualSense on a USB cable:** set a Controller speaker sound to "Controller only"; does it play on the pad? - **Two DualSenses:** do both play it? - **Switch Pro:** rumble as it is, then with `HOS_SWITCH_DETAILED=1` in `longshot_env.txt`: any difference, any input lag? - **Xbox One or Series, Windows or Linux:** do all four motors, the triggers' too, play? - **Any controller:** did Link move or drift on his own, as reported above?
HumanBean changed title from WIP: feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full to feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full 2026-12-03 18:18:33 +00:00
Author
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The new multi-controller audio path has an unsynchronized shared state access and replaces a second controller’s haptic channel with the first controller’s. The newly enabled Bluetooth speaker is also reported too loud by both testers, and the current head still needs controller and build validation.

This updates RenHDrum, adds game-aware controller effects and Bluetooth speaker audio, and builds the library into the game. It expands controller support, but adds audio threads and routing complexity; the current multi-pad implementation has correctness problems.

Blocking (1): must change before merging.

  1. L1 host/rumble_renhdrum.c:491: The audio callback selects the first cable by reading the shared pad slots without the lock used to change them. (more on the line) Do: Protect selection and publication of the cable slots with the same synchronization, including initial publication, and keep the selected ownership valid for the callback.

Should fix (3): not blocking, but worth doing before merging.

  • L2 host/rumble_renhdrum.c:479: Mirroring replaces the second pad’s haptic speaker channel with the first pad’s combined audio and haptics. (more on the line) Do: Mirror only the game speaker contribution and add it to each pad’s own DSP output, preserving its haptic channel.
  • L3 host/pad_speaker.c:241: The new Bluetooth speaker path uses the existing full speaker boost at the default 100% level, which both controller testers reported as too loud. (more on the line) Do: Reduce the default Bluetooth speaker gain to a comfortable level, retaining the volume control for players who want more, and verify it on hardware.
  • L4 tests/test_pad_endpoint_linux.py:64: The new test ignores CC and assumes clang or cc is available under that name. (more on the line) Do: Honor CC using the repository’s compiler selection convention and handle an unavailable compiler explicitly.

Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)

  • L5: The Linux wired speaker fix and multi-controller routing need runs on the current head. When: The endpoint selection, mirrored audio and unplug handling are new on this head, but no controller has exercised them in the game. Do: Run wired DualSense audio and headphone routing on Linux, and two wired and two Bluetooth DualSenses with one unplugged, checking speaker output and haptics.
  • L6: The controller and platform paths changed since the recorded runs need current-head coverage. When: The current head changes polling, HID writers and backend selection for Xbox, Switch, Steam Controller and DualSense, but the reported controller runs predate these changes. Do: Build and run the current head on Windows and Linux with the affected controller families, including default and explicitly enabled experimental modes, and check input, rumble, shutdown and reconnection.
  • L7: The added polling, audio encoding and integrated Rust build have no measured cost. When: Players with Bluetooth audio enabled now encode audio and run per-pad writers, and all builds include the new Rust sources; the description supplies no frame-time, CPU or clean and incremental build comparison. Do: Compare repeated base and head runs in the same scene and settings, including frame times with controller audio active, and clean and incremental build time and size.

@fix can do L1, L2, L3 and L4.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • Is the reported movement loss or drift reproducible on the current head and on the base with the same controller and settings?

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven on this head. Two Windows testers confirmed Bluetooth speaker audio and triggers on earlier heads; one also checked USB and additional trigger effects. The Linux wired-speaker fix and later multi-pad changes have not been exercised on controllers, and no performance or build-time comparison is supplied.

Other systems: The changes affect controller polling, audio mixing, HID output, game builds and the builder protocol on Windows and Linux. Switch Pro, Switch 2 Pro, Xbox, Steam Controller, Linux DualSense audio, multiple DualSenses and the current Windows game build remain unverified. The release workflow must be updated first.

Switches: HOS_SWITCH2_HD, HOS_PAD_VOLUME_PIN and HOS_SWITCH_DETAILED are added, default off, and have switch-table rows. Their hardware behavior and appropriate defaults remain unverified.

Reviewed: c6184395cc against 1780f597e7: Read repository rules, CONTRIBUTING.md, standards and the PR template; docs/review-checklist.md is absent. Read the new trigger and light modules, the speaker routing and relevant RenHDrum and controller polling paths, the Linux endpoint test, commit message, description and tester comments; inspected portions of the builder and build-script diffs. The large vendored update, remaining changed files, translations, generated schema and all surrounding code were not read in full, so this is not a complete review.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance with a Co-Authored-By trailer.
  • The three new environment switches have entries in the switch table.
  • The reported Windows controller runs provide evidence for earlier revisions, with their limitations stated.

Testing: No code, tests, builds or scripts were run, as requested. CI was still running in the supplied results.

Overlaps and merge order: The release workflow change at MagicBeanAdmin/Release d5925467 must merge first; no other overlap was established.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new multi-controller audio path has an unsynchronized shared state access and replaces a second controller’s haptic channel with the first controller’s. The newly enabled Bluetooth speaker is also reported too loud by both testers, and the current head still needs controller and build validation. This updates RenHDrum, adds game-aware controller effects and Bluetooth speaker audio, and builds the library into the game. It expands controller support, but adds audio threads and routing complexity; the current multi-pad implementation has correctness problems. **Blocking (1)**: must change before merging. 1. **L1** `host/rumble_renhdrum.c:491`: The audio callback selects the first cable by reading the shared pad slots without the lock used to change them. (more on the line) **Do:** Protect selection and publication of the cable slots with the same synchronization, including initial publication, and keep the selected ownership valid for the callback. **Should fix (3)**: not blocking, but worth doing before merging. - **L2** `host/rumble_renhdrum.c:479`: Mirroring replaces the second pad’s haptic speaker channel with the first pad’s combined audio and haptics. (more on the line) **Do:** Mirror only the game speaker contribution and add it to each pad’s own DSP output, preserving its haptic channel. - **L3** `host/pad_speaker.c:241`: The new Bluetooth speaker path uses the existing full speaker boost at the default 100% level, which both controller testers reported as too loud. (more on the line) **Do:** Reduce the default Bluetooth speaker gain to a comfortable level, retaining the volume control for players who want more, and verify it on hardware. - **L4** `tests/test_pad_endpoint_linux.py:64`: The new test ignores CC and assumes clang or cc is available under that name. (more on the line) **Do:** Honor CC using the repository’s compiler selection convention and handle an unavailable compiler explicitly. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L5**: The Linux wired speaker fix and multi-controller routing need runs on the current head. *When:* The endpoint selection, mirrored audio and unplug handling are new on this head, but no controller has exercised them in the game. **Do:** Run wired DualSense audio and headphone routing on Linux, and two wired and two Bluetooth DualSenses with one unplugged, checking speaker output and haptics. - **L6**: The controller and platform paths changed since the recorded runs need current-head coverage. *When:* The current head changes polling, HID writers and backend selection for Xbox, Switch, Steam Controller and DualSense, but the reported controller runs predate these changes. **Do:** Build and run the current head on Windows and Linux with the affected controller families, including default and explicitly enabled experimental modes, and check input, rumble, shutdown and reconnection. - **L7**: The added polling, audio encoding and integrated Rust build have no measured cost. *When:* Players with Bluetooth audio enabled now encode audio and run per-pad writers, and all builds include the new Rust sources; the description supplies no frame-time, CPU or clean and incremental build comparison. **Do:** Compare repeated base and head runs in the same scene and settings, including frame times with controller audio active, and clean and incremental build time and size. `@fix` can do L1, L2, L3 and L4. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - Is the reported movement loss or drift reproducible on the current head and on the base with the same controller and settings? **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on this head. Two Windows testers confirmed Bluetooth speaker audio and triggers on earlier heads; one also checked USB and additional trigger effects. The Linux wired-speaker fix and later multi-pad changes have not been exercised on controllers, and no performance or build-time comparison is supplied. **Other systems:** The changes affect controller polling, audio mixing, HID output, game builds and the builder protocol on Windows and Linux. Switch Pro, Switch 2 Pro, Xbox, Steam Controller, Linux DualSense audio, multiple DualSenses and the current Windows game build remain unverified. The release workflow must be updated first. **Switches:** HOS_SWITCH2_HD, HOS_PAD_VOLUME_PIN and HOS_SWITCH_DETAILED are added, default off, and have switch-table rows. Their hardware behavior and appropriate defaults remain unverified. **Reviewed:** c6184395cc68 against 1780f597e7af: Read repository rules, CONTRIBUTING.md, standards and the PR template; docs/review-checklist.md is absent. Read the new trigger and light modules, the speaker routing and relevant RenHDrum and controller polling paths, the Linux endpoint test, commit message, description and tester comments; inspected portions of the builder and build-script diffs. The large vendored update, remaining changed files, translations, generated schema and all surrounding code were not read in full, so this is not a complete review.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance with a Co-Authored-By trailer. - The three new environment switches have entries in the switch table. - The reported Windows controller runs provide evidence for earlier revisions, with their limitations stated. **Testing:** No code, tests, builds or scripts were run, as requested. CI was still running in the supplied results. **Overlaps and merge order:** The release workflow change at MagicBeanAdmin/Release d5925467 must merge first; no other overlap was established. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -234,0 +238,4 @@
the pad's report 0x36 (host/rumble_renhdrum.c), so only the volume is ours. The mixer thread's. */
static void bt_write(const float *mono, int frames) {
float out[256];
const float scale = speaker_scale();
Member

L3 (should fix): The new Bluetooth speaker path uses the existing full speaker boost at the default 100% level, which both controller testers reported as too loud.

When: A player with the default controller speaker volume and Bluetooth HD Haptics enabled now hears controller-only sounds from the pad at the reported excessive level.

Do: Reduce the default Bluetooth speaker gain to a comfortable level, retaining the volume control for players who want more, and verify it on hardware.

**L3** (should fix): The new Bluetooth speaker path uses the existing full speaker boost at the default 100% level, which both controller testers reported as too loud. *When:* A player with the default controller speaker volume and Bluetooth HD Haptics enabled now hears controller-only sounds from the pad at the reported excessive level. **Do:** Reduce the default Bluetooth speaker gain to a comfortable level, retaining the volume control for players who want more, and verify it on hardware.
@ -318,0 +476,4 @@
/* (not a whole buffer there yet: this one is left as it is, and nothing is played twice) */
if (mirrored - l->mirror_at >= n)
for (uint32_t i = 0; i < n; i++, l->mirror_at++)
f[i * 4] = mirror[l->mirror_at % RH_MIRROR][0], f[i * 4 + 1] = mirror[l->mirror_at % RH_MIRROR][1];
Member

L2 (should fix): Mirroring replaces the second pad’s haptic speaker channel with the first pad’s combined audio and haptics.

When: With two cabled DualSenses and controller speaker routing active, channel 1 already contains each pad’s own HD Haptics taps. The mirror copies the first pad’s channel 1 over the second’s, so the second loses its own taps and receives the first pad’s instead.

Do: Mirror only the game speaker contribution and add it to each pad’s own DSP output, preserving its haptic channel.

**L2** (should fix): Mirroring replaces the second pad’s haptic speaker channel with the first pad’s combined audio and haptics. *When:* With two cabled DualSenses and controller speaker routing active, channel 1 already contains each pad’s own HD Haptics taps. The mirror copies the first pad’s channel 1 over the second’s, so the second loses its own taps and receives the first pad’s instead. **Do:** Mirror only the game speaker contribution and add it to each pad’s own DSP output, preserving its haptic channel.
@ -324,2 +489,3 @@
if (usb_dsp) filled = rh.dualsense_dsp_fill_f32(usb_dsp, f, (size_t)frames) >= 0;
if (l->dsp) filled = rh.dualsense_dsp_fill_f32(l->dsp, f, (size_t)frames) >= 0;
ReleaseSRWLockExclusive(&lk);
const int speaks = l == cable_first(); /* (the controller speaker's sounds: the first cable's) */
Member

L1 (blocking): The audio callback selects the first cable by reading the shared pad slots without the lock used to change them.

When: When a cabled DualSense connects or disconnects while another cable’s SDL callback runs, cable_first reads a pad pointer concurrently with the poll thread publishing or clearing it. That is a C data race and can select an inconsistent speaker owner.

Do: Protect selection and publication of the cable slots with the same synchronization, including initial publication, and keep the selected ownership valid for the callback.

**L1** (blocking): The audio callback selects the first cable by reading the shared pad slots without the lock used to change them. *When:* When a cabled DualSense connects or disconnects while another cable’s SDL callback runs, cable_first reads a pad pointer concurrently with the poll thread publishing or clearing it. That is a C data race and can select an inconsistent speaker owner. **Do:** Protect selection and publication of the cable slots with the same synchronization, including initial publication, and keep the selected ownership valid for the callback.
@ -0,0 +61,4 @@
print("FAIL: pad_endpoint does not use pad_endpoint_by_name off Windows")
return 1
cc = shutil.which("clang") or shutil.which("cc")
with tempfile.TemporaryDirectory() as folder:
Member

L4 (should fix): The new test ignores CC and assumes clang or cc is available under that name.

When: On a supported Windows or Linux test environment where the configured compiler is supplied through CC but neither executable is on PATH, the test passes None to subprocess instead of compiling its harness.

Do: Honor CC using the repository’s compiler selection convention and handle an unavailable compiler explicitly.

**L4** (should fix): The new test ignores CC and assumes clang or cc is available under that name. *When:* On a supported Windows or Linux test environment where the configured compiler is supplied through CC but neither executable is on PATH, the test passes None to subprocess instead of compiling its harness. **Do:** Honor CC using the repository’s compiler selection convention and handle an unavailable compiler explicitly.
HumanBean force-pushed renhdrum-071 from c6184395cc
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 0c2c15cc7f
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 21:42:51 +00:00
Compare
Author
Owner

Pushed 0c2c15cc7f, rebased on main 76092c5e5a. Boot check passed on Linux; none of these fixes has run on a controller.

Review of c6184395

  • L1: the audio callback picks the first cable and reads the slots under the lock that changes them; a pad is published under it too.
  • L2: the first pad's mirror now carries only what the game's speaker added, and each other pad adds that to its own output, so its haptic taps stay.
  • L3: speaker volume halved: 100 % is half of what it was, 200 % the old maximum, over cable and Bluetooth.
  • L4: the test honours CC and fails with a clear message without a compiler.
  • L5, L6: not done. They need controllers, listed under Still to test.
  • L7: not done. Nothing is measured, as Measurements says.
  • Drift on the base? Not known: nobody has run the base with the same controller.

@trzz1214, thanks for testing. The speaker is halved on both paths here; when the next RenHDrum release is vendored, our Bluetooth half has to come out again.

On Link not moving or drifting: I found no cause in the code, and this change leaves stick filtering as it was. One unproven guess: over Bluetooth, an item on ZR keeps the trigger effect streaming about every 11 ms, which might crowd a weak adapter. If you can, it would help to know:

  1. Did it happen over USB, Bluetooth or both?
  2. What was on ZR when it did?
  3. Does it still happen with "DualSense game-aware triggers" off?
  4. Does the same controller do it on a current main build?

The game's log from a run where it happened would help too (please check it for anything personal before posting).

Pushed 0c2c15cc7f90, rebased on `main` 76092c5e5a3b. Boot check passed on Linux; none of these fixes has run on a controller. **Review of c6184395** - **L1**: the audio callback picks the first cable and reads the slots under the lock that changes them; a pad is published under it too. - **L2**: the first pad's mirror now carries only what the game's speaker added, and each other pad adds that to its own output, so its haptic taps stay. - **L3**: speaker volume halved: 100 % is half of what it was, 200 % the old maximum, over cable and Bluetooth. - **L4**: the test honours `CC` and fails with a clear message without a compiler. - **L5, L6**: not done. They need controllers, listed under Still to test. - **L7**: not done. Nothing is measured, as Measurements says. - **Drift on the base?** Not known: nobody has run the base with the same controller. **@trzz1214**, thanks for testing. The speaker is halved on both paths here; when the next RenHDrum release is vendored, our Bluetooth half has to come out again. On Link not moving or drifting: I found no cause in the code, and this change leaves stick filtering as it was. One unproven guess: over Bluetooth, an item on ZR keeps the trigger effect streaming about every 11 ms, which might crowd a weak adapter. If you can, it would help to know: 1. Did it happen over USB, Bluetooth or both? 2. What was on ZR when it did? 3. Does it still happen with "DualSense game-aware triggers" off? 4. Does the same controller do it on a current `main` build? The game's log from a run where it happened would help too (please check it for anything personal before posting).
First-time contributor

Found the cause of the drifting I reported, and it's not this PR: I had Debug cheats on, and a double-tap of Jump toggles No-clip flight (even with its row Off). It stays on across save loads until the game is closed. I reproduced it. Sorry for the noise.

Side note, outside this PR: that shortcut is easy to trigger by accident.

Found the cause of the drifting I reported, and it's not this PR: I had Debug cheats on, and a double-tap of Jump toggles No-clip flight (even with its row Off). It stays on across save loads until the game is closed. I reproduced it. Sorry for the noise. Side note, outside this PR: that shortcut is easy to trigger by accident.
HumanBean force-pushed renhdrum-071 from 0c2c15cc7f
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to dcb564ea2b
Some checks failed
PR description / Title and description (pull_request_target) Failing after 6s
CI / What the change needs (pull_request) Successful in 6s
CI / Third-party parts and guide screenshots (pull_request) Successful in 10s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m29s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 21m23s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 15m52s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 15m20s
CI / Website build and checks (pull_request) Failing after 39s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 52m36s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m7s
2026-12-04 03:37:01 +00:00
Compare
Author
Owner

Rebased: dcb564ea2b on main f577a1aeab. Boot check passed on Linux; no controller path ran.

  • Conflicts were in menu strings (both sides' kept) and generated files (regenerated).
  • This change's lift of the 64-setting limit is dropped: main now has its own.
  • Tests still failing are listed under Testing; none is in code this change touches.

@trzz1214, thanks for tracking the drift down. Agreed that the no-clip shortcut is outside this PR; it is worth an issue of its own.

You offered to test again: if you have time, this head with your DualSense would help most. In order:

  1. Controller speaker at 100 % and 200 %, over USB and Bluetooth: is 100 % comfortable now?
  2. Take damage with "DualSense game-aware triggers" on: L2 should pulse.
  3. The R2 effects again (slingshot, bow, Hookshot, hammer, Din's Fire, menus).
  4. With a second DualSense, if you have one: both play the speaker, each trigger follows, and unplugging one leaves the other working.
  5. Headphones in the pad's jack over Bluetooth: its sounds go to the TV, with no taps from the pad.
Rebased: dcb564ea2bf4 on `main` f577a1aeabdb. Boot check passed on Linux; no controller path ran. - Conflicts were in menu strings (both sides' kept) and generated files (regenerated). - This change's lift of the 64-setting limit is dropped: `main` now has its own. - Tests still failing are listed under Testing; none is in code this change touches. **@trzz1214**, thanks for tracking the drift down. Agreed that the no-clip shortcut is outside this PR; it is worth an issue of its own. You offered to test again: if you have time, this head with your DualSense would help most. In order: 1. Controller speaker at 100 % and 200 %, over USB and Bluetooth: is 100 % comfortable now? 2. Take damage with "DualSense game-aware triggers" on: L2 should pulse. 3. The R2 effects again (slingshot, bow, Hookshot, hammer, Din's Fire, menus). 4. With a second DualSense, if you have one: both play the speaker, each trigger follows, and unplugging one leaves the other working. 5. Headphones in the pad's jack over Bluetooth: its sounds go to the TV, with no taps from the pad.
HumanBean deleted branch renhdrum-071 2026-12-04 03:53:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3044
No description provided.