Skip to content

GameInput: enforce statusFilter in RegisterDeviceCallback (#1489) - #1603

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

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

Conversation

@hajduzsolt

@hajduzsolt hajduzsolt commented Nov 24, 2026 •

Copy link
Copy Markdown

Enforces statusFilter in IGameInput::RegisterDeviceCallback so callbacks only fire when (filter & STATUS) != 0. Part of #1489.

What is in it

  • crates/xcl/src/hle/gameinput.rs: check filter & STATUS != 0 in register_device_callback before invoking or spawning the enumeration callback.
  • crates/xcl/src/hle/gameinput.rs: add unit test register_device_callback_enforces_status_filter verifying filter == 0 and non-matching status bits do not invoke the callback while matching bits invoke it with STATUS.

Tested

  • Hardware & toolchain: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Ryzen 7 9800X3D, Windows 11 10.0.26300.9974, rustc 1.98.1 (48a229cea 2026-09-01), debug (cargo test).
  • cargo test -p xcl --lib hle::gameinput::tests -- --test-threads=2: 10 passed, 0 failed, 0 ignored.
  • cargo test --workspace -- --test-threads=2: 777 passed, 0 failed, 41 ignored (xcl --lib: 728 passed, 0 failed, 21 ignored; integration/e2e suites: 49 passed, 0 failed, 20 ignored).
  • SKIPPED runtime tests: SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.

Regression run

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 49 48 14
device removals: 0
crashes: 0
peak commit: 20195 MB

PR:

xcl-smoke v1
commit: 67da08e9c2478e3e6ed2e7935602febc31da03b9
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14833 MB

Not tested

  • Hotplug device-status transitions (XCL exposes a single permanently connected virtual gamepad).

AI use

  • Antigravity (Gemini 4 Hydrogen, high): added statusFilter check in register_device_callback, wrote unit test, ran the workspace test suite, and drafted commit and PR description.

IGameInput::RegisterDeviceCallback previously ignored its statusFilter parameter, invoking the callback even when filter == 0 or none of the requested status bits matched STATUS.

Check filter & STATUS != 0 before firing the initial enumeration callback.

Part of xcl-dev#1489

Assisted-by: Antigravity (Gemini 4 Hydrogen, high)
@hajduzsolt
hajduzsolt force-pushed the gameinput/register-device-callback-status-filter branch from a3f78b6 to 67da08e Compare November 24, 2026 18:54
@hajduzsolt
hajduzsolt marked this pull request as ready for review November 24, 2026 19:07
@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, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@throny

throny commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

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

@CalvyPZ CalvyPZ added the duplicate This issue or pull request already exists label Nov 25, 2026
@CalvyPZ CalvyPZ closed this Nov 25, 2026
@CalvyPZ CalvyPZ reopened this Nov 25, 2026
@CalvyPZ CalvyPZ removed the duplicate This issue or pull request already exists label Nov 25, 2026
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.

5 participants