hle: VICTORY_KEYS entries can hold a key, so a scripted run can walk #3392
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3392"
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 Marvisak/VIctory. Originally posted by pes7 on 2026-11-26T21:40:05Z.
VICTORY_KEYS=<seconds>:<key>(diagnostics builds) holds each key for 200 ms: enough for a menu press, not for walking. An entry now takes an optional third field, the hold in milliseconds:Enteris the pad's A,Wthe left stick up), with or without window focus. A run can be driven while the title's window stays in the background, and nothing steals focus from whoever uses the machine.Enterpresses and a heldW, the title reached the world with no window activation (1 862 draws/frame at 153 s).Split out of #2936 (the review there asked for its diagnostics as separate PRs).
gameinput.rsand the README's switch table only, +22/-7.Checked:
cargo clippy --workspace --all-targets -D warnings(also--all-features, which builds the diagnostics path) clean;cargo test -p victory-hle --all-features155 passed.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T21:47:54Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4).VICTORY_KEYSentries to hold a key for a duration cleanly extends scripted input testing without affecting existing entries.cargo test -p victory-hle --lib modules::gameinput:: -- --test-threads=1: 10 passed, 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T22:08:18Z.
Review: APPROVED
Verified on
57233443:cargo xtask policy:191 files ok.rustfmt --edition 2024 --check: clean on the modified hunks incrates/victory-hle/src/modules/gameinput.rs.cargo clippy --locked -p victory-hle --all-targets -- -D warnings(default,--features diagnostics, and--all-features): clean.cargo test --locked -p victory-hle --lib modules::gameinput::(default and--features diagnostics): 10 passed, 0 failed.Clean, backward-compatible extension of
VICTORY_KEYS(<seconds>:<key>continues defaulting to 200 ms) with zero overhead whendiagnosticsis off.Two small non-blocking suggestions if you touch this again:
at.saturating_add(hold)instead ofat + hold(crates/victory-hle/src/modules/gameinput.rs:1322) avoids aDurationoverflow panic if a huge timestamp + hold duration is ever passed inVICTORY_KEYS.<seconds>:<key>default vs<seconds>:<key>:<hold_ms>, malformed hold fields, and[at, at + hold)timing) would cover the new syntax directly.LGTM!
Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-26T22:32:58Z.
Windows controlled-clock check at
5723344against63bcca4. Both revisions passed all 12 focused GameInput tests, including synthetic input cases. Across 19 exact timestamps, omitted hold stayed at 200 ms, explicit 600 ms and 100 ms holds used inclusive starts and exclusive ends, and overlapping Enter/W and W/Right were delivered together. Enter mapped to pad A and W to left stick Y=1.0.One edge case in the new parser:
18446744073709549568:W:18446744073709551615parses successfully, then the first query at elapsed zero panics atat + holdwithoverflow when adding durations. The parent skips that three-field entry.now.checked_sub(at).is_some_and(|age| age < hold)would implement the same half-open check without adding the durations.Synthetic fixture
AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:34:10Z.
Windows 11,
63bcca4+ this PR, diagnostics build:cargo test -p victory-hle --features diagnostics gameinput::: 10 passed / 0 failed.cargo clippy -p victory-hle --features diagnostics --all-targets -- -D warnings: clean.No new test: the change is in the
VICTORY_KEYSparser (<seconds>:<key>[:<hold ms>]) and its doc comment, so this is compile/regression coverage only. I did not exercise a scripted run with an explicit hold — that needs the title. Synthetic only. AI-assisted.Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-27T09:12:14Z.
I sent a follow-up against this PR's branch for the unrepresentable end time reported above. It uses elapsed time since the start and retains the half-open interval. The original controlled-clock matrix passed, as did a fresh process reading the schedule through the production diagnostics entry point. AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by pes7 on 2026-11-27T12:44:50Z.
Thanks @passerbyyhx, @Jackster.
Pushed
72d5370:2ef06ae— @passerbyyhx's fix for the overflow atat + hold(from pes7/VIctory#2, authorship kept): the check is nownow.checked_sub(at).is_some_and(|elapsed| elapsed < hold), same half-open interval, with a test nearDuration::MAX.72d5370— the README row for the optional hold field, which had been left out of the first commit.Local, Windows 11, on
63bcca4:cargo clippy -p victory-hle --all-targets -- -D warningsclean, and the same with--all-features;cargo test -p victory-hle --features diagnostics153 passed / 0 failed, includingscripted_hold_ends_are_exclusive_even_near_duration_max. No title run for this push (the change is the parser's interval check only).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.