Repository navigation
Shader library on a full drive: no .part left behind, and one red line instead of a traceback - #2610
Open
Haseenesss wants to merge 2 commits into
Open
Haseenesss wants to merge 2 commits into
Haseenesss wants to merge 2 commits into
Conversation
…emporary file On a full drive, shader_lib.write left the half-written <library>.img.part on disk, up to the size of the whole library, and dmsh_build.py's fallback then tried to write the same shaders into the folder with that space still taken (LNPANDY/NX2Apple#1265: 131,426 iOS shaders, the image and then the folder failed with ENOSPC). A failed write or rename now removes the .part and raises the same error; _Files.to_file does the same with its .tmp file. A killed write still leaves only the .part, which remove_image clears before the next full build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a folder, stops the build with one red line When publish_library could not write the image, it wrote the staged outputs back into the folder. On a full drive that failed too, and the OSError from shader_cache's to_file ended the stage with a traceback (LNPANDY/NX2Apple#1265: 131,426 iOS shaders, eleven hours, then [Errno 28] twice). The second failure now stops the build with one [RED] line naming the folder and the error, and saying that the compiled shaders are in the shader cache: publish_cache stored each one when it finished, so a build again in the same work folder takes them from there. The staged entries are left as they are. Only the failure path changes; a library that is written is the same as before. DMSH_CHAIN moves with dmsh_build.py (dmsh_chain.py --header). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A player's iOS shader build filled the drive at the very end (LNPANDY/NX2Apple#1265, Windows, 131,426 shaders, about eleven hours).
publish_librarycould not write the image, tried to write the shaders back into the folder, failed again, and the stage ended with a Python traceback.Two commits:
tools/shader_lib: a failedwriteremoves its.part, and_Files.to_fileremoves its.tmpfile. Before, a failed image kept up to the whole library on the drive. The folder fallback then had even less space.chain/dmsh_build: when the folder cannot take the shaders either, the build stops with one[RED]line. It names the folder and the error, and says that the compiled shaders are in the shader cache, so a build again in the same work folder reuses them. The staged entries are kept.dm/gfx/nvn/dmsh_chain.hmoves with it.Only the failure path changes. A library that is written is the same as before.
Checked
python3 -m unittest discover -s dm/tools/tests -p <file>fortest_shader_lib.py(new: a failed write and a failed rename leave no.partand keep an existing image),test_shader_cache.py(new:to_fileleaves no.tmp),test_shader_toolchain_cache.py(new: a full drive during the folder fallback exits with one red line, keeps the stage, and the cache still restores the shader), andtest_nsp_chain.py. All pass.regress.py check --games.Docs
dmsh_chain.py --headerwas run anddm/gfx/nvn/dmsh_chain.his part of the change🤖 Generated with Claude Code