Skip to content

Snapshot Mario Wonder's two same-pass feedback draws - #192

Closed
spedmo wants to merge 1 commit into
seedds:mainfrom
spedmo:wonder-feedback-snap
Closed

spedmo wants to merge 1 commit into
seedds:mainfrom
spedmo:wonder-feedback-snap

Conversation

@spedmo

@spedmo spedmo commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Problem

Super Mario Bros. Wonder showed flickering black 16×16 blocks during play on an Apple M6 Mac (v0, --platform mac-app). The blocks were pure black, aligned to the 16-pixel grid, and appeared in about one frame in 30, mostly in the lower left. The title screen and menus were clean.

Cause

Two full-screen post passes sample the 1920×1080 RG11B10F scene they render into: a7e5c6fd501cf21f (from GameAglShader) and 22a61cb1ec732aef (agl's agl_technique_pfx). Metal leaves that undefined. This is the same mechanism as Same-pass feedback read through a snapshot. That entry already named these two draws as ones to add to feedback_snap if they ever showed blocks. On an RG11B10F target the blocks are black instead of magenta.

Fix

The fix lists both keys in the profile's feedback_snap, which adds 2 snapshots a frame. There are no code changes.

Testing

Screenshots of the first course's opening dialogue, counted for whole black 16×16 tiles (Apple M6, macOS 27):

Setup Frames with blocks
DM_NVN_FB_SNAP=0 6 of 160
DM_NVN_FB_SNAP=all 0 of 80
DM_NVN_FB_SNAP set to the two keys 0 of 120
The two keys in the profile (rebuilt app) 0 of 150

The game note records the finding and the DM_CTL route. docs_symptoms.py was rerun and test_docs.py passes. It was not tested on an iPhone or on update 1.2.1, which uses the same two shader keys (shader_map.tsv).

🤖 Generated with Claude Code

Super Mario Bros. Wonder showed flickering black 16x16 blocks in courses
on an Apple M6 Mac (v0): its post passes a7e5c6fd501cf21f and
22a61cb1ec732aef sample the RG11B10F scene they render into, which Metal
leaves undefined. Listing both in the profile's feedback_snap makes them
read a snapshot. Screenshot counts in the first course: 6 of 160 frames
with blocks before, 0 of 120 with DM_NVN_FB_SNAP set to the two keys,
0 of 150 with them in the profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
seedds added a commit that referenced this pull request Oct 27, 2026
Super Mario Bros. Wonder showed flickering 16x16 blocks, black or neon
green (0, 252, 0), aligned to the 16-pixel grid: on an Apple M6 in v0's
first course (#192) and on an Apple M1 in 1.2.1's dialogue (#377). Two
full-screen post passes, a7e5c6fd501cf21f (GameAglShader) and
22a61cb1ec732aef (agl's agl_technique_pfx), sample the 1920x1080
RG11B10F scene they render into, which Metal leaves undefined. The same
keys run in v0 and 1.2.1. Listing both in the profile's feedback_snap
makes them read a snapshot taken before the draw, 2 a frame.

Screenshots counted for solid grid-aligned tiles that flicker: v0's
opening course 6 of 160 frames before, 0 of 150 after (#192); 1.2.1
from #377's save, the Poplin's dialogue in the Badge House, 23 of 158
before (22 black and 4 green tiles), 0 of 158 after, on the M6 (about
+0.05 ms submit, GPU p50 3.95 -> 4.27 ms). Not run on an M1 or an
iPhone.

Co-authored-by: spedmo <[email protected]>
@seedds

seedds commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks, this was the right fix. It's on main now as 1963fab, with you as co-author. The PR conflicted with main, so I applied it there by hand instead of merging.

I also checked it on update 1.2.1, using the save from #377 (neon green blocks in dialogue on an M1). The green blocks show up on an M6 too. They're the same bug: depending on the GPU, the read returns black or (0, 252, 0). With the save in the Poplin's dialogue in the Badge House, screenshots counting solid 16×16 tiles that flicker gave:

  • feedback_snap off (as on main before): 23 of 158 frames with blocks (22 black tiles, 4 green)
  • your two keys: 0 of 158

With the keys on, 1.2.1's log shows only a7e5c6fd501cf21f and 22a61cb1ec732aef being snapshotted, so 1.2.1 does use the same two keys. The cost there is about 0.05 ms of submit time and 0.3 ms of GPU time a frame. I updated the notes for 1.2.1 and the green colour.

A separate commit (35e1b6e) fixes the NSP script's shader split, which broke for Wonder after the switch to a single RomFS image: it gave zstd a path inside RomFS.img.

Closing as merged by hand.

@seedds seedds closed this Oct 27, 2026
seedds added a commit that referenced this pull request Oct 27, 2026
f646545 (launcher.json schema 1, #418) was made from a diff against a
branch based on 6138a54, so it also reverted the two commits main had
gained since: Mario Wonder's two same-pass feedback draws in
feedback_snap (1963fab, #192, #377) and shader_split feeding zstd the
bytes of a .zs file inside a RomFS image (35e1b6e). This puts their
seven files back as those commits left them; nothing else touched them
since. Found when a Mario Wonder Mac app pack failed its shader split
with zstd exit status 1 on every .zs file in RomFS.img.

Co-authored-by: spedmo <[email protected]>
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
seedds#377)

Super Mario Bros. Wonder showed flickering 16x16 blocks, black or neon
green (0, 252, 0), aligned to the 16-pixel grid: on an Apple M6 in v0's
first course (seedds#192) and on an Apple M1 in 1.2.1's dialogue (seedds#377). Two
full-screen post passes, a7e5c6fd501cf21f (GameAglShader) and
22a61cb1ec732aef (agl's agl_technique_pfx), sample the 1920x1080
RG11B10F scene they render into, which Metal leaves undefined. The same
keys run in v0 and 1.2.1. Listing both in the profile's feedback_snap
makes them read a snapshot taken before the draw, 2 a frame.

Screenshots counted for solid grid-aligned tiles that flicker: v0's
opening course 6 of 160 frames before, 0 of 150 after (seedds#192); 1.2.1
from seedds#377's save, the Poplin's dialogue in the Badge House, 23 of 158
before (22 black and 4 green tiles), 0 of 158 after, on the M6 (about
+0.05 ms submit, GPU p50 3.95 -> 4.27 ms). Not run on an M1 or an
iPhone.

Co-authored-by: spedmo <[email protected]>
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
5acb436 (launcher.json schema 1, seedds#418) was made from a diff against a
branch based on 0b0c9bf, so it also reverted the two commits main had
gained since: Mario Wonder's two same-pass feedback draws in
feedback_snap (679c65c, seedds#192, seedds#377) and shader_split feeding zstd the
bytes of a .zs file inside a RomFS image (0388e2d). This puts their
seven files back as those commits left them; nothing else touched them
since. Found when a Mario Wonder Mac app pack failed its shader split
with zstd exit status 1 on every .zs file in RomFS.img.

Co-authored-by: spedmo <[email protected]>
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