GameInput: a device callback reports the statuses its filter names #1784

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

@⁠b3IKK on GitHub · 2026-11-24 20:37 UTC · original
b3IKK:gameinput/device-callback-filter → main · +31 −5 · 1 files · 1 commits · open

Addresses XCL-BT-027 from #1488.

IGameInput::RegisterDeviceCallback takes a statusFilter (a GameInputDeviceStatus mask) and ignored it (_filter): the callback always reported every status the gamepad has — connected, input enabled, output enabled, synchronized (0x47). A title that asked for one status (say OutputEnabled, to decide whether rumble works) was told about all of them, and a filter the device matches none of (a wired-only status on a wireless pad) still got a callback it should not see.

This reports STATUS & filter — the statuses the device has that the caller asked for — and calls nothing when the filter matches none of them.

What is in it

  • crates/xcl/src/hle/gameinput.rs: register_device_callback honours statusFilter on both the blocking and the async enumeration paths; add test a_device_callback_reports_only_the_statuses_it_asked_for (connected → 0x1, input+output → 0x6, a status the device does not have → no callback). Fails on main with left: 71, right: 1.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 893 passed, 0 failed, 42 ignored (SKIPPED: 2 no wave64; 1 no heap windows; 1 cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib gameinput: 10 passed, 0 failed

Regression run

main (e9e94ce, clean tree, no local changes):

xcl-smoke v1
commit: e9e94ce665d16bb0e2d2e4cb6b37e149f0d27721
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1646 (PresentX 1646)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14489 MB

PR (9b8c3de, clean tree, no local changes):

xcl-smoke v1
commit: 9b8c3de8851ad14e916bc3d8f9c214bf6ea5c854
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1644 (PresentX 1644)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14491 MB

Not tested

  • a title that registers for a status this emulation does not have and expects a later callback when it appears (the gamepad reports all four at once)
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: checked XCL-BT-027 against register_device_callback, wrote the fix and test (and confirmed it fails without it), rebased onto e9e94ce, ran the test suite and scripts/smoke.ps1 regression runs with #677's title hashing, and drafted this PR description.
**@⁠b3IKK** on GitHub · 2026-11-24 20:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784) `b3IKK:gameinput/device-callback-filter` → `main` · +31 −5 · 1 files · 1 commits · open Addresses `XCL-BT-027` from #1488. `IGameInput::RegisterDeviceCallback` takes a `statusFilter` (a `GameInputDeviceStatus` mask) and ignored it (`_filter`): the callback always reported every status the gamepad has — connected, input enabled, output enabled, synchronized (`0x47`). A title that asked for one status (say `OutputEnabled`, to decide whether rumble works) was told about all of them, and a filter the device matches none of (a wired-only status on a wireless pad) still got a callback it should not see. This reports `STATUS & filter` — the statuses the device has that the caller asked for — and calls nothing when the filter matches none of them. **What is in it** - `crates/xcl/src/hle/gameinput.rs`: `register_device_callback` honours `statusFilter` on both the blocking and the async enumeration paths; add test `a_device_callback_reports_only_the_statuses_it_asked_for` (connected → `0x1`, input+output → `0x6`, a status the device does not have → no callback). Fails on `main` with `left: 71, right: 1`. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 893 passed, 0 failed, 42 ignored (SKIPPED: 2 `no wave64`; 1 `no heap windows`; 1 `cannot disable the driver cache (Windows Developer Mode is required))` - `cargo test -p xcl --lib gameinput`: 10 passed, 0 failed **Regression run** main (`e9e94ce`, clean tree, no local changes): ``` xcl-smoke v1 commit: e9e94ce665d16bb0e2d2e4cb6b37e149f0d27721 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1646 (PresentX 1646) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14489 MB ``` PR (`9b8c3de`, clean tree, no local changes): ``` xcl-smoke v1 commit: 9b8c3de8851ad14e916bc3d8f9c214bf6ea5c854 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1644 (PresentX 1644) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14491 MB ``` **Not tested** - a title that registers for a status this emulation does not have and expects a later callback when it appears (the gamepad reports all four at once) - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: checked `XCL-BT-027` against `register_device_callback`, wrote the fix and test (and confirmed it fails without it), rebased onto `e9e94ce`, ran the test suite and `scripts/smoke.ps1` regression runs with #677's title hashing, and drafted this PR description.
IGameInput::RegisterDeviceCallback's statusFilter was ignored: the
callback always reported all of the gamepad's statuses (connected,
input enabled, output enabled, synchronized). A title that asked for one
of them - or only for output enabled, to decide whether rumble works -
was told about every status, and a filter the device does not match (a
wired connection on a wireless pad) still produced a callback.

Report the statuses the device has that the filter names; a filter it
matches none of calls nothing.

Assisted-by: OpenCode (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:05:05 +00:00
Author
Owner

@⁠b3IKK on GitHub · 2026-11-24 21:21 UTC · original

Rebased onto e9e94ce (which brought #677's anonymised itle: line into scripts/smoke.ps1) and re-ran both: 893 passed, 0 failed, 42 ignored; the blocks above are from the new script.

**@⁠b3IKK** on GitHub · 2026-11-24 21:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784#issuecomment-7144817290) Rebased onto e9e94ce (which brought #677's anonymised itle: line into scripts/smoke.ps1) and re-ran both: 893 passed, 0 failed, 42 ignored; the blocks above are from the new script.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 21:28 UTC · original · edited 2026-11-24 22:20 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 9b8c3de (on its base e9e94ce).

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, 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 pso_measurement_compiles_an_exact_synthetic_record: 891 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_device_callback_reports_only_the_statuses_it_asked_for.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 893 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and there pso_measurement_compiles_an_exact_synthetic_record ran and passed.

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.
**@⁠futurepro62** on GitHub · 2026-11-24 21:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784#issuecomment-7144966882) · edited 2026-11-24 22:20 UTC Full-suite run, since this PR has no test report yet. Tested exact head `9b8c3de` (on its base `e9e94ce`). **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, 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 pso_measurement_compiles_an_exact_synthetic_record`: **891 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `a_device_callback_reports_only_the_statuses_it_asked_for`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **893 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and there `pso_measurement_compiles_an_exact_synthetic_record` ran and passed. **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 23:36 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 23:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784#issuecomment-7147585297) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:26 UTC · original

PR #1784 — GameInput compatibility verification

Tested clean checkout 9b8c3de8851ad14e916bc3d8f9c214bf6ea5c854. The change intersects the device status with the caller's filter in both enumeration paths and suppresses callbacks when the intersection is empty.

Environment

STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, DoublePrecisionFloatShaderOps=0, wave range 8–32). DXC/DXIL 1.9.2609.5. Rust 1.100.0 (0ef1bc386 2026-11-09), unoptimized dev/test profiles with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both succeeded.
  • cargo test -p xcl gameinput -- --nocapture returned 10 passed, 0 failed, 0 ignored. The new blocking-enumeration test verified connected-only (0x1), input and output enabled (0x6), and suppression for an unsupported wired-status filter (0x8). The existing asynchronous unregister test also passed with the full status filter.
  • One run of cargo test --workspace --no-fail-fast -- --test-threads=4 under the shared Arc lock, with RUST_TEST_NOCAPTURE=1 to retain skip diagnostics. Across 20 test summaries, libtest reported 875 passed, 18 failed, 42 ignored (exit 101). The log contains 7 explicit SKIPPED lines within the reported passes. Those paths provide zero coverage.

Failures and skips

  • 17 GPU library failures. 13 reported CreateComputePipelineState errors (0x80070057), including FP64 tests. The other four were assertions for FMA contraction, implicit-LOD mip sampling, FP16 high-half preservation, and wave64 pixel reductions.
  • One test-title integration failure. The dynamic-depth-bias check for RSSetDepthBiasX rendered the top-right pixel blue where it expected green.
  • Seven skips: two for unavailable wave64, two for the missing D3D12 debug layer, one for tiled resources tier below 2, one for unavailable heap windows, and one for the Developer Mode requirement when disabling the driver cache.

Not tested

A main baseline, retail-title smoke comparison, other adapters, game-data tests requiring unset XCL_SAMPLE_* variables, and asynchronous enumeration with a partial status filter.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1784-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784#issuecomment-7151914100) # PR #1784 — GameInput compatibility verification Tested clean checkout `9b8c3de8851ad14e916bc3d8f9c214bf6ea5c854`. The change intersects the device status with the caller's filter in both enumeration paths and suppresses callbacks when the intersection is empty. **Environment** STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, `DoublePrecisionFloatShaderOps=0`, wave range 8–32). DXC/DXIL 1.9.2609.5. Rust 1.100.0 (0ef1bc386 2026-11-09), unoptimized dev/test profiles with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded. - `cargo test -p xcl gameinput -- --nocapture` returned 10 passed, 0 failed, 0 ignored. The new blocking-enumeration test verified connected-only (`0x1`), input and output enabled (`0x6`), and suppression for an unsupported wired-status filter (`0x8`). The existing asynchronous unregister test also passed with the full status filter. - One run of `cargo test --workspace --no-fail-fast -- --test-threads=4` under the shared Arc lock, with `RUST_TEST_NOCAPTURE=1` to retain skip diagnostics. Across 20 test summaries, libtest reported **875 passed, 18 failed, 42 ignored** (exit 101). The log contains **7 explicit `SKIPPED` lines** within the reported passes. Those paths provide zero coverage. **Failures and skips** - 17 GPU library failures. 13 reported `CreateComputePipelineState` errors (`0x80070057`), including FP64 tests. The other four were assertions for FMA contraction, implicit-LOD mip sampling, FP16 high-half preservation, and wave64 pixel reductions. - One test-title integration failure. The dynamic-depth-bias check for `RSSetDepthBiasX` rendered the top-right pixel blue where it expected green. - Seven skips: two for unavailable wave64, two for the missing D3D12 debug layer, one for tiled resources tier below 2, one for unavailable heap windows, and one for the Developer Mode requirement when disabling the driver cache. **Not tested** A `main` baseline, retail-title smoke comparison, other adapters, game-data tests requiring unset `XCL_SAMPLE_*` variables, and asynchronous enumeration with a partial status filter. **AI use** T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1784-suite.log` and published this report.
Author
Owner

@⁠throny on GitHub · 2026-11-25 18:10 UTC · original

Two contributors checked independently and found that #1603 solves the same problem (for #1488) in a different way: #1607, group D92. 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-25 18:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1784#issuecomment-7170551890) <!-- xcl-1607-hint:D92 --> Two contributors checked independently and found that #1603 solves the same problem (for #1488) in a different way: #1607, group D92. 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/1784/head:github-bot/gh-1784'
git switch 'github-bot/gh-1784'

Merge

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