Diagnostics: script gamepad input by frame (VICTORY_SCRIPTED_INPUT) #3293
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3293"
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 neonbyte1 on 2026-11-26T16:12:59Z.
A diagnostics switch that plays a scripted gamepad timeline, so a headless run can move the character without a real controller or window focus:
Each entry sets the pad from that presented frame until the next entry. It's keyed on the frame token that
victory_gpu::framepresent logs show. The states:fwd,back,left,right;look_*;lt,rt;a/b/x/y,menu,view,lb/rb/ls/rs, and the d-pad (du/dd/dl/dr);offreleases everything.States combine with
+(fwd+look_right). The script overlays a connected pad, or the keyboard stand-in pad when none is connected.How it relates to
VICTORY_KEYS:VICTORY_KEYS(and #3239's holds and repeats) is timed in seconds and goes through the keyboard path. This one is timed in presented frames and sets pad state directly. At about one frame per second, wall-clock timing lands at different points of the game from run to run, while frame-keyed timing is repeatable. The README row says so next toVICTORY_KEYS.Changes:
gameinput.rs: the parser, the timeline lookup, and the overlay in the poll, plus three unit tests: parsing, segment lookup, and the overlaid reading.frame.rs: a diagnostics-only accessor for the frame number.README.md: one row next toVICTORY_KEYS.All of it is behind
diagnostics; when the variable is unset, nothing changes.In game (GTA VI on Linux, RTX 5090, GE-Proton11-14, headless gamescope,
mainplus the PRs needed on that setup):Tested: the
gameinputtests pass undercargo xtask wine-test(#1218), 13/13, with and withoutdiagnostics. Clippy-D warningsandcargo xtask policyare clean. Not run on native Windows.AI-assisted (Claude); measured on my machine, no game data shared.
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-26T16:15:43Z.
Review: COMMENTED
Frame-keyed timing is a good complement to
VICTORY_KEYS, and thediagnosticsforwarding tovictory-gpuis already there, soframe::number()resolves.One trap: unknown tokens are ignored but the entry is still kept, so a typo'd entry (
1800:fwrd,look_rigth) becomes a neutral pad and silently acts likeofffrom that frame on. In an unattended run that looks like the character just stopped. Awarn!naming the token (once, at parse time) would make that obvious; andscripted_input_timeline_holds_the_last_statecould pin it.Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T16:43:50Z.
@AurumCarlos good catch, thanks. Fixed in
56dcd63. An entry with an unknown token is now dropped whole, so the last valid state stays active, and the parser warns once per bad token with the entry text (unknown scripted input token; entry ignored).I chose dropping the whole entry over keeping the recognised tokens: applying
fwdfromfwd+boguswould invent a state the script never asked for, and a lone typo would still look likeoff.The timeline test now includes
40:fwd+bogusand50:look_rigth, and checks that the previous state (back) is still active at frame 49. A second test checks that a bad token is reported once. Thegameinputtests pass under Wine (14/14), and clippy, policy and formatting are clean.AI-assisted (Claude); measured on my machine, no game data shared.
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-26T16:47:13Z.
Review: COMMENTED
56dcd63resolves it: dropping the whole entry keeps the last valid state, and the warning names the token and the entry once. The two tests cover both. LGTM.Tiny edge, no change needed: a trailing
+(1500:fwd+) now yields an empty token, so that entry is dropped with a warning for"". That's the right outcome, just a slightly cryptic message.Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T16:49:33Z.
@AurumCarlos thanks for re-checking. Agreed on
1500:fwd+: dropping it is the right outcome, and the""in the warning is cryptic. I'll leave it as is unless a maintainer would like the message to say "empty token" explicitly; that's a one-line change.AI-assisted (Claude); no game data shared.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T16:50:06Z.
Independent Windows verification of PR #3293 (head
56dcd63).CARGO_TARGET_DIR=D:\Victory-Contrib\target-3293,CARGO_BUILD_JOBS=2.cargo test --locked -p victory-hle --lib -- --exact modules::gameinput::tests::scripted_input_timeline_holds_the_last_state modules::gameinput::tests::scripted_pad_reaches_the_stand_in_reading modules::gameinput::tests::scripted_pad_overlays_a_host_pad3 passed; 0 failed; 153 filtered out, exit 0.git diff --check origin/main HEADclean.63bcca43(synthetic tests are added by this PR).Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T17:32:12Z.
Review: APPROVED
Reviewed and verified locally on Windows 11 x64:
VICTORY_SCRIPTED_INPUTcleanly drives frame-indexed gamepad state timelines over both stand-in and connected host pads without affecting normal input when unset.cargo test -p victory-hle --lib modules::gameinput:: -- --test-threads=1: 14 passed, 0 failed (includingscripted_input_timeline_holds_the_last_state,scripted_input_warns_once_per_unknown_token,scripted_pad_overlays_a_host_pad, andscripted_pad_reaches_the_stand_in_reading).cargo clippy -p victory-gpu -p victory-hle --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu -p victory-hle --features diagnostics --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-26T21:02:18Z.
Review: APPROVED
LGTM — verified against
origin/main(63bcca43) on Windows x64.56dcd63cleanly addresses earlier parsing concerns by dropping the entire entry on unknown tokens, preserving the prior valid state, and emitting a one-time warning (unknown scripted input token; entry ignored).diagnosticswith no behavior change whenVICTORY_SCRIPTED_INPUTis unset.1500:a;1501:off) can be skipped if multiple frames advance within the 8 ms input polling interval (crates/victory-hle/src/modules/gameinput.rs:254,510).merge_padoverlays additively over host/stand-in state, diagnostics builds still readframe::number()(gameinput.rs:1376) even when the env var is unset, and repeated conflicting stick tokens in one entry clamp sequentially per token (gameinput.rs:199).cargo test --locked -p victory-gpu --lib frame::(default and--features diagnostics): 2 passed, 0 failed.cargo test --locked -p victory-hle --lib modules::gameinput::(default and--features diagnostics): 14 passed, 0 failed.cargo clippy -p victory-gpu -p victory-hle --all-targets --locked -- -D warnings(default and--all-features): clean.cargo xtask policy: 191 files ok;rustfmt --edition 2024: clean on changed hunks.Synthetic tests only; no game data used.
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T23:35:15Z.
NVIDIA full-suite run, to go with the reports above by Dukestar69, cloph-dsp, fuzeofficlal, since none of them names a GPU run. Tested exact head
56dcd63(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 870 passed, 0 failed, 10 ignored.scripted_input_timeline_holds_the_last_state,scripted_input_warns_once_per_unknown_token,scripted_pad_reaches_the_stand_in_reading,scripted_pad_overlays_a_host_pad.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T23:51:31Z.
@futurepro62 thanks, that's the GPU run this PR was missing, and it matches what I see on an RTX 5090 under Wine (the gameinput tests pass there too). Good to have the pre-existing NVIDIA failures named with their issues.
AI-assisted (Claude); no game data shared.
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.