Skip to content

Super Mario Bros. Wonder: the recorded seed list, the Metal 4 path on iOS and its g18p/g19p archives - #651

Open
oliverames wants to merge 2 commits into
seedds:mainfrom
oliverames:wonder-prewarm-manifest
Open

oliverames wants to merge 2 commits into
seedds:mainfrom
oliverames:wonder-prewarm-manifest

Conversation

@oliverames

@oliverames oliverames commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #653 for the pso_gpu profile key. Merge that PR first so the Wonder build includes both GPU archives.

The Wonder profile gets its prewarm seed list. Three files change in dm/games/010015100B514000/: pso_manifest.tsv grows from the 2-line placeholder to 3 comment lines and 1,855 rows (966 shader S rows, 876 render-pipeline R rows, 13 compute C rows), byte-identical to the app's own pso_user.tsv record; README.md gains the prewarm bullet in the ## Shaders section; game.tsv adds a # ---- Graphics ---- block with pso_mtl4 on and a new optional profile key row pso_gpu g18p g19p.

The symptom this answers measured on the record device: with the profile as it stands the app runs the MTLDevice path (no bases), so every pipeline no list names is compiled on the submit thread, inside the frame that draws it. In one 6.5-minute session 337 long frames carried 1,052 on-the-spot compiles (14.2 s of compile over 197 frames), the worst a single 1,014.6 ms frame with 142 pipelines; typical bursts 20–230 ms. The docs cover the machinery (The pipeline prewarm lists, Pipeline bases and the pipeline archive, The pipeline archive made offline); Breath of the Wild's note (Pipelines on a cold start) is the precedent.

The seed list

The 1,855 rows were recorded by play on an iPhone 19,4 (a Duo foldable, the applegpu_g19p GPU family, iOS 27.2) with update 1.2.1 on 2026-10-28 and -29. The record is the app's own pso_user.tsv (one line per pipeline as built, first-use order), and the route covered is the boot, the title, a save load, and the courses played, the opening world's first courses among them. Everything was validated before writing: all 966 S keys resolve against the profile's shader_map.tsv (16,269 keys); all 876 R rows were decoded (each pso_skey's embedded vertex and fragment keys) and every key resolves; the 13 C keys resolve; 0 malformed and 0 duplicate rows. On the record device the app's log states the prepare step replayed 760 lines (391 shaders, 368 render pipelines, 1 compute) in 0.06 s on 6 workers before the first frame, with "shader keys not in the shader map (another game version) 0"; the shipped file is the grown 1,855-row one. That replay is the evidence behind the rows, not gameplay acceptance, and it covers the recorded route, not the whole game.

The Metal 4 rows

pso_mtl4 on turns on, on iOS, what the Mac already runs by default: the pipeline archive made offline, the prepare step, the bases and the hybrid pipelines. pso_gpu g18p g19p names the GPU families the offline archive compiles for — g18p, the iPhone 17 family's A19/A19 Pro, and g19p, the Duo's — through a generic pso_gpu profile key that a companion pull request (branch profile-pso-gpu) adds to game.py, build_ipa.sh and the NSP script. Without that key change the pso_gpu row is inert and the archive builds for the script's default g18p; the profile branch alone is otherwise fully functional with today's main. As an archive probe on the Wonder shader build (this Mac, Apple M2 Pro, toolchain metalfe-32023.922), pso_offline.py --gpu g19p over the profile's pairs gives 3,698 pairs → 3,697 bases, 67 MB, 113 s, with planning 27.5 s; 1 pair is left to the device (layer write) and there are 0 function-constant pairs. Those numbers are Mac-side only; dm/games/README.md's pso_mtl4 row gains pso_gpu in the companion PR.

Tests

The branch is rebased onto a662f29. The generated patch index now includes Wonder's Metal 4 setting, and the launcher and packaging tests expect its new default. Mario 3D World retains coverage of profiles with Metal 4 off. All 27 launcher-settings, profile-packing and documentation tests pass. game.py loads the two rows. The S/R/C validation above covers the manifest's shader-table references.

What this change does not claim

No device acceptance yet. On the Duo the archive must open (the stamp/coverage probe at start); the hybrids must hold in gameplay; the prepare step's cold first-start build needs its measurement (that is the fallback when the archive is unusable); the steady-state GPU cost of the Metal 4 path on Wonder is unmeasured; and the memory cost of the bases (Wonder's other windows reach 2.2 GB resident) sits against the increased memory limit. Until a device run says otherwise the current install stays as it is with the key off; with it on, a game whose archive fails to open falls back to the device's own prebuild exactly as the docs describe.

Files:

  • dm/games/010015100B514000/pso_manifest.tsv: 290 B → 782,541 B
  • dm/games/010015100B514000/README.md: +~930 B
  • dm/games/010015100B514000/game.tsv: +14 lines

seedds and others added 2 commits November 2, 2026 13:03
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