feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full #3044
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3044
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:renhdrum-071"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
input.rumble) now plays on RenHDrum's pads; it was silent there (onmaintoo).Off by default:
HOS_SWITCH2_HD) and the Windows controller volume pin (HOS_PAD_VOLUME_PIN).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/.sobeside it:game/crates/renhdrumbuildsthird_party/renhdrum's sources, unmodified, intoliblongshot_rs.a(the patternoxc-formatteruses). Its Opus encoder is the libopus the game already compiles; compiling RenHDrum's own copy would define everyopus_*twice.host/rumble_renhdrum.ccalls it directly, so the compiler checks each signature against the header. The loader and the "no RenHDrum" status are gone.scripts/renhdrum.pyis gone; whatlongshot_builder.pyused of it isscripts/rust_toolchain.py. The builder no longer builds, carries or copies a library.third_party/rustfmt.tomlkeepscargo fmtout of third-party sources, which it now reaches as a path dependency.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,
svcExitProcesslets 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:
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, basemainf577a1aeab, anddev.py smokepassed (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.abuilt forx86_64-pc-windows-gnullvmand 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}.cpass 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 teston this change rebased onmainf577a1ae: 878 passed, 13 skipped, 7 failed. Six are renderer cache checks that fail on plainmain(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 thatmainnow has its own version of; it is dropped from this change. Thencargo test --release --workspace --no-fail-fast:build-driver'sthe_repository_s_lock_and_the_table_agreefails (the compiler stamp it pins is not the one ofmain'stools.lock) andlongshot-builder'sone_copyfails (amods_recordedline inprofile.json, frommain's mods code); this change touches neither, and neither was run on plainmain. Two targets that ran stale binaries from a temporary checkout of mine pass rebuilt.Clippy and
cargo testof build-core, game-core and longshot-game pass. The changed host files pass a llvm-mingw syntax check. Newtests/test_pad_endpoint_linux.py. Cold reviews of earlier rounds, and the automated review onc6184395(L1 to L4 fixed: cable slots read under their lock, mirroring adds only the game's sounds, speaker volume, the test honoursCC); 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.dlland 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:
HOS_SWITCH_DETAILED=1: rumble that starts and stops with the game's, no input lag (by hand).HOS_SWITCH2_HD=1: vibration that stops with the game's (by hand).HOS_PAD_VOLUME_PIN=1pins 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
HOS_PAD_VOLUME_PINremembers one volume for all pads.longshot.ymlbuilds the RenHDrum library only for sources that havescripts/renhdrum.py, pushed to MagicBeanAdmin/Release (d5925467). No release has run with it.HOS_SWITCH_DETAILEDwrites HID reports beside SDL's driver; the builder now also lets the game write report0x10(rumble only) to a Switch Pro Controller.steam-devices); the Controls page and the user docs say so.panic = "abort", as all the game's Rust); as a library it was caught at its boundary.renhdrum.dllto remove or replace.HOS_RUMBLE_BACKEND=hdormotorsstill leaves it out.HOS_PAD_VOLUME_PINis Windows-only, untested, off.longshot_options.inikeys. New labels and help in the 12 non-English languages are not native-reviewed.third_party/formatting file is outside every vendored part.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses. (It fails onmaintoo, as Testing says.)main, or Measurements says why there is nothing to measure. (Not measured.)third_party/changed only by re-vendoring RenHDrum 0.7.1 (PROVENANCE.md,check_third_party.pypasses); nothing GPL-incompatible.When it applies
HOS_SWITCH2_HD,HOS_PAD_VOLUME_PINandHOS_SWITCH_DETAILEDship off, untested on hardware, with their rows ingpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e45fvvxoZWKqwHUVeM
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 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: #2881mod init --testwrites a starter test; players' mods page covers sources (#2868) 8458b0b4a6## 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 base462919343e, 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: #2869The 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_016o1k1SQVyAWsujjFVd8WucMods 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_016o1k1SQVyAWsujjFVd8WucTested 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 on Windows 11 (AMD Ryzen AI 7 350 / Radeon 860M,
02944239c) with a DualSense over Bluetooth:Build
scripts/renhdrum.py build+checksucceeded cleanly on Windows (renhdrum.dllv0.7.1,930,816bytes, SHA-256bc24ca3352187bdd983d830edf2e2bd1f47c0b0df89f1934979dcee00119d385,usable).longshot-game.execompiled and linked cleanly on Windows (llvm-mingw, Rust 1.99.1).DualSense (Bluetooth) results
pad speaker: playing on the DualSense over Bluetooth (RenHDrum's reports)).vibration: R2: RenHDrum item 1 on ZR, ammunition 36).Feel / tuning feedback (non-blocking)
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
HOS_SWITCH2_HD=1).Relevant log lines
02944239c849f7a5b91eWIP: feat(pads): RenHDrum 0.7.1 with game-aware DualSense triggers and the speaker over Bluetoothto WIP: feat(pads): RenHDrum 0.7.1 and HD Haptics+ in fullSecond round, force-pushed (was
02944239) and rebased on currentmod-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.@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.program, which the release never ran #305349f7a5b91e8e666392d5Pushed: rebased on
main, and RenHDrum is now built into the game (norenhdrum.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.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
0x70vs0x50:pro2_build_reportfollows 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 your0x50capture 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 behindHOS_SWITCH2_HD=1makes sense.panic = "abort": RenHDrum's C ABI wraps every entry point incatch_unwind, so a bug only silences rumble instead of taking the host down. Built in withpanic = "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.8e666392d5f2bca051eaPushed: 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.Tested head
8e666392don 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 throughhost/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.
f2bca051ea43d68a709343d68a7093f60d52b7d7Pushed
f60d52b7d7, rebased onmain1c91b18f. New since the last push: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.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).f60d52b7d7c6184395ccPushed
c6184395cc, rebased onmain1780f597e7. New since the last push:main's #3094 added to the renamedscripts/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:
HOS_SWITCH_DETAILED=1inlongshot_env.txt: any difference, any input lag?WIP: feat(pads): RenHDrum 0.7.1 and HD Haptics+ in fullto feat(pads): RenHDrum 0.7.1 and HD Haptics+ in full@review
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.
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.
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.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.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)
@fixcan do L1, L2, L3 and L4.Questions (1) (not confirmed from the code; they don't hold the recommendation)
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:
c6184395ccagainst1780f597e7: 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:
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.
@ -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();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];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) */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 1cc = shutil.which("clang") or shutil.which("cc")with tempfile.TemporaryDirectory() as folder: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.
c6184395cc0c2c15cc7fPushed
0c2c15cc7f, rebased onmain76092c5e5a. Boot check passed on Linux; none of these fixes has run on a controller.Review of
c6184395CCand fails with a clear message without a compiler.@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:
mainbuild?The game's log from a run where it happened would help too (please check it for anything personal before posting).
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.
0c2c15cc7fdcb564ea2bRebased:
dcb564ea2bonmainf577a1aeab. Boot check passed on Linux; no controller path ran.mainnow has its own.@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: