runtime: add the input clock to input trace state lines #3381
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3381
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3379"
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?
@Leyukaka on GitHub · 2026-11-28 17:10 UTC · original
Leyukaka:runtime-input-trace-time→main· +15 −8 · 4 files · 1 commits · merged 2026-11-29 10:11 UTCRefs #870.
Change
X2W_INPUT_TRACE=1(#3179) writes a state line only when a reading is captured, so the 250 ms repeat does not give a steady cadence. In a 900 s run with manual input, counting the lines rebuilt 688.6 s. A recorded session therefore cannot be replayed from line counts. Each state line now ends withtime=, the input clock in seconds since process start (process_milliseconds(), the clock the trace already uses for its 250 ms repeat). That is the time base of anX2W_INPUT_SCRIPTwithbase=start, so a press recorded attime=81.250replays as a press at[email protected]in such a script.The field is appended, so prefix and substring matches on the existing fields still match. Event lines (
wait,mark,group) are unchanged.Verification
5acb107fonaec2e084, Windows 11 build 26300, release build.ctest --test-dir out/build/release -R "gameinput|startup_run_ps1|input_script": 9/9 passed.startup_gameinput_tracedrives the clock withX2W_INPUT_CLOCK_MS. Its three expected state lines now end withtime=2.000,time=2.500andtime=3.600.startup_gameinput_traceon exactly those three lines.Docs:
docs/startup-runtime.mdanddocs/experiments/startup-input-trace.mddescribe the field.Not covered: in
startup_gameinput_tracethe first poll is at 0 ms, soscriptandtimeprint the same value; the test proves the field and its scale, not thattimeuses the process clock rather than the script clock. No tool turns a trace into a script yet.@KelboLive on GitHub · 2026-11-28 20:35 UTC · original · approved these changes
LGTM — useful addition for session replay.
Adds
timefield (seconds since process start on the input clock) tox2w-input-trace statelines. This is the time base of anX2W_INPUT_SCRIPTwithbase=start, enabling recorded sessions to be replayed from it. Updates docs and tests consistently.Ready to land.
@KelboLive on GitHub · 2026-11-28 21:57 UTC · original · approved these changes
LGTM — useful addition for session replay.
Adds
timefield (seconds since process start on the input clock) tox2w-input-trace statelines. This is the time base of anX2W_INPUT_SCRIPTwithbase=start, enabling recorded sessions to be replayed from it. Updates docs and tests consistently.Ready to land.