Skip to content

Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d) - #1752

Closed
deanpektas27 wants to merge 2 commits into
seedds:mainfrom
deanpektas27:raw-pointer-resolve-once

Conversation

@deanpektas27

Copy link
Copy Markdown

What and why

Symptom. In Ocarina of Time (0400486024DEC000, v131072), the colour pass that draws the game's own task/mesh geometry took about 6 ms of GPU at the minimum dynamic resolution, 683x384. Nearly all of it was geometry: 5.8 ms, against 0.2 ms after it (measured with DM_NVN_GPUPROF_GEOM from #1751). The same geometry in the game's depth pre-pass costs about 0.2 ms. Dropping all mesh draws (DM_NVN_SKIP_MESH=1) removed about 8 ms a frame and the 40 ms spikes.

Cause. The 11 colour-pass mesh shaders read each vertex's attributes word by word through 5 pointers they load from a storage buffer. Each 32-bit load took its own trip through the raw pool table (Raw global memory lookups that start from their last entry). Even on a last-entry hit that is the entry's four bounds plus its two delta words, about 7 memory reads per word of data, at 253 to 506 loads per thread. The pre-pass versions read only the position and have 0 or 1 such load.

Change. General, in the translator (GlobalToStorage.ResolveRawRuns), for loads only:

  • Raw loads whose address is a base plus a constant offset c >= 0, as the decoder builds it, are grouped by the base's value. That value is the same SSA values, or the same pure integer operations of them (RawValueKey): the decoder computes a pointer plus a uniform register again for each instruction.
  • A run of two loads or more calls RawResolveRange once, at the nearest block that dominates its loads, with a base whose definition reaches that point. It finds the entry holding the whole range [base + min c, base + max c + 4): the entry it chose last, else the chunk's hint, else the search. It returns 0 when no single entry holds the range. The entry's delta is read there once.
  • Each load calls the resolved helper. A non-zero entry moves the address by the delta with no table read. Entry 0 takes the full per-access lookup as before: a run across two pools, into a gap, or through a pointer that is invalid on a path where the guarded load would not run.
  • The resolve only reads the table, so running it where a guarded load would not is harmless. Stores and atomics keep the per-access path, because the write log is per entry.

Reference entry: Raw global memory loads through one pointer that resolve its pool once. The game note has a line for it. Chain ad6a64058f5f.

In each larger colour-pass mesh shader this gives 506 lookups → 122 resolves, 490 resolved loads and 16 single lookups. The shader reloads its pointers inside each guarded block, so there is a run per block; the resolve's own last entry makes all but the first of each pointer's resolves a hit.

