Skip to content

NVN: opt-in bounded compute dispatch ordering - #1887

Open
bmjask wants to merge 1 commit into
seedds:mainfrom
bmjask:codex/nvn-bounded-compute-ordering
Open

bmjask wants to merge 1 commit into
seedds:mainfrom
bmjask:codex/nvn-bounded-compute-ordering

Conversation

@bmjask

@bmjask bmjask commented Nov 9, 2026 •

Copy link
Copy Markdown

Buffer-only compute dispatches currently insert a copy-encoder barrier even when their complete read/write ranges are disjoint. This opt-in change tracks those ranges and skips only independent barriers. RAW, WAR and WAW dependencies with copies/dispatches remain ordered; unknown, indirect, image, sparse, unresolved and overflowing bindings fall back conservatively.

Extracted from #1663, independently based on main e3ad8255; no shader-chain change or image-quality reduction. Enable with DM_NVN_CS_RANGES=1, or use ab for existing A/B phases. Default remains off.

Historical A/B evidence

November 8, Apple M4 Max, crowded Market; recovered from this campaign's chat and cross-checked against its saved JSON reports. These measurements are from the combined playability branch, not a fresh comparison of this extraction against current main.

Comparison Control Candidate Interpretation
Stable late same-process ABBA cycle, mean GPU 10.580 ms 10.395 ms 1.75% lower; same host/shaders/save/window
Reverse-order process pair, FPS 93.6 94.9 Modest gain
Same pair, median GPU 10.72 ms 10.45 ms Matching GPU/CPU median clocks: 1578/4512 MHz
Same pair, frame p99 13.00 ms 14.55 ms Worse tail latency; keep experimental

The preceding 93.7/87.0 FPS pair had different clocks and is not a reliable gain/regression verdict. Source reports: compute-range-review.json, heavy-market/predicated-cs-ranges-ab-02/ab-review.json, compute-range-full-gfx-result.json, and compute-range-regress/report.md. The game note records scope and limitations.

Validation

On this extracted change: 6,986 focused GPU checks pass in each direct/deferred encoder mode with Metal API validation; 11 documentation checks pass. Tests cover real copy/dispatch results, dependency directions, capacity and conservative fallback, not just implementation counters.

Historical full graphics and local Ocarina regression passed on the combined source; the regression ran at 60 FPS (59.5/59.5), so it is correctness coverage only. This extraction has not received a renewed full gameplay regression or five-game validation. Ocarina is the only local game; other titles and iOS are untested. The current playable app was not replaced. That validation and a current-main performance comparison remain outstanding.

Reproducible evidence

Tested extraction: d3143a345fef9fd9ca79b263911203d38cd4d562. Test source at that commit; game note at that commit. Run on an Apple-silicon Mac with the repository's build dependencies configured:

make -C dm/gfx/tests GAME=0400486024DEC000 check_t_cs_ranges

Saved local test-output excerpt (not a new test run or a CI result):

compute range ordering: 6986 checks, 0 failed
compute range ordering: 6986 checks, 0 failed

Historical A/B figures above describe the older combined branch. They are not fresh performance validation of this extracted commit. The remaining gameplay/regression limitations above still apply.

Rebase validation — 2026-11-09

Current head: a157107714b58f7a1d1baf3e5946d546a8c9bded, one commit above upstream 9983d659e6101867215e4afe5dd6287ad8e0d4a3.

Full graphics check list: 126 test targets plus the two Python check targets passed on rerun. The focused compute fixture passed 6,986 checks in each encoding mode. An initial feedback timestamp assertion failed intermittently; the exact assertion also reproduced on unchanged upstream e121931, so this remains an upstream test limitation.

Mac fixtures were tested before the final upstream iOS-linker-only commit; verified that dm/ios/tools/gen_build.py is the sole subsequent file difference. Impact analysis was also run. No new gameplay A/B performance claim: historical figures above still describe the combined branch. Full current-chain game rebuild and gameplay regression remain pending; only Ocarina assets are locally available, and other titles/iOS are untested. The installed app and codex/ocarina-playability were preserved.

@FifteenPen

Copy link
Copy Markdown
Contributor

For comparison: #1901 removes the same barriers by following the game's own nvnCommandBufferBarrier calls (as draw_barriers game does for draw passes), per profile, rather than by proving buffer ranges disjoint. On main d8b2b64, Ocarina's kokiri-deck route docked: GPU p50 15.63 → 14.76 ms. The two could coexist: ranges for games whose barriers cannot be trusted, the profile key where they can.

@bmjask
bmjask force-pushed the codex/nvn-bounded-compute-ordering branch from d3143a3 to a157107 Compare November 9, 2026 13:49
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants