Repository navigation
Conversation
|
Independent Windows check under AddressSanitizer of
No title run, so the state RVAs and real game/session transitions aren't covered. GPUs tested: n/a (CPU unit test). AI-assisted: yes. |
aslan2142
left a comment
There was a problem hiding this comment.
Keeping #2749 over closed competing variant #1917 (BOOT-INPUT-STATE-RELATIVE, #1900): implementing state-relative presses natively in GameInput using locally supplied LEONIDA_GAME_STATE_RVA / LEONIDA_SESSION_STATE_RVA is clean-room compliant and avoids #1917's hardcoded game RVAs and PowerShell SendInput races.
However, requesting changes before merge for two bugs spotted in the diff:
runtime/shims/gameinput.cpp(update_keyboard_pad): After moving thenow >= *due + std::max(press.hold, kMaxHold)check insideif (!started[i]), oncestarted[i]becomes1, the lineconst bool active = now < scheduled[i] + press.hold || calls - began[i] < kReads;no longer enforces thestd::max(press.hold, kMaxHold)upper cap. If the title stops polling pads (calls - began[i] < kReads), a started press stays held indefinitely past 5 s, contradictingdocs/gameinput.md. Please restorenow < scheduled[i] + std::max(press.hold, kMaxHold) && (...).runtime/src/main.cpp(start_title_peek): Settingif (have_title_state) period = 1;unconditionally overridesLEONIDA_PEEK_SECONDSfor[rt] peekstderr logging as well, printing peek lines every 1 s (5–10× faster than configured). Please keep sampling title state every 1 s while only printing[rt] peekwhentick % peek_period == 0(respectingLEONIDA_PEEK_SECONDS).
(AI-assisted review.)
KelboLive
left a comment
There was a problem hiding this comment.
Two blockers, both matching aslan2142's review — and I built the SDL path the PR's own test command never compiles (-DLEONIDA_SDL3=OFF), which is where the first one lives.
- The 5 s cap is lost once a press starts (
runtime/shims/gameinput.cpp:2044vs:2049). The cap only gates the!started[i]branch; afterwardsactive = now < scheduled + hold || calls - began < kReads, with no wall-clock bound. Reproduced with a temporary probe case:y@0:0.3with two reads is still held at 6 s, and with no further reads it stays down indefinitely.docs/gameinput.md:537promises "never past 5 s". TheLEONIDA_INPUT_FILEloop still enforces the cap at:2032— the scripted loop should keep the same outer check afterstarted[i]. - The peek period is overridden (
runtime/src/main.cpp:143).period = 1also drives the print (:188) and theSleep(:203), so when both RVAs are setLEONIDA_PEEK_SECONDSis ignored;boot.ps1setsPEEK_SECONDS=5together with the RVAs by default, so peek output is 5× as frequent and thet=labels advance in 1 s.runtime/README.md:405still says "everyLEONIDA_PEEK_SECONDS". Sample at 1 s, print every configured period.
Everything else checks out: the RVA sampling and since/start_at/update() chain is exactly as described (the tests pin 62.0/62.6 s and 67.0/67.6 s), the anchor-identity guard is covered (forcing if (false && …) gives 5 failures), gameinput_no_sdl_test and the SDL gameinput_test both pass here (0 and 400 checks), gta6rt builds, the docs tests are 37 + 39 green, and merge-tree is clean with none of the four changed files touched on main since the merge base.
Minor: the SDL build adds a C4456 tick shadow at gameinput.cpp:2007, and no SDL test covers relative anchors (the shared parser is covered by the no-SDL test). Also the two state RVAs (LEONIDA_GAME_STATE_RVA, LEONIDA_SESSION_STATE_RVA) are missing from runtime/README.md's table, and the parser accepts 64-bit hex while main.cpp:199 truncates to u32, so a longer value silently never matches.
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
Claimed in the coordination issue as: BOOT-INPUT-STATE-RELATIVE — #2570 (comment)
Fixes: #1900
What and why
Add opt-in state-relative scripted GameInput presses (
button@game=<hex>+secondsandbutton@session=<hex>+seconds) while preserving the existingbutton@secondsformat. The runtime samples the locally configured game/session state RVAs once per second; a relative press is scheduled from the observation of its matching state. No RVAs or game-derived state data are stored in the repository.Tested
cmake -S runtime -B runtime/build -DLEONIDA_SDL3=OFF.gta6rtandgameinput_no_sdl_testwith Visual Studio 2022 BuildTools / MSVC 19.44 and Windows SDK 10.0.26100.0. Build succeeded; existing warnings remain in unrelated files.ctest --test-dir runtime/build -C RelWithDebInfo -R '^gameinput_no_sdl(_script)?$' --output-on-failure— 2/2 passed. Synthetic tests cover both state anchors and a press missed by sparse title reads.tests/test_text_write_line_endings.py(Python 3.13) — 3 passed.scripts/check_no_game_data.pyon changed files andgit diff --check— passed.GPUs tested: n/a (no GPU tests run; Windows 11 Pro 10.0.26200)
AI-assisted: yes (OpenCode, GPT-6 Luna)
Checklist
mainand merges cleanly.