Skip to content

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
seedds:mainfrom
Haseenesss:shader-lib-full-drive
Open

Haseenesss wants to merge 2 commits into
seedds:mainfrom
Haseenesss:shader-lib-full-drive

Conversation

@Haseenesss

Copy link
Copy Markdown
Contributor

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_library could 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 failed write removes its .part, and _Files.to_file removes its .tmp file. 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.h moves with it.

Only the failure path changes. A library that is written is the same as before.

Checked

  • Tests: python3 -m unittest discover -s dm/tools/tests -p <file> for test_shader_lib.py (new: a failed write and a failed rename leave no .part and keep an existing image), test_shader_cache.py (new: to_file leaves 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), and test_nsp_chain.py. All pass.
  • Games run: none. The change is only on the full-drive path, which no game reaches, so I did not run regress.py check --games.
  • Devices and OS: M-series Mac, macOS 27.2.

Docs

  • A chain tool changed: dmsh_chain.py --header was run and dm/gfx/nvn/dmsh_chain.h is part of the change
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

Haseenesss and others added 2 commits November 14, 2026 08:29
…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>
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders labels Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant