gameinput: say so when LEONIDA_INPUT_SCRIPT has no keyboard pad to drive (INPUT-SCRIPT-PAD-OFF-NOTE) #2152

Closed
leonida/mandy
quartz-heron-58 wants to merge 0 commits from input-script-pad-note into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

quartz-heron-58 commented 2026-11-26 00:05:38 +00:00

Claimed in the coordination issue as: INPUT-SCRIPT-PAD-OFF-NOTE (#1608)

What and why

In a build with SDL3, LEONIDA_INPUT_SCRIPT drives the keyboard pad, and the pad's update is also where the script is read. With LEONIDA_KEYBOARD_PAD unset or off the script was never parsed and nothing was logged: an unattended boot sat at the title's first prompt with no hint why. docs/gameinput.md says the pad "has to be enabled", but the run itself was silent. I lost several unattended boots to this before reading that line.

This adds one log line at configuration time, printed once a process, when a script is set and the keyboard pad is off:

[rt] gameinput: LEONIDA_INPUT_SCRIPT is set but the keyboard pad is off, so the script is not read and no scripted press will happen: with SDL3 the script drives the keyboard pad (set LEONIDA_KEYBOARD_PAD=always for an unattended run, or 1)
  • runtime/shims/gameinput_script.h: pad_off_note(script_text, keyboard_pad_on), a pure helper that returns the text or null. It does not parse the script, so a script whose entries would all be rejected is reported too, and it is outside the parser that #2144 changes.
  • runtime/shims/gameinput.cpp: read_config prints it once.
  • runtime/test/gameinput_test.cpp: six cases for the helper.
  • docs/gameinput.md: one sentence in the LEONIDA_INPUT_SCRIPT row.

No behaviour change: the pad is not switched on for the user, and a build without SDL3 is untouched (its scripted pad needs no keyboard pad).

Tested

Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo via scripts\build_runtime.ps1 -FetchSdl3 on main 33bd07cf8 plus this commit: build exit 0.

  • ctest -R gameinput: 3 of 3 pass (gameinput_host, gameinput, gameinput_script). gameinput_test.exe run directly: 370 checks, 0 failures, the six new pad-off note lines among them.
  • gameinput_probe --seconds 3 with LEONIDA_INPUT_SCRIPT=a@1,a@2:
    • LEONIDA_KEYBOARD_PAD unset: the line above once, no press lines;
    • LEONIDA_KEYBOARD_PAD=always: no such line, two press a@ lines;
    • no script: no such line.
  • scripts/check_no_game_data.py on the four changed files: clean.

Not run: the whole ctest set, a build without SDL3 (the helper is an unused inline there), Linux/Wine.

GPUs tested: n/a (no GPU code; the machine has an RTX 4080, NVIDIA 621.24)

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule)

🤖 Generated with Claude Code

Claimed in the coordination issue as: INPUT-SCRIPT-PAD-OFF-NOTE (#1608) ### What and why In a build with SDL3, `LEONIDA_INPUT_SCRIPT` drives the keyboard pad, and the pad's update is also where the script is read. With `LEONIDA_KEYBOARD_PAD` unset or off the script was never parsed and nothing was logged: an unattended boot sat at the title's first prompt with no hint why. docs/gameinput.md says the pad "has to be enabled", but the run itself was silent. I lost several unattended boots to this before reading that line. This adds one log line at configuration time, printed once a process, when a script is set and the keyboard pad is off: ```text [rt] gameinput: LEONIDA_INPUT_SCRIPT is set but the keyboard pad is off, so the script is not read and no scripted press will happen: with SDL3 the script drives the keyboard pad (set LEONIDA_KEYBOARD_PAD=always for an unattended run, or 1) ``` - `runtime/shims/gameinput_script.h`: `pad_off_note(script_text, keyboard_pad_on)`, a pure helper that returns the text or null. It does not parse the script, so a script whose entries would all be rejected is reported too, and it is outside the parser that #2144 changes. - `runtime/shims/gameinput.cpp`: `read_config` prints it once. - `runtime/test/gameinput_test.cpp`: six cases for the helper. - `docs/gameinput.md`: one sentence in the `LEONIDA_INPUT_SCRIPT` row. No behaviour change: the pad is not switched on for the user, and a build without SDL3 is untouched (its scripted pad needs no keyboard pad). ### Tested Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo via `scripts\build_runtime.ps1 -FetchSdl3` on main 33bd07cf8 plus this commit: build exit 0. - `ctest -R gameinput`: 3 of 3 pass (gameinput_host, gameinput, gameinput_script). `gameinput_test.exe` run directly: 370 checks, 0 failures, the six new `pad-off note` lines among them. - `gameinput_probe --seconds 3` with `LEONIDA_INPUT_SCRIPT=a@1,a@2`: - `LEONIDA_KEYBOARD_PAD` unset: the line above once, no press lines; - `LEONIDA_KEYBOARD_PAD=always`: no such line, two `press a@` lines; - no script: no such line. - `scripts/check_no_game_data.py` on the four changed files: clean. Not run: the whole ctest set, a build without SDL3 (the helper is an unused inline there), Linux/Wine. GPUs tested: n/a (no GPU code; the machine has an RTX 4080, NVIDIA 621.24) AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Tyrannys commented 2026-11-27 14:51:10 +00:00

Independent verification of head cc435fa16 merged into current main (ec91d695c), no conflicts.

Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, LEONIDA_SDL3_FETCH=ON. No game files.

Tests:

  • ctest -R gameinput: gameinput_host, gameinput, gameinput_script pass (3/3). gameinput_test.exe run alone: 370 checks, 0 failures, all six pad-off note checks PASS.
  • gameinput_probe by hand:
    • LEONIDA_INPUT_SCRIPT=a@1,a@2, LEONIDA_KEYBOARD_PAD unset: the new line once, no presses.
    • same script with LEONIDA_KEYBOARD_PAD=always: no such line, 2 scripted press(es), 0 rejected, presses at 1.0 s and 2.0 s.
    • LEONIDA_KEYBOARD_PAD=off: the line once.
    • no script: no line.
    • LEONIDA_KEYBOARD_PAD=yes (unknown value) with a script: the existing "unknown" line, then the new line. That is right, since the pad really is off then.

Full suite: this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into main ec91d695c. ctest -j 6: 500/502; the two failures, xbox_present and d3d12_set_descriptor_heaps, fail on plain main here as well (known). Plain main baseline (first run in a fresh build dir): same two, plus xs_proxy_mock, d3d12_queue_handover_two_queues and timeouts in big_compile_gate and api_ref_state that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on main, not as something this PR fixes. No new failure.

Note: without SDL3 (my first configure) gameinput and gameinput_script are disabled, so the new checks only run in an SDL3 build. That is expected.

No problems found.

AI-assisted (Claude Code).

Independent verification of head `cc435fa16` merged into current `main` (`ec91d695c`), no conflicts. Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, `LEONIDA_SDL3_FETCH=ON`. No game files. **Tests:** - `ctest -R gameinput`: `gameinput_host`, `gameinput`, `gameinput_script` pass (3/3). `gameinput_test.exe` run alone: 370 checks, 0 failures, all six `pad-off note` checks PASS. - `gameinput_probe` by hand: - `LEONIDA_INPUT_SCRIPT=a@1,a@2`, `LEONIDA_KEYBOARD_PAD` unset: the new line once, no presses. - same script with `LEONIDA_KEYBOARD_PAD=always`: no such line, `2 scripted press(es), 0 rejected`, presses at 1.0 s and 2.0 s. - `LEONIDA_KEYBOARD_PAD=off`: the line once. - no script: no line. - `LEONIDA_KEYBOARD_PAD=yes` (unknown value) with a script: the existing "unknown" line, then the new line. That is right, since the pad really is off then. **Full suite:** this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into `main` `ec91d695c`. `ctest -j 6`: 500/502; the two failures, `xbox_present` and `d3d12_set_descriptor_heaps`, fail on plain `main` here as well (known). Plain `main` baseline (first run in a fresh build dir): same two, plus `xs_proxy_mock`, `d3d12_queue_handover_two_queues` and timeouts in `big_compile_gate` and `api_ref_state` that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on `main`, not as something this PR fixes. No new failure. Note: without SDL3 (my first configure) `gameinput` and `gameinput_script` are disabled, so the new checks only run in an SDL3 build. That is expected. No problems found. AI-assisted (Claude Code).
OreoFR commented 2026-11-28 22:00:03 +00:00

Verified by OreoFR

  • Base: main c1ecf04ed + PR head cc435fa16; green run in a merge package of 16 PRs, no new ctest failure vs main
  • Test: ctest -R "^(gameinput|gameinput_script)$"
  • Red on main: the test does not compile without the PR (rt::gameinput::script::pad_off_note missing)
  • Green with the PR: 2/2 OK
  • Verdict: READY (red by compilation only; shares gameinput.cpp and gameinput_test.cpp with #2086, so tested in separate packages)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

**Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `cc435fa16`; green run in a merge package of 16 PRs, no new ctest failure vs main - Test: `ctest -R "^(gameinput|gameinput_script)$"` - Red on main: the test does not compile without the PR (rt::gameinput::script::pad_off_note missing) - Green with the PR: 2/2 OK - Verdict: READY (red by compilation only; shares gameinput.cpp and gameinput_test.cpp with #2086, so tested in separate packages) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 reviewed 2026-12-01 11:00:25 +00:00
aslan2142 left a comment
No description provided.
Adding a one-time diagnostic log in `gameinput.cpp` when `LEONIDA_INPUT_SCRIPT` is set while the keyboard pad is off (with unit tests in `gameinput_test.cpp` and a note in `docs/gameinput.md`) is clean and helpful, but requesting changes for merge readiness: 1. **Merge conflict:** Currently conflicts with `main`. 2. **Stale/failing CI:** The previous run had cancelled/failing jobs (`windows`, `check`, `linux-gpu-tools`). Please rebase onto current `main` and run CI to green. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:25:01 +00:00

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 (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

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 (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.