Diagnostics: VICTORY_KEYS can hold a key longer than 0.2 s #2203
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2205"
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 fiestorra on 2026-11-25T07:58:04Z.
VICTORY_KEYScould not hold a key for longer than 0.2 s, and that ambiguity cost me a morningThe scripted keys held every key for 0.2 s, hardcoded:
That is fine for the screens it was written for — it advanced the conditions page and the notices — but it makes one particular failure impossible to tell apart from another: a screen that samples its input slower than the hold behaves exactly like a screen that takes no input. I spent this morning concluding the second about the setup wizard, and it was wrong: the operator advanced that same screen by hand with the keyboard.
An entry may now say how long to hold it:
at:key[:hold], the hold in seconds, 0.2 s when omitted, so every existing string behaves exactly as it did. The parse moved intoparse_scripted— a function of its own, testable without touching the environment — and the test pins three things: the default, an explicit hold, and a hold that does not parse, which falls back to the default rather than dropping the key, because a run that loses one press is worse than one that presses slightly wrong.cargo test -p victory-hle --features diagnostics --lib→ 143 passed, with the one failuremainalso has in a session with no desktop; clippy with and without--all-featuresclean under-D warnings;rustfmt --checkshows the same four hunks the file already had onmain.What this does not do is prove that a longer hold gets past the wizard. That is the next run, and it will say either way — the point of the change is that the answer becomes a measurement instead of a guess. If the wizard still ignores a 0.8 s hold, then it genuinely does not take keyboard input, and the next place to look is the pad it might be waiting for, not the length of the press.
No game data is involved: an environment variable and a test.
Written with an AI assistant.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T08:03:10Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
VICTORY_KEYS can hold a key longer than 0.2s — input-timing fix for diagnostics; relates to #2114's stand-in pad.
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T08:09:34Z.
Windows validation on
c26291awith diagnostics enabled. All 9 GameInput unit tests passed. I also ran a local probe using the production scripted-key source, a synthetic connected pad holding B in slot 1, and the GameInput current-reading interface. Each row ran in a fresh process.940d32f940d32fc26291aThe extended hold reached the consumer past the old 200 ms default, then released while preserving B. Synthetic input only. AI-assisted validation.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:29:07Z.
Automated triage for the maintainers.
This lets the diagnostics-only
VICTORY_KEYSscript give each key an optional hold (at:key[:hold], still 0.2 s by default). It moves the parser out ofhost::scriptedinto a testableparse_scriptedingameinput.rs, with a unit test covering the default, a bad hold and malformed entries. I checked that the key table and the default behaviour matchmainand that the change is only compiled undertest/diagnostics. CI passes.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:56:26Z.
Code review and Windows 11 verification at head
c26291a329d5merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/gameinput.rs:276-308, 1322-1331):#[cfg(any(test, feature = "diagnostics"))]/#[cfg(feature = "diagnostics")](zero default-build impact).parse_scripteddrops malformed/negative/NaN/Infatentries cleanly, falls back toDEFAULT_HOLD = 200 mson omitted or invalidhold, and treatshold == 0.0as an empty range.gameinput.rs:1331):(at..at + hold).contains(&now)can panic withDurationaddition overflow if someone passes two very large values inVICTORY_KEYS(e.g.1e19:Enter:1e19); usingat.saturating_add(hold)avoids that cleanly.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-hle --tests -- -D warnings(default +--features diagnostics): 0 warningscargo test --locked -p victory-hle -- gameinput: 11/11 passed on both default and--features diagnostics.LGTM.
Imported from Marvisak/VIctory. Originally posted by UwUCammie on 2026-11-26T01:23:17Z.
Tried the hold syntax on the fxceless fork. With
50:Enter:4.4the first room was visible by 80 seconds on the RX 7900 XT. Ordinary taps still showed the cutscene at 100 seconds in the control run. I kept your commit credit in the port.One edge case I found while adding the boundary test: checking
now.checked_sub(at)againstholdalso handles a valid start and hold whose sum is outsideDuration’s range. Port and testsImported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-26T12:37:32Z.
The window is what gets tested now, and the two edge cases are fixed
Head
6c9548f0, rebased onto63bcca43first.held(keys, now)comparesnow.checked_sub(at)with the hold, so a pair whose sum leavesDuration's range cannot panic — andatin the future is simply not held. That is the shape @UwUCammie suggested, taken rather than my ownsaturating_add.a_scripted_key_is_held_exactly_its_windowasserts down at +0.35 s and up at +0.8 s for a 0.8 s hold, the zero-hold default at +0.1 s and released at +0.25 s, and no panic on a1e19hold.scripted()now just callsheld, so the tested function is the one the runtime uses.VICTORY_KEYSrow shows30:Enter,35:X:0.8and says the time after the second colon is the hold, 0.2 s when omitted.Measured here:
cargo test -p victory-hle --features diagnostics --lib→ 153 passed, 1 failed; the failure islifecycle::tests::showing_a_title_window_shows_its_stand_in, which fails the same way on a clean63bcca43in this desktop-less session.cargo clippy -p victory-hle --features diagnostics --all-targets -- -D warningsis clean.Not verified: a run of the title with a long hold — this machine's session 0 cannot present, so the click that motivated the change has not been re-shot through the menu.
Written with an AI assistant.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:58:07Z.
Review: APPROVED
Reviewed at
6c9548f06f6ad9acbf9e1b4d34b0245090d540ad— APPROVE.Verification
cargo xtask policy(191 files ok) and all fourcargo clippy -p victory-hletargets (--lib,--tests,--all-targets,--all-featureswith-D warnings) passed cleanly with zerodead_codewarnings in both default anddiagnosticsbuilds.at:key(default0.2 s), boundary handling ofDuration::try_from_secs_f64(negative,NaN,Inf, non-numeric, and overflowing values), zero-hold fallback to0.2 s, and overflow-safe release checks vianow.checked_sub(at)inheld().cargo test -p victory-hle --lib modules::gameinput(12/12) under both default features and--features diagnostics.Non-blocking notes
30:Enter:0.8:ms) are ignored after the third field (crates/victory-hle/src/modules/gameinput.rs:135); checkingparts.next().is_some()would reject malformed entries.README.md:200could note that bare seconds are expected and invalid/zero holds fall back to0.2 s(while host polling at8 mslimits sub-poll hold durations).Scripted,parse_scripted, andheld(gameinput.rs:124) could use#[cfg(any(test, all(windows, feature = "diagnostics")))]to avoid unused warnings on non-Windowsdiagnosticsbuilds, and plain backticks for`scripted`(gameinput.rs:127) avoid an unresolved intra-doc link.gameinput.rs:1961has extra trailing blank lines flagged byrustfmt --check, anda_scripted_key_is_held_exactly_its_window(gameinput.rs:1825) would hit an actualat + holdoverflow case with bothatandholdset to1e19.Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-27T07:49:55Z.
Thanks — that is the approval I needed. For the record, the object-ordering case you asked about on the way in is the one the head actually implements:
held(keys, now)comparesnow.checked_sub(at)with the hold, a zero hold falls back to the 0.2 s default, anda_scripted_key_is_held_exactly_its_windowpins down-at-+0.35 s and up-at-+0.8 s for a 0.8 s hold. Nothing else changed after6c9548f0.Written with an AI assistant.
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.