Repository navigation
Translate the startup shaders on all cores when building - #27
Merged
Merged
Conversation
prepare_shader_seed.py sent all 8,290 startup shaders through one translator service, one at a time. It now starts one service per CPU core, gives each a share of the shaders, and merges the results in the original order. The output is byte-identical to the one-at-a-time run. On an Apple M4 (10 cores), 1.4.3 translation went from about 74 s to about 16 s. build_app.py also runs make with -j for the game binary, about 3 s less. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tvc97
added a commit
to tvc97/MacNativeGames
that referenced
this pull request
Oct 19, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream rewrote prepare_shader_seed.py (the shared shader list, agl .sharcb and game-module shaders, listed bind states, deps dedup), so the parallel translation is ported onto the new prepare(). Work is split per shader: a shader's default and listed jobs run in order on one translator service, because whether a listed job is translated and kept depends on that shader's earlier results. The results are then taken in job order. Checked against upstream's script on the same 1.4.3 RomFS and modules (Apple M4, 10 cores): all 44,885 output files, the 84 skipped and pso_manifest.tsv are identical. Translation took 166.1 s, now 28.5 s; the whole step took 203.8 s, now 64.7 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tvc97
added a commit
to tvc97/MacNativeGames
that referenced
this pull request
Oct 19, 2026
…y05010419#38) Conflicts resolved toward the refreshed PR branches: nvn_mtl.m from perf/async-shader-loading (ly05010419#30 on current upstream) plus ly05010419#13's parallel warm-up and the precompiled-library hit/miss log; prepare_shader_seed.py from perf/parallel-shader-seed (ly05010419#27); runtime/cheats.c kept in every runtime target and in loader.c. AGENTS.md stays tracked here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ly05010419
added a commit
that referenced
this pull request
Oct 19, 2026
…tops the others when one fails (after PR #27) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AZC16EYkS2AmLMgumTJaXJ
tvc97
added a commit
to tvc97/MacNativeGames
that referenced
this pull request
Oct 19, 2026
…mods, shortcut status, 1.4.3 world survey, shader list) Conflicts: - nvn_mtl.m pso_get: kept the async pipeline path (ly05010419#30) with upstream's sampler border colour emulation, as on perf/async-shader-loading (6d4cbfb); pso_pend_kick builds from the key's fsfn. - game_patches_v143.c: our overlay scene-size manifest beside upstream's runtime_output_size_current. - frontend.m: upstream's live shortcut status. - README: upstream's text; key 3 keeps "native high resolution". - prepare_shader_seed.py: upstream's follow-up to ly05010419#27 (8 services, stop on failure). - shader_list.tsv: upstream's list, which already holds every row of ours. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ly05010419
added a commit
that referenced
this pull request
Oct 20, 2026
…ultrawide HUD, 1.4.3 survey, mods, controls.txt) into the Breath of the Wild branch Resolved by hand: nvn_mtl.m (PR #34's paged-bitmap serial sets keep the serial forgetting of 635fb31: totk_serial_del clears a bit; the memory line shows both; the BotW frame reset stays in mtl_present), build_app.py (make -j and the per-game launcher defines), the Makefile (the BotW targets and the Opus test), loader.c (the #57 stale-reference handler and 1.4.3's survey return address are TOTK-only: Breath of the Wild has no GAME_ADDR for them), world_survey.c (BotW keeps its stub, with runtime_survey_sync), README (both update-history rows). Found by the merged build: Breath of the Wild lacked runtime_output_size_current (frontend.m's shortcut text) and runtime_survey_sync (hle_nvn.c); and the add-on content file handles shared fs_host.c's 0x200000000 range, so closing a host file at the title ended the game ("close invalid add-on content handle"): they now start at 0x400000000. Tested on the merged binaries: TOTK 1.2.1 jump session (anomalies 0, occlusion normal, serial set 48,606 / 13 pages), Breath of the Wild DLC + key 3 (k3a6) and key 2 (k2c, 11 of 12 pairs within 5 px). Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
Summary
prepare_shader_seed.pysends every translation job through onetotk_xlate --serviceprocess, one request at a time, so build step3/4 shadersuses one core. On 1.4.3 that is now 24,032 jobs: the startup shaders plus the bind states from the shared shader list.This PR starts one translator service per CPU core and splits the work per shader:
produced, deps dedup).jobsorder:rows(pso_manifest.tsv),completed,skipped, and each shader's.variants.build_app.pyalso passes-j<cores>to themake runtime…call.seed-manifest.json'spreparation_sha256covers this script, so an existingbuild/shader-seedis prepared again once after updating, and is reused after that.Updated after upstream's rewrite of
prepare_shader_seed.py(shared shader list,.sharcband game-module shaders): the parallel loop was ported onto the newprepare()and measured again.Measurements (Apple M4, 10 cores, macOS 27, TOTK 1.4.3)
Same RomFS, modules (
--modules rewritten/v143), translator, SPIRV-Cross and shader list. Fresh output folder each run, outside the repo.secondsinseed-manifest.json)main, one serviceseed-manifest.jsonhave the same SHA-256.pso_manifest.tsvis byte-identical, the 84skippedentries are identical, and so are 15,321 variants and 12,472 startup shaders. Onlypreparation_sha256andsecondsdiffer.make -j. A cleanmake runtime-v143goes from 15.0 / 14.5 s to 12.2 / 11.8 s. This gain is small becausenvn_mtl.mdominates the build.Tests
python -m unittest discover -s tests: all tests pass.git diff --check: clean.🤖 Generated with Claude Code