GameInput: XCL_PRESS_LIVE presses the lines appended to a file while the title runs #2449
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2449
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Zayfway on GitHub · 2026-11-25 19:20 UTC · original
Zayfway:input/press-live→main· +231 −1 · 1 files · 2 commits · openXCL_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
@DavidM1911 on GitHub · 2026-11-25 20:29 UTC · original
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
@Zayfway on GitHub · 2026-11-25 21:17 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-26 01:50 UTC · original
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
@bmjask on GitHub · 2026-11-25 20:38 UTC · original · reviewed
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.
@luckyteagirl on GitHub · 2026-11-26 07:38 UTC · original · reviewed
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.@Gevroska on GitHub · 2026-11-26 10:17 UTC · original
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 GTA VI 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.
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.