GameInput: a device callback reports the statuses its filter names #1774
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1784"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T20:37:15Z.
Addresses
XCL-BT-027from #1488.IGameInput::RegisterDeviceCallbacktakes astatusFilter(aGameInputDeviceStatusmask) 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 (sayOutputEnabled, 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_callbackhonoursstatusFilteron both the blocking and the async enumeration paths; add testa_device_callback_reports_only_the_statuses_it_asked_for(connected →0x1, input+output →0x6, a status the device does not have → no callback). Fails onmainwithleft: 71, right: 1.Tested
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: 2no wave64; 1no heap windows; 1cannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib gameinput: 10 passed, 0 failedRegression run
main (
e9e94ce, clean tree, no local changes):PR (
9b8c3de, clean tree, no local changes):Not tested
AI use
XCL-BT-027againstregister_device_callback, wrote the fix and test (and confirmed it fails without it), rebased ontoe9e94ce, ran the test suite andscripts/smoke.ps1regression runs with #677's title hashing, and drafted this PR description.Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T21:21:16Z.
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.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T21:28:02Z.
Full-suite run, since this PR has no test report yet. Tested exact head
9b8c3de(on its basee9e94ce).Tested
cargo build --workspace, thenXCL_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.a_device_callback_reports_only_the_statuses_it_asked_for.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).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and therepso_measurement_compiles_an_exact_synthetic_recordran and passed.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T23:36:04Z.
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 unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:26:18Z.
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 --workspaceandcargo test --workspace --no-runboth succeeded.cargo test -p xcl gameinput -- --nocapturereturned 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.cargo test --workspace --no-fail-fast -- --test-threads=4under the shared Arc lock, withRUST_TEST_NOCAPTURE=1to retain skip diagnostics. Across 20 test summaries, libtest reported 875 passed, 18 failed, 42 ignored (exit 101). The log contains 7 explicitSKIPPEDlines within the reported passes. Those paths provide zero coverage.Failures and skips
CreateComputePipelineStateerrors (0x80070057), including FP64 tests. The other four were assertions for FMA contraction, implicit-LOD mip sampling, FP16 high-half preservation, and wave64 pixel reductions.RSSetDepthBiasXrendered the top-right pixel blue where it expected green.Not tested
A
mainbaseline, retail-title smoke comparison, other adapters, game-data tests requiring unsetXCL_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 againstpr1784-suite.logand published this report.upstream-sync referenced this pull request2026-11-25 05:08:08 +00:00
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T18:10:53Z.
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.
Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:42:33Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:26:42Z.
merge-check claim
head:
9b8c3de885Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:48:38Z.
merge-check
base:
db3921dchead:
9b8c3de885merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2146 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at
db3921dc: 2145 passed, 0 failed, 48 ignored.review: it builds and passes, but two things are open. (1) It overlaps #1603, which is open for the same call, and the two differ in behaviour: this PR hands the callback the device's status masked by the filter, #1603 hands it the full status and uses the filter only to decide whether to call. With this PR a title that asks for "connected" only would be told that input is not enabled. I could not settle which is right: the public documentation today describes a newer version of the API without this parameter. (2) The triage note in the thread asking the two authors to agree on one PR has no reply.
performance: none.
verdict: not yet: decide between this and #1603 first (masked or full status in the callback); the code itself has no other finding.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T00:50:17Z.
merge-check claim
head:
9b8c3de885Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T01:05:34Z.
merge-check
base:
53e85fb124head:
9b8c3de885merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2793 passed, 1 failed, 49 ignored; SKIPPED: 28 (22 no wave64 on this GPU; 3 per-lane form refused: V_CVT_F16_F32, V_MUL_F16, V_PK_MUL_F16 (#1426 semantics); 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (standin.rs:459, left (0, 1, 1), right (0, 0, 1)), fails on base too: main alone at
53e85fbgives 2792 passed, 1 failed (same test, same assertion), 49 ignored. The new test a_device_callback_reports_only_the_statuses_it_asked_for passes.review: (1) The callback's currentStatus is masked by the filter (STATUS & filter). The GameInput docs for this API version (GameInputDeviceCallback, v0-v3 appendix) define currentStatus as "Current connection and input status of the device", and RegisterDeviceCallback's statusFilter as limiting which status changes trigger the callback, not what it reports. A title that registers for Connected (0x1) is told the pad is connected but not InputEnabled (0x2). #1603 (older, open, D92 in #1607) gates the same way but passes the full status, which matches the docs. This settles the question left open in the first check: the parameter is documented in the docs' appendix for v0-v3. (2) The new test locks in the masked status (0x1 -> 0x1, 0x2|0x4 -> 0x6); with the full status it would expect 0x47. (3) The test comment calls 0x8 "a wired connection"; in GameInputDeviceStatus 0x8 is RawIoEnabled (wired is the absence of Wireless, 0x80). (4) Whether statusFilter also gates the initial enumeration callbacks is not documented; both PRs gate it. (5) Only the blocking enumeration path is tested; the async path got the same change without a test. Scope is fine: one file, the callback and its test. Not run with a real title or controller.
performance: none: one mask and compare per RegisterDeviceCallback call.
verdict: not yet: pass the device's full status to the callback and keep the filter only for whether to call (as #1603 does), or take #1603 instead (D92 in #1607).
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.
Imported from ivall/xcl. Originally posted by johnbf8x on 2026-11-30T01:15:07Z.
merge-check
base:
53e85fb124head:
9b8c3de885merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; main has changed crates/xcl/src/hle/gameinput.rs by +409/-76 since the PR's base
e9e94ce6, the merge was automatic; the merged tree was tested uncommitted)build: cargo build --workspace -> ok (the PR merged and main alike, each in its own target dir)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both, so no lib total. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer). Failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), both fail on main too. The lib in parts: hle::d3d12x::list_x alone on 1 thread 113 passed, 0 failed on both; the rest on 4 threads ends the process on both before its summary (PR: 1731 ok, 1 FAILED, then 0x80004005; a second run of the same PR binary: 1732 ok, 0 failed, then 0x80004005; main: 1458 ok, 0 failed, then 0xc0000409). The one failure, hle::d3d12x::alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads, is in code this PR does not touch and passed 5 of 5 runs alone on the PR and 5 of 5 on main, so I count it as flaky, not the PR's. cargo test -p xcl --lib hle::gameinput:: -- --test-threads=1 -> PR 13 passed, main 12 passed, 0 failed on both; the PR's new a_device_callback_reports_only_the_statuses_it_asked_for passes
review: after reading the whole diff (one file, gameinput.rs). It does what the description says: the callback runs only when STATUS & filter is not 0 and gets that masked status, on the blocking and the asynchronous path. (1) The masked status is the problem jsalzy's check names, and I agree: Microsoft's GameInput versioning notes describe the pre-v4 statusFilter as choosing which status changes fire the callback, with currentStatus / previousStatus being the device's status, not a filtered view of it, so a title that registers for Connected (0x1) would be told the pad is not input-enabled. #1603 (D92 on #1607) gates the same way and passes the full status. (2) The new test locks in the masked values (0x1 -> 0x1, 0x2|0x4 -> 0x6). (3) The test covers the blocking enumeration only; the asynchronous path's change is untested. (4) A filter of 0 now gets no callback, where before it got one with every status. Not run with a real title or controller
performance: none expected by default: one AND and one compare per RegisterDeviceCallback call, nothing per frame (reasoned, not measured)
verdict: not yet: pass the device's full status to the callback and use the filter only to decide whether to call it (as #1603 does); the merge, build and suite are otherwise clean here
hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:46:46Z.
Triage (#1607) – head
9b8c3de#1603 makes the same gating change in
register_device_callback(gameinput.rs): no callback when the status filter names none of the gamepad's statuses.This PR also passes
STATUS & filterascurrentStatus. GameInput documentscurrentStatusas the device's status; the filter only selects which changes call back. A title that registers withGameInputDeviceInputEnabled(0x2) alone would get a status withoutGameInputDeviceConnectedand can treat the gamepad as disconnected. The new test pins that (filter 0x1 -> status 0x1, filter 0x6 -> 0x6). Its comment also calls 0x8 a wired connection, but 0x8 isGameInputDeviceRawIoEnabled.Recommendation: close (bad: currentStatus is masked by the filter; #1603 gates without masking).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.