GameInput: XCL_PRESS_LIVE presses the lines appended to a file while the title runs #2439
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2449"
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 Zayfway on 2026-11-25T19:20:58Z.
XCL_PRESS_LIVE=<file>: lines appended to the file while the title runs are pressed in order, one after another. A script or an agent can then walk a title's menus by deciding each press after it has seen the last screen. Until now every press had to be timed before the run (XCL_PRESS_AT) or made through the keyboard, which needs the window's focus.What is in it
hle/gameinput.rs: alivemodule. A thread reads what is appended to the file every 100 ms. Each complete line is queued; lines already in the file at the start are not pressed.BUTTON[+BUTTON…][:ms], names as inXCL_PRESS_AT(case does not matter), held 200 ms unless a time is given;wait:msholds nothing.scripted(), the pathXCL_PRESS_ATalready uses, so they need no focus.follow()reads only the bytes appended since its last look. Emptying the file (or replacing it with a shorter one) starts over; the append-only contract is in the doc.Why: from a background process,
SetForegroundWindow/SendInputare often refused (no focus, a system dialog on top). Screens such as first boot, legal pages with a countdown, and loading screens come at different times from run to run, so fixedXCL_PRESS_ATtimings drift.Tested
RTX 3060 12 GB (driver 610.88, 32-lane), Ryzen 7 5700X, 16 GB RAM, Windows 11 26300, Rust 1.100.0, debug and release.
cargo test --workspace --no-fail-fast -- --test-threads=4atd0a127e: 1292 passed, 1 failed, 46 ignored.gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier. It fails the same way onmainat50a9fdeon this card, and is not touched here.tests/e2e.rsneedscargo build --workspacefirst; with it, 3 passed.In the game at this head (
d0a127e): on the profile screen, with no focus,BogusthenAwere written to the file. The log shows:XCL_PRESS_LIVE "Bogus" not understood …;XCL_PRESS_LIVE "A" pressed;gamepad buttons 0x4 pressed for the first time, 13 ms later.The title then left its profile screen for its intro (checked on a screenshot before and after, not attached).
An earlier form of the same code (same module, on #2057's branch) drove 3 runs of the newer retail title from a fresh data folder: profile, first-boot screens, legal pages, policy checkboxes, into loading. The log shows
GameInput: live press …for each line, and the screens advance as pressed. These presses were made without the window's focus;SendInputhad been refused.Regression run
main:
PR:
(
mainran first, with colder caches; neither run reaches the code, which only acts withXCL_PRESS_LIVEset.)Not tested
XCL_PRESS_AT).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:38:00Z.
Review: COMMENTED
This is not merge-ready. follow() rereads the entire file every 100 ms rather than reading from offset, making a long-lived append-only automation file O(total size) per poll with repeated full allocations. Truncate-and-rewrite/atomic replacement can also be missed if the file regrows beyond offset before polling; document append-only semantics or robustly identify rotation. Finally, Queue::held advances through all expired lines with the same now, so a long inter-poll interval drops queued presses despite the comment that late polling still sees every press. Decide/test that contract, and provide current Windows/title-driven XCL_PRESS_LIVE evidence.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:29:19Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1 real failure, deterministic (also fails--test-threads=1, 1219/1):The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.
— Devin
Imported from ivall/xcl. Originally posted by Zayfway on 2026-11-25T21:17:47Z.
Thanks both. Updated in
d0a127e; the description has the new suite counts, a new regression block and an in-title check at this head.@bmjask:
follow()keeps the offset already read, seeks to it, and reads only the bytes appended since. An incomplete last line waits in a buffer for the next look (complete_lines, tested).held(now)only leaves the current line whennowis past its end. The line it then takes getsuntil = now + holdwithhold > 0, so it is returned on that same poll and is never skipped by it. One poll can therefore move past at most one finished line.A:0is now refused at parse time.polls_far_apart_lose_no_presspins this down: three presses, polls 10 s apart, all three seen, in order.d0a127e, on the profile screen with no window focus,BogusthenAwritten to the file giveXCL_PRESS_LIVE "Bogus" not understood, thenXCL_PRESS_LIVE "A" pressed, thengamepad buttons 0x4 pressed for the first time13 ms later. The title then left its profile screen.@DavidM1911:
a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfails the same way onmainat50a9fdeon an RTX 3060, run alone withcargo test -p xcl --lib a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier. This PR only toucheshle/gameinput.rs, so that failure belongs tomain(the recompiler), not to this change.AI-assisted (Claude Code); every result above is from this machine.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:50:03Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:38:46Z.
Review: COMMENTED
gameinput.rs:344–349,415–416: the watcher takes its initial file length only whenQUEUEis first accessed, and that happens insidescripted()on the first GameInput state poll (line 263). The documented contract says lines already present at startup are skipped and lines appended while the title runs are pressed. With an empty precreated file, launch the title, appendA\nduring startup before its first state poll, then let it poll:QUEUEinitializes with length 2 and startsfollowat EOF, silently discarding that command. This gap can be long on a title that delays its first input query, and the late-poll queue test cannot cover it because that test starts after watcher initialization.Could the initial offset/watcher be established at host or title startup, before GameInput polling, and could a fixture append between startup and first poll? If first-poll initialization is intentional, the docs and a ready signal need to make that boundary explicit for automation clients. Source review at exact head
d0a127e662b8055cfb8f11f7e899546b7d09a829; I have not run a title-timed reproduction. AI-assisted review with Codex.Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-26T10:17:16Z.
I tested
XCL_PRESS_LIVEthrough a GameInput reading callback on PR headd0a127e6. AppendingA:100to the selected file delivered an A press followed by a neutral reading. A B press in a separate file produced no callback. After I unregistered the callback, the poller still observed a Down press from the selected file, and no callback arrived during the following 350 ms. The focused Windows test passed with zero skips.I also ran the retail game menu sequence twice on an RTX 3080 using local build
648786af, instrumented to record button transitions. Both runs recorded all 14 presses and 14 releases, checked both boxes, and reached loading without sending desktop input or changing focus. Navigation took 91.228 s and 91.295 s.The first run later faulted during loading. The second reached its scheduled 300-second exit. Neither showed a playable scene.
I used Codex GPT-6.2 Sol for the callback fixture and title runs. A separate Codex GPT-6.2 Sol agent verified the recorded transitions and loading observations. Codex GPT-6.2 Astra wrote this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-30T23:02:57Z.
Following up on my single-button callback test, I used
XCL_PRESS_LIVEto navigate a retail-game menu on my RTX 3080. I tested PR headd0a127e6integrated with main86e86fcb, with local tracing added to record the input XCL sampled.The trace recorded all 14 presses and releases in order. Before the final A press, the window capture showed both boxes checked and Confirm selected. The form closed about 3.2 seconds after release. At 3.4 seconds, XCL recorded 614 DirectStorage requests with zero failures. The sequence reached loading without manual input or a window-focus change.
AI disclosure — Codex GPT-6.2 Sol ran the test. The input trace, window captures and storage counts were independently checked. GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:07:20Z.
Triage (#1607) – head
d0a127eNo open or merged PR adds a live press file: main has only
XCL_PRESS_AT/XCL_PRESS_A_AT, and the only otherXCL_PRESS_FILE(#1011) is closed and replayed timed presses read at start, not appended lines.live::followreads only the bytes past the last offset, keeps an incomplete line until its newline, and restarts from 0 when the file shrinks;Queue::heldstarts a line's hold at the first poll after it is due, so a late poll loses no press. The tests cover parsing, partial lines, the gap between repeated presses and polls far apart. No problems found in the diff.Recommendation: keep open.
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.