Diagnostics: VICTORY_KEYS can hold a key longer than 0.2 s #2205
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2205
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fiestorra on GitHub · 2026-11-25 07:58 UTC · original
fiestorra:diag/keys-hold→main· +110 −31 · 2 files · 2 commits · openVICTORY_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.
The scripted keys held each key for 0.2 s with no way to change it. A screen that samples its input more slowly than that ignores the key, and the run looks exactly like a screen that ignores input - which is what cost me a morning: I concluded the setup wizard took no input at all, when the operator advanced the same screen by hand. An entry may now carry its hold: `at🔑hold`, in seconds, 0.2 when it does not. The parse is a function of its own so it can be tested; the test pins the default, an explicit hold, and a hold that does not parse (the key is kept, because the run matters more than the exact timing). No behaviour changes for an existing VICTORY_KEYS string.@Dathinel on GitHub · 2026-11-25 08:09 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 13:29 UTC · original
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
@fuzeofficlal on GitHub · 2026-11-26 00:56 UTC · original
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.
@UwUCammie on GitHub · 2026-11-26 01:23 UTC · original
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 testsc26291a329to6c9548f06f@catminou4 on GitHub · 2026-11-25 08:03 UTC · original · reviewed
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.
@fiestorra on GitHub · 2026-11-26 12:37 UTC · original
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.
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.