mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1765] bvh_gpu_smoke: clean temporary work dirs, guard inputs, and publish --json atomically (BVH-GPU-SMOKE-WORK-CLEANUP-AND-JSON-SAFETY) #1777
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1777
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1765
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/bvh-gpu-smoke-work-cleanup-and-json-safety📝 Commits (1)
7122cf6bvh_gpu_smoke: clean temporary work dirs, guard --max-shared-memory/--json inputs, and write JSON atomically📊 Changes
2 files changed (+205 additions, -32 deletions)
View changed files
📝
tests/test_bvh_gpu_smoke.py(+110 -0)📝
tools/bvh_gpu_smoke.py(+95 -32)📄 Description
Claimed in the coordination issue as: BVH-GPU-SMOKE-WORK-CLEANUP-AND-JSON-SAFETY https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161287514
What and why
Hardens
tools/bvh_gpu_smoke.py:--game-dirtranslation work folder: Allocate auto-createdbvh_gpu_work_*folders viacontextlib.ExitStack+tempfile.TemporaryDirectoryso extracted/disassembled shaders fromXboxBvhBuilder.dllare always removed when the run finishes or aborts (leaving explicit--workintact).--max-shared-memory> 0: Reject zero or negative values upfront alongside--timeout/--heap-bytes.--jsonagainst directories and input paths upfront: Refuse a directory path or a path aliasing--game-dir,XboxBvhBuilder.dll,--spirv, or any*.spvinput viasame_report_pathbefore translating or invokingvk_compute_test.Path(a.json).write_text(...)(which crashed with an unhandledPermissionErrortraceback or risked partial writes) with_write_json_atomic(staging in destination directory,published_mode,replace_retry, and restoring0o600before unlinking on failure), returning exit code2cleanly onOSError.Adds 4 unit tests in
tests/test_bvh_gpu_smoke.py(Cli).Tested
Windows 11 x64 (
10.0.26100), Python3.14.7, CPU only with mockedvk_compute_test/ translation (no game files). Commit7122cf6d451382be00c5a78e55c1578a4ebdc140.python -I tests/test_bvh_gpu_smoke.py -v:main(bcaa13da) with all 17 tests: 4 failures, 1 error (leaked temp work dir, unvalidated--max-shared-memory/--jsoninputs, unhandledPermissionErroron read-only--json);python -I tests/test_ci_registration.py: 16 tests, OK.python -I tests/test_text_write_line_endings.py: 3 tests, OK.python -I scripts/check_no_game_data.py tools/bvh_gpu_smoke.py tests/test_bvh_gpu_smoke.py,python -m compileall -q tools tests,git diff --check: exit0.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.