BVH-REHYDRATE-STAGE-CLEANUP: harden staged BLAS output and cleanup #915
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!915
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/915/head"
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?
@fitzypopper on GitHub · 2026-11-24 15:10 UTC · original
fitzypopper:bvh-rehydrate-stage-cleanup→main· +47 −0 · 2 files · 1 commits · merged 2026-11-24 20:32 UTCClaimed in the coordination issue as:
BVH-REHYDRATE-STAGE-CLEANUP(claim comment).tools/bvh_rehydrate.py's_publishwrote the staged BLAS withNamedTemporaryFile's mode and unlinked it on failure without making it writable first. On Windows a staged file carrying a read-only destination's mode cannot be unlinked, which masks the original error. This usespublished_mode(dest)for the staged file and, on failure, chmods it to0o600before unlinking, with cleanup errors suppressed so the original exception survives.New
tests/test_bvh_rehydrate_stage_cleanup.pypatchesos.replaceto fail, asserts the staged file is made writable and removed, and checks the previous output is intact. Verified red onorigin/mainand green with this change. The existing 18test_bvh_rehydrate.pytests still pass.No game data: synthetic bytes only.
check_no_game_data.pyand the line-ending test pass.AI-assisted: yes.
@aslan2142 on GitHub · 2026-11-24 20:32 UTC · original
Merged. This was compared with #828 for BVH-REHYDRATE-STAGE-CLEANUP. The
_publishchange is the same in both and matchesbvh_indexandnavmesh_index; this PR's test is the stronger one:os.replace, no.bvh_rehydrate-*file is left and the previous output is intact.mainand passes here, locally on Linux. It merges cleanly.Worth a follow-up: a test that an output with mode 0640 keeps it, and one for a read-only destination.
AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).