GameInput: size PlayStation HID read buffer from HIDP_CAPS #2536

Open
ramon-victor wants to merge 1 commit from upstream-pr/2546 into main
ramon-victor commented 2026-11-25 22:34:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ramon-victor on 2026-11-25T22:34:08Z.


Fixes #2465.

Problem

crates/xcl/src/hle/playstation.rs matches DualShock 4 controllers over Bluetooth (vid&0002054c, service 00001124-0000-1000-8000-00805f9b34fb), opens their HID handle, and reads reports into a hardcoded 128-byte buffer (let mut buf = [0u8; 128];).

On Windows, hidclass.sys rejects every ReadFile call whose buffer is smaller than HIDP_CAPS.InputReportByteLength with ERROR_INVALID_USER_BUFFER (1784). A DualShock 4 over Bluetooth advertises InputReportByteLength = 547 (input report 0x19), so ReadFile fails immediately on the first call, causing reader() to close the handle, sleep 1 s, and reconnect in a loop without reading input.

Fix

  • Query HIDP_CAPS.InputReportByteLength on the opened HID handle via HidD_GetPreparsedData, HidP_GetCaps, and HidD_FreePreparsedData (hid.dll, raw-dylib), always freeing preparsed data before returning.
  • Allocate the ReadFile buffer dynamically to read_buffer_len(input_report_byte_length(h)), clamping nonzero cap lengths to at least 64 bytes and falling back to 1024 bytes (>= 547) if HIDP_CAPS cannot be queried or reports zero.
  • Guard the unreadable-report log (buf[0]) against zero-length reads so it does not log a stale report ID.
  • Leave known() and parse() untouched so this change stays independent of Bluetooth DualSense report-parsing work (#2081).
  • Add unit tests in playstation::read_buffer_tests covering HidpCaps ABI size/offset against Windows SDK hidpi.h, buffer sizing across USB/Bluetooth/fallback lengths, and invalid-handle handling through hid.dll.

Tested

  • Targeted unit tests (cargo test --lib -p xcl playstation): 4 passed, 0 failed (hidp_caps_layout_and_read_buffer_sizing, input_report_byte_length_handles_invalid_handle, plus the 2 existing PlayStation tests).
  • Full workspace (.\scripts\test.ps1, NVIDIA GeForce RTX 3070, Windows 11): 1425 passed, 0 failed, 46 ignored.
  • Release build (cargo build --release -p xcl) and 60 s retail smoke run (see below).

Not tested

  • Live input delivery on a physical DualShock 4 controller connected over Bluetooth (no DualShock 4 hardware is attached on this test machine; HIDP_CAPS layout and HidD_GetPreparsedData/HidP_GetCaps/HidD_FreePreparsedData signatures were verified against Windows SDK hidpi.h/hidsdi.h, and hid.dll raw-dylib invocation was verified on INVALID_HANDLE_VALUE).

Regression run

Main (f087b99):

xcl-smoke v1
commit: f087b998d0d51a9f11bbfa0761967a63e778edd9
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14467 MB

This PR (20b18f7):

xcl-smoke v1
commit: 20b18f742afb2f2cfa0670d132cc78329757780d
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1622 (PresentX 1622)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14003 MB

AI use

  • Antigravity (Gemini 4 Neon): implementation, ABI verification against Windows SDK headers, tests, and PR drafting.
<!-- greyfinch-sync:ivall/xcl:issue:5500336934 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546). Originally posted by [ramon-victor](https://github.com/ramon-victor) on 2026-11-25T22:34:08Z. --- Fixes #2465. **Problem** `crates/xcl/src/hle/playstation.rs` matches DualShock 4 controllers over Bluetooth (`vid&0002054c`, service `00001124-0000-1000-8000-00805f9b34fb`), opens their HID handle, and reads reports into a hardcoded 128-byte buffer (`let mut buf = [0u8; 128];`). On Windows, `hidclass.sys` rejects every `ReadFile` call whose buffer is smaller than `HIDP_CAPS.InputReportByteLength` with `ERROR_INVALID_USER_BUFFER` (1784). A DualShock 4 over Bluetooth advertises `InputReportByteLength = 547` (input report `0x19`), so `ReadFile` fails immediately on the first call, causing `reader()` to close the handle, sleep 1 s, and reconnect in a loop without reading input. **Fix** - Query `HIDP_CAPS.InputReportByteLength` on the opened HID handle via `HidD_GetPreparsedData`, `HidP_GetCaps`, and `HidD_FreePreparsedData` (`hid.dll`, `raw-dylib`), always freeing preparsed data before returning. - Allocate the `ReadFile` buffer dynamically to `read_buffer_len(input_report_byte_length(h))`, clamping nonzero cap lengths to at least 64 bytes and falling back to 1024 bytes (`>= 547`) if `HIDP_CAPS` cannot be queried or reports zero. - Guard the unreadable-report log (`buf[0]`) against zero-length reads so it does not log a stale report ID. - Leave `known()` and `parse()` untouched so this change stays independent of Bluetooth DualSense report-parsing work (#2081). - Add unit tests in `playstation::read_buffer_tests` covering `HidpCaps` ABI size/offset against Windows SDK `hidpi.h`, buffer sizing across USB/Bluetooth/fallback lengths, and invalid-handle handling through `hid.dll`. **Tested** - Targeted unit tests (`cargo test --lib -p xcl playstation`): 4 passed, 0 failed (`hidp_caps_layout_and_read_buffer_sizing`, `input_report_byte_length_handles_invalid_handle`, plus the 2 existing PlayStation tests). - Full workspace (`.\scripts\test.ps1`, NVIDIA GeForce RTX 3070, Windows 11): `1425 passed, 0 failed, 46 ignored`. - Release build (`cargo build --release -p xcl`) and 60 s retail smoke run (see below). **Not tested** - Live input delivery on a physical DualShock 4 controller connected over Bluetooth (no DualShock 4 hardware is attached on this test machine; `HIDP_CAPS` layout and `HidD_GetPreparsedData`/`HidP_GetCaps`/`HidD_FreePreparsedData` signatures were verified against Windows SDK `hidpi.h`/`hidsdi.h`, and `hid.dll` `raw-dylib` invocation was verified on `INVALID_HANDLE_VALUE`). **Regression run** Main (`f087b99`): ``` xcl-smoke v1 commit: f087b998d0d51a9f11bbfa0761967a63e778edd9 gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14467 MB ``` This PR (`20b18f7`): ``` xcl-smoke v1 commit: 20b18f742afb2f2cfa0670d132cc78329757780d gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1622 (PresentX 1622) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14003 MB ``` **AI use** - Antigravity (Gemini 4 Neon): implementation, ABI verification against Windows SDK headers, tests, and PR drafting.
DavidM1911 commented 2026-11-25 23:09:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T22:46:53Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7176779345 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7176779345). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T22:46:53Z. --- 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!
futurepro62 commented 2026-11-25 23:09:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T22:53:21Z.


Full-suite run, since this PR has no test report yet. Tested exact head 20b18f7 (on its base e1d84b7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1413 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: hidp_caps_layout_and_read_buffer_sizing, input_report_byte_length_handles_invalid_handle.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1424 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main e1d84b7 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7176903353 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7176903353). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T22:53:21Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `20b18f7` (on its base `e1d84b7`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1413 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `dispatch_chain_native_wave64_builds_whole`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `hidp_caps_layout_and_read_buffer_sizing`, `input_report_byte_length_handles_invalid_handle`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1424 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `e1d84b7` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
SlopTart commented 2026-11-26 00:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T23:33:29Z.


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): 165 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 hidp_caps_layout_and_read_buffer_sizing and input_report_byte_length_handles_invalid_handle: 2 passed. No physical pad on this lane; these verify the HID parsing/sizing path, not device I/O.

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.

<!-- greyfinch-sync:ivall/xcl:comment:7177728689 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7177728689). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T23:33:29Z. --- **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): 165 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 `hidp_caps_layout_and_read_buffer_sizing` and `input_report_byte_length_handles_invalid_handle`: 2 passed. No physical pad on this lane; these verify the HID parsing/sizing path, not device I/O. **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.
throny commented 2026-11-26 02:08:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-26T01:10:12Z.


Two contributors checked independently and found that #2525 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.

<!-- greyfinch-sync:ivall/xcl:comment:7179502733 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7179502733). Originally posted by [throny](https://github.com/throny) on 2026-11-26T01:10:12Z. --- <!-- xcl-1607-hint:D120 --> Two contributors checked independently and found that #2525 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.
upipibi commented 2026-11-26 23:22:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T23:22:53Z.


Tested head 20b18f742afb2f2cfa0670d132cc78329757780d, merge-base e1d84b7d9153f86a97d2ec5d209d196046fc0bea, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0

Head 20b18f7 (on its merge-base e1d84b7 with main), debug, NVIDIA GeForce RTX 3070 8 GB, native Windows.

  • cargo test -p xcl --lib -- read_buffer_tests playstation --test-threads=1, 3 runs on 20b18f7: 4 passed, 0 failed, 0 ignored each time (hidp_caps_layout_and_read_buffer_sizing, input_report_byte_length_handles_invalid_handle and the 2 existing PlayStation tests).
  • Negative control: only the PR's read_buffer_tests module appended to the merge-base e1d84b7's playstation.rs: it does not compile, 11 errors, all E0425 (HidpCaps, read_buffer_len, input_report_byte_length, MIN_INPUT_REPORT_LEN not found), so the tests need the PR's code.
  • cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4 (the hle::xaudio2 tests hang on this machine, on main too; 9 filtered out):
    • 20b18f7: 1291 passed, 0 failed, 26 ignored
    • merge-base e1d84b7: 1289 passed, 0 failed, 26 ignored
    • SKIPPED lines, 25 on each: 21 no wave64 on this adapter, 3 wave32 per-lane forms the translator refuses (#1426 semantics), 1 needs Developer Mode.

Not tested: retail title. A physical DualShock 4 over Bluetooth (no pad here); this only checks the HIDP_CAPS layout, the buffer sizing and the invalid-handle path.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

<!-- greyfinch-sync:ivall/xcl:comment:7205492272 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7205492272). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T23:22:53Z. --- Tested head `20b18f742afb2f2cfa0670d132cc78329757780d`, merge-base `e1d84b7d9153f86a97d2ec5d209d196046fc0bea`, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0 Head `20b18f7` (on its merge-base `e1d84b7` with `main`), debug, NVIDIA GeForce RTX 3070 8 GB, native Windows. - `cargo test -p xcl --lib -- read_buffer_tests playstation --test-threads=1`, 3 runs on `20b18f7`: 4 passed, 0 failed, 0 ignored each time (`hidp_caps_layout_and_read_buffer_sizing`, `input_report_byte_length_handles_invalid_handle` and the 2 existing PlayStation tests). - Negative control: only the PR's `read_buffer_tests` module appended to the merge-base `e1d84b7`'s `playstation.rs`: it does not compile, 11 errors, all E0425 (`HidpCaps`, `read_buffer_len`, `input_report_byte_length`, `MIN_INPUT_REPORT_LEN` not found), so the tests need the PR's code. - `cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4` (the `hle::xaudio2` tests hang on this machine, on `main` too; 9 filtered out): - `20b18f7`: 1291 passed, 0 failed, 26 ignored - merge-base `e1d84b7`: 1289 passed, 0 failed, 26 ignored - SKIPPED lines, 25 on each: 21 no wave64 on this adapter, 3 wave32 per-lane forms the translator refuses (#1426 semantics), 1 needs Developer Mode. Not tested: retail title. A physical DualShock 4 over Bluetooth (no pad here); this only checks the HIDP_CAPS layout, the buffer sizing and the invalid-handle path. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Decodere commented 2026-11-27 02:45:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T02:45:03Z.


Independent desktop NVIDIA / Windows 11 verification of PR #2546 at head 20b18f742afb2f2cfa0670d132cc78329757780d (1 commit; exact parent & merge-base: e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (20b18f74)

Command Result
cargo test --release -p xcl --lib hidp_caps_layout_and_read_buffer_sizing -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1325 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib input_report_byte_length_handles_invalid_handle -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1325 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib hle::playstation:: (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 1322 filtered out × 3 (0.00s × 3, 0 skipped)
cargo build --release -p xcl Clean build (1m 07s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):

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

PR #2546 (20b18f742afb2f2cfa0670d132cc78329757780d):

xcl-smoke v1
commit: 20b18f742afb2f2cfa0670d132cc78329757780d
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1595 (PresentX 1595)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14005 MB

Runtime log observations (xcl.log)

  • 9221 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19513 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14005 MB committed by the process; video memory 6115 MB local, 4683 MB non-local.

Limits of coverage

  • HIDP_CAPS struct layout, read_buffer_len sizing, and invalid-handle HidD_GetPreparsedData safety were verified via both new unit tests (3/3 each) and hle::playstation:: (4/4 × 3), and the 60 s retail smoke confirms clean build and runtime non-regression on Windows 11.
  • No physical DualSense / DualShock 4 PlayStation controller (USB or Bluetooth) is attached to this host, so live HID input-report reads against a physical controller were not exercised here.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7208397325 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7208397325). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T02:45:03Z. --- Independent desktop NVIDIA / Windows 11 verification of **PR #2546** at head `20b18f742afb2f2cfa0670d132cc78329757780d` (`1` commit; exact parent & merge-base: `e1d84b7d9153f86a97d2ec5d209d196046fc0bea`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`20b18f74`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib hidp_caps_layout_and_read_buffer_sizing -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1325 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib input_report_byte_length_handles_invalid_handle -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1325 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib hle::playstation::` (3 consecutive runs) | `4 passed; 0 failed; 0 ignored; 1322 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 07s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`e1d84b7d9153f86a97d2ec5d209d196046fc0bea`, cached baseline on the same machine): ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1531 (PresentX 1531) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13982 MB ``` PR #2546 (`20b18f742afb2f2cfa0670d132cc78329757780d`): ``` xcl-smoke v1 commit: 20b18f742afb2f2cfa0670d132cc78329757780d gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1595 (PresentX 1595) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14005 MB ``` ### Runtime log observations (`xcl.log`) - `9221` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19513 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14005 MB committed by the process; video memory 6115 MB local, 4683 MB non-local`. ### Limits of coverage - `HIDP_CAPS` struct layout, `read_buffer_len` sizing, and invalid-handle `HidD_GetPreparsedData` safety were verified via both new unit tests (`3/3` each) and `hle::playstation::` (`4/4` × 3), and the 60 s retail smoke confirms clean build and runtime non-regression on Windows 11. - No physical DualSense / DualShock 4 PlayStation controller (USB or Bluetooth) is attached to this host, so live HID input-report reads against a physical controller were not exercised here. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
throny commented 2026-11-28 03:01:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:01:31Z.


merge-check claim
head: 20b18f742a

<!-- greyfinch-sync:ivall/xcl:comment:7232744167 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7232744167). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:01:31Z. --- merge-check claim head: 20b18f742afb2f2cfa0670d132cc78329757780d
throny commented 2026-11-28 03:16:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T03:16:10Z.


