Skip to content

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

Open
b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:gameinput/device-callback-filter
Open

b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:gameinput/device-callback-filter

Conversation

@b3IKK

@b3IKK b3IKK commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 Scripts: smoke blocks print the game folder's name #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)
@b3IKK
b3IKK force-pushed the gameinput/device-callback-filter branch from 7046ac0 to 9b8c3de Compare November 24, 2026 21:21
@b3IKK

b3IKK commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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.

@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

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 (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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!

@JJAutoCompare

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants