Apply published_mode(out) to staged temporary file before replacement,
and ensure write permissions (0o600) are restored in finally block
before attempting os.unlink, preventing stranded temporary files and
masked errors on Windows when permissions are restricted.
agent: yes
AI-assisted: yes
A truncated or malformed shaders/spirv/index.json could let the shaders stage report success and then leave the pipeline stage asking for another full translation. Treat a readable but malformed index as recoverable from completed shards, keep accepting a UTF-8 BOM index, and still reject a real empty merge. Also account for shaders/assets overlap in preflight free-space checks when both stages run.
Carried from the source patch in Sigtryggur-Mani-Gudmundsson's graphics-runtime-patches collection:
33ab48d3ea/README.md (recovering-a-damaged-shader-index)
AI-assisted.
tools/native_pso_hashes.py (#497) imports shader_carve, so
test_tool_startup runs it with --help; it took that as a wrong argument
count and exited 2, which fails the test on main. -h/--help now print the
docstring to stdout and return 0, like mesh_compute_vs.py.
Generate a deterministic hash-to-stage catalog alongside the translated shaders. Backfill an existing translation without disassembling it again, reject conflicting identities, and atomically replace a complete catalog.
Adapted from the GPL native stage index by enx, with the Xbox layout measurements by LooperSalty and KkelebekK.
Adapted-from: 5c175db901