Repository navigation
glb_writer: retry a replace hit by a sharing violation; test ab_control_flow's metadata filters (#425, #441 follow-ups) - #728
Conversation
…ol_flow's metadata filters Follow-ups to review points on two merged PRs. ItsNotRexed#425 (@SourNuht): write_glb said overlapping writers all publish complete files, but on Windows os.replace onto the same destination raises PermissionError while another writer is replacing it. 8 threads x 40 writes to one path failed 43-152 of 320 calls. A replace that hits PermissionError is now retried with a short backoff (about 1.3 s in total), Windows only; a lasting hold still raises and leaves the old file. Other errors are not retried. ItsNotRexed#441 (@ToxicmaggotRP): the stage, binding and feature filters were never reached by the tests (the rejected entries had no files, so they dropped out earlier), and only dispatch-side instability was tested. Tests only; each of those filters now fails a test when removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The staging file comes from NamedTemporaryFile, which creates it 0600, so every GLB written since ItsNotRexed#425 has been owner-only on Linux. The staging file now gets the replaced file's mode, or 0666 minus the umask for a new one, before the replace. Same issue @VictorJulianiR found in rtti_scan (ItsNotRexed#750). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Added 18c8092: the published GLB now keeps the replaced file's permission bits, or 0666 minus the umask for a new file. Before this, AI-assisted (Claude Code). |
|
Checked #728 (7410f5d) on Windows 11, Python 3.13.14:
(AI-assisted review, no game files.) |
|
Reviewed and tested 18c8092 on Windows 11 Pro (26300), Python 3.12.10: pass
Code read: the retry is limited to |
|
Tested 18c8092 on Linux (WSL2 Ubuntu), Python 3.12, CPU only: pass, with the same concern as #750
|
|
Thanks @kapitche. Correction to my description: what this PR added on top of main was the |
…the umask glb_writer._output_mode and rtti_scan._report_mode read the umask with os.umask(0) then os.umask(mask). The umask is process-wide, so any thread creating a file in that window got mask 0. A probe file created with mode 0666 gives the same bits (and honours a directory's default ACL) without changing anything. Raised by kapitche on ItsNotRexed#750 and ItsNotRexed#728. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the umask glb_writer._output_mode and rtti_scan._report_mode read the umask with os.umask(0) then os.umask(mask). The umask is process-wide, so any thread creating a file in that window got mask 0. A probe file created with mode 0666 gives the same bits (and honours a directory's default ACL) without changing anything. Raised by kapitche on ItsNotRexed#750 and ItsNotRexed#728. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups to review points on two merged PRs. Claimed in #634 (comment), new item.
#425 (thanks @SourNuht):
glb_writer.write_glbon Windows. The docstring says overlapping writers all publish complete files, but on Windowsos.replaceonto the same destination raisesPermissionError(a sharing violation) while another writer is replacing it. In the #425 review, 8 threads × 40 writes to one path failed 43–152 of 320 calls. Now_replaceretries onlyPermissionError, only on Windows, with a short backoff (about 1.3 s in total). A hold that lasts longer still raises and leaves the old file in place. Other errors are raised at once, as before. The docstring says so.#441 (thanks @ToxicmaggotRP):
tests/test_ab_control_flow.py. The stage, binding and feature filters insupported_pixel_shaderswere never reached: the rejected index entries had no disassembly or SPIR-V, so the file check dropped them first. Also, only dispatch-side instability was tested. This PR changes tests only, nottools/ab_control_flow.py. A new test gives every rejected entry valid files, so only its metadata can drop it. Another covers structured-side instability, including a form that times out on only one run.The #422 point (stale
docs/models.md) is left out: #650 rewrote that file, and the pin itself is tracked as BUILD-101.Tested on Windows 11, Python 3.13 (no GPU needed):
python -I tests/test_glb_atomic.py: 9 OK (4 new). The new thread test fails onmainwith dozens ofPermissionErrors and passed 8/8 runs with the fix.python -I tests/test_glb_writer.py,tests/test_world_build.py: OK.python -I tests/test_ab_control_flow.py: OK. I removed each of the stage, binding and feature filters and the structured-instability check fromtools/ab_control_flow.pyin turn. Each removal fails a test.python -m compileall -q make_game.py tools tests: OK.AI-assisted (Claude Code).
🤖 Generated with Claude Code