Repository navigation
Conversation
…leaves the files a shader build writes alone After a full Ocarina of Time build, mds_stores stayed at 100-156% CPU for more than 40 minutes with nothing else running, and mdfind found the build folder's .metal sources. Spotlight indexes every file under the home folder and reads the text of the .metal sources. The shader step writes a file per shader variant into shader/cache/b-<chain>/ before it packs them into one: 195,157 for Ocarina of Time, 42,850 of them .metal. That build was made before the libraries and the compile cache became one file each, so its folder kept them, with 311,903 more files in the cache. On macOS 27 only a folder whose name ends in .noindex keeps Spotlight out; a .metadata_never_index file inside does not (lunks, PR seedds#1355, which names the temporary folder so). The shader folder is SHADER = 'shader.noindex'. A shader/ from before moves there before any step reads it. A rename keeps every file and its times, and no step's key holds the folder's path, so the split, the libraries and the compile cache are reused and nothing is translated again. The first build after the move packs the Mac app again, as pack_app.py's key names its inputs' paths. When both names exist (an older checkout made shader/ again), shader/ stays and a [NOTE] line names it. bench.py, regress.py and bug_report.py read either name. Measured on a MacBook Air M4, macOS 27.2, with APFS clones of that build folder's subfolders in a folder Spotlight indexes, as the CPU of mds, mds_stores and mdworker_shared above idle until it settled: - a sixteenth of b-<chain>/ (11,973 files): 152 s, at up to 772%; about 2,500 s for the whole folder a shader build writes. Deleting them: under 1 s. - a sixteenth of the old compile cache (19,839 files): 210 s; about 3,300 s for the whole. - pso/ (1,162 files) 33 s; patched_*/, profile/, tools/, font/ and app/ (45 files) 4 s; logs/ (15 files, one of 277 MB) 3 s; extract/ (a 26 GB RomFS.img) 2 s. So the shader folder is where the indexing is, and the other folders keep their names: logs/ and profile/ are also paths front ends read. A game benchmark ran in another session during most of this. Checked: CI's tool-test loop passes but for test_tree_tar.py's test_packs_a_quiet_folder_and_keeps_its_attributes, which fails the same on main on this Mac; lint_python.py has no new finding. The shader package and keys of that build, cloned: pkg.outputs.key matches split_output_key before and after the move. No build was run with this change. Front-ends: interface: the build folder's shader folder is shader.noindex/ instead of shader/ (cache/, ios/, vk/, gl/, pkg/ and the keys inside it, and the Mac run command's DM_MSL_DIR); a shader/ from before moves there at the next build. _Drafted with Claude; reviewed by me._
1 of 3 tasks
fpedrolucas95
added a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
…lder is named shader.noindex, so Spotlight leaves the files a shader build writes alone
gnosticgeek
pushed a commit
to gnosticgeek/nxforge
that referenced
this pull request
Nov 6, 2026
…rina of Time, with the reasons Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qteK29T18U8p1c9LsVY8g
gnosticgeek
pushed a commit
to gnosticgeek/nxforge
that referenced
this pull request
Nov 6, 2026
# Conflicts: # docs/agents/symptoms.md # docs/development.md # docs/reference/packing.md # scripts/bench.py # scripts/build_ipa_from_nsp.py # scripts/regress.py
Contributor
Author
|
Closing: since 9c2fb0c a build no longer keeps the per-shader files this measured (195,157 in |
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
After a full Ocarina of Time build,
mds_storesstayed at 100–156% CPU for more than 40 minutes with nothing else running, andmdfindfound the build folder's.metalsources (measurement on #1355). Spotlight indexes each file the shader step writes, and reads the text of the.metalsources:b-<chain>/holds a file per shader variant until the step packs them into one, 195,157 for Ocarina of Time. On macOS 27 only a folder whose name ends in.noindexkeeps Spotlight out; a.metadata_never_indexfile inside does not, as @lunks found in #1355, which names the temporary foldertmp.noindex.The shader folder is now
shader.noindex(SHADER). Ashader/from before moves there before any step reads it: a rename keeps every file and its times, and no step's key holds the folder's path, so the split, the libraries and the compile cache are reused and nothing is translated again. The first build after the move packs the Mac app again, sincepack_app.py's key names its inputs' paths. When both names exist (an older checkout madeshader/again),shader/stays and a[NOTE]line names it.bench.py,regress.pyandbug_report.pyread either name.This is independent of #1355: it is based on main and does not touch the temporary folder. @lunks will rebase #1355 on whichever lands first; a trial merge of the two branches (
git merge-tree) has no conflict.Which folders Spotlight spends its time on
MacBook Air M4, 24 GB, macOS 27.2. APFS clones of the subfolders of that Ocarina of Time build folder went into a folder Spotlight indexes (
~/nxnative-spotlight-test, never the real build folder), one at a time. The figure is the CPU ofmds,mds_storesandmdworker_sharedabove their idle level, sampled each second until the minute's mean was back at idle.mdfindfound every entry of the shader,pso/,logs/andextract/clones afterwards. The two shader samples are the files whose names start with0, a sixteenth.shader/cache/b-<chain>/, a sixteenthshader/cache/cas/(beforecas.db), a sixteenthpso/patched_v131072/,profile/,tools/,font/,app/logs/(one log of 277 MB)extract/(a 26 GBRomFS.img)About 5,800 s for the shader files of a build folder from before the one-file libraries and cache: an hour or more at 100–156%, which covers the more than 40 minutes seen. On main the libraries and cache are one file each at rest, but a shader build still writes
b-<chain>/, about 2,500 s of indexing for Ocarina of Time. Every other folder together took 42 s, so they keep their names;logs/andprofile/are also the paths docs/frontends.md gives front ends. Importers (mdimport -t):.metal,.tsvand.loggo through the RichText importer, which reads their text;.json,.metallib,.mtl4aandRomFS.imgget none. A game benchmark ran in another session during most of the measurement.Checked
dm/tools/tests/test_*.py,dm/ios/tests/test_*.pyanddm/gfx/tests/test_*.pywithDM_GAME=010015100B514000andDMSH_TEST_XLATEset: 154 files, all pass buttest_tree_tar.py'stest_packs_a_quiet_folder_and_keeps_its_attributes, which fails the same on main on this Mac (the 14dm/gfx/testsfiles that compile Metal ran with Xcode 27.2'sDEVELOPER_DIR, as the selected Xcode beta has no Metal toolchain). New:test_nsp_chain.pySpotlight(the move keeps contents and times, the new name wins over a leftover, a link is left alone, nowork / 'shader'left in the script,bench.pyreads the same name),test_nsp_work_dir.pytest_shader_folder_from_before_moves_first(main moves it before any step),test_bench.pytest_shader_folder;test_bug_report.py,test_regress.pyandtest_nsp_mac_app.pyfollow the name.lint_python.pywith the pinned ruff 0.17.2 and pyright 1.1.414: no new finding.pkg.outputs.keymatchessplit_output_keybefore and aftermove_to_noindex.regress.pyonly finds the shader folder by either name now (its tests pass);regress.py checkwas not run.Front ends
Front-ends: interface: the build folder's shader folder is shader.noindex/ instead of shader/ (cache/, ios/, vk/, gl/, pkg/ and the keys inside it, and the Mac run command's DM_MSL_DIR); a shader/ from before moves there at the next build.
Docs
docs/reference/<subsystem>.mdentry (Spotlight indexes the files a shader build writes), andpython3 dm/tools/docs_symptoms.pywas run (the symptom index).docs/development.md, the bug report form and the two game notes that namedshader/follow the name.Drafted with Claude; reviewed by me.
🤖 Generated with Claude Code