merge-check
base: 753e8b1a
head: 20b18f742a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (no PlayStation controller attached here, so the device path did not run) (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: none. The capability struct's size and the status constant are right; the buffer is the larger of the device's report length and 64 bytes, at most 65535, and 1024 if the query fails; the read is bounded by the buffer and the parser checks the report's length and id, so short and long reports are safe. For the maintainer: triage marked #2525 as a duplicate (still open).
performance: one heap buffer per controller thread; not a hot path.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7232934960 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7232934960). Originally posted by [throny](https://github.com/throny) on 2026-11-28T03:16:10Z. --- merge-check base: 753e8b1a head: 20b18f742afb2f2cfa0670d132cc78329757780d merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (no PlayStation controller attached here, so the device path did not run) (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored review: none. The capability struct's size and the status constant are right; the buffer is the larger of the device's report length and 64 bytes, at most 65535, and 1024 if the query fails; the read is bounded by the buffer and the parser checks the report's length and id, so short and long reports are safe. For the maintainer: triage marked #2525 as a duplicate (still open). performance: one heap buffer per controller thread; not a hot path. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-28 12:05:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T12:05:33Z.


merge-check claim
head: 20b18f742a

<!-- greyfinch-sync:ivall/xcl:comment:7238987720 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7238987720). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T12:05:33Z. --- merge-check claim head: 20b18f742afb2f2cfa0670d132cc78329757780d
KOLESNiii commented 2026-11-28 13:39:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:39:12Z.


merge-check
base: e429936c10
head: 20b18f742a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4, run at the same time as 2 other PRs' suites in one queued job: the lib unit-test target (unittests src\lib.rs) exited with STATUS_ACCESS_VIOLATION (0xc0000005) partway, during the vfs tests, after this PR's two new tests had passed; the other 38 targets -> 131 passed, 3 failed, 20 ignored. The lib target rerun alone through the queue on the same merge commit (cargo test -p xcl --lib --no-fail-fast -- --test-threads=4) -> 1997 passed, 6 failed, 28 ignored, 24 SKIPPED, no crash. Together: 2128 passed, 9 failed, 48 ignored (the base's 2126 passed plus this PR's 2 new tests); failing: the 9 tests that fail on the base e429936c too (its suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9): 6 lib GPU tests (gpu::dxil::module::split dispatch_chain_oversized_loop_matches_whole / dispatch_chain_wave32_live_loops / dispatch_chain_wave64_live_loops_and_exchange, gpu_heap_flat_reads_match_guarded_and_root_output, gpu_compute_mode_dispatch_abi, gpu_float_cas_uses_ieee_equality) and 3 e2e tests (test_title_runs_and_game_folder_is_untouched, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_under_the_debug_layer_with_dred); not caused by this PR. The access violation did not recur alone and was not traced.
review: none. Whole diff read (playstation.rs: the HID read buffer is sized from HIDP_CAPS.InputReportByteLength (at least 64), 1024 when the caps cannot be read, instead of a fixed 128 bytes; the "report this does not read" log reads the id only when bytes came; HIDP_CAPS declared (64 bytes, InputReportByteLength at +4, as in hidpi.h), hid.dll linked; 2 tests). A Bluetooth controller with 547-byte reports no longer fails ReadFile.
performance: no runtime cost of note (one caps query and one allocation per opened controller).
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 10136a7b6791b81d90898ff7a4dca8aa2150b1e1 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.

<!-- greyfinch-sync:ivall/xcl:comment:7240088527 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7240088527). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T13:39:12Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: 20b18f742afb2f2cfa0670d132cc78329757780d merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4, run at the same time as 2 other PRs' suites in one queued job: the lib unit-test target (unittests src\lib.rs) exited with STATUS_ACCESS_VIOLATION (0xc0000005) partway, during the vfs tests, after this PR's two new tests had passed; the other 38 targets -> 131 passed, 3 failed, 20 ignored. The lib target rerun alone through the queue on the same merge commit (cargo test -p xcl --lib --no-fail-fast -- --test-threads=4) -> 1997 passed, 6 failed, 28 ignored, 24 SKIPPED, no crash. Together: 2128 passed, 9 failed, 48 ignored (the base's 2126 passed plus this PR's 2 new tests); failing: the 9 tests that fail on the base e429936c too (its suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9): 6 lib GPU tests (gpu::dxil::module::split dispatch_chain_oversized_loop_matches_whole / dispatch_chain_wave32_live_loops / dispatch_chain_wave64_live_loops_and_exchange, gpu_heap_flat_reads_match_guarded_and_root_output, gpu_compute_mode_dispatch_abi, gpu_float_cas_uses_ieee_equality) and 3 e2e tests (test_title_runs_and_game_folder_is_untouched, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_under_the_debug_layer_with_dred); not caused by this PR. The access violation did not recur alone and was not traced. review: none. Whole diff read (playstation.rs: the HID read buffer is sized from HIDP_CAPS.InputReportByteLength (at least 64), 1024 when the caps cannot be read, instead of a fixed 128 bytes; the "report this does not read" log reads the id only when bytes came; HIDP_CAPS declared (64 bytes, InputReportByteLength at +4, as in hidpi.h), hid.dll linked; 2 tests). A Bluetooth controller with 547-byte reports no longer fails ReadFile. performance: no runtime cost of note (one caps query and one allocation per opened controller). verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 10136a7b6791b81d90898ff7a4dca8aa2150b1e1 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft). correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.
Grimkaaah commented 2026-11-30 12:05:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Grimkaaah on 2026-11-30T12:05:18Z.


