Repository navigation
Conversation
Cover small output buffers, retained readings, and stable sequence numbers. The buffer and snapshot cases are adapted from MichaelSmithAI's BastienRodz#2 regression based on Marvisak#927. Place the test next to the keyboard reading tests so it can merge with Marvisak#2715.
|
Matches the documented contract on both sides: GetKeyState writes a zeroed entry after the last valid key when the buffer has room (the terminator titles scan for), and GetGamepadState returns false but still writes an at-rest state for non-gamepad readings. The reused-buffer regression is the right way to catch stale-state bugs. |
|
Independent WARP/CPU verification Head: Environment: Windows x64, WARP selected ( Commands (each with
Results: baseline 148 passed, 0 failed (146 unit + 2 integration); PR 150 passed, 0 failed (148 unit + 2 integration). Targeted regressions 2/2 passed. Clippy passed. Negative control: reverted both production handlers; each targeted regression failed (exit 101), as expected. No implementation bug found. Not tested: physical GPU, retail title, release build. AI-assisted: Codex (gpt-6-luna). |
|
Independent Windows 11 verification and review of Verification (
|
|
Automated triage for the maintainers. In This is a recommendation for a maintainer to look, not an approval. Generated by Claude Code |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64:
cargo test -p victory-hle --lib modules::gameinput::: 12 passed, 0 failed (including newkeyboard_reading_clears_previous_gamepad_stateandkey_state_terminates_a_reused_buffer).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).
|
NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head Tested
Not tested
AI use
|
fuzeofficlal
left a comment
There was a problem hiding this comment.
The gamepad_state change (crates/victory-hle/src/modules/gameinput.rs:1068-1079) matches the documented at-rest output for a reading without the gamepad kind. For key_state (gameinput.rs:1051-1067), writing KeyState::default() at out[n] satisfies callers that consume either out[..returned] or stop at the first zeroed {scanCode: 0, virtualKey: 0} terminator, while the GDK keyboard guide leaves spare tail entries unspecified.
A few polish suggestions:
- Document in a short comment why only the single terminator slot
out[n]is cleared (as opposed to zeroing all ofout[n..count]), in case a caller scans the fullcountskipping zero entries. key_state_terminates_a_reused_bufferuses a 2-slot buffer with 1 key, leaving only 1 spare slot so it doesn't distinguish single-slot termination from full-tail clearing; extending it to >= 3 prefilled slots (plus zero-key, truncatedkeys.len() > count,count == 0, and nulloutcases) would lock down the exact contract.rustfmt --edition 2024 --checkflags line1598in the new testkeyboard_reading_clears_previous_gamepad_state(alongside 4 pre-existing lines ingameinput.rs).
Local verification on commit 88d7c75f72e4: xtask policy (184 files ok), cargo clippy -p victory-hle --all-targets (default and --all-features), gameinput:: tests (11 passed), and the full victory-hle suite (148 unit + 2 integration = 150 passed, 0 failed) all pass.
…d output buffers
GetGamepadState must return an at-rest state and false for readings without gamepad input. GetKeyState uses a zero scan code and virtual key to mark the end of valid keys when the output has room. Implement both for reused output buffers. Regression tests start with a pressed button/trigger or a nonzero key in the output and cover a full buffer, spare space, and an empty list. Both tests failed before the fix. Nine input tests passed locally using the fake host, excluding the native host and export resolver. References: GetGamepadState and GetKeyState.