GPU-RUNNER-TEMP-ERROR: report temporary directory creation failures #1302

Merged
delysidemanYT1 merged 1 commit from upstream-pr/1302 into main 2026-12-01 15:14:59 +00:00
delysidemanYT1 commented 2026-11-24 21:33:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by delysidemanYT1 on 2026-11-24T21:33:55Z.


Claimed in the coordination issue as: GPU-RUNNER-TEMP-ERROR
Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145037818

When creating the default scratch directory fails, report the OS error, suggest a writable --work directory and exit with status 2 instead of a traceback. Explicit work directories still use the existing diagnostic. Temporary directories are still cleaned after the suite runs.

Verified on Windows: reproduced the uncaught PermissionError beforehand. After the fix, a mocked PermissionError returns 2, includes the OS error and --work hint, and does not start the suite. Also checked scratch cleanup for successful and failed suite returns. All 95 GPU runner unit tests and git diff --check passed. No GPU execution or game files required. AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480709820 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302). Originally posted by [delysidemanYT1](https://github.com/delysidemanYT1) on 2026-11-24T21:33:55Z. --- Claimed in the coordination issue as: GPU-RUNNER-TEMP-ERROR Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145037818 When creating the default scratch directory fails, report the OS error, suggest a writable --work directory and exit with status 2 instead of a traceback. Explicit work directories still use the existing diagnostic. Temporary directories are still cleaned after the suite runs. Verified on Windows: reproduced the uncaught PermissionError beforehand. After the fix, a mocked PermissionError returns 2, includes the OS error and --work hint, and does not start the suite. Also checked scratch cleanup for successful and failed suite returns. All 95 GPU runner unit tests and git diff --check passed. No GPU execution or game files required. AI-assisted (Codex).
fin-github commented 2026-11-24 21:41:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:41:38Z.

Review: COMMENTED


  • scripts/run_gpu_tests.py compiles. tests/test_run_gpu_tests.py (64) and tests/test_run_gpu_tests_paths.py (21)
    pass on the PR.

The change reads right: a failing mkdtemp() now gives an error and exit 2 instead of a traceback, and --work
keeps its old message. Nothing tests the new branch, though. A small case in tests/test_run_gpu_tests_paths.py
that patches tempfile.mkdtemp to raise OSError and expects exit 2 plus the "Pass --work" hint would keep it from
quietly regressing.

Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6047868266 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302#pullrequestreview-6047868266). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T21:41:38Z. **Review:** COMMENTED --- - `scripts/run_gpu_tests.py` compiles. `tests/test_run_gpu_tests.py` (64) and `tests/test_run_gpu_tests_paths.py` (21) pass on the PR. The change reads right: a failing `mkdtemp()` now gives an error and exit 2 instead of a traceback, and `--work` keeps its old message. Nothing tests the new branch, though. A small case in `tests/test_run_gpu_tests_paths.py` that patches `tempfile.mkdtemp` to raise `OSError` and expects exit 2 plus the "Pass --work" hint would keep it from quietly regressing. Tested on Windows 11 Pro 26200, CPython 3.14.4, applied on main 4a50cafc7. No GPU or game files used. AI-assisted (Claude Code).
zmasi commented 2026-11-28 21:18:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:18:47Z.


#1302 | head e8960d3c58 (merged cleanly with main aa918e5d9f) | python -I tests/test_run_gpu_tests.py + run_gpu_tests.main() tempfile.mkdtemp OSError and --work "" probes | red on main: unhandled OSError: [Errno 28] No space left on device when tempfile.mkdtemp(prefix="leonida_gpu_tests_") fails before try:, and --work "" silently fell back to tempfile.mkdtemp(...) (a.work or ...) while skipping finally: cleanup (a.work is None was false) | green on PR+main: 75 ran, OK (test_run_gpu_tests.py), mkdtemp failure exits 2 with error: cannot create a temporary GPU test directory: [Errno 28] No space left on device. Pass --work with a writable directory., and --work "" exits 2 with error: cannot prepare GPU test directory : The system cannot find the path specified (no traceback, no leaked temp dir) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited scripts/run_gpu_tests.py on Windows 11: moving if work is None: work = tempfile.mkdtemp(...) inside the guarded try ... except OSError block cleanly catches temporary-directory creation errors with exit code 2 and an actionable --work diagnostic while also rejecting --work "" instead of leaking an uncleaned temporary directory. Also verified tests/test_ci_registration.py and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245926512 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302#issuecomment-7245926512). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:18:47Z. --- #1302 | head e8960d3c58f0f998a19b0c9983110750ce5bebc6 (merged cleanly with main aa918e5d9f) | `python -I tests/test_run_gpu_tests.py` + `run_gpu_tests.main()` `tempfile.mkdtemp` `OSError` and `--work ""` probes | red on main: unhandled `OSError: [Errno 28] No space left on device` when `tempfile.mkdtemp(prefix="leonida_gpu_tests_")` fails before `try:`, and `--work ""` silently fell back to `tempfile.mkdtemp(...)` (`a.work or ...`) while skipping `finally:` cleanup (`a.work is None` was false) | green on PR+main: `75 ran, OK` (`test_run_gpu_tests.py`), `mkdtemp` failure exits `2` with `error: cannot create a temporary GPU test directory: [Errno 28] No space left on device. Pass --work with a writable directory.`, and `--work ""` exits `2` with `error: cannot prepare GPU test directory : The system cannot find the path specified` (no traceback, no leaked temp dir) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `scripts/run_gpu_tests.py` on Windows 11: moving `if work is None: work = tempfile.mkdtemp(...)` inside the guarded `try ... except OSError` block cleanly catches temporary-directory creation errors with exit code `2` and an actionable `--work` diagnostic while also rejecting `--work ""` instead of leaking an uncleaned temporary directory. Also verified `tests/test_ci_registration.py` and `scripts/check_no_game_data.py`.
TheGeogeo commented 2026-11-29 01:12:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:12:46Z.


Checked e8960d3c5 merged (no commit) with main 87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • This PR adds no test, so there is no red/green to show.
  • No regression: the tests around scripts/run_gpu_tests.py give the same result on main and on the merge (test_gpu_build_dir.py 18 OK, test_gpu_blocked_program.py 7 OK, test_f16_hw_words.py 40 passed and 4 more). test_build_runtime_fallback.py has 1 failure on main too.

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248634743 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302#issuecomment-7248634743). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T01:12:46Z. --- Checked `e8960d3c5` merged (no commit) with `main` `87a39df94`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - This PR adds no test, so there is no red/green to show. - No regression: the tests around `scripts/run_gpu_tests.py` give the same result on `main` and on the merge (`test_gpu_build_dir.py` 18 OK, `test_gpu_blocked_program.py` 7 OK, `test_f16_hw_words.py` 40 passed and 4 more). `test_build_runtime_fallback.py` has 1 failure on `main` too. No blocker from my side. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 18:49:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T18:49:27Z.


Checked e8960d3c5 against main 7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • No test in the PR. The missing one: in tests/test_run_gpu_tests.py, patch tempfile.mkdtemp to raise PermissionError and call run_gpu_tests.main() without --work. It should return 2, print cannot create a temporary GPU test directory, mention --work, and not start the suite. On main the call is outside the try, so the PermissionError escapes as a traceback.
  • No regression: tests/test_run_gpu_tests.py gives 75 tests OK on main and on the merge. The merge is clean, and check_no_game_data.py is clean.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260787413 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302#issuecomment-7260787413). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T18:49:27Z. --- Checked `e8960d3c5` against `main` `7c330c76d`: Python 3.12.4, Windows 11 10.0.26300, CPU only. - No test in the PR. The missing one: in `tests/test_run_gpu_tests.py`, patch `tempfile.mkdtemp` to raise `PermissionError` and call `run_gpu_tests.main()` without `--work`. It should return 2, print `cannot create a temporary GPU test directory`, mention `--work`, and not start the suite. On `main` the call is outside the `try`, so the `PermissionError` escapes as a traceback. - No regression: `tests/test_run_gpu_tests.py` gives 75 tests OK on `main` and on the merge. The merge is clean, and `check_no_game_data.py` is clean. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 11:40:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:40:39Z.

Review: APPROVED


Reviewed the diff against main: scripts/run_gpu_tests.py:810-825 cleanly catches OSError around tempfile.mkdtemp as well as os.makedirs and returns exit code 2 with an actionable message suggesting --work. Clean-room verified. Approving; awaiting a green CI run before merge.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130499499 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1302#pullrequestreview-6130499499). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:40:39Z. **Review:** APPROVED --- Reviewed the diff against `main`: `scripts/run_gpu_tests.py:810-825` cleanly catches `OSError` around `tempfile.mkdtemp` as well as `os.makedirs` and returns exit code 2 with an actionable message suggesting `--work`. Clean-room verified. Approving; awaiting a green CI run before merge. *(AI-assisted review.)*
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1302
No description provided.