Repository navigation
Bound translated fragment uniform reads to the NVN binding length - #1909
Closed
oz-rinkliff wants to merge 1 commit into
Closed
oz-rinkliff wants to merge 1 commit into
oz-rinkliff wants to merge 1 commit into
Conversation
Pass the binding length alongside the GPU address so reads preserve the valid prefix and return zero outside it. Test short, partially valid and rebound banks on Metal. The TTYD Peach doorway passes on Mac and iPad; the measured iPad frame-time cost remains open.
Fasen24-AI
added a commit
to Fasen24-AI/swordboiMacNative
that referenced
this pull request
Nov 10, 2026
…nds once to half), seedds#1909 (fragment uniform reads bound to the binding length), seedds#1901 (dispatch_overlap on for Ocarina), seedds#1459 (MetalFX takes agl_ndsr_vr, no-curve variants linear), seedds#1903 (render scale stubs for Ocarina; replaces the seedds#1497 ceiling we carried) Hand-resolved: the mesh draw keeps the task isolation of seedds#1842 and the copy paths our nvn_tex_level_range / DM_SHARPEN; seedds#1497's stub, test and BINDING entry go; the build-keyed rule names the render scale function (main+0x31d3200). Chain e906c7467690. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014eD437mxrMnW2UwLZhpwc7 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#1459 by PromethOps (open): DM_UPSCALER=metalfx takes agl's agl_ndsr_vr.pck networks too, and a variant with no curve and no power is drawn as one colour space: Ocarina of Time's upscaler is MetalFX's - seedds#1497 by givethesourceplox (open): Add a render-scale ceiling for Ocarina v131072 - seedds#1842 by ycarogabriel-lgtm (open): Ocarina of Time: opt-in task isolation (DM_NVN_ISOLATE_TASK), the Hi-Z task a5288 in command buffers of its own, a workaround for its GPU hangs on an M1 - seedds#1897 by Know-It-All-Brother (closed): HMMA with an f16 accumulator rounds once per 8 products, as Ampere does (chain change) - seedds#1901 by FifteenPen (open): The game's compute dispatches with no game barrier between them run side by side (profile key dispatch_overlap, on for Ocarina of Time): Kokiri Forest GPU p50 15.63 → 14.76 ms - seedds#1902 by fxd0h (open): HFMA2 rounds once to half, as Ampere does (chain change) - seedds#1903 by FifteenPen (open): Ocarina of Time takes the launcher's Render scale: the 3D views at that fraction of the game's own size, the dynamic resolution held at its top level (Kokiri Forest docked at 0.75: GPU p50 15.77 → 14.31 ms, 60 fps held) - seedds#1909 by oz-rinkliff (open): Bound translated fragment uniform reads to the NVN binding length
Fasen24-AI
added a commit
to Fasen24-AI/swordboiMacNative
that referenced
this pull request
Nov 10, 2026
…1909 seedds#1897 seedds#1917 seedds#1920 seedds#1936) and seedds#1902, ahead of merging main Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014eD437mxrMnW2UwLZhpwc7 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#1897 by Know-It-All-Brother (closed): HMMA with an f16 accumulator rounds once per 8 products, as Ampere does (chain change) - seedds#1902 by fxd0h (open): HFMA2 rounds once to half, as Ampere does (chain change) - seedds#1909 by oz-rinkliff (open): Bound translated fragment uniform reads to the NVN binding length - seedds#1917 by FifteenPen (closed): A draw that writes depth and samples its own depth attachment reads a copy of it: Ocarina of Time's light-blue dashes over the rock at Death Mountain Trail's cave entrance are gone - seedds#1920 by nawangwe (closed): A GPU-written span's sliver inside a texture does not make it the GPU's: Ocarina of Time's terrain tiles no longer vanish or show another tile's surface (seedds#1566) - seedds#1936 by TheGoldfish11 (closed): Write resolution-family image textures uncompressed
Owner
|
Thanks. Superseded by 26062f9, which bounds every translated uniform read to the size the game bound (a read past it gives 0, as on Maxwell), with you credited as co-author. Closing. |
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.
What and why
I reproduced #1860 on clean main at
a1e155a38524(chain38c7b39dc6fd). The M3 Ultra reported three failed Metal command buffers containing fragment shaderf1e0f08cc43e21e3, revoked the process's GPU access and exited with code 70.The NVN command records both the address and the size of a uniform binding. Generated Metal fragment shaders previously received only its address. TTYD's Peach sequence sometimes supplies 16 bytes for slot 11. Variant 6 reads a loop count at byte 2,304. A separate GPU test on clean main read a deliberately placed value at that offset even with the binding shortened to 16 bytes. I didn't capture the actual value from the hanging invocation.
This change supplies the bound length alongside each ordinary fragment constant bank read by the shader. Reads inside the binding still use the original GPU buffer. A partial vector preserves the bytes inside the range, and reads entirely beyond it return zero. The rule uses no title ID or shader key.
Checked
I rebased the draft onto
7479adf8. The gameplay builds and four-title comparison below useda1e155a38524, shader chain46beb3f34a2d; I reran the shader rewrite unit tests after the rebase. The rebase includes an upstream shader-package lookup change and produces a different chain hash.t_render_counter_overlapfailed its CopyBuffer0 check andt_render_enable_queuefailed nine checks. Both also failed on unmodifieda1e155a38524. The targeted fragment regression passed.46beb3f34a2dwith MetalFX and no logged GPU hang. Performance remains an open problem: I saw about 40 fps. In the final two 300-frame windows, median frame time was 25.14 and 26.06 ms and median GPU time was 22.96 and 23.96 ms. The older shader-specific padding build ended around 16.67 ms per frame at the same MetalFX resolution. These are different revisions and the frames are not synchronized.iPad performance follow-up
I also tried a separate build on the same base as the tested PR code, moving the partial-vector copy out of line (experimental chain
d26eeb03ba27). I reached the hallway again with MetalFX at 1920×1080 → 2420×1361 and no recorded GPU hang. The last two 300-frame windows had median frame times of 20.56 and 20.60 ms (about 49 fps), versus 25.14 and 26.06 ms (about 38–40 fps) in the first general-bounds run. Median GPU time in those windows fell from 22.96–23.96 ms to 18.48–18.64 ms. The MetalFX present pass stayed around 1.1 ms. These are end-of-run comparisons rather than a synchronized frame benchmark. The experimental iPad shader image was 23% smaller, but this still misses the 16.67 ms frame budget. The experiment is not part of the submitted diff.Docs
The TTYD game note links the new rendering reference entry and the symptom index has been regenerated. No game data or keys are included.