[PR #447] [MERGED] UI-WINDOWS-INPUT-DEADLINE: Honor the Windows console input deadline #498

Closed
opened 2026-11-26 20:18:05 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/447
Author: @ettehn
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: fix/windows-console-input-deadline


📝 Commits (1)

  • 5523b44 Honor the Windows console input deadline

📊 Changes

2 files changed (+47 additions, -16 deletions)

View changed files

📝 tests/test_leonida_tui.py (+37 -0)
📝 tools/leonida_tui.py (+10 -16)

📄 Description

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.

🔄 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/447 **Author:** [@ettehn](https://github.com/ettehn) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `fix/windows-console-input-deadline` --- ### 📝 Commits (1) - [`5523b44`](https://github.com/ubiquitarianism/leonida/commit/5523b441694bd6ad3e96956533daef94afa4eab3) Honor the Windows console input deadline ### 📊 Changes **2 files changed** (+47 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_leonida_tui.py` (+37 -0) 📝 `tools/leonida_tui.py` (+10 -16) </details> ### 📄 Description Claimed in the coordination issue as: [UI-WINDOWS-INPUT-DEADLINE](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123038456) ### 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:05 +01:00
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#498
No description provided.