Report overlapping VICTORY_KEYS holds as one active key #2716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2718"
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 VlREX on 2026-11-25T18:46:49Z.
With VICTORY_KEYS=0:W,0.05:A,0.1:W the diagnostics keyboard reported W, A, W at 100 ms. Report each active virtual key once, releasing it only after its last hold expires. A deterministic regression test exercises overlapping intervals, another simultaneously held key, and the release boundary. It failed before the fix and passed afterward, alongside seven existing fake-host input tests in an isolated Windows GNU run. No game assets or physical keyboard required.
Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-25T18:50:17Z.
The
.len()check at 249 ms misses an order change in this fixture.active_scripted_keysreturnsWAat 199 ms andAWat 200 ms. The first W interval expires, but the second still holds W, so neither key was released or pressed at that boundary.Could the test assert
WAat 249 ms? The earlier #2499 covers the same overlap and preserves the order by merging holds before polling.AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T18:51:45Z.
Correct - dedupe keeps first-occurrence order and a key survives until its last overlapping hold expires; checked_sub also avoids the subtraction-underflow the old window check would hit before t=0. Boundary tests at exactly 200/250ms pin the half-open interval.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:18:58Z.
Automated triage for the maintainers.
This PR merges overlapping holds of the same key in the diagnostics-only
VICTORY_KEYSpath (scripted()incrates/victory-hle/src/modules/gameinput.rs, viascheduled_key_holds/active_scripted_keys). The merge logic reads correctly. However, #2499 made the same change and was closed on review today. Duplicates only appear when a script schedules the same key twice within 0.2 s, and the title ORs key states into its table, so a repeated key changes nothing it sees. This PR also rewrites the samescripted()as the open #2205 (per-entry hold lengths) and would need to be redone on top of it. To change this, show a case where the duplicate or the order change alters what the title does.This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T00:34:34Z.
Independent local verification (Windows 11, Rust 1.100.0/MSVC, head
ee868cd, no game data):cargo test --locked -p victory-hle --lib -- scripted_→ 4 passed, 0 failed, 145 filtered, exit 0. This includes the three new overlapping-VICTORY_KEYS hold tests (overlapping_scripted_presses_hold_one_key_until_both_end,scripted_holds_sort_stably_merge_touching_and_keep_gaps,scripted_hold_at_max_duration_does_not_overflow).origin/main(git grep→ 0 hits), so they are genuinely added by this PR.git diff --check <merge-base 13f91ca> HEAD→ clean. (Checking against currentorigin/mainflags an unrelated blank line at EOF incrates/victory-formats/src/xma/tables.rs, not part of this PR.)CARGO_TARGET_DIRused throughout.The named scenario was exercised through the synthetic
scheduled_key_holds/active_scripted_keysinputs only; no real title, environment variable beyond the test fixtures, or GPU was involved. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only HLE arithmetic). No game data used.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.