mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:20:51 +01:00
[PR #558] [MERGED] rdna2spirv: isolate and clean up index staging files (SHADER-INDEX-ATOMIC) #604
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#604
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/558
Author: @JiyouProt
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:codex/shader-index-atomic📝 Commits (3)
12833b5rdna2spirv: isolate and clean up index staging files (SHADER-INDEX-ATOMIC)62c061erdna2spirv: preserve published index permissionse4dc13bbuild: declare file_mode in translator dependency lists📊 Changes
5 files changed (+155 additions, -7 deletions)
View changed files
📝
.github/workflows/runtime.yml(+2 -0)📝
make_game.py(+1 -1)📝
runtime/cmake/translator_deps.cmake(+1 -0)➕
tests/test_rdna2spirv_index_write.py(+129 -0)📝
tools/rdna2spirv.py(+22 -6)📄 Description
Claimed in the coordination issue as: SHADER-INDEX-ATOMIC — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121429083
What and why
write_indexused the fixed sibling<index>.tmp. An existing file at that name was overwritten, a directory at that name blocked a valid write, and concurrent writers could replace or remove each other's staging file. Failed writes also left partial staging files behind.Use a unique temporary file in the destination directory, close it before publishing through the existing Windows-aware
replace_retry, and remove it if serialization, fsync or replacement fails (including interruption). Keep fsync, sorted JSON, LF output and atomic replacement. Temporary names do not match the shard-merge glob. No shader translation rule changes.Six synthetic regression tests reproduce the old behavior and cover an unrelated .tmp file/directory, serialization/fsync/replace failures, interruption and overlapping writers. The overlap test also checks that the shard glob sees only complete indexes.
Tested
Windows, Python 3.14.3, based on main
ece4ba5b31(current when this task started).python -I tests/test_rdna2spirv_index_write.py: 6 passed.python -I tests/test_rdna2spirv_merge.py: 30 passed.python -I tests/test_text_write_line_endings.py: 3 passed.make_game.py --help, no-game-data scan of both changed files andgit diff --check: passed.GPUs tested: n/a — index file publication only; fixtures are synthetic dictionaries. No game files needed or used.
AI-assisted: yes, with Codex.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.