GameInput: XCL_PRESS_BASE=frame counts scripted presses from the first frame #3712

Merged
throny merged 1 commit from upstream-pr/3712 into main 2026-12-02 19:18:06 +00:00
throny commented 2026-12-02 18:16:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-02T18:16:20Z.


XCL_PRESS_AT / XCL_PRESS_A_AT count their times from the host's start. A cold shader preparation before the title runs can take minutes: on 2026-12-02 two retail-title runs showed their first frame after 288 s and 302 s. A fixed press list then misses the title's first screens. XCL_PRESS_BASE=frame counts the times from the first game frame instead and presses nothing before it. It is opt-in: without it, the only change is that the presenter stores one timestamp at the first frame.

This is an opt-in alternative to #2933, which changes the default clock to the guest's entry point. Testers use this for the title run: line of #3041 merge checks: one press list gets into the world whatever the preparation takes.

What is in it

  • crates/xcl/src/hle/gameinput.rs: FIRST_FRAME_MS, and press_clock() choosing between host uptime and time since the first frame; module doc line.
  • crates/xcl/src/hle/d3d12x/present.rs: stores the first frame's host uptime.
  • Test press_times_count_from_the_first_frame_when_asked.

Tested

  • RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0.
  • cargo test -p xcl --lib gameinput: 14 passed, 0 failed.
  • cargo test --workspace -- --test-threads=4 on the head: 3005 passed, 0 failed, 52 ignored; 25 SKIPPED lines (no wave64 and similar on this adapter).
  • This exact change has been our local patch for every world run on this machine since 2026-12-02 morning (runs 450-492), with XCL_PRESS_BASE=frame and the press list 10:A,14:A,…,160:A. Each run reached the world, including after a 302 s preparation.

Regression run

main 817eb1fc9:

xcl-smoke v1
commit: 817eb1fc9fb0763008ae5d8de1f7f586f442b51d
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1559 (PresentX 1559)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17215 MB

this PR's head:

xcl-smoke v1
commit: b1e6bd616f9ea89565fc3f594ad28d5ceba23adb
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1543 (PresentX 1543)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16045 MB

Not tested

  • AMD; titles other than the retail one; Wine. (CI: one timing test from #2367, token_on_timeout_and_token_in_origin_refresh, failed once on the runner and passes locally.)

AI use

  • Claude Code with Claude Opus 5.5 wrote the change, the test and this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5612245418 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3712). Originally posted by [throny](https://github.com/throny) on 2026-12-02T18:16:20Z. --- `XCL_PRESS_AT` / `XCL_PRESS_A_AT` count their times from the host's start. A cold shader preparation before the title runs can take minutes: on 2026-12-02 two retail-title runs showed their first frame after 288 s and 302 s. A fixed press list then misses the title's first screens. `XCL_PRESS_BASE=frame` counts the times from the first game frame instead and presses nothing before it. It is opt-in: without it, the only change is that the presenter stores one timestamp at the first frame. This is an opt-in alternative to #2933, which changes the default clock to the guest's entry point. Testers use this for the `title run:` line of #3041 merge checks: one press list gets into the world whatever the preparation takes. **What is in it** - `crates/xcl/src/hle/gameinput.rs`: `FIRST_FRAME_MS`, and `press_clock()` choosing between host uptime and time since the first frame; module doc line. - `crates/xcl/src/hle/d3d12x/present.rs`: stores the first frame's host uptime. - Test `press_times_count_from_the_first_frame_when_asked`. **Tested** - RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0. - `cargo test -p xcl --lib gameinput`: 14 passed, 0 failed. - `cargo test --workspace -- --test-threads=4` on the head: 3005 passed, 0 failed, 52 ignored; 25 `SKIPPED` lines (no wave64 and similar on this adapter). - This exact change has been our local patch for every world run on this machine since 2026-12-02 morning (runs 450-492), with `XCL_PRESS_BASE=frame` and the press list `10:A,14:A,…,160:A`. Each run reached the world, including after a 302 s preparation. **Regression run** main `817eb1fc9`: ``` xcl-smoke v1 commit: 817eb1fc9fb0763008ae5d8de1f7f586f442b51d gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1559 (PresentX 1559) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 17215 MB ``` this PR's head: ``` xcl-smoke v1 commit: b1e6bd616f9ea89565fc3f594ad28d5ceba23adb gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1543 (PresentX 1543) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16045 MB ``` **Not tested** - AMD; titles other than the retail one; Wine. (CI: one timing test from #2367, `token_on_timeout_and_token_in_origin_refresh`, failed once on the runner and passes locally.) **AI use** - Claude Code with Claude Opus 5.5 wrote the change, the test and this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3712
No description provided.