GameInput: DualSense USB output report and adaptive trigger effect layouts #704

Open
MrCheese5 wants to merge 2 commits from upstream-pr/709 into main
MrCheese5 commented 2026-11-24 03:57:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MrCheese5 on 2026-11-24T03:57:26Z.


Stacked on #552; only the top commit belongs here.

A pure builder for the DualSense's USB output report 0x02. It covers compatible rumble (or leaving the actuators to audio haptics), the two adaptive trigger effect blocks (0x05 off, 0x21 feedback, 0x25 weapon, 0x26 vibration, over the 10 zones of the trigger's travel), the light bar, the player and mute LEDs, the light bar setup and the motor power attenuation. The byte offsets follow the output report layout in Linux's hid-playstation driver. No code is taken from it.

Nothing calls it yet: #552 only reads the controller. The next PRs in this stack use it for rumble (#715) and the adaptive triggers (#731).

What is in it

  • crates/xcl/src/hle/dualsense_report.rs: TriggerEffect, Output, with tests checking the trigger blocks and the whole USB report byte for byte
  • crates/xcl/src/hle/mod.rs: the module

Tested

  • RTX 4090 (driver 621.14), i9-14900K, Windows 11 26200, Rust stable-x86_64-pc-windows-msvc, debug tests, release smoke runs
  • cargo test -p xcl --lib dualsense_report: 2 passed
  • cargo test --workspace -- --test-threads=1: 696 passed, 0 failed, 41 ignored; SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64)
  • Single-threaded on purpose: with --test-threads=4, GPU tests on this machine hang or lose the device tonight on main too (bdab194 and 91f9a5e; bdab194 had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded, main 91f9a5e passes (cargo test -p xcl --lib -- --test-threads=1: 647 passed, 0 failed).

Regression run
Both runs use a fresh data root of their own. The title is not driven by a controller during the run, so this shows that nothing else changes, not the new path.

xcl-smoke v1
commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db
gpu: NVIDIA GeForce RTX 4090
title: Xbox
seconds: 60
exit: 0x0
frames shown: 811 (PresentX 811)
presents per 2 s (last 3): 37 34 36
device removals: 0
crashes: 0
peak commit: 15536 MB
xcl-smoke v1
commit: 3b568ed3ea450813e015e7cf1697722d62de88b8
gpu: NVIDIA GeForce RTX 4090
title: Xbox
seconds: 60
exit: 0x0
frames shown: 837 (PresentX 837)
presents per 2 s (last 3): 37 37 36
device removals: 0
crashes: 0
peak commit: 15531 MB

Not tested

  • The Bluetooth output report (0x31 with CRC) is not part of this PR.
  • Nothing calls this code yet, so nothing in a title changes.
  • AMD and other NVIDIA GPUs (the change has no GPU code).

AI use

  • Claude Code with Claude Opus 5.5: wrote the code, the tests and this description; the hardware checks above are runs on the machine named under Tested.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5465794998 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/709). Originally posted by [MrCheese5](https://github.com/MrCheese5) on 2026-11-24T03:57:26Z. --- Stacked on #552; only the top commit belongs here. A pure builder for the DualSense's USB output report 0x02. It covers compatible rumble (or leaving the actuators to audio haptics), the two adaptive trigger effect blocks (0x05 off, 0x21 feedback, 0x25 weapon, 0x26 vibration, over the 10 zones of the trigger's travel), the light bar, the player and mute LEDs, the light bar setup and the motor power attenuation. The byte offsets follow the output report layout in Linux's `hid-playstation` driver. No code is taken from it. Nothing calls it yet: #552 only reads the controller. The next PRs in this stack use it for rumble (#715) and the adaptive triggers (#731). **What is in it** - `crates/xcl/src/hle/dualsense_report.rs`: `TriggerEffect`, `Output`, with tests checking the trigger blocks and the whole USB report byte for byte - `crates/xcl/src/hle/mod.rs`: the module **Tested** - RTX 4090 (driver 621.14), i9-14900K, Windows 11 26200, Rust stable-x86_64-pc-windows-msvc, debug tests, release smoke runs - `cargo test -p xcl --lib dualsense_report`: 2 passed - `cargo test --workspace -- --test-threads=1`: 696 passed, 0 failed, 41 ignored; SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64) - Single-threaded on purpose: with `--test-threads=4`, GPU tests on this machine hang or lose the device tonight on `main` too (bdab194 and 91f9a5e; bdab194 had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded, `main` 91f9a5e passes (`cargo test -p xcl --lib -- --test-threads=1`: 647 passed, 0 failed). **Regression run** Both runs use a fresh data root of their own. The title is not driven by a controller during the run, so this shows that nothing else changes, not the new path. ``` xcl-smoke v1 commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db gpu: NVIDIA GeForce RTX 4090 title: Xbox seconds: 60 exit: 0x0 frames shown: 811 (PresentX 811) presents per 2 s (last 3): 37 34 36 device removals: 0 crashes: 0 peak commit: 15536 MB ``` ``` xcl-smoke v1 commit: 3b568ed3ea450813e015e7cf1697722d62de88b8 gpu: NVIDIA GeForce RTX 4090 title: Xbox seconds: 60 exit: 0x0 frames shown: 837 (PresentX 837) presents per 2 s (last 3): 37 37 36 device removals: 0 crashes: 0 peak commit: 15531 MB ``` **Not tested** - The Bluetooth output report (0x31 with CRC) is not part of this PR. - Nothing calls this code yet, so nothing in a title changes. - AMD and other NVIDIA GPUs (the change has no GPU code). **AI use** - Claude Code with Claude Opus 5.5: wrote the code, the tests and this description; the hardware checks above are runs on the machine named under **Tested**. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-24 07:06:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T04:46:54Z.


Tested exact head 3b568ed (on its base 91f9a5e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 696 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Not tested

  • A DualSense (none connected here), a retail title or scripts/smoke.ps1 (no title on this machine), AMD, a release build.

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:7122332871 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/709#issuecomment-7122332871). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T04:46:54Z. --- Tested exact head `3b568ed` (on its base `91f9a5e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **696 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. **Not tested** - A DualSense (none connected here), a retail title or `scripts/smoke.ps1` (no title on this machine), AMD, a release build. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
MesshM commented 2026-11-24 07:06:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:47:43Z.


Test run of 3b568ed3ea450813e015e7cf1697722d62de88b8 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge), so the tree tested includes the stack under it (#552).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 705 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 664 passed, 0 failed, 21 ignored
  • 0 SKIPPED; usb_output_report_layout and trigger_effect_blocks pass.

Review: A pure builder with layout tests, no device I/O, so it is safe to land ahead of its users. I did not compare every trigger effect byte against a reference.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122345356 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/709#issuecomment-7122345356). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T04:47:43Z. --- Test run of `3b568ed3ea450813e015e7cf1697722d62de88b8` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge), so the tree tested includes the stack under it (#552). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **705 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 664 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `usb_output_report_layout` and `trigger_effect_blocks` pass. **Review:** A pure builder with layout tests, no device I/O, so it is safe to land ahead of its users. I did not compare every trigger effect byte against a reference. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
JJAutoCompare commented 2026-11-25 07:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:18:30Z.


Empirical test report (3b568ed3)

Hardware / environment

  • Commit 3b568ed3ea450813e015e7cf1697722d62de88b8. Windows 11 Enterprise Evaluation, build 10.0.26200.9974. AMD Ryzen 7 3800X 8-Core Processor.
  • Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0 (3acc79c0c), DXC 1.9.2609.5 (01b62ad47). Unoptimized test profile with debug info and incremental compilation disabled.
  • Focused runs used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. All commands ran outside the Arc test wrapper.

Commands and results

  • cargo test --workspace --no-run exited 0 and built 15 test executables.
  • cargo test -p xcl --lib hle::dualsense_report::tests:: exited 0 with 2 passed, 0 failed, 0 ignored, 0 skipped.
  • cargo test -p xcl --lib hle::playstation::tests:: exited 0 with 2 passed, 0 failed, 0 ignored, 0 skipped.
  • Focused total from the captured output was 4 passed, 0 failed, 0 ignored, and 0 case-sensitive SKIPPED lines.

Observed behavior

  • Byte assertions passed for adaptive trigger off, feedback, weapon, and vibration modes, including zone masks, strength and amplitude packing, weapon zone clamping, and vibration frequency placement.
  • The 48-byte DualSense USB report assertions passed for the report ID, enable flags, motor order, trigger block offsets, attenuation, and LED fields. The tests also exercised omitted rumble and disabled lightbar setup.
  • Synthetic DualShock 4 and DualSense USB input reports decoded to the expected gamepad state. The tests also checked rejection of short or unrelated reports and the expected classification of sample USB and Bluetooth HID paths.

Not tested

Physical DualSense hardware, the full GPU workspace suite, and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr709-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154656438 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/709#issuecomment-7154656438). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:18:30Z. --- ### Empirical test report (3b568ed3) **Hardware / environment** - Commit `3b568ed3ea450813e015e7cf1697722d62de88b8`. Windows 11 Enterprise Evaluation, build 10.0.26200.9974. AMD Ryzen 7 3800X 8-Core Processor. - Rust 1.100.0 (`0ef1bc386`, `x86_64-pc-windows-msvc`), Cargo 1.100.0 (`3acc79c0c`), DXC 1.9.2609.5 (`01b62ad47`). Unoptimized test profile with debug info and incremental compilation disabled. - Focused runs used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. All commands ran outside the Arc test wrapper. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built 15 test executables. - `cargo test -p xcl --lib hle::dualsense_report::tests::` exited 0 with 2 passed, 0 failed, 0 ignored, 0 skipped. - `cargo test -p xcl --lib hle::playstation::tests::` exited 0 with 2 passed, 0 failed, 0 ignored, 0 skipped. - Focused total from the captured output was 4 passed, 0 failed, 0 ignored, and 0 case-sensitive `SKIPPED ` lines. **Observed behavior** - Byte assertions passed for adaptive trigger off, feedback, weapon, and vibration modes, including zone masks, strength and amplitude packing, weapon zone clamping, and vibration frequency placement. - The 48-byte DualSense USB report assertions passed for the report ID, enable flags, motor order, trigger block offsets, attenuation, and LED fields. The tests also exercised omitted rumble and disabled lightbar setup. - Synthetic DualShock 4 and DualSense USB input reports decoded to the expected gamepad state. The tests also checked rejection of short or unrelated reports and the expected classification of sample USB and Bluetooth HID paths. **Not tested** Physical DualSense hardware, the full GPU workspace suite, and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr709-focused.log and published.
DavidM1911 commented 2026-11-25 12:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:56:34Z.


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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7161710787 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/709#issuecomment-7161710787). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T11:56:34Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
github-actions[bot] commented 2026-11-29 07:42:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:42:07Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252636336 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/709#issuecomment-7252636336). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:42:07Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:59:20 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 3b568ed

Stacked on #552 (now merged as 0db1c5a1; the branch still carries the old commit 09ff6e94 and needs a rebase); only 3b568ed belongs here. #710, #715 and #731 are stacked on top of it and use the builder, so they are not duplicates. No other open or merged PR builds a DualSense output report.
No problems found in dualsense_report.rs: the offsets match the hid-playstation common report and the trigger blocks. It is not called yet, as the description says.
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:7300263367 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/709#issuecomment-7300263367). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:59:20Z. --- **Triage (#1607)** – head 3b568ed Stacked on #552 (now merged as 0db1c5a1; the branch still carries the old commit 09ff6e94 and needs a rebase); only 3b568ed belongs here. #710, #715 and #731 are stacked on top of it and use the builder, so they are not duplicates. No other open or merged PR builds a DualSense output report. No problems found in `dualsense_report.rs`: the offsets match the hid-playstation common report and the trigger blocks. It is not called yet, as the description says. 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/709:upstream-pr/709'
git switch 'upstream-pr/709'

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