Repository navigation
gameinput: keyboard pad input scripts of any length (RT-INPUT-SCRIPT-LENGTH) - #1074
Conversation
|
Confirmed on native Windows 11 (26100.7623) at I held B through the test keyboard source, scheduled X once at startup and again as the last entry at 0.70 s, and sampled the virtual pad through both press windows. At script lengths of 63, 64, 65, 69, 70, 76 and 4,096 ASCII bytes, GameInput reported For a control I kept the same probe, scheduler and libraries and restored only the parent commit’s 64-byte environment reader. Both 63-byte runs still saw both X presses. At every tested length from 64 bytes up, only B was visible (12/12 control runs). The unmodified PR tests also passed here: SDL virtual pad and synthetic keyboard input only. No game files or GPU needed. AI-assisted: yes (OpenAI Codex). |
|
Review of #1074, "gameinput: read full-length keyboard pad scripts (RT-INPUT-SCRIPT-LENGTH)" Head: 5e86f4a (one commit on bd8d72b). Claim on #14 (comment 7139824543, Moriz82) matches the change. Environment: Windows 11 Pro 26300, MSVC 19.50 (VS 18 Build Tools), CMake with the "Visual Studio 18 2026" generator. No SDL3 is installed on this machine and none is on the drive, so What I ran
Findings
Verdict: the length fix is correct and bounded, the merge is clean, and the docs table row is present and passes the docs test. I could not run the real test here (no SDL3). The standalone harness confirms the new reader handles long values, and that the old reader drops them. I would approve after the title or description reflects that this adds the scheduler. Rejecting malformed times (finding 4) plus a malformed-input test case (finding 5) are recommended but not blocking. Findings 6 and 7 are doc clarifications. AI-assisted. |
5e86f4a to
6aac7d9
Compare
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Resolves truncation of LEONIDA_INPUT_SCRIPT environment variables exceeding 64 characters by querying actual length dynamically from the OS. Successfully schedules multi-stage button sequences with 300ms press duration. Validated with focused test cases in gameinput_test.cpp and docs/env_vars. 100% clean-room.
…LENGTH) Main had no keyboard pad script scheduler. Add timed button presses with a full-length environment reader so entries beyond byte 63 reach the pad. Combine scheduled and physical presses. Reject malformed entries and report their count when the script is read on the first pad update. Build gta6rt and gameinput_test. Exercise a long script, rejected items, focus loss, configuration reload and release under Wine. Restore only the old environment reader to reproduce the missing presses. Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> AI-assisted (Codex and Claude Code agents). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
6aac7d9 to
f9ba70b
Compare
|
Thank you for testing the script on native Windows. The 14/14 passing
On the amended branch, the default run passed 364/364 and the focused 🤖 Generated with Claude Code |
Merging. **Why merged:** RT-4444-TARGET: where the device can't use a 4444 format as a colour attachment (NVIDIA), a B4G4R4A4 render target becomes an RGBA8 image. Its T#s keep the 4_4_4_4 format, and PSO RTV formats follow the image. Before this, the render target couldn't be created at all (size UINT64_MAX). sodove (5070 Ti) and SweatierKey approved. **Why it's good:** The new d3d12_b4g4r4a4_target really runs here (not skipped): "B4G4R4A4_UNORM ... using RGBA8", OK, 0 validation errors. b5g5r5a1_uav, srgb_uav and vulkan_device also pass. **Follow-up, not a blocker:** sodove measured that the RGBA8 fallback stores clears at 8-bit precision instead of quantising to 4 bits (0/1920 texels matched WARP's 4-bit result), and buffer-footprint copies from it move 4-byte texels (documented in the code). Quantising on clear and store would close that gap. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: ProjectLeonida#517, ProjectLeonida#907, ProjectLeonida#927, ProjectLeonida#954 and ProjectLeonida#1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from ProjectLeonida#510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** VK-UAV-CLEAR-PACK16: B5G6R5, B5G5R5A1 and B4G4R4A4 join the UAV-clear layout table, with conversion checks and an exhaustive 65,536-word round trip. Timon360SB (2060S and 5070, 60/60) and SweatierKey approved. The current head b67109e is a content-identical rebase of the reviewed one. **Why it's good:** uav_clear, short_uav_clear, b5g5r5a1_uav and replay_uav_clear_offset all pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** RT-TITLE-HOST-REGION: a test-only probe that imports a 185 MiB host region as a BDA buffer through VK_EXT_external_memory_host and checks coherence both ways. A machine that can't import exits 77 (skip). No runtime source changes. Timon360SB, madhyn (3060 Ti/Wine) and SweatierKey approved. **Why it's good:** vk_host_region_import and its _validation variant: "185 MiB imported ... cpu-gpu-coherence=ok", 0 validation errors. Nit for a follow-up: the _validation test sets VK_VALIDATE_SYNC=1, which nothing in the tree reads; if sync validation is the goal, the Khronos layer setting is spelled differently, so that variant probably runs core validation only. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** TEST-INDIRECT-RT-ARENA: d3d12_indirect_rt_test replaces a nested std::max with an initializer-list std::max to work around an MSVC 19.52 miscompile. It's 6 lines. sodove passed both revisions, and the current head is a content-identical rebase. **Why it's good:** indirect_rt and indirect_rt_upload_sysmem: PASS with 0 validation errors, and the RayQuery got hit=1 here under validation. Timon360SB's hit=0 on a 5070 with GPU-assisted validation shows up on the base too, so it isn't this PR. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
|
Merging. Why merged: RT-INPUT-SCRIPT-LENGTH: the shim's env() reader now handles values of any length (64 characters or more used to read as unset). The PR also adds the LEONIDA_INPUT_SCRIPT keyboard-pad scheduler ( Why it's good: gameinput_host, gameinput and the new gameinput_script pass; with validation, gameinput_script passes and logs "8 accepted / 11 rejected". The parsing is bounded (strtod with end-pointer and finiteness checks) and reads only its own env var. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: RT-INPUT-SCRIPT-LENGTH (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 contains the integration. #955 changes physical
right-stick keys and controller hotplug in the same shim.
What and why
Main had no scheduler for keyboard pad input scripts. This change reads
LEONIDA_INPUT_SCRIPTand schedules comma-separatedbutton@secondsentries. The shared environment reader now reads every
LEONIDA_*setting used by this shim at full length. Previously, values of 64
characters or more read as unset.
The first keyboard pad update reads the script and starts its clock.
Each scheduled press lasts 300 ms and works with or without focus. A
physical key or another active scheduled press can keep a button held.
reload_config()leaves the startup script in effect.Spaces around an entry are allowed. Empty entries, unknown buttons and
missing, malformed, negative or non-finite times are ignored. The shim
logs the accepted and rejected counts for each nonempty script. Leave
the variable unset to disable scheduling.
Tested
Release cross-build with clang-cl 23.1.5 and an xwin SDK on CachyOS,
kernel 7.3.5. The tests used Proton Experimental (Wine 11), a Ryzen 5
5600X, 16 GB RAM and SDL virtual joysticks. The host had an RTX 4070
12 GB with NVIDIA 620.73.04. CMake omitted the optional XMA2 decoder
because the Rust Windows target was unavailable.
The 135-byte fixture places X at byte offset 67, padded with whitespace,
and schedules X again later. It supplies an unknown button, missing and
invalid times, empty items and a whitespace-only item. Physical B and
scripted X are held on the first reading. After losing focus and
reloading with a different script, only X is held. Once the original
press expires and focus returns, only B is held.
The default run passed 364/364 checks. The focused run passed 10/10 and
reported eight scheduled entries and eleven rejected entries.
Both controls used the same test object and link settings. For the
reader control, restore only
env()from the commit's parent. For theparser control, restore only the pre-review parsing loop with its
unchecked time conversion. Run each control with
--input-script.Each fraction counts passing checks. Only the child ran the default
suite. The old parser counted 14 entries as valid.
Both
gameinputandgameinput_scriptappeared disabled without SDL3and enabled again after restoring SDL3. The documentation suite passed
4/4 tests. The semantic suite passed 6,168 tests in 470 files. The
content and whitespace checks passed.
A contributor tested the pre-review scheduler on native Windows 11.
All 14/14 runs passed at lengths from 63 to 4,096 bytes. With only the
old reader restored, both 63-byte runs passed and all 12/12 longer runs
missed the scheduled presses. Native Windows has not been rerun on this
revision. AMD, Intel, a physical controller and a game boot were not
tested on this revision.
GPUs tested: none. The GameInput tests use synthetic input.
AI-assisted: yes
Checklist
bd8d72bb2, verified to merge cleanly into955d9be34.🤖 Generated with Claude Code