GPU-RUNNER-TEMP-ERROR: report temporary directory creation failures #1302
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1302"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).
Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:41:38Z.
Review: COMMENTED
scripts/run_gpu_tests.pycompiles.tests/test_run_gpu_tests.py(64) andtests/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--workkeeps its old message. Nothing tests the new branch, though. A small case in
tests/test_run_gpu_tests_paths.pythat patches
tempfile.mkdtempto raiseOSErrorand expects exit 2 plus the "Pass --work" hint would keep it fromquietly 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).Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:18:47Z.
#1302 | head
e8960d3c58(merged cleanly with mainaa918e5d9f) |python -I tests/test_run_gpu_tests.py+run_gpu_tests.main()tempfile.mkdtempOSErrorand--work ""probes | red on main: unhandledOSError: [Errno 28] No space left on devicewhentempfile.mkdtemp(prefix="leonida_gpu_tests_")fails beforetry:, and--work ""silently fell back totempfile.mkdtemp(...)(a.work or ...) while skippingfinally:cleanup (a.work is Nonewas false) | green on PR+main:75 ran, OK(test_run_gpu_tests.py),mkdtempfailure exits2witherror: cannot create a temporary GPU test directory: [Errno 28] No space left on device. Pass --work with a writable directory., and--work ""exits2witherror: 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: yesAudited
scripts/run_gpu_tests.pyon Windows 11: movingif work is None: work = tempfile.mkdtemp(...)inside the guardedtry ... except OSErrorblock cleanly catches temporary-directory creation errors with exit code2and an actionable--workdiagnostic while also rejecting--work ""instead of leaking an uncleaned temporary directory. Also verifiedtests/test_ci_registration.pyandscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:12:46Z.
Checked
e8960d3c5merged (no commit) withmain87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.scripts/run_gpu_tests.pygive the same result onmainand on the merge (test_gpu_build_dir.py18 OK,test_gpu_blocked_program.py7 OK,test_f16_hw_words.py40 passed and 4 more).test_build_runtime_fallback.pyhas 1 failure onmaintoo.No blocker from my side.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T18:49:27Z.
Checked
e8960d3c5againstmain7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.tests/test_run_gpu_tests.py, patchtempfile.mkdtempto raisePermissionErrorand callrun_gpu_tests.main()without--work. It should return 2, printcannot create a temporary GPU test directory, mention--work, and not start the suite. Onmainthe call is outside thetry, so thePermissionErrorescapes as a traceback.tests/test_run_gpu_tests.pygives 75 tests OK onmainand on the merge. The merge is clean, andcheck_no_game_data.pyis clean.AI-assisted (Claude Code).
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-825cleanly catchesOSErroraroundtempfile.mkdtempas well asos.makedirsand returns exit code 2 with an actionable message suggesting--work. Clean-room verified. Approving; awaiting a green CI run before merge.(AI-assisted review.)