I compared this with the same HID read path in my project, which reads DualSense, DualSense Edge and DualShock 4 over USB and Bluetooth with ReadFile. I also checked it against hidapi's Windows backend, SDL's PS4/PS5 HIDAPI drivers and Linux hid-playstation.

What I checked, all fine:

  • HidpCaps is 64 bytes, InputReportByteLength is at +4, and HIDP_STATUS_SUCCESS is 0x00110000 (hidpi.h). The preparsed data is freed on every path.
  • The caps are read on the same handle that is read, so the size is that collection's. hidapi does the same: it allocates caps.InputReportByteLength and reads exactly that. We read with max(caps length, 78), or 1024 when the caps are unknown, so your 1024 fallback matches ours.
  • Windows pads each report to InputReportByteLength. That is why SDL's PS5 driver accepts the Bluetooth 0x01 report at 10 or 78 bytes. So a DS4's 10-byte 0x01 report arrives as 547 bytes, and parse only needs 10 or more.
  • The new id guard on a 0-byte read (playstation.rs:180) is right.
  • No output reports are written, so padding to OutputReportByteLength and the Bluetooth output CRC32 don't apply yet.
  • Double input: the HID pad is used only when XInput has no pad, so a Steam Input or DS4Windows copy wins. This PR doesn't change that.

One gap, not a bug in this diff: with this PR ReadFile succeeds, but a DualShock 4 over Bluetooth gives input only while it sends the basic 0x01 report. After anything reads its calibration feature report (Steam Input's PlayStation support, DS4Windows, an SDL game), it sends 0x11 until it reconnects. parse drops 0x11 (playstation.rs:198, r[0] != 0x01), so the log says "sent a report this does not read (id 0x11, 547 bytes)" once and the pad stays silent. #2081 parses 0x11. Landing both closes #2465 fully. Otherwise #2465 is fixed only for pads still in basic mode.

Duplicate: #2525 fixes the same thing. This PR is the more complete one, for two reasons:

  • When the caps can't be read, it falls back to 1024 bytes (at least 547). #2525 falls back to 128 bytes (its playstation.rs:121), the size that fails on a DS4 over Bluetooth.
  • It guards buf[0] on a 0-byte read.

#2525's one advantage is that it uses the windows-sys HidD_* / HidP_GetCaps / HIDP_CAPS bindings instead of a hand-declared struct and a raw-dylib block. Switching to those here is optional.

Not checked: we haven't run this PR, on a pad or otherwise. No DS4 over Bluetooth was read with it.

AI use: Claude Code (Claude Opus 5.5) reviewed this by comparing it with the same mechanism in my project, Victory Grimkaaah.

<!-- greyfinch-sync:ivall/xcl:comment:7277926808 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7277926808). Originally posted by [Grimkaaah](https://github.com/Grimkaaah) on 2026-11-30T12:05:18Z. --- I compared this with the same HID read path in my project, which reads DualSense, DualSense Edge and DualShock 4 over USB and Bluetooth with ReadFile. I also checked it against hidapi's Windows backend, SDL's PS4/PS5 HIDAPI drivers and Linux hid-playstation. What I checked, all fine: - `HidpCaps` is 64 bytes, `InputReportByteLength` is at +4, and `HIDP_STATUS_SUCCESS` is 0x00110000 (hidpi.h). The preparsed data is freed on every path. - The caps are read on the same handle that is read, so the size is that collection's. hidapi does the same: it allocates `caps.InputReportByteLength` and reads exactly that. We read with max(caps length, 78), or 1024 when the caps are unknown, so your 1024 fallback matches ours. - Windows pads each report to `InputReportByteLength`. That is why SDL's PS5 driver accepts the Bluetooth 0x01 report at 10 or 78 bytes. So a DS4's 10-byte 0x01 report arrives as 547 bytes, and `parse` only needs 10 or more. - The new id guard on a 0-byte read (playstation.rs:180) is right. - No output reports are written, so padding to OutputReportByteLength and the Bluetooth output CRC32 don't apply yet. - Double input: the HID pad is used only when XInput has no pad, so a Steam Input or DS4Windows copy wins. This PR doesn't change that. One gap, not a bug in this diff: with this PR ReadFile succeeds, but a DualShock 4 over Bluetooth gives input only while it sends the basic 0x01 report. After anything reads its calibration feature report (Steam Input's PlayStation support, DS4Windows, an SDL game), it sends 0x11 until it reconnects. `parse` drops 0x11 (playstation.rs:198, `r[0] != 0x01`), so the log says "sent a report this does not read (id 0x11, 547 bytes)" once and the pad stays silent. #2081 parses 0x11. Landing both closes #2465 fully. Otherwise #2465 is fixed only for pads still in basic mode. Duplicate: #2525 fixes the same thing. This PR is the more complete one, for two reasons: - When the caps can't be read, it falls back to 1024 bytes (at least 547). #2525 falls back to 128 bytes (its playstation.rs:121), the size that fails on a DS4 over Bluetooth. - It guards `buf[0]` on a 0-byte read. #2525's one advantage is that it uses the windows-sys `HidD_*` / `HidP_GetCaps` / `HIDP_CAPS` bindings instead of a hand-declared struct and a `raw-dylib` block. Switching to those here is optional. Not checked: we haven't run this PR, on a pad or otherwise. No DS4 over Bluetooth was read with it. AI use: Claude Code (Claude Opus 5.5) reviewed this by comparing it with the same mechanism in my project, Victory Grimkaaah.
Foniass commented 2026-12-01 08:20:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:20:43Z.


Triage (#1607) – head 20b18f7

#2525 fixes the same problem in the same way: both size the playstation.rs ReadFile buffer from HidP_GetCaps(...).InputReportByteLength. #2525 uses the windows-sys HID bindings and falls back to 128 bytes. This PR declares HIDP_CAPS and the hid imports by hand (raw-dylib), with a 64-byte minimum and a 1024-byte fallback. No problems found in the diff: the hand-written HIDP_CAPS layout (64 bytes, InputReportByteLength at offset 4) matches the SDK. Only one of the two should be merged.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305194834 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2546#issuecomment-7305194834). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:20:43Z. --- **Triage (#1607)** – head 20b18f7 #2525 fixes the same problem in the same way: both size the `playstation.rs` ReadFile buffer from `HidP_GetCaps(...).InputReportByteLength`. #2525 uses the `windows-sys` HID bindings and falls back to 128 bytes. This PR declares `HIDP_CAPS` and the hid imports by hand (`raw-dylib`), with a 64-byte minimum and a 1024-byte fallback. No problems found in the diff: the hand-written `HIDP_CAPS` layout (64 bytes, `InputReportByteLength` at offset 4) matches the SDK. Only one of the two should be merged. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2546:upstream-pr/2546'
git switch 'upstream-pr/2546'

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/2546'
git switch 'upstream-pr/2546'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2546'
git switch 'upstream-pr/2546'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2546'
git switch 'main'
git merge --squash 'upstream-pr/2546'
git switch 'main'
git merge --ff-only 'upstream-pr/2546'
git switch 'main'
git merge 'upstream-pr/2546'
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
xcl-dev/xcl!2536
No description provided.