Repository navigation
Conversation
A scripted press (XCL_PRESS_AT / XCL_PRESS_A_AT) was a fixed 200 ms window of host uptime. When the title's reading thread stalls, the window falls between two reads and the press is never seen: in a retail title's run at 4-22 fps (first GetCurrentReading at 16.2 s), the presses at 24, 26, 32 and 120 s were lost. Presses are now a latch (PressLatch, pure over time and read): down at their time, held until 200 ms have passed AND two readings saw them, then up for 100 ms and two readings before the next press of the same button, so presses cannot merge. The 250 Hz poller peeks without counting; a state it pushes to reading callbacks counts as enough readings, as a callback is not skipped. Each press logs once when first seen by a reading. With the latch, a run of the same title with presses at 11, 13, 24, 26, 32 and 120 s logged all six as seen, the last two 10.7 s and 12.4 s after they were due. Tests drive the latch with 500 ms, stalled and 1 ms read sequences; the 500 ms and stalled ones fail with the old 200 ms window. Assisted-by: omp (Claude Sonnet 5.5) Assisted-by: omp (Claude Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A scripted press (
XCL_PRESS_AT/XCL_PRESS_A_AT) is a fixed 200 ms window of host uptime. A title whose reading thread stalls reads its pad less often than that, and the press falls between two reads: in a retail title's run at 4-22 fps (firstGetCurrentReadingat 16.2 s), the presses at 24, 26, 32 and 120 s were never seen. Now a press stays down until the title has read it: at least 200 ms and two readings, then up for 100 ms and two readings before the next press of the same button, so two presses never merge.Related: xcl-dev#609 (
XCL_PRESS_HOLD=s, a longer fixed hold) fixes the same symptom with a hold the user has to pick. In the run below the reads came up to 12.4 s after a press was due, and the same script has presses 2 s apart (11 and 13 s): a hold long enough for the late ones (≥ 12.4 s) holds the early ones together as one press (xcl-dev#609's test: "presses that overlap are held together"). With the latch neither has to be chosen. If xcl-dev#609 lands first, I will rebase and keepXCL_PRESS_HOLDas the minimum hold. xcl-dev#565 (reading history) and xcl-dev#893 (scripted sticks) touch the same file but not scripted presses; xcl-dev#565 changes the poller thread, so one of the two will need a rebase.What is in it
crates/xcl/src/hle/gameinput.rs, one commit:PressLatch(pure over time and reading):advance(t)moves each press Pending → Down → Up → Done;read(t)is a reading the title is handed and counts it.poll()(whatGetCurrentReadingand the readings hand the title) counts a reading; the 250 Hz poller only peeks (poll_peek), and a state it pushes to the reading callbacks counts as two readings (scripted_delivered), since a callback is not skipped by a slow reader.GameInput: scripted press 5 (A at 32 s) seen at 42.73 s.BUTTON_NAMES) for the parser and the log line.slow_readings_still_see_every_press_and_presses_do_not_merge(reads 500 ms apart),a_press_between_two_distant_readings_is_seen_by_the_next_ones(a 15 s stall),fast_readings_hold_a_press_for_200_ms_and_a_second_press_follows_after_a_gap(1 ms reads). Withread()put back tomain's 200 ms window, the first two fail on the buttons down.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4:8cd2f03onmain85e3826): 878 passed, 0 failed, 42 ignored;main85e3826: 875 passed, 0 failed, 42 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_PRESS_AT=11:A,13:A,24:A,26:A,32:A,120:A, on our integration branch (main+ other PRs) with this commit: all six presses logged as seen, at 11.03, 13.03, 24.03, 26.03, 42.73 and 132.37 s (the title did not read its pad between 32 and 42.7 s, nor between 120 and 132.4 s). The run before it, same branch and script without this commit: the title first asked for a reading at 16.2 s, and no A was seen at any scripted time (the log's first A is at 73.7 s).Regression run
.\scripts\smoke.ps1 -Game <retail title> -Seconds 60, no input (both runs stay on the start screen),mainfirst, same machine:Not tested
main+ this PR alone, but on our integration branch. The regression pair sends no input, so it does not reach the latch.AI use
main's window, ran the suite and wrote this description. The title runs are ours, on the hardware above.Mirror of xcl-dev#1765 (auto-synced, do not edit).