Repository navigation
fix: compile deeply nested NS2 Metal shaders offline - #1849
Merged
ly05010419 merged 1 commit intoNov 9, 2026
Merged
ly05010419 merged 1 commit into
ly05010419 merged 1 commit into
Conversation
This was referenced Nov 7, 2026
ly05010419
added a commit
that referenced
this pull request
Nov 9, 2026
…ep sources (after PR #1849)
ly05010419
added a commit
that referenced
this pull request
Nov 9, 2026
…(1395490241lhj-code) Preserve the contributor's original head.
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.
Generated Switch 2 MSL can exceed Metal/clang's default bracket nesting limit of 256, for example when translation turns an unrolled early-exit loop into nested blocks. Those sources currently fail offline compilation.
Select
-fbracket-depth=1024per deep source in the Mac app shader step and the translation-cache compiler. The app step applies this only to registered NS2 versions. Ordinary source commands, safe-math flags, SHA-based library names and compiler cache stamps remain unchanged, so existing libraries are reused. Compiler errors retain the existing reporting and cleanup behavior.The scanner and synthetic walk are adapted from seedds' nxnative work at
56b73f21; attribution is recorded inTHIRD_PARTY_NOTICES.mdunder the existing MIT notice.Validation against main
9fe3fdc1d08ce5e1a64d120f257d79cc2dc7c0ca:python -m unittest discover -s tests: 1,541 tests run, 169 skipped, no failures (201.175 seconds). Existing subprocess ResourceWarnings were emitted.git diff --checkpassed; read-only review found no blocking issue.Draft validation limits: no full game app or extracted shader corpus was rebuilt for this isolated patch. The bracket scan is intended for generated MSL, counts comments/literals too, and raises the limit only to 1024. This does not establish gameplay or performance acceptance.
Final upstream CI: run 42323956367 was cancelled at the existing 10-minute job limit. All four new bracket-depth tests passed on the hosted runner, including the real Metal compiler test. Before cancellation, the log recorded four failures in
test_settings_panel.SettingsPanel.test_current_modes_and_refresh(TOTK v1.4.3, compact/corners, overrides off/on). A control run on unchanged main at9fe3fdc1completed all 1,537 tests and failed those same four subcases on the settings-window height assertion. These PRs do not change that code. Full upstream CI is therefore not passing; the timed-out runs do not establish complete-suite acceptance.Independent CI repair: #1850 corrects the baseline settings height assertion and splits source tests while retaining the final
testgate and all eight UBSan checks. Its upstream run completed all 1,540 discovered tests without failures (8 skips) and passed all eight UBSan checks. That successful run is for the CI repair branch, not this PR: this PR's previous run remains cancelled and needs a rerun after the CI fix is available on its branch.Integration validation (2026-11-07): all three jobs passed on the exact combined commit
360180ae85f263e3fa57ffe6bceddfcab3855e63(fork CI run). This separate validation branch merges the unchanged heads of #1841, #1849, #1850, #1852 and #1856; none of these PR branches was rebased or expanded.