GameInput: size PlayStation HID reads for the collection #2525

Open
github-bot wants to merge 1 commit from github-bot/gh-2525 into main AGit
Owner

@⁠loyodea on GitHub · 2026-11-25 21:35 UTC · original
loyodea:gameinput-ds4-hid-report-length → main · +43 −1 · 3 files · 1 commits · open

Fixes #2465. XCL used a fixed 128-byte buffer for Windows HID reads. A DualShock 4 Bluetooth HID collection can advertise a 547-byte maximum. Size the read buffer from the collection capabilities and keep the previous fallback when the capability is unavailable.

What is in it

  • playstation.rs queries the existing HID handle, releases the preparsed data, and uses the advertised input report length. A synthetic regression covers Bluetooth, USB, fallback sizing, and parsing.
  • Cargo.toml enables the required bindings in the existing windows-sys dependency. The README describes the input behavior.

Tested

  • Windows 11 Pro build 26300, Ryzen 7 5700X3D, RX 9060 XT driver 32.0.32029.2010, Rust 1.100.0 GNU x64, DXC 1.9.2609.5, debug.
  • cargo +stable-x86_64-pc-windows-gnu test -j 4 -p xcl --lib hle::playstation::tests: 3 passed, 0 failed, 0 ignored. The regression failed before the fix with a 128-byte buffer where it expected 547 bytes.
  • Workspace build passed. cargo +stable-x86_64-pc-windows-gnu test -j 4 --workspace --no-fail-fast -- --test-threads=4: 1,420 passed, 4 failed, 46 ignored. The four GPU failures also appeared on an independent checkout of the same base and earlier clean upstream. Eight SKIPPED notices covered six unsupported per-lane paths, driver-cache measurement without Developer Mode, and the opt-in heap-window path.
  • Verified all three HID imports in the built executable. The synthetic end-to-end title passed.

Regression run

Paired real-title smoke runs are pending. This draft remains blocked on those runs.

Not tested

Physical DualShock 4 Bluetooth, retail titles, MSVC, release, and other GPU vendors.

AI use

OpenAI Codex with GPT-6.2 Sol (extra-high reasoning for the implementation and final checks) updated the code and regression and ran the tests.

**@⁠loyodea** on GitHub · 2026-11-25 21:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2525) `loyodea:gameinput-ds4-hid-report-length` → `main` · +43 −1 · 3 files · 1 commits · open Fixes #2465. XCL used a fixed 128-byte buffer for Windows HID reads. A DualShock 4 Bluetooth HID collection can advertise a 547-byte maximum. Size the read buffer from the collection capabilities and keep the previous fallback when the capability is unavailable. **What is in it** - `playstation.rs` queries the existing HID handle, releases the preparsed data, and uses the advertised input report length. A synthetic regression covers Bluetooth, USB, fallback sizing, and parsing. - `Cargo.toml` enables the required bindings in the existing `windows-sys` dependency. The README describes the input behavior. **Tested** - Windows 11 Pro build 26300, Ryzen 7 5700X3D, RX 9060 XT driver 32.0.32029.2010, Rust 1.100.0 GNU x64, DXC 1.9.2609.5, debug. - `cargo +stable-x86_64-pc-windows-gnu test -j 4 -p xcl --lib hle::playstation::tests`: 3 passed, 0 failed, 0 ignored. The regression failed before the fix with a 128-byte buffer where it expected 547 bytes. - Workspace build passed. `cargo +stable-x86_64-pc-windows-gnu test -j 4 --workspace --no-fail-fast -- --test-threads=4`: 1,420 passed, 4 failed, 46 ignored. The four GPU failures also appeared on an independent checkout of the same base and earlier clean upstream. Eight SKIPPED notices covered six unsupported per-lane paths, driver-cache measurement without Developer Mode, and the opt-in heap-window path. - Verified all three HID imports in the built executable. The synthetic end-to-end title passed. **Regression run** Paired real-title smoke runs are pending. This draft remains blocked on those runs. **Not tested** Physical DualShock 4 Bluetooth, retail titles, MSVC, release, and other GPU vendors. **AI use** OpenAI Codex with GPT-6.2 Sol (extra-high reasoning for the implementation and final checks) updated the code and regression and ran the tests.
Use the Windows HID collection's maximum input report length for ReadFile. A DualShock 4 Bluetooth collection can advertise 547 bytes, while the old fixed buffer holds 128. Add synthetic coverage for Bluetooth, USB and fallback sizes.

Fixes #2465.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:32:54 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 21:54 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 21:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2525#issuecomment-7175685033) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠xpatfussy69x on GitHub · 2026-11-25 22:21 UTC · original

Test run on exact head 09dda60 (09dda60869b741c6193277fe7f5d7dc4ab12d428, on its base 6d12f58), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too)
  • cargo test -p xcl --lib read_buffer_matches_the_hid: 1 passed, 0 failed
  • This PR's new tests in the workspace run:
    • read_buffer_matches_the_hid_collection_input_report_length: ok

Regression run (60 s, default settings, a retail title)

main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1091 (PresentX 1091)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

this PR:

xcl-smoke v1
commit: 09dda60869b741c6193277fe7f5d7dc4ab12d428
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1098 (PresentX 1098)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14790 MB

No crash or device removal; frames 101 % of main's, peak commit 100 %.

Not tested

  • No PlayStation controller was connected (the smoke run has no controller input), so the HID read path did not run: a regression check only
  • The PR merged into current main (tested on its own base; it merges into e1d84b7 without conflicts)
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
**@⁠xpatfussy69x** on GitHub · 2026-11-25 22:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2525#issuecomment-7176267425) Test run on exact head `09dda60` (`09dda60869b741c6193277fe7f5d7dc4ab12d428`, on its base `6d12f58`), clean tree. **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs - `cargo test --workspace -- --test-threads=4`: 1424 passed, 0 failed, 46 ignored - SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (on `main` too) - `cargo test -p xcl --lib read_buffer_matches_the_hid`: 1 passed, 0 failed - This PR's new tests in the workspace run: - `read_buffer_matches_the_hid_collection_input_report_length`: ok **Regression run** (60 s, default settings, a retail title) main: ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1091 (PresentX 1091) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` this PR: ``` xcl-smoke v1 commit: 09dda60869b741c6193277fe7f5d7dc4ab12d428 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1098 (PresentX 1098) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14790 MB ``` No crash or device removal; frames 101 % of `main`'s, peak commit 100 %. **Not tested** - No PlayStation controller was connected (the smoke run has no controller input), so the HID read path did not run: a regression check only - The PR merged into current `main` (tested on its own base; it merges into `e1d84b7` without conflicts) - AMD / native wave64 **AI use** - Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 22:49 UTC · original

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of read_buffer_matches_the_hid_collection_input_report_length: passed. GameInput, CPU-side, fine under the Wine lane. Note the test drives the size computation from the HID report descriptor, not a real pad, so it verifies the parsing path rather than device input.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 22:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2525#issuecomment-7176837910) **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `read_buffer_matches_the_hid_collection_input_report_length`: passed. GameInput, CPU-side, fine under the Wine lane. Note the test drives the size computation from the HID report descriptor, not a real pad, so it verifies the parsing path rather than device input. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Author
Owner

@⁠throny on GitHub · 2026-11-26 00:58 UTC · original

Two contributors checked independently and found that #2546 solves the same problem (for #2465) in a different way: #1607, group D120. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-26 00:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2525#issuecomment-7179300805) <!-- xcl-1607-hint:D120 --> Two contributors checked independently and found that #2546 solves the same problem (for #2465) in a different way: #1607, group D120. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2525/head:github-bot/gh-2525'
git switch 'github-bot/gh-2525'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2525'
git switch 'github-bot/gh-2525'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2525'
git switch 'github-bot/gh-2525'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2525'
git switch 'main'
git merge --squash 'github-bot/gh-2525'
git switch 'main'
git merge --ff-only 'github-bot/gh-2525'
git switch 'main'
git merge 'github-bot/gh-2525'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.