Skip to content

Revert the HMMA chain change (bd9f422d): it puts dotted bands in Ocarina of Time's upscaled picture - #1576

Closed
NicoPV94 wants to merge 1 commit into
seedds:mainfrom
NicoPV94:fix/ocarina-ndsr-vr-bands
Closed

NicoPV94 wants to merge 1 commit into
seedds:mainfrom
NicoPV94:fix/ocarina-ndsr-vr-bands

Conversation

@NicoPV94

@NicoPV94 NicoPV94 commented Nov 6, 2026

Copy link
Copy Markdown

What and why

Symptom: on main (b2d46b8, M4 Max), everything Ocarina of Time (0400486024DEC000 v131072) draws in real time has dark, dotted vertical bands across the whole picture: a few pixels wide, about 64 output pixels apart, on Link, the grass and the scenery, in the opening's forest scene, Link's house and Kokiri Forest. The movies, the title, the menus' 2D and the HUD are clean. DM_UPSCALER=metalfx does not remove them.

Where: a colour dump of one frame (DM_CTL texdump) shows the scene's own targets at 1536x864 clean and only the upscaled 2048x1152 picture banded. That picture is written by agl_ndsr_vr.pck's compute network (f8965bffbdf51d78, then its HMMA shaders), which MetalFX does not replace (it takes agl_ndsr.pck's place only).

Cause: commit bd9f422, "HMMA chains keep their accumulators and A in the SIMD-group's matrices". With that commit reverted on top of main (the translator and dmsh_build.py's hmma_msl together; reverting only the translator leaves HMMA rewrite failed on 62 shaders), the same save, moment and screenshot draw without bands. Which of its flags gets this network wrong is not known yet. The commit's own reference entry says the NDSR upscaler loads none of its A where its LDSM read it, so the suspects are the accumulator slots, A reuse and C = 0.

Ruled out on the way:

Change: bd9f422 reverted: TensorPass.cs, InstEmitAmpereTensor.cs, HelperFunctionManager.cs, Instruction.cs, TransformPasses.cs, dmsh_build.py's hmma_msl and test_dmsh_hmma.py; the translator rebuilt, tool_lock.py --update-lock, dmsh_chain.py --header (chain 1681473c4e47). The commit's reference entry is replaced by one for the bands (Dotted bands in the variable-resolution NDSR upscaler's picture), and the game note says what is lost: the movie networks go back from 11.4 to 14.8 ms of compute a frame on an M6, as measured in bd9f422.

This is a revert, not the fix of the flag itself: it would be better to land bd9f422 again without whatever breaks agl_ndsr_vr, and the reference entry leaves that open. Until then, every Mac player of this game on main sees the bands.

Checked

🤖 Generated with Claude Code

…na of Time's upscaled picture (agl_ndsr_vr.pck's network); chain 1681473c4e47

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 6, 2026
@lunks

lunks commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for the bisect. #1544 fixes the cause: a plain HMMA call overwrote the chain waiting in slot 0, which is agl_ndsr_vr's, so the revert is not needed. In game, with the fix and #1456 kept: the dotted columns are gone (esdras-kyo, M5 Max; aksmith-git, M4 Pro, library rebuilt) and so are the horizontal rows (PucaVaz, M4 Air); see #1544. Could you try it? Chain 5c852d7989ac.

@NicoPV94

NicoPV94 commented Nov 7, 2026

Copy link
Copy Markdown
Author

Closing: 13b432b on main fixes the cause (a plain HMMA call overwrote the chain waiting in slot 0, chain d866f9700d78), so the revert isn't needed and the speed-up stays. Thanks @lunks and everyone who tested it.

@NicoPV94 NicoPV94 closed this Nov 7, 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.

3 participants