UI-WINDOWS-INPUT-DEADLINE: Honor the Windows console input deadline #447

Manually merged
github merged 1 commit from gh-pr/447/head into gh-pr/447/base 2026-11-26 09:00:39 +00:00
Owner

@⁠ettehn on GitHub · 2026-11-24 05:34 UTC · original
ettehn:fix/windows-console-input-deadline → main · +47 −16 · 2 files · 1 commits · merged 2026-11-24 06:32 UTC

Claimed in the coordination issue as: UI-WINDOWS-INPUT-DEADLINE

What and why

After discarding a mouse move or another non-key record, the Windows build console reused the full input timeout. In a 100 ms wait, a mouse move at 90 ms let the same call consume a key arriving at 150 ms. Each wait now uses the time remaining until a single monotonic deadline. Zero-timeout reads still poll without blocking.

Tested

Windows 11 25H2 (26200.9974), Ryzen 9 8945HX, Python 3.13.7.

  • The synthetic Win32 regression fails on main by returning the late key. With the patch, the first read times out within Win32 millisecond granularity, and a subsequent zero-timeout poll retrieves the key.
  • python -IB tests/test_leonida_tui.py passed 25 tests. python -IB tests/test_make_game_argparse.py passed 38 tests.
  • python -IB tests/test_text_write_line_endings.py passed 3 tests. python -IB scripts/check_no_game_data.py also passed.

GPUs tested: n/a. The test simulates Win32 events and runs on the CPU.

AI-assisted: Yes, OpenAI Codex helped reproduce, fix, and test the issue.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule change.
**@⁠ettehn** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/447) `ettehn:fix/windows-console-input-deadline` → `main` · +47 −16 · 2 files · 1 commits · merged 2026-11-24 06:32 UTC Claimed in the coordination issue as: [UI-WINDOWS-INPUT-DEADLINE](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why After discarding a mouse move or another non-key record, the Windows build console reused the full input timeout. In a 100 ms wait, a mouse move at 90 ms let the same call consume a key arriving at 150 ms. Each wait now uses the time remaining until a single monotonic deadline. Zero-timeout reads still poll without blocking. ### Tested Windows 11 25H2 (26200.9974), Ryzen 9 8945HX, Python 3.13.7. - The synthetic Win32 regression fails on `main` by returning the late key. With the patch, the first read times out within Win32 millisecond granularity, and a subsequent zero-timeout poll retrieves the key. - `python -IB tests/test_leonida_tui.py` passed 25 tests. `python -IB tests/test_make_game_argparse.py` passed 38 tests. - `python -IB tests/test_text_write_line_endings.py` passed 3 tests. `python -IB scripts/check_no_game_data.py` also passed. GPUs tested: n/a. The test simulates Win32 events and runs on the CPU. AI-assisted: Yes, OpenAI Codex helped reproduce, fix, and test the issue. ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption. - No translator rule change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:00:36 +00:00
github manually merged commit 5523b44169 into gh-pr/447/base 2026-11-26 09:00:39 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 06:32 UTC · original

Merging. Why merged: the Windows console input wait now honours its deadline instead of restarting the full wait after a discarded record (e.g. a mouse-move event).
Why it's good: security-reviewed (local tool change only). Tested on Windows 11 merged onto main 8f481cf: tests/test_leonida_tui.py 24 passed on main -> 25 passed with this PR; the new test fails on main and passes with the fix; compileall clean.

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

**@⁠QemmHD** on GitHub · 2026-11-24 06:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/447#issuecomment-7124041617) Merging. Why merged: the Windows console input wait now honours its deadline instead of restarting the full wait after a discarded record (e.g. a mouse-move event). Why it's good: security-reviewed (local tool change only). Tested on Windows 11 merged onto main 8f481cf: tests/test_leonida_tui.py 24 passed on main -> 25 passed with this PR; the new test fails on main and passes with the fix; compileall clean. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.