GameInput: XCL_PRESS_HOLD holds scripted presses longer #604
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/609"
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 pablogonz12 on 2026-11-24T02:27:01Z.
XCL_PRESS_AT/XCL_PRESS_A_AThold each scripted button for 200 ms. A title that draws a frame every few seconds reads its pad about as seldom and misses such a press: a retail title under Wine here (about one frame in 4 s while its first screens load) never saw a scripted A; with the press held for 8 s it logsGameInput: gamepad buttons 0x4 pressed for the first time.XCL_PRESS_HOLD=sholds each press forsseconds; without it nothing changes.What is in it
crates/xcl/src/hle/gameinput.rs:XCL_PRESS_HOLD(seconds, > 0; default 0.2), read once; the test of a press moves intoheld(presses, t, hold); the module andparse_pressesdocs name the variable.a_press_is_held_for_its_hold_time.Tested
cargo xwin test --workspace --release --locked --target x86_64-pc-windows-msvc --no-run, then each of the 15 test binaries from its package folder under Wine (GE-Proton11-14, Mesa 26.3.1, DXC 1.9.2609.5, Rust 1.100.0, static CRT) with--test-threads=4; no filters, 0SKIPPEDlines on the head, 0 on the base:1178e8a): 679 passed, 7 failed, 41 ignored;main(cb868b2): 678 passed, 7 failed, 41 ignored.disk_free_space_ex_reports_pls_quota,gpu::recomp::tests::gpu_f64_math_random,gpu::recomp::tests::gpu_f64_roots,gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction,hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime,set_predication_buffer_state_and_kickoff,test_title_runs_and_game_folder_is_untouched.XCL_PRESS_AT=60:A,90:A,…withXCL_PRESS_HOLD=8: the A press is logged at 61 s; with the default 200 ms no press was logged in a 240 s run with presses every 10 s.Regression run
Both blocks are the output of each commit's own unmodified
scripts/smoke.ps1, written to a file by PowerShell and pasted as is. It ran in Windows PowerShell 7.7.0 (pwsh.exe) under Wine (GE-Proton11-14, Linux), not on native Windows, with MinGit 2.56.1 forgit;xcl.exeis an MSVC release build (cargo xwin, static CRT), passed with-Xcl. Host workarounds outside the script: a pseudo-terminal,DOTNET_SYSTEM_GLOBALIZATION_USENLS=1, and importing PowerShell's Utility and Management modules before calling it.mainis this PR's base commit; no scripted input in either run, so this is a regression check, not a run ofXCL_PRESS_HOLD. These replace the earlier blocks from a bash script. Frame counts at this speed are small and vary between runs. Each commit was run once. Note that this title can end in a device removal on this host even onmain(seen in repeat runs of another base commit, see #464).main:This PR's head:
Not tested
XCL_PRESS_HOLDwith the test title's e2e tests (they keep the default).AI use
Imported from ivall/xcl. Originally posted by H0UNDZER0 on 2026-11-24T03:05:42Z.
Tested on an RTX 5080, release build: pass, 686 passed, 0 failed.
1178e8a37e78cc31c99f2d4e0883c7bebb6e7448, this PR's head as is (on its basecb868b2), release build.XCL_*variables set.cargo build --release --workspace --locked: OK, the same singlefetch_updatewarning asmain.cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4, run twice (the second with--show-output): 686 passed, 0 failed, 41 ignored both times. The basecb868b2gives 685 / 0 / 41 here: the difference is the newa_press_is_held_for_its_hold_time, which passes.SKIPPED: the usual 2,gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).e2e) ends withfailures: 0.Not tested
XCL_PRESS_HOLDset: no suite test setsXCL_PRESS_ATorXCL_PRESS_A_AT; the new unit test checksheldon its own.main. When this was written that wasdd2ae9a;git merge-treeshowed no conflict.scripts/smoke.ps1.AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)
Imported from ivall/xcl. Originally posted by mikebuckets171 on 2026-11-24T07:55:57Z.
Mac/Wine verification of this head as filed (a second host for the counts, not a review of the design).
Tested
x86_64-pc-windows-gnullvm, LLVM-MinGW 20261117 as the linker.cb868b2(detached at the PR head, not the merged state):cargo build --workspace --lockedandcargo test --no-run --release --lockedgreen — 15 test executables, no new warnings from these files.press: 4 passed, 0 failed, 0 ignored,including this PR's own new
hle::gameinput::tests::a_press_is_held_for_its_hold_time(the rest of thefilter's matches are unrelated tests that happen to contain "press"). Nothing else in
gameinputchanged verdict.
What this host can and cannot say about the motivation
With #541 applied, this bench's port run presents ~24 fps and reads the pad continuously, and its own
scripted button run (the port's
XCL_REMOTE_INPUTknob: 176 presses in ~15 s held phases) reached thegamepad state every time. But I never ran
XCL_PRESS_ATwith the default 200 ms against a title state thatdraws one frame every few seconds, so I can neither confirm nor refute the failure mode this PR describes —
the Wine observation in your description (one frame in 4 s, a scripted A never seen, held 8 s and logged) is
the evidence for it, from a title state this bench does not reach.
Related: I have just filed #893 (
XCL_STICK_AT/XCL_LOOK_AT, a scripted thumbstick held from asecond until the next entry) for what
XCL_PRESS_ATcannot reach: movement and the camera. Its semanticssidestep the hold-length problem — an entry holds until the next one, so a slow-polling title cannot miss it —
and it applies after
kbminpoll(), so if both land the order stayskbm→ scripted buttons → scriptedsticks and the three compose without touching each other. I will rebase onto whichever lands first.
Not tested
unverified here.
AI use
Imported from ivall/xcl. Originally posted by Alpha325 on 2026-11-25T02:11:45Z.
I tested
1178e8a37e78cc31c99f2d4e0883c7bebb6e7448on Windows 11 build 26200 with a debug MSVC build. The synthetic fixture callsgameinput::poll()in a fresh process for each setting, so each case readsXCL_PRESS_HOLDindependently.XCL_PRESS_HOLD=" 8 ", both scripted buttons were active (0xc) after the default 200 ms window would have expired. On the parent commitcb868b2, the same test failed with0x0.NaN, both presses had expired as expected (0x0).cargo test --offline --locked -p xcl --lib hle::gameinput::tests -- --test-threads=1returned 10 passed, 0 failed.The fixture uses synthetic input only. AI use — OpenAI Codex (GPT-6) wrote and ran the test and drafted this report.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:37:02Z.
Empirical test report (
1178e8a3)Hardware / environment
1178e8a37e78cc31c99f2d4e0883c7bebb6e7448, checked out detached with a clean worktree.x86_64-pc-windows-msvc. DXC reported version 1.9.2609.5 (01b62ad47).XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both Cargo commands ran outsideInvoke-ArcTest.ps1with incremental compilation and dev/test debug info disabled.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test binaries. It executed zero tests.cargo test -p xcl --lib hle::gameinput::tests::exited 0. The log contained 10 passed, 0 failed, 0 ignored, 657 filtered out, and 0 case-sensitive lines beginning withSKIPPED.AtomicU32::fetch_updatein XGameRuntime.Observed behavior
The diff adds one unit test,
a_press_is_held_for_its_hold_time. The test passed and checked that a press is absent before its scheduled time and that A has expired half a second into a 200 ms hold. With an 8 s hold, A is still active at that point, A and B are both active while their holds overlap, and each button is released at its own end boundary. The other nine GameInput unit tests also passed.Not tested
The full GPU workspace suite and game smoke runs were omitted. Runtime parsing of
XCL_PRESS_HOLDwas outside the focused test's coverage. The PR adds no integration test.AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr609-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:58:44Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:12Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:24:35Z.
merge-check claim
head:
1178e8a37eImported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:36:29Z.
merge-check
base:
9dfbe3ea66head:
1178e8a37emerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test
hle::gameinput::tests::a_press_is_held_for_its_hold_timepassed, as did the existing gameinput tests.review: no blocking finding; one file, every hunk read. Scripted presses (
XCL_PRESS_AT,XCL_PRESS_A_AT) were held for a fixed 200 ms;XCL_PRESS_HOLD=<seconds>now sets that time, read once, and a missing, unparsable, zero or negative value keeps 200 ms. The window test moved into a small pure functionheld, which the test covers (default, longer hold, overlapping presses). Without the variable nothing changes. A note from our own runs, not a finding: a title that polls its pad seldom does miss a 200 ms press, so the switch is useful. Not tested by me: a title run with the variable set.performance: none: one cached float per poll.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T14:28:57Z.
merge-check
base:
9dfbe3ea66head:
1178e8a37emerge: clean
build: cargo build --workspace -> ok (also
cargo build --release -p xcl)tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing:
gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it).hle::gameinput::tests::a_press_is_held_for_its_hold_timeran and passed. Withheldput back to a fixed 0.2 s window, it fails atgameinput.rs:1366(left 0, right 4: the 8 s hold is not honoured); file restored after.review: one file, whole diff read. Without the variable the window is
t >= s && t < s + 0.2, the same expression as on main, now insideheld(gameinput.rs:273), so default timing is unchanged by construction. Parsing (gameinput.rs:268), checked by running the same expression on sample values: unset, empty, "0", "-1", "abc" and "NaN" all give the 0.2 s default; " 2 " gives 2 (trimmed); "3.5" gives 3.5. Note: "inf" and an overflowing value such as "1e400" parse to infinity and pass the> 0.0filter, so each scripted press is then held from its time until the end of the run and later presses merge into it; clamping to a finite maximum or refusing non-finite values (h.is_finite()) would avoid that. The value is read once (OnceLock) and not logged, so a run's log does not say which hold was used, andGameInputlogs only the first press of each button set (gameinput.rs:330).performance:
scripts/smoke.ps1, 60 s of a retail title, release. Variable unset and no presses: 1587 frames, 18120 MB peak commit against 1659 frames, 17322 MB on the base (after one warm-up). WithXCL_PRESS_A_AT=20,24,28,32,36,40,44,48,52,56(the first presses of our own scripted runs): base 1451 frames, 28848 MB; merge withXCL_PRESS_HOLDunset 1445 frames, 29442 MB; merge withXCL_PRESS_HOLD=3.51527 frames, 28303 MB. No device removal, no crash in any run. How far each got, from the logs: in all three press runs the first A is logged at 20.0 s and the title then leaves the screen it waits on, which the log shows as the Opus decoder being made and the same XGameRuntime error report right after: base 20.25 s / 20.72 s, merge unset 20.23 s / 20.67 s, merge with 3.5 s hold 23.56 s / 23.99 s. So with the variable unset the merge reaches the same milestones at the same second as the base, and with the hold the title acts about 3.3 s later, as it would if it reacts when the button is let go; all three end with the same 84239 pipelines made (60753 in the runs without presses). The 3.5 s run also logs a button set 0x2 pressed at 6.97 s, which no script sent (scripted presses are A, 0x4); I take it to be input from this PC's controller or keyboard and did not trace it.verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, tests and smokes, reviewed the diff against the merged source and wrote this)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:48:21Z.
Triage (#1607) – head
1178e8aOverlap: #1765 addresses the same problem (a title that reads its pad seldom misses a 200 ms scripted press) differently, by keeping each press down until two of the title's readings have seen it; this PR adds a fixed, configurable hold (
XCL_PRESS_HOLD). Neither makes the other's change; main still has the fixed 200 ms window inscripted().No problems found in the diff. Note that with a long hold, two presses of the same button closer than the hold merge into one (the test asserts this), so
XCL_PRESS_HOLDcannot be used to press a button twice quickly.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.