fix(input): restore Windows controller input on the Rust Mod API #2516

Merged
HumanBean merged 3 commits from snaildev99/Longshot:fix/rust-api-controller into mod-api 2026-11-26 04:25:52 +00:00
Contributor

Summary

Restore Windows controller input when the Rust game runs inside the AppContainer. The broker opens the SDL devices and gives the game a dedicated controller connection. The Switch 2 Pro USB driver and its NFC reader are unavailable in the Windows sandbox.

Rebased on Rust Mod API #2434 at b9ac71657. This supersedes #2016. The controller connection is restricted to the game process or its same-image relaunch, and the broker carries the virtual-controller flag. The forge target is mod-api. Controller-only diff

Testing

Previous hand test at 7448586ca. Windows 11, one 8BitDo Ultimate 2 over Bluetooth, AppContainer enabled. On the Rust API baseline there was no gameplay input. With this change, movement and L-menu input worked in Adult Kakariko.

Before the latest changes, both C fixtures compiled and passed on Windows with llvm-mingw Clang via tests/test_pad_broker_route.py and tests/test_pad_broker_state.py. They cover input routing, session ownership, snapshot bounds, disconnect and reconnect handling, and sensor recovery.

Still to test: Windows gameplay on the rebased head, the full project suite and Linux build. Physical reconnect, gyro and rumble remain to be exercised by hand.

The standard Windows builder at this #2434 revision misses the ImGui include flags for vk_ui2.cpp. The local play builds use the renderer's existing ImGui flags for that file.

Measurements

Verdict: The same controller regained gameplay input with the sandbox enabled.

Observation Before, Rust API at 563ca4e55 After, earlier hand test at 7448586ca
Gameplay input over Bluetooth No response Movement and L-menu input worked

Input latency and frame time have not been measured.

Risks

This changes the controller broker handshake and snapshot format. Use a broker and game from the same build. Hardware coverage currently includes the reported Bluetooth controller on the previously tested revision.

Checklist

Ready for review

  • Focused change based on the Rust API revision targeted by this PR.
  • Repeat the Windows in-game test on the rebased head.
  • Full suite passes or baseline failures are documented.
  • Performance measurements recorded.
  • Only source, tests and project documentation are included.

When it applies

  • Game-free controller routing and state checks pass on this head.
  • Controller broker documentation updated.
  • AI assistance recorded in commit trailers.
  • Linux build confirmed.

Ready to merge

  • Review and CI complete.
## Summary Restore Windows controller input when the Rust game runs inside the AppContainer. The broker opens the SDL devices and gives the game a dedicated controller connection. The Switch 2 Pro USB driver and its NFC reader are unavailable in the Windows sandbox. Rebased on Rust Mod API #2434 at `b9ac71657`. This supersedes #2016. The controller connection is restricted to the game process or its same-image relaunch, and the broker carries the virtual-controller flag. The forge target is `mod-api`. [Controller-only diff](https://git.magicbean.dev/snaildev99/Longshot/compare/b9ac716574fbba18f1fa8d2bcb3f24afb1180565...f8b0c6c68cf581e28239636a72d0cef1ff4c324c) ## Testing **Previous hand test at `7448586ca`.** Windows 11, one 8BitDo Ultimate 2 over Bluetooth, AppContainer enabled. On the Rust API baseline there was no gameplay input. With this change, movement and L-menu input worked in Adult Kakariko. Before the latest changes, both C fixtures compiled and passed on Windows with llvm-mingw Clang via `tests/test_pad_broker_route.py` and `tests/test_pad_broker_state.py`. They cover input routing, session ownership, snapshot bounds, disconnect and reconnect handling, and sensor recovery. **Still to test:** Windows gameplay on the rebased head, the full project suite and Linux build. Physical reconnect, gyro and rumble remain to be exercised by hand. The standard Windows builder at this #2434 revision misses the ImGui include flags for `vk_ui2.cpp`. The local play builds use the renderer's existing ImGui flags for that file. ## Measurements **Verdict:** The same controller regained gameplay input with the sandbox enabled. | Observation | Before, Rust API at `563ca4e55` | After, earlier hand test at `7448586ca` | |---|---|---| | Gameplay input over Bluetooth | No response | Movement and L-menu input worked | Input latency and frame time have not been measured. ## Risks This changes the controller broker handshake and snapshot format. Use a broker and game from the same build. Hardware coverage currently includes the reported Bluetooth controller on the previously tested revision. ## Checklist ### Ready for review - [x] Focused change based on the Rust API revision targeted by this PR. - [ ] Repeat the Windows in-game test on the rebased head. - [ ] Full suite passes or baseline failures are documented. - [ ] Performance measurements recorded. - [x] Only source, tests and project documentation are included. ### When it applies - [ ] Game-free controller routing and state checks pass on this head. - [x] Controller broker documentation updated. - [x] AI assistance recorded in commit trailers. - [ ] Linux build confirmed. ### Ready to merge - [ ] Review and CI complete.
Port the sandbox controller transport from #2016 and preserve virtual controller detection on the host SDL backend.

Assisted-by: OpenAI Codex
fix(input): reserve a game-owned controller connection
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
7448586cab
Carry controller traffic on its own authenticated connection and retain the normal broker channels for other operations.

Assisted-by: OpenAI Codex
Author
Contributor

Tested in game: Windows 11, one 8BitDo Ultimate 2 over Bluetooth, AppContainer enabled. On the Rust API baseline there was no gameplay input. With this change, movement and L-menu input worked in Adult Kakariko.

Tested in game: Windows 11, one 8BitDo Ultimate 2 over Bluetooth, AppContainer enabled. On the Rust API baseline there was no gameplay input. With this change, movement and L-menu input worked in Adult Kakariko.
Member

Possibly related, for context:

  • issue #2010 Game: Mod API Windows sandbox blocks controller input — Open report of Windows controller input blocked by the sandbox; this change addresses it.
Possibly related, for context: - issue #2010 Game: Mod API Windows sandbox blocks controller input — Open report of Windows controller input blocked by the sandbox; this change addresses it.
snaildev99 force-pushed fix/rust-api-controller from 7448586cab
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
to ac4856fe71
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-25 23:05:16 +00:00
Compare
snaildev99 force-pushed fix/rust-api-controller from ac4856fe71
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to f8b0c6c68c
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 28s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-25 23:12:42 +00:00
Compare
Author
Contributor

Rebased the controller fix on Rust Mod API #2434 at b9ac71657. Both Windows broker fixtures passed on f8b0c6c68. The previous Bluetooth playtest is recorded above. Windows gameplay confirmation on the new head is pending. Controller-only diff

Rebased the controller fix on Rust Mod API #2434 at `b9ac71657`. Both Windows broker fixtures passed on `f8b0c6c68`. The previous Bluetooth playtest is recorded above. Windows gameplay confirmation on the new head is pending. [Controller-only diff](https://git.magicbean.dev/snaildev99/Longshot/compare/b9ac716574fbba18f1fa8d2bcb3f24afb1180565...f8b0c6c68cf581e28239636a72d0cef1ff4c324c)
Owner
@review
BeanBot left a comment

Recommendation: Approve. The rebased head still needs gameplay and controller-feature testing. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The Windows broker opens controllers outside the AppContainer and sends bounded input snapshots and motor commands to the game. It restores input in an earlier playtest, at the cost of sandboxed HD haptics and Switch 2 Pro USB support; the Linux build regression must be fixed.

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

  • L1 tests/test_pad_motion_policy.py:12: This new fixture defaults to gcc and ignores CC, so it cannot run with the project's selected compiler on systems without gcc. (more on the line) Do: Honor CC and choose an available portable compiler fallback, as the other new controller fixtures do.
  • L2 docs/dev/reference/sandbox.md:378: The documented confined gameplay run names controllers that are not supported by the supplied test report. (more on the line) Do: Describe the recorded 8BitDo run and leave the other controllers listed as untested unless their results are supplied.

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

  • L3 host/pad_broker_windows.c:153: The rebased controller transport and its recovery paths need an in-game hardware run. (more on the line) Do: On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results.
  • L4 host/pad_sdl.c:250: The changed sensor recovery policy also needs a native controller run. (more on the line) Do: After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result.

@fix can do L1 and L2.

Checks: Still running: Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / As their notes say (pull_request), Third-party parts / The same as upstream (pull_request).

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

Does it help: Unproven on this head. The author reports movement and L-menu input with one Bluetooth controller on earlier commit 7448586ca, compared with no input on the Rust API baseline; the rebased head has not been played.

Other systems: The transport affects Windows sandboxed SDL controllers, motion, motor rumble, reconnects and Steam Input. The motion policy also changes on unconfined Windows and Linux. Linux compilation is broken; hardware behavior on the current head remains untested.

Switches: HOS_SWITCH2 remains on by default and HOS_SWITCH2_RUMBLE_TEST remains off, but neither operates in the Windows sandbox. HOS_HD_RUMBLE and HOS_RUMBLE_BACKEND retain their defaults but cannot enable the corresponding haptic backends there. The restrictions are documented.

Reviewed: f8b0c6c68c against b9ac716574: Read the repository rules, PR template, standards, commits, changes to the broker and controller paths, and the new controller fixtures. Skimmed the remaining changed tests and documentation. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent. The full contents of every changed code file and all dependent callers were not read.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance in Assisted-by trailers.
  • The changed file list contains source, tests and documentation rather than game-derived output.
  • The broker validates request sizes and bounds before applying controller commands, and validates snapshot lengths before consuming them.
  • The renderer interface change documents an additional return value without changing the host structure layout.

Testing: No code, tests or project scripts were run, as requested. The author reports that two Windows fixtures passed on the head; the full suite, Linux build and head gameplay remain pending.

Overlaps and merge order: The PR says it supersedes #2016 and targets the Rust Mod API branch at #2434. No independent Forgejo overlap check was possible with the network closed.


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

**Recommendation: Approve.** The rebased head still needs gameplay and controller-feature testing. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The Windows broker opens controllers outside the AppContainer and sends bounded input snapshots and motor commands to the game. It restores input in an earlier playtest, at the cost of sandboxed HD haptics and Switch 2 Pro USB support; the Linux build regression must be fixed. **Should fix (2)**: not blocking, but worth doing before merging. - **L1** `tests/test_pad_motion_policy.py:12`: This new fixture defaults to gcc and ignores CC, so it cannot run with the project's selected compiler on systems without gcc. (more on the line) **Do:** Honor CC and choose an available portable compiler fallback, as the other new controller fixtures do. - **L2** `docs/dev/reference/sandbox.md:378`: The documented confined gameplay run names controllers that are not supported by the supplied test report. (more on the line) **Do:** Describe the recorded 8BitDo run and leave the other controllers listed as untested unless their results are supplied. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `host/pad_broker_windows.c:153`: The rebased controller transport and its recovery paths need an in-game hardware run. (more on the line) **Do:** On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results. - **L4** `host/pad_sdl.c:250`: The changed sensor recovery policy also needs a native controller run. (more on the line) **Do:** After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result. `@fix` can do L1 and L2. **Checks:** Still running: `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on this head. The author reports movement and L-menu input with one Bluetooth controller on earlier commit 7448586ca, compared with no input on the Rust API baseline; the rebased head has not been played. **Other systems:** The transport affects Windows sandboxed SDL controllers, motion, motor rumble, reconnects and Steam Input. The motion policy also changes on unconfined Windows and Linux. Linux compilation is broken; hardware behavior on the current head remains untested. **Switches:** HOS_SWITCH2 remains on by default and HOS_SWITCH2_RUMBLE_TEST remains off, but neither operates in the Windows sandbox. HOS_HD_RUMBLE and HOS_RUMBLE_BACKEND retain their defaults but cannot enable the corresponding haptic backends there. The restrictions are documented. **Reviewed:** f8b0c6c68cf5 against b9ac716574fb: Read the repository rules, PR template, standards, commits, changes to the broker and controller paths, and the new controller fixtures. Skimmed the remaining changed tests and documentation. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent. The full contents of every changed code file and all dependent callers were not read.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance in Assisted-by trailers. - The changed file list contains source, tests and documentation rather than game-derived output. - The broker validates request sizes and bounds before applying controller commands, and validates snapshot lengths before consuming them. - The renderer interface change documents an additional return value without changing the host structure layout. **Testing:** No code, tests or project scripts were run, as requested. The author reports that two Windows fixtures passed on the head; the full suite, Linux build and head gameplay remain pending. **Overlaps and merge order:** The PR says it supersedes #2016 and targets the Rust Mod API branch at #2434. No independent Forgejo overlap check was possible with the network closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -364,3 +376,3 @@
### What needs checking on Windows
Nothing of this has run on Windows yet. Known to work in an AppContainer, from how Windows treats them (and how UWP apps
The confined gameplay run used a PS4 and a Switch Pro controller. Motion, ordinary rumble, hotplug and reconnect,
Member

L2 (should fix): The documented confined gameplay run names controllers that are not supported by the supplied test report.

When: The PR and its comments report one 8BitDo Ultimate 2 over Bluetooth, but this page says the run used a PS4 and a Switch Pro controller, overstating hardware coverage.

Do: Describe the recorded 8BitDo run and leave the other controllers listed as untested unless their results are supplied.

**L2** (should fix): The documented confined gameplay run names controllers that are not supported by the supplied test report. *When:* The PR and its comments report one 8BitDo Ultimate 2 over Bluetooth, but this page says the run used a PS4 and a Switch Pro controller, overstating hardware coverage. **Do:** Describe the recorded 8BitDo run and leave the other controllers listed as untested unless their results are supplied.
@ -0,0 +150,4 @@
free(s);
InterlockedExchange(&occupied, 0);
}
int hos_pad_broker_serve(void **session, const void *request, size_t bytes, BrokerPadSnapshot *out) {
Member

L3 (should fix): The rebased controller transport and its recovery paths need an in-game hardware run.

When: The only gameplay result predates the dedicated connection and rebase; the head's fixtures use fake devices and do not show that real controller input, reconnect, motion and rumble work through the Windows broker.

Do: On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results.

**L3** (should fix): The rebased controller transport and its recovery paths need an in-game hardware run. *When:* The only gameplay result predates the dedicated connection and rebase; the head's fixtures use fake devices and do not show that real controller input, reconnect, motion and rumble work through the Windows broker. **Do:** On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results.
host/pad_sdl.c Outdated
@ -235,3 +250,1 @@
if (pads[i].motion_on != want && now >= pads[i].motion_retry_ns) {
const int ok = hos_sdl_pad_sensor_enable(pads[i].gc, HOS_SDL_SENSOR_ACCEL, want) &
hos_sdl_pad_sensor_enable(pads[i].gc, HOS_SDL_SENSOR_GYRO, want);
if ((pads[i].motion_on != want || (!want && pads[i].motion_enabled)) && now >= pads[i].motion_retry_ns) {
Member

L4 (should fix): The changed sensor recovery policy also needs a native controller run.

When: The revised enable and rollback loop runs outside the Windows sandbox too, including on Linux; the fixture substitutes sensor calls and cannot establish that a real device continues reporting motion after toggling and recovery.

Do: After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result.

**L4** (should fix): The changed sensor recovery policy also needs a native controller run. *When:* The revised enable and rollback loop runs outside the Windows sandbox too, including on Linux; the fixture substitutes sensor calls and cannot establish that a real device continues reporting motion after toggling and recovery. **Do:** After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result.
@ -0,0 +9,4 @@
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--cc", default="gcc")
Member

L1 (should fix): This new fixture defaults to gcc and ignores CC, so it cannot run with the project's selected compiler on systems without gcc.

When: A Windows developer with the supported llvm-mingw Clang toolchain and CC set to clang runs the test without --cc; it still attempts to execute gcc.

Do: Honor CC and choose an available portable compiler fallback, as the other new controller fixtures do.

**L1** (should fix): This new fixture defaults to gcc and ignores CC, so it cannot run with the project's selected compiler on systems without gcc. *When:* A Windows developer with the supported llvm-mingw Clang toolchain and CC set to clang runs the test without --cc; it still attempts to execute gcc. **Do:** Honor CC and choose an available portable compiler fallback, as the other new controller fixtures do.
Owner
@fix
BeanBot force-pushed fix/rust-api-controller from f8b0c6c68c
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 28s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to ddd8e39300
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
Third-party parts / As their notes say (pull_request) Successful in 20s
PR description / Description follows the template (pull_request_target) Failing after 7s
2026-11-26 04:21:38 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The earlier Windows playtest showed that controller input returned, but the rebased transport and sensor recovery have not yet been exercised on hardware. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is ddd8e39300. I rebased it onto mod-api (93c7a8e8ae). I edited its description to match the change.

Changed

  • Compiler selection in tests/test_pad_motion_policy.py:14: Honor CC, falling back to Clang or cc as the other controller fixtures do. Tests were not run, as requested.
  • Controller coverage in docs/dev/reference/sandbox.md:378: Document the 8BitDo Ultimate 2 Bluetooth run and identify PS4 and Switch Pro controllers as untested.

Nothing was built or run: the checks run again on the new head.

The broker gives the sandboxed Windows game access to controller input while retaining the game's existing input mapping. The latest fix corrects the recorded controller coverage and compiler selection in a fixture; it does not remove the controller feature.

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

  • L3 host/pad_broker_windows.c:153: The rebased controller transport and its recovery paths need an in-game hardware run. When: The only gameplay result predates the dedicated connection and rebase; the head's fixtures use fake devices and do not show that real controller input, reconnect, motion and rumble work through the Windows broker. Do: On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results.
  • L4 host/pad_sdl.c:250: The changed sensor recovery policy also needs a native controller run. When: The revised enable and rollback loop runs outside the Windows sandbox too, including on Linux; the fixture substitutes sensor calls and cannot establish that a real device continues reporting motion after toggling and recovery. Do: After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result.

Checks: they run again on this head; a failure shows on the pull request.

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

Does it help: Unproven on the rebased head. An 8BitDo Ultimate 2 over Bluetooth had no gameplay response on the earlier Rust API baseline and supported movement and L-menu input on the earlier PR revision, according to the author's Windows 11 playtest.

Other systems: The transport affects sandboxed Windows controller input, motion, rumble and reconnect behavior. Native controller sensor recovery also changed; its device behavior remains untested. Linux build confirmation is pending.

Switches: HOS_SWITCH2 remains on by default for unconfined Windows; its USB driver and NFC reader are unavailable in the sandbox. HOS_SWITCH2_RUMBLE_TEST remains off by default and applies to unconfined Windows. The fix adds no switches.

Reviewed: ddd8e39300 against 93c7a8e8ae: Read the fix diff, the motion-policy fixture, the controller transport and sensor-recovery code relevant to the ledger, and the repository rules and PR template. The larger base diff and other changed files were not read in full; recorded runs were read from the PR and comments.; nothing run (a code review).

Checked and fine:

  • The fixture honors --cc and CC, then falls back to Clang or cc.
  • The sandbox documentation now attributes the gameplay run to the 8BitDo controller and identifies the other controller coverage as untested.
  • The fix leaves the controller transport in place.

Testing: No commands from the project or tests were run. The author reports two Windows broker fixtures passed before the latest changes; gameplay on the rebased head, reconnect, gyro, rumble and the Linux build remain to be tested.

Overlaps and merge order: The PR says it supersedes #2016 and targets mod-api after #2434; no independent overlap check was available.


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

**Recommendation: Approve.** The code is ready: only testing is left. The earlier Windows playtest showed that controller input returned, but the rebased transport and sensor recovery have not yet been exercised on hardware. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is ddd8e39300b7. I rebased it onto `mod-api` (93c7a8e8ae95). I edited its description to match the change. **Changed** - **Compiler selection in tests/test_pad_motion_policy.py:14**: Honor CC, falling back to Clang or cc as the other controller fixtures do. Tests were not run, as requested. - **Controller coverage in docs/dev/reference/sandbox.md:378**: Document the 8BitDo Ultimate 2 Bluetooth run and identify PS4 and Switch Pro controllers as untested. Nothing was built or run: the checks run again on the new head. The broker gives the sandboxed Windows game access to controller input while retaining the game's existing input mapping. The latest fix corrects the recorded controller coverage and compiler selection in a fixture; it does not remove the controller feature. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `host/pad_broker_windows.c:153`: The rebased controller transport and its recovery paths need an in-game hardware run. *When:* The only gameplay result predates the dedicated connection and rebase; the head's fixtures use fake devices and do not show that real controller input, reconnect, motion and rumble work through the Windows broker. **Do:** On the head, reproduce the baseline failure and verify buttons, sticks, physical disconnect and reconnect, gyro and motor rumble in Windows sandboxed gameplay; record the controller and results. - **L4** `host/pad_sdl.c:250`: The changed sensor recovery policy also needs a native controller run. *When:* The revised enable and rollback loop runs outside the Windows sandbox too, including on Linux; the fixture substitutes sensor calls and cannot establish that a real device continues reporting motion after toggling and recovery. **Do:** After fixing the Linux build, exercise motion enable, disable and recovery with a real controller on Linux or unconfined Windows and record the result. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the rebased head. An 8BitDo Ultimate 2 over Bluetooth had no gameplay response on the earlier Rust API baseline and supported movement and L-menu input on the earlier PR revision, according to the author's Windows 11 playtest. **Other systems:** The transport affects sandboxed Windows controller input, motion, rumble and reconnect behavior. Native controller sensor recovery also changed; its device behavior remains untested. Linux build confirmation is pending. **Switches:** HOS_SWITCH2 remains on by default for unconfined Windows; its USB driver and NFC reader are unavailable in the sandbox. HOS_SWITCH2_RUMBLE_TEST remains off by default and applies to unconfined Windows. The fix adds no switches. **Reviewed:** ddd8e39300b7 against 93c7a8e8ae95: Read the fix diff, the motion-policy fixture, the controller transport and sensor-recovery code relevant to the ledger, and the repository rules and PR template. The larger base diff and other changed files were not read in full; recorded runs were read from the PR and comments.; nothing run (a code review). **Checked and fine:** - The fixture honors --cc and CC, then falls back to Clang or cc. - The sandbox documentation now attributes the gameplay run to the 8BitDo controller and identifies the other controller coverage as untested. - The fix leaves the controller transport in place. **Testing:** No commands from the project or tests were run. The author reports two Windows broker fixtures passed before the latest changes; gameplay on the rebased head, reconnect, gyro, rumble and the Linux build remain to be tested. **Overlaps and merge order:** The PR says it supersedes #2016 and targets mod-api after #2434; no independent overlap check was available. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(input): restore Windows controller input on the Rust Mod API to fix(input): restore Windows controller input on the Rust Mod API 2026-11-26 04:25:44 +00:00
HumanBean merged commit 4adb732f69 into mod-api 2026-11-26 04:25:52 +00:00
HumanBean deleted branch fix/rust-api-controller 2026-11-26 04:25:53 +00:00
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
Third-party parts / As their notes say (pull_request) Successful in 20s
PR description / Description follows the template (pull_request_target) Failing after 7s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2516
No description provided.