Repository navigation
Remove stale shader library folders after a build and offer them in Free space - #231
Merged
Merged
Conversation
…Free space Every change to the shader chain translates all shaders again into a new b-<chain> folder, and nothing removed the old ones. A Breath of the Wild build folder held two (2.1 GB and 2.3 GB, 4.4 GB together), and each upstream update adds another. Patch 0032 (forwarded as seedds/nxnative#682): after a successful shader build the NSP script removes the b-<old> folders in shader/cache and shader/ios and their keys, and logs the freed size. A failed or stopped build keeps them. The Mac launcher's Free space sheet gets an "Old shader versions" row for folders that were left before this change or by another checkout. It lists the b-<12 hex digits> folders (and keys) that are not the current chain, with their sizes, and removing them costs nothing on the next build. The current chain is DMSH_CHAIN in the checkout's dm/gfx/nvn/dmsh_chain.h, read as the NSP script's chain_of() does. Without it nothing counts as old. The Shader output row stays as it is, and choosing both counts the old versions once. Strings in zh, en and sv, and the Qt table regenerated (the Qt front end has no Free space feature).
3 tasks done
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
This is a fix. Every change to the shader chain translates all shaders again into a new
b-<chain>folder, and nothing removed the old ones. A Breath of the Wild build folder heldb-157e1b96c8da(2.1 GB) andb-a78f966a7b38(2.3 GB) besides the current chain, 4.4 GB nothing reads, and each upstream update adds about 2 GB per game. The latest pin bump changes the chain again.b-<other>folders inshader/cacheandshader/iosand their keys, and logsremoved old shader libraries b-… (N GB). A build that stops or fails keeps the old libraries.shader_regressionshas run by then, and the next chain change compares with the folder that stays. The Metal compile cache is not touched. It is keyed by the MSL, shared across chains and never pruned, so it grows only with new MSL.b-<12 hex digits>folders and keys that are not the current chain, each with its size, and removing them costs nothing on the next build. The current chain isDMSH_CHAINin the checkout'sdm/gfx/nvn/dmsh_chain.h, read the waychain_of()in the NSP script reads it. Without a readable chain nothing counts as old. The Shader output row stays as it is, and picking both counts the old versions once.Issue: none existed, this PR is the issue (as #219 was). Upstream: seedds/nxnative#682.
Checked
python3 scripts/patches.py check,python3 -m unittest discover -s scripts/tests,python3 -m unittest discover -s frontend-qt/tests,dm/tools/tests/test_nsp_mac.pyandtest_docs.py,cd frontend && swift build -c release && swift test(443 tests, 0 failures). New Swift tests cover the chain read from the header, old versions listed with sizes and the current one kept, removal keeping the current libraries, the compile cache and look-alike names, no removal without a chain or during a build, and Shader output still removing everything.NX_LAUNCHER_CAPTURE_DIR=<dir> swift testcaptured the sheet with the new row (BotW sizes, two versions listed, row selected). The captures arefree-space.pngandfree-space-running.png, kept locally.Screenshots
The sheet with the new row between Shader output and Xcode project (captures kept locally, GitHub takes no upload from the command line).
Scope
patches.py checkpasses, statusforwarded seedds/nxnative#682forwarded seedds/nxnative#682