fix: deliver AutoA taps to the first connected gamepad #318

Open
mauroalvare wants to merge 5 commits from upstream-pr/318 into main
mauroalvare commented 2026-11-26 02:44:27 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mauroalvare on 2026-11-26T02:44:27Z.


Change

anyxboxx run --auto-a passes VICTORY_AUTO_A=150 to Neptune. On the base commit, GameInput synthesized Enter for the keyboard and its stand-in gamepad. Connecting an XInput pad disconnects the stand-in, leaving the title's gamepad reads without the automatic A pulse.

Sample the pulse through Source::auto_a and add A to the lowest-numbered connected XInput pad. Physical buttons, triggers and axes are included in that reading. With no XInput pad, the stand-in receives the tap through Enter. Microsoft XInput controller indices

Original verification

Base c4c93bdc413191a9dc909998d2d53080a3f0c880, head 8630cac. Windows PowerShell 5.1, Rust 1.98.1 and Python 3.13.15.

python -m pytest tests/test_lanceur_victory.py -q -rs
26 passed

python -m pytest -rs
1666 passed, 0 skipped

python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools
All checks passed!

# From third_party/victory
cargo test --locked -p victory-hle --lib auto_a_taps_the_first_connected_pad
Base with the regression test: 0 passed, 1 failed (buttons 8, expected 12)
Fix: 1 passed, 0 failed

cargo test --locked -p victory-hle
111 unit tests and 1 integration test passed

cargo test --locked -p victory-hle --features diagnostics --lib gameinput
8 passed

cargo test --locked -p victory-loader --test load_probe
2 passed

cargo xtask policy
asset policy: 199 files ok

The full Python suite used the RTX 5070 Ti (driver 621.40) for hardware tests and WARP for explicit software-adapter checks. C++ runtime, Rust bridge and TomBox binaries were reused from identical source trees and submodule commit. The launcher and GameInput reproductions ran on the CPU.

Oracle and test data

The launcher's existing synthetic executable prints its environment. The release launcher test checks that the child receives VICTORY_AUTO_A=150. The Rust test uses synthetic XInput slots 1 and 3 and reads the state through the title-facing GameInput methods. Slot 1 reported B alone (0x8) on the base and A+B (0xC) with the fix. The test also checks the analog values, the other pad, and the end of the pulse while Enter is held.

Checklist

  • One behavior with a failing regression on the base.
  • Synthetic inputs, the existing GameInput test double, and the hle-probe fixture.
  • Ruff, README consistency and the VIctory asset policy passed.

Investigation, implementation and verification were assisted by OpenAI Codex.

Rebase verification

Rebased on c41c224. cargo test --locked --offline -j 4 -p victory-hle gameinput -- --test-threads=1 passed all 8 GameInput tests. python -m pytest -q -rs tests/test_lanceur_victory.py tests/test_anyxboxx_run.py passed all 28 tests with the release launcher.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5503044654 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/318). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-26T02:44:27Z. --- ## Change `anyxboxx run --auto-a` passes `VICTORY_AUTO_A=150` to Neptune. On the base commit, GameInput synthesized Enter for the keyboard and its stand-in gamepad. Connecting an XInput pad disconnects the stand-in, leaving the title's gamepad reads without the automatic A pulse. Sample the pulse through `Source::auto_a` and add A to the lowest-numbered connected XInput pad. Physical buttons, triggers and axes are included in that reading. With no XInput pad, the stand-in receives the tap through Enter. [Microsoft XInput controller indices](https://learn.microsoft.com/en-us/windows/win32/xinput/getting-started-with-xinput#multiple-controllers) ## Original verification Base `c4c93bdc413191a9dc909998d2d53080a3f0c880`, head `8630cac`. Windows PowerShell 5.1, Rust 1.98.1 and Python 3.13.15. ```text python -m pytest tests/test_lanceur_victory.py -q -rs 26 passed python -m pytest -rs 1666 passed, 0 skipped python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools All checks passed! # From third_party/victory cargo test --locked -p victory-hle --lib auto_a_taps_the_first_connected_pad Base with the regression test: 0 passed, 1 failed (buttons 8, expected 12) Fix: 1 passed, 0 failed cargo test --locked -p victory-hle 111 unit tests and 1 integration test passed cargo test --locked -p victory-hle --features diagnostics --lib gameinput 8 passed cargo test --locked -p victory-loader --test load_probe 2 passed cargo xtask policy asset policy: 199 files ok ``` The full Python suite used the RTX 5070 Ti (driver 621.40) for hardware tests and WARP for explicit software-adapter checks. C++ runtime, Rust bridge and TomBox binaries were reused from identical source trees and submodule commit. The launcher and GameInput reproductions ran on the CPU. ## Oracle and test data The launcher's existing synthetic executable prints its environment. The release launcher test checks that the child receives `VICTORY_AUTO_A=150`. The Rust test uses synthetic XInput slots 1 and 3 and reads the state through the title-facing GameInput methods. Slot 1 reported B alone (`0x8`) on the base and A+B (`0xC`) with the fix. The test also checks the analog values, the other pad, and the end of the pulse while Enter is held. ## Checklist - [x] One behavior with a failing regression on the base. - [x] Synthetic inputs, the existing GameInput test double, and the `hle-probe` fixture. - [x] Ruff, README consistency and the VIctory asset policy passed. Investigation, implementation and verification were assisted by OpenAI Codex. ## Rebase verification Rebased on `c41c224`. `cargo test --locked --offline -j 4 -p victory-hle gameinput -- --test-threads=1` passed all 8 GameInput tests. `python -m pytest -q -rs tests/test_lanceur_victory.py tests/test_anyxboxx_run.py` passed all 28 tests with the release launcher.
Exorion1er commented 2026-11-26 11:04:08 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by Exorion1er on 2026-11-26T11:04:08Z.

Review: APPROVED


Thanks! AutoA was already on main (Neptune's start-neptune.ps1 and the launcher's -AutoA switch), so this fixes an existing opt-in path rather than adding behaviour: with VICTORY_AUTO_A unset nothing changes. The regression test reproduces the missing tap with a pad in slot 1, and the fix stays inside the GameInput poll. Small non-blocking nit: the auto-A flag riding on Source::keys() as a tuple could be its own trait method. Approving.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review:6073004999 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/318#pullrequestreview-6073004999). Originally posted by [Exorion1er](https://github.com/Exorion1er) on 2026-11-26T11:04:08Z. **Review:** APPROVED --- Thanks! AutoA was already on main (Neptune's `start-neptune.ps1` and the launcher's `-AutoA` switch), so this fixes an existing opt-in path rather than adding behaviour: with `VICTORY_AUTO_A` unset nothing changes. The regression test reproduces the missing tap with a pad in slot 1, and the fix stays inside the GameInput poll. Small non-blocking nit: the auto-A flag riding on `Source::keys()` as a tuple could be its own trait method. Approving.
LooperSalty commented 2026-11-26 14:01:35 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-26T14:01:35Z.


This PR now conflicts with main in tests/test_lanceur_victory.py (other launcher PRs changed the same test module). Please rebase on main, keep the tests of both sides, run python -m pytest tests/test_lanceur_victory.py and force-push your branch.

🤖 Generated with Claude Code

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7194169493 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/318#issuecomment-7194169493). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-26T14:01:35Z. --- This PR now conflicts with main in `tests/test_lanceur_victory.py` (other launcher PRs changed the same test module). Please rebase on main, keep the tests of both sides, run `python -m pytest tests/test_lanceur_victory.py` and force-push your branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mauroalvare commented 2026-11-26 18:25:28 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mauroalvare on 2026-11-26T18:25:28Z.


I rebased the GameInput fix and took the suggestion to expose the tap through a separate Source::auto_a method. The poll samples it once for the keyboard and the first connected controller. The release-launcher test now covers anyxboxx run --auto-a.

All eight GameInput tests and all 28 launcher tests passed.

The latest CI run passed.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7200446944 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/318#issuecomment-7200446944). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-26T18:25:28Z. --- I rebased the GameInput fix and took the suggestion to expose the tap through a separate `Source::auto_a` method. The poll samples it once for the keyboard and the first connected controller. The release-launcher test now covers `anyxboxx run --auto-a`. All eight GameInput tests and all 28 launcher tests passed. [The latest CI run passed](https://github.com/LooperSalty/AnyXboxX/actions/runs/45872484847).
mauroalvare commented 2026-11-27 00:49:27 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mauroalvare on 2026-11-27T00:49:27Z.


Updated this branch for the mouse support added by #461. Auto-A still taps the first connected pad, and mouse input still reaches the stand-in pad. All 21 automatic GameInput tests passed, including a new regression that exercises Auto-A and the mouse together.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7206782054 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/318#issuecomment-7206782054). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-27T00:49:27Z. --- Updated this branch for the mouse support added by #461. Auto-A still taps the first connected pad, and mouse input still reaches the stand-in pad. All 21 automatic GameInput tests passed, including a new regression that exercises Auto-A and the mouse together.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/318:upstream-pr/318'
git switch 'upstream-pr/318'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/318'
git switch 'upstream-pr/318'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/318'
git switch 'upstream-pr/318'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/318'
git switch 'main'
git merge --squash 'upstream-pr/318'
git switch 'main'
git merge --ff-only 'upstream-pr/318'
git switch 'main'
git merge 'upstream-pr/318'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LooperSalty/AnyXboxX!318
No description provided.