Checked

  • Tests:

    • New dm/gfx/tests/test_dmsh_raw_run.py (DMSH_TEST_XLATE). It checks the translated shape: three loads at +0, +4 and +12 through one pointer call the range helper once, before them, then the resolved helper three times, with no per-access helper left.
    • On the GPU, the two translated helpers read what the table names for 1,536 reads with one cache word over the cases: inside a pool, above 4 GiB through the hint, across two adjacent pools, from a pool into a gap, in a gap, and at address 0.
    • All 23 dm/gfx/tests/test_dmsh_*.py pass with the new translator. test_dmsh_pairs.py needs DM_GAME set.
    • tool_lock.py --check-tools, dm/tools/tests/test_nsp_chain.py, test_xlate_anycpu.py and test_docs.py pass.
    • dm/tools/tests/test_env_switches.py fails on main too, for unrelated switches. With this PR alone it would also list DM_NVN_GPUPROF_GEOM, which the reference entry names; DM_NVN_GPUPROF_GEOM: split each render pass's GPU time into geometry and pixels #1751 adds it.
  • Game run: The Legend of Zelda: Ocarina of Time (0400486024DEC000, v131072, Mac build), two runs on an M3 Max, both around Kakariko Village with DM_NVN_GPUPROF=every:300 DM_NVN_GPUPROF_GEOM=1: about a minute at one spot before, and a longer, more varied play after. So these numbers are indicative, not a matched A/B.

    300-frame windows from frame 1200 before (chain 3ee52af3ca18) after
    frame time p50 22.1 ms 18.8 ms
    frame time p95 38.9 ms 22.6 ms
    GPU p50 22.0 ms 17.1 ms
    GPU p95 38.3 ms 19.5 ms
  • Devices and OS: M3 Max (36 GB), macOS 27.0.1, Xcode 27.2.

  • regress.py check --games 0400486024DEC000: the only game with a local Mac build. Ocarina has no smoke.tsv route, so this is the static chain check only, with no boot. No other game was checked here; owners of games with raw global memory shaders (Donkey Kong Bananza's terrain and agl compute; the SDK vertex shader 588e242a52f5f7aa in Tears of the Kingdom and Wonder) are the ones to run it.

    The report was made before rebasing onto eed7c429: baseline bd979ced, candidate this change at chain 84e2efe99fef. The rebase brought only upstream's own chain change 51ecd693 (pixel output masks, other code), which conflicted on the generated dmsh_chain.h alone. The translator tests above were run again on the rebased tree.

## regress.py check (full): CHANGED

Baseline `bd979ced3ae6bad60bf86429a71d172297d93471` bd979ced3ae6, candidate `worktree` ab811a9152ae; Apple M3 Max, macOS 27.0.1, Xcode 27.2; 2980.4 s

| game | status | shaders (base → cand) | newly failing | newly building | changed MSL | interface (new / known) | boot | fps p50 | frame p99 ms | peak MB | prepare s | new RED |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OoT-dev `0400486024DEC000` | **CHANGED** | 42848/42848 → 42848/42848 | 0 | 0 | 2247 | 0 / 0 | – | – | – | – | – | – |

CHANGED: 2,247 shaders' MSL changed (reflection 0, variants 1,406), the shaders with a raw lookup. That matches the reference entry's count of Ocarina shaders with such a lookup (2,241 there). No shader newly fails, and no pipeline interface changed.

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run
  • A chain tool changed: dmsh_chain.py --header was run and dm/gfx/nvn/dmsh_chain.h is part of the change
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

https://claude.ai/code/session_01F2HonzMnSwhcWL1SPBk2PG

…ve its pool once: Ocarina of Time's colour-pass mesh shaders no longer look up the pool table for every word they read, frame time p50 22.1 → 18.8 ms and p95 38.9 → 22.6 ms on an M3 Max (chain ad6a64058f5f)

GlobalToStorage.ResolveRawRuns groups the raw loads whose address is a base plus a constant offset c >= 0, as the decoder builds it (low = base low + c, high = base high + carry, or the carry alone for a high word of 0), by the base's value (the same SSA values or the same pure integer operations of them). A run of two loads or more calls RawResolveRange once, at the nearest block dominating its loads, for [base + min c, base + max c + 4): the entry it chose last, else the chunk's hint, else the search, or 0 when no single entry holds the range; its delta is read there once. Each load calls the resolved helper, which moves the address by that delta with no table read, and takes the full lookup on entry 0. Stores and atomics keep the per-access path.

The 11 colour-pass mesh shaders read each vertex's attributes word by word through 5 pointers: 253 to 506 lookups a thread (about 7 memory reads per word), and the pass that draws them was 5.8 ms of geometry and 0.2 ms of pixels at 683x384. After: 122 resolves, 490 resolved loads and 16 single lookups in the larger ones; that pass about 3.5 ms, the main colour pass 2.8 → 1.4-2.2 ms with more draws, GPU p50 22.0 → 17.1 ms, and the game's dynamic resolution rises above its minimum again. Measured over a longer, more varied play than the baseline, so indicative.

dm/gfx/tests/test_dmsh_raw_run.py checks the translated shape and runs the two helpers on the GPU over runs inside a pool, above 4 GiB through the hint, across adjacent pools, into a gap, in a gap and at address 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F2HonzMnSwhcWL1SPBk2PG
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) docs Documentation shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders game: 0400486024DEC000 A game labels Nov 8, 2026
…earch at every raw lookup, and Ocarina of Time's compute pipelines for its foliage's reaction to a sword took 11.3 s to build the first time, a 12 s freeze; fresh builds of the slowest are 2.57 → 1.59 s and 2.33 → 1.44 s (chain 723dc3a3e17d)

EmitTableSearch emits the binary search of GlobalToStorage's raw pool table as a loop of GmemMapLog2 steps, for the per-access helper and for RawResolveRange. It runs only when the last entry and the hint both missed, but Metal inlines every helper at every call site, so the unrolled form was copied hundreds of times into each shader with raw lookups, and the resolves of the previous change added one more copy each (77e64b1d8200eac3: 2.57 s unrolled, 3.71 s with the resolves, 1.59 s with the loop; its metallib 508 → 290 KB). test_dmsh_raw_last.py and test_dmsh_raw_run.py read through the search on the GPU (gaps, adjacent pools, address 0) and pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F2HonzMnSwhcWL1SPBk2PG
@deanpektas27

Copy link
Copy Markdown
Author

Added bf4b0fb: the pool table's binary search is now a loop (EmitTableSearch), in the per-access helper and in RawResolveRange. Chain 723dc3a3e17d.

Why. Playing on the first commit, cutting the foliage that reacts to a sword in Kokiri Forest's hidden area (where the boulder circles the chest) froze the game for about 12 s. The [longframe] line shows 9 new pipelines taking 10,820 ms in one frame. The pipelines summary says compute pipelines: built 8, 11,278 ms building. They are built on the submit thread at their first dispatch.

The four large ones (77e64b1d8200eac3, 4b1f9bd05d7ac115, d8abf8a34811f8c6, e28c9a738fbd99fe) have raw lookups. Metal inlines the helpers at every call site, so the unrolled 13-step search was copied hundreds of times into each, and this PR's resolves added one more copy per resolve.

Fresh pipeline builds (newComputePipelineStateWithFunction on an M3 Max, each version compiled at -O2 so neither comes from Metal's cache):

shader main (unrolled) first commit with the loop
77e64b1d8200eac3 2.57 s 3.71 s 1.59 s
d8abf8a34811f8c6 2.33 s 3.46 s 1.44 s
e28c9a738fbd99fe 0.44 s 0.54 s 0.26 s

The first one's metallib is 508 KB on main, 654 KB on the first commit and 290 KB with the loop.

The search runs only when the last entry and the hint both miss. test_dmsh_raw_last.py and test_dmsh_raw_run.py take it on the GPU (gaps, adjacent pools, address 0) and pass, and so do all 23 test_dmsh_*.py.

Not yet measured: in-game frame time with the loop.

Still open, a separate host matter: compute pipelines are built on the submit thread at their first dispatch. A shader the prewarm list doesn't hold still pauses the game for its build, now about 40% shorter than on main.

The regression report above predates both this commit and the rebase. The 2,247 changed shaders are the same set.

@deanpektas27 deanpektas27 changed the title Raw global memory loads through one pointer resolve its pool once: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain ad6a64058f5f) Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d) Nov 8, 2026
Aznracer pushed a commit to Aznracer/Mighty-Green-Kokiri-Kid that referenced this pull request Nov 8, 2026
thomasruegsegger pushed a commit to thomasruegsegger/nxnative that referenced this pull request Nov 8, 2026
…chain header (chain 48f5dda3c8ff)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FifteenPen

Copy link
Copy Markdown
Contributor

A data point from our tree: there, vertex shaders already read raw memory 16 bytes at a time (four adjacent words as one load), and this PR's task/mesh-only port showed no measurable gain in Hyrule Castle Town (A/B, 2 walks before, 3 after, M4 Pro). Main has since made 64- and 128-bit raw loads one vector load (04419bc), so a measurement on current main would be the one that counts.

Know-It-All-Brother added a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…ument, dynamic table count, hint words 6/7): loads through one pointer at constant offsets resolve their pool once; main's 64/128-bit vector loads keep their helper; a resolved range whose end wraps past 2^64 takes entry 0 (the per-access path)
Know-It-All-Brother added a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…ites is rewritten too (the value keeps its flush; the add is Metal's); raw-load tests follow seedds#1663's table (count in entry 0, hint words 6 and 7, pointer site argument), and the seedds#1752 GPU test adds a run whose end wraps past 2^64
AmateurWizrd added a commit to AmateurWizrd/nxnative that referenced this pull request Nov 9, 2026
…1752, ported onto vector loads)

loads and seedds#1813's miss zeroing: a vector load joins its base's run and
reads through RawResolvedV2/V4; a lone vector load keeps its own helper.
Chain 64cad52bbad5.
Know-It-All-Brother added a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 10, 2026
…eedds#1663 with PR seedds#1752 ported onto them (pointer sites, dynamic table counts, 128-bit raw loads as one vector load), BarrierExits (a compute thread that returns before a barrier keeps arriving at the later ones), float atomic adds and the other Ryujinx changes this branch carries; dmsh_xlate rebuilt from these sources and dmsh_chain.lock updated
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 10, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
…e pointer resolve their pool once; seedds#1585's site path joins EmitAccess)

Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1585 by nafields (open): Raw global memory through a pointer read when the draw is bound: the host fills each fixed-offset pointer's pool range before the draw (chain 1ffcb6b77740)
- seedds#1751 by deanpektas27 (open): DM_NVN_GPUPROF_GEOM: split each render pass's GPU time into geometry and pixels
- seedds#1752 by deanpektas27 (open): Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d)
Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
…s), the resolved helper takes (lo, hi, site, entry, delta): without this no run was resolved; the two raw tests take the site

Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1585 by nafields (open): Raw global memory through a pointer read when the draw is bound: the host fills each fixed-offset pointer's pool range before the draw (chain 1ffcb6b77740)
- seedds#1752 by deanpektas27 (open): Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d)
Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
…), on top of the seedds#1585 site fix

Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1585 by nafields (open): Raw global memory through a pointer read when the draw is bound: the host fills each fixed-offset pointer's pool range before the draw (chain 1ffcb6b77740)
- seedds#1752 by deanpektas27 (open): Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d)
Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
…t raw loads as one vector load, occlusion conditions read once landed, dynamic-resolution stub; hand-merged with the seedds#1585 sites and the seedds#1752 resolved runs)

Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1585 by nafields (open): Raw global memory through a pointer read when the draw is bound: the host fills each fixed-offset pointer's pool range before the draw (chain 1ffcb6b77740)
- seedds#1752 by deanpektas27 (open): Raw global memory loads through one pointer resolve its pool once, and the pool table search is a loop: Ocarina of Time's colour-pass mesh shaders stop looking up the pool table per word (chain 723dc3a3e17d)
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 10, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 10, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
Know-It-All-Brother added a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 10, 2026
…eedds#1663 with PR seedds#1752 ported onto them (pointer sites, dynamic table counts, 128-bit raw loads as one vector load), BarrierExits (a compute thread that returns before a barrier keeps arriving at the later ones), float atomic adds and the other Ryujinx changes this branch carries; dmsh_xlate rebuilt from these sources and dmsh_chain.lock updated
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 10, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
@AmateurWizrd

Copy link
Copy Markdown
Contributor

Measurements for this change from Ocarina of Time (0400486024DEC000) on an M3 Pro (14-core GPU, 18 GB, macOS 27.3), and a port of it onto current main.

Port. GlobalToStorage.cs on main has the vector loads since this PR was opened, so this branch does not apply. AmateurWizrd/nxnative@11fa67fe (branch raw-load-on-vector-loads, on 2d3fb83b) carries the change onto them, with test_dmsh_raw_run.py (new) and test_dmsh_raw_last.py; source and tests only, the translator binary, lock and chain header need native_tools.sh and dmsh_chain.py --header. The 50 tests of test_dmsh_raw_run, test_dmsh_raw_last and test_dmsh_meshstage pass (12 skipped).

Measured:

  • Earlier, at the Kokiri Forest standing view on a line based on 04811a63: the foliage mesh pass 7.8 -> 3.0 ms, GPU p50 24 -> 15.5 ms per frame.
  • Today, on 0d84a3f7 with this port and Large mesh stage memory in a device slice: foliage mesh pass 2.86 -> 2.01 ms in Ocarina of Time on M3 Pro #2308 (mesh stage memory in a device slice), a 75 s Kokiri Forest route recorded from play and replayed read for read, unpaced, three runs each against main: GPU p50 20.61 to 20.80 -> 19.44 to 19.47 ms, hard spot (about 3,300 draws a frame) 21.49 to 21.57 -> 20.57 to 20.61 ms, 45.6 to 46.2 -> 48.6 to 48.7 fps. No new [RED] lines; all 42,848 shaders build. The two changes were not measured apart on the route.

neko973 pushed a commit to neko973/nxnative that referenced this pull request Nov 11, 2026
…orted onto vector loads (PR seedds#1752)

the pool table search is a loop) carried onto upstream's vector loads. Source and tests only: the translator binary,
dmsh_chain.lock and the chain header need a rebuild with dm/tools/native_tools.sh.
neko973 added a commit to neko973/nxnative that referenced this pull request Nov 11, 2026
…kept-entry cache, tests take the seven kept words; DM_GFX_SCALE (chain e87f5802f90a)

The port of PR seedds#1752 (AmateurWizrd's 11fa67f on main's vector loads) merged with the seven private words of the per-access
lookup: a resolved helper moves by the run's delta, and its fallback lookup keeps the cache. test_dmsh_raw_run and
test_dmsh_raw_last match one or more kept words and pass them in their GPU harness. DM_GFX_SCALE answers a graphics scale
tier; unset, the answer follows the operation mode as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
neko973 added a commit to neko973/nxnative that referenced this pull request Nov 11, 2026
… tested area at 59-60 fps), DM_PRESENT_LINK=0, the graphics scale tier, the final sweep and soak

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 12, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 12, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 12, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 12, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 16, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.

(cherry picked from commit d17df17)
stan69b pushed a commit to stan69b/nxnative that referenced this pull request Nov 18, 2026
…d the allocator pool tried and reverted

Game note, "For an iPhone or iPad build": a new current bullet for the iPhone 17 at the owner's
Kokiri spot. Its table gives the GPU span, the GPU work and the gaps before and inside
submissions, before and after A-2. Gameplay GPU p50 is 21-24 ms, under the cap's 33.3 ms, so
shader pull requests seedds#1752 and seedds#1833 were not tried. The frame is CPU-bound at 16-20 fps under
thermal state 1-2. The bullet records the uncapped A/B of A-2, and a command allocator pool of
128 that removed its waits but no frame time, at a cost of about 300 MB (not kept). Open:
translation cost, samples-passed reports, footprint growth. The CPU timeline the table was
measured with is a local diagnostic, not in this pull request.

rendering.md: the A-2 entry gets its measured result. A Found-on line in the note, and the
outdated iPhone line under "Not run on an iPhone yet" now points to the section.

(cherry picked from commit d17df17)
@seedds

seedds commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Thank you @deanpektas27 for the Ocarina of Time mesh-pass profiling and for pointing out both the repeated pool lookups and the unrolled table-search compile stalls (and thanks to @FifteenPen and @AmateurWizrd for the follow-up tests).

Closing this PR because both parts have now been superseded on main: commit 43e816d (PR #2769) moved the raw-global table search into a loop/shared helper, and commit 83493e9 coalesces dominated same-base raw global loads with a bounded two-page, zero-call lookup. Because main also moved to 64/128-bit vector raw loads since this PR was opened, this branch now conflicts and targets the old scalar path.

Checking whether current main matches your Ocarina of Time mesh-pass GPU timings and avoids the Kokiri Forest pipeline-build stall is still open; a fresh report on current main is welcome if any gap remains.

@seedds seedds closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants