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

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

@⁠hajduzsolt on GitHub · 2026-11-24 18:08 UTC · original
hajduzsolt:gameinput/register-device-callback-status-filter → main · +32 −2 · 1 files · 1 commits · open

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.
**@⁠hajduzsolt** on GitHub · 2026-11-24 18:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1603) `hajduzsolt:gameinput/register-device-callback-status-filter` → `main` · +32 −2 · 1 files · 1 commits · open 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 #1489

Assisted-by: Antigravity (Gemini 4 Hydrogen, high)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:00 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:22 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1603#issuecomment-7143435338) 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!
Author
Owner

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

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.

**@⁠throny** on GitHub · 2026-11-25 18:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1603#issuecomment-7170551190) <!-- xcl-1607-hint:D92 --> 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.
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/1603/head:github-bot/gh-1603'
git switch 'github-bot/gh-1603'

Merge

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