[PR #1917] windows-boot: state-relative input presses (BOOT-INPUT-STATE-RELATIVE) #1924

Open
opened 2026-11-26 21:19:25 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1917
Author: @BubsMcgee
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: boot-input-state


📝 Commits (1)

  • 34da84a windows-boot: state-relative input presses (BOOT-INPUT-STATE-RELATIVE)

📊 Changes

4 files changed (+391 additions, -9 deletions)

View changed files

📝 scripts/windows-boot/README.md (+10 -1)
📝 scripts/windows-boot/boot.ps1 (+134 -8)
➕ tests/test_boot_input_script.py (+91 -0)
➕ tools/boot_input_script.py (+156 -0)

📄 Description

Claimed in the coordination issue as: BOOT-INPUT-STATE-RELATIVE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166666931). No dependencies; this is the harness side and reads keys through the keyboard pad (GetAsyncKeyState), so #1790's focus mode is orthogonal.

Fixes: #1900

What and why

-InputScript was absolute-time only (a@45,a@60,...). The title reaches the same states at different times from run to run, so the same script lands presses in different game states; in A/B runs an A at 75/90 s can advance in one build and back out to the menu (session d -> 0) in another, changing presents, PSO counts and the path being compared.

This adds button@game=<hex>+<delay> / button@session=<hex>+<delay>: the harness watches the existing LEONIDA_PEEK values (0x7446510 game, low dword of 0x98f828c session) and injects the key once that state has been seen for the delay. Absolute entries still go to the runtime unchanged.

Files

  • tools/boot_input_script.py: parse and due matcher (stdlib only).
  • scripts/windows-boot/boot.ps1: split the script, watch the log, inject through the keyboard pad (SendInput, LEONIDA_KEYBOARD_PAD=always; no focus needed), and read the log in the digest with a share that tolerates the redirect handle.
  • scripts/windows-boot/README.md and --help: the new form and an example.
  • tests/test_boot_input_script.py: synthetic parse/due cases.

Tested

  • python -I tests/test_boot_input_script.py: 12/12.
  • python -I scripts/check_no_game_data.py on the changed files: OK.
  • -DryRun with a@session=3+5,a@session=d+5: absolute='' state=2.
  • 200 s boot on RTX 3080 Ti / Windows 11 / NVIDIA 616.64 with a@session=3+5,a@session=d+5: the harness injected a at session=3 (55.8 s) and session=d (70.9 s); the keyboard pad logged press [email protected]/69.0/69.9; -DigestOnly reads states session=3 @55 s, session=d @70 s, and the known world-start device loss (lib_cs_03426...).

AI-assisted.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1917 **Author:** [@BubsMcgee](https://github.com/BubsMcgee) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `boot-input-state` --- ### 📝 Commits (1) - [`34da84a`](https://github.com/ubiquitarianism/leonida/commit/34da84a13d5a3d4b5bf11f10652fb908c0024fbc) windows-boot: state-relative input presses (BOOT-INPUT-STATE-RELATIVE) ### 📊 Changes **4 files changed** (+391 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `scripts/windows-boot/README.md` (+10 -1) 📝 `scripts/windows-boot/boot.ps1` (+134 -8) ➕ `tests/test_boot_input_script.py` (+91 -0) ➕ `tools/boot_input_script.py` (+156 -0) </details> ### 📄 Description Claimed in the coordination issue as: BOOT-INPUT-STATE-RELATIVE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166666931). No dependencies; this is the harness side and reads keys through the keyboard pad (`GetAsyncKeyState`), so #1790's focus mode is orthogonal. Fixes: #1900 ### What and why `-InputScript` was absolute-time only (`a@45,a@60,...`). The title reaches the same states at different times from run to run, so the same script lands presses in different game states; in A/B runs an A at 75/90 s can advance in one build and back out to the menu (`session d -> 0`) in another, changing presents, PSO counts and the path being compared. This adds `button@game=<hex>+<delay>` / `button@session=<hex>+<delay>`: the harness watches the existing `LEONIDA_PEEK` values (`0x7446510` game, low dword of `0x98f828c` session) and injects the key once that state has been seen for the delay. Absolute entries still go to the runtime unchanged. ### Files - `tools/boot_input_script.py`: parse and due matcher (stdlib only). - `scripts/windows-boot/boot.ps1`: split the script, watch the log, inject through the keyboard pad (`SendInput`, `LEONIDA_KEYBOARD_PAD=always`; no focus needed), and read the log in the digest with a share that tolerates the redirect handle. - `scripts/windows-boot/README.md` and `--help`: the new form and an example. - `tests/test_boot_input_script.py`: synthetic parse/due cases. ### Tested - `python -I tests/test_boot_input_script.py`: 12/12. - `python -I scripts/check_no_game_data.py` on the changed files: OK. - `-DryRun` with `a@session=3+5,a@session=d+5`: `absolute='' state=2`. - 200 s boot on RTX 3080 Ti / Windows 11 / NVIDIA 616.64 with `a@session=3+5,a@session=d+5`: the harness injected `a` at session=3 (55.8 s) and session=d (70.9 s); the keyboard pad logged `press [email protected]/69.0/69.9`; `-DigestOnly` reads states `session=3 @55 s`, `session=d @70 s`, and the known world-start device loss (`lib_cs_03426...`). AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1924
No description provided.