Skip to content

Ignore AppleDouble files in c1 guard - #555

Closed
ranamoeezhassan wants to merge 1 commit into
seedds:mainfrom
ranamoeezhassan:fix-c1-guard-appledouble
Closed

ranamoeezhassan wants to merge 1 commit into
seedds:mainfrom
ranamoeezhassan:fix-c1-guard-appledouble

Conversation

@ranamoeezhassan

Copy link
Copy Markdown
Contributor

Summary

On external drives, macOS may create binary AppleDouble sidecars named ._<file>. c1_guard.py selected every filename ending in .metal, so it tried to decode ._…_b.metal as UTF-8 and aborted with UnicodeDecodeError after all iOS shader libraries had compiled.

Exclude ._ sidecars from the scanner's Metal-source jobs. This lets the post-build metadata scan complete without changing shader compilation or cache behavior.

Validation

  • Ran c1_guard.py against the retained Mac shader outputs: completed successfully.
  • Ran cb_extent.py against the same outputs: completed successfully.
  • No shader build or Metal compilation was rerun.

seedds added a commit that referenced this pull request Oct 29, 2026
…ppleDouble files

On an exFAT or FAT drive macOS writes a binary AppleDouble ._<name>
beside each file. c1_guard.py took every name ending in .metal for a
shader's MSL, read ._<key>_b.metal as UTF-8 and stopped with a
UnicodeDecodeError after every library had compiled. cb_extent.py only
got past it by ignoring what it cannot parse; dmsh_mtlcache.py took
._<key>_b for a shader, found no readable reflection and filled the
Metal cache from none of that folder's libraries.

All three now take only the names dmsh_build.py writes, <16 hex key>_b...
.metal / .json, as dmsh_build.py (OUT_KEY) and regress.py already did:
c1_guard.py outputs (used by cb_extent.py too) and dmsh_mtlcache.py
OUTPUT. None of them is in the chain version.

test_nsp_chain runs both table tools on a folder with ._ files (the old
c1_guard.py stops on it); the Metal prefill test uses real key names and
plants ._ files. On 13 Sentinels' 751 shaders c1_full.tsv and
cb_extent.tsv are unchanged. Reference entry and symptom index line
added (GitHub PR #555). Regression check skipped.

Co-authored-by: Rana Moeez <[email protected]>
@seedds

seedds commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Thanks for the diagnosis — landed in 9791d74 (with you as co-author), in a more general form: instead of skipping ._ names in c1_guard.py alone, c1_guard.py, cb_extent.py and dmsh_mtlcache.py now take only the names the shader build writes (<16 hex key>_b….metal / .json, as dmsh_build.py's OUT_KEY). dmsh_mtlcache.py had the same problem quietly: a ._<key>_b.metal stopped it from filling the Metal cache from that folder. test_nsp_chain.py runs both table tools on a folder with ._ files, and the tables are unchanged on real outputs.

@seedds seedds closed this Oct 29, 2026
MIsaacM added a commit to MIsaacM/nxnative-lab that referenced this pull request Oct 30, 2026
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…ppleDouble files

On an exFAT or FAT drive macOS writes a binary AppleDouble ._<name>
beside each file. c1_guard.py took every name ending in .metal for a
shader's MSL, read ._<key>_b.metal as UTF-8 and stopped with a
UnicodeDecodeError after every library had compiled. cb_extent.py only
got past it by ignoring what it cannot parse; dmsh_mtlcache.py took
._<key>_b for a shader, found no readable reflection and filled the
Metal cache from none of that folder's libraries.

All three now take only the names dmsh_build.py writes, <16 hex key>_b...
.metal / .json, as dmsh_build.py (OUT_KEY) and regress.py already did:
c1_guard.py outputs (used by cb_extent.py too) and dmsh_mtlcache.py
OUTPUT. None of them is in the chain version.

test_nsp_chain runs both table tools on a folder with ._ files (the old
c1_guard.py stops on it); the Metal prefill test uses real key names and
plants ._ files. On 13 Sentinels' 751 shaders c1_full.tsv and
cb_extent.tsv are unchanged. Reference entry and symptom index line
added (GitHub PR seedds#555). Regression check skipped.

Co-authored-by: Rana Moeez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants