GPU-TIMEOUT-OVERFLOW: Reject GPU timeouts that overflow platform waits #1350

Open
github-bot wants to merge 1 commit from github-bot/gh-1350 into main AGit
Owner

@⁠delysidemanYT1 on GitHub · 2026-11-24 22:12 UTC · original
delysidemanYT1:gpu-timeout-overflow → main · +4 −0 · 1 files · 1 commits · open

Claimed in the coordination issue as: GPU-TIMEOUT-OVERFLOW
Claim: #14

Reject finite positive LEONIDA_GPU_TEST_TIMEOUT values above the signed 32-bit millisecond wait limit before launching a subprocess. Preserve the default, fractional timeouts and the existing unlimited setting.

Reproduced the Windows OverflowError at 1e300. Checked seven accepted and rejected boundary cases with synthetic subprocesses. All eight GPU timeout unit tests passed. No GPU run. git diff --check passed. No game files. AI-assisted (Codex).

**@⁠delysidemanYT1** on GitHub · 2026-11-24 22:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1350) `delysidemanYT1:gpu-timeout-overflow` → `main` · +4 −0 · 1 files · 1 commits · open Claimed in the coordination issue as: GPU-TIMEOUT-OVERFLOW Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 Reject finite positive LEONIDA_GPU_TEST_TIMEOUT values above the signed 32-bit millisecond wait limit before launching a subprocess. Preserve the default, fractional timeouts and the existing unlimited setting. Reproduced the Windows OverflowError at 1e300. Checked seven accepted and rejected boundary cases with synthetic subprocesses. All eight GPU timeout unit tests passed. No GPU run. git diff --check passed. No game files. AI-assisted (Codex).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:48:22 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-24 23:25 UTC · original

Independent verification (AI-assisted, overnight review batch):

  • Checked out 5ca1539; diff is a single guard in runtime/test/shaders/check.py:694-697 (gpu_test_timeout).
  • Manual boundary checks (CPython 3.14.4, Windows): 1e300 now exits with the new diagnostic; 2147483 accepted, 2147483.5/2147484 rejected, 0/-1 still mean no limit, 0.5 accepted, non-numeric/nan still rejected by the existing check.
  • Reproduced the underlying hazard on this Python: subprocess.run(..., timeout=1e300) misbehaves (raises TimeoutExpired immediately rather than waiting), confirming huge timeouts break platform waits.
  • python -I -m pytest tests/test_gpu_test_timeout.py: 8 passed + 7 subtests.
  • py -3.14 -m compileall -q tools tests make_game.py: clean.
  • Minor note (non-blocking): the bound (2**31-1)//1000 = 2147483 is slightly conservative — 2147483.5 s would still fit in a signed 32-bit ms wait — but a ~24-day timeout difference is irrelevant in practice.
  • CPU only, no GPU, no game files. LGTM.
**@⁠whoalin1** on GitHub · 2026-11-24 23:25 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1350#issuecomment-7147391083) Independent verification (AI-assisted, overnight review batch): - Checked out 5ca1539; diff is a single guard in `runtime/test/shaders/check.py:694-697` (`gpu_test_timeout`). - Manual boundary checks (CPython 3.14.4, Windows): `1e300` now exits with the new diagnostic; `2147483` accepted, `2147483.5`/`2147484` rejected, `0`/`-1` still mean no limit, `0.5` accepted, non-numeric/`nan` still rejected by the existing check. - Reproduced the underlying hazard on this Python: `subprocess.run(..., timeout=1e300)` misbehaves (raises TimeoutExpired immediately rather than waiting), confirming huge timeouts break platform waits. - `python -I -m pytest tests/test_gpu_test_timeout.py`: 8 passed + 7 subtests. - `py -3.14 -m compileall -q tools tests make_game.py`: clean. - Minor note (non-blocking): the bound `(2**31-1)//1000 = 2147483` is slightly conservative — 2147483.5 s would still fit in a signed 32-bit ms wait — but a ~24-day timeout difference is irrelevant in practice. - CPU only, no GPU, no game files. LGTM.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1350/head:github-bot/gh-1350'
git switch 'github-bot/gh-1350'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1350'
git switch 'github-bot/gh-1350'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1350'
git switch 'github-bot/gh-1350'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1350'
git switch 'main'
git merge --squash 'github-bot/gh-1350'
git switch 'main'
git merge --ff-only 'github-bot/gh-1350'
git switch 'main'
git merge 'github-bot/gh-1350'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.