Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dm/games/01007EF00011E000/validated.tsv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The chain this game was last green on in scripts/regress.py check / baseline --record (one row per mode, the latest of each). Written by the harness, committed with the pull request.
# mode <TAB> chain=<DMSH_CHAIN> commit=<short SHA>[+dirty] date=<UTC day> machine=<model> macos=<version>. No game data.
full chain=e65a4ebd3322 commit=4a1f683018+dirty date=2026-11-01 machine=Mac16,7 macos=27.2
full chain=0ad559cdbb28 commit=ca080711d3 date=2026-11-04 machine=Mac16,7 macos=26.7.1
10 changes: 10 additions & 0 deletions dm/games/0400486024DEC000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ Run headless, `DM_CTL` at a control file. The work folder has `boot.sh <secs> <l

From an empty save: at about 45 s `A` (title), `A` (New Game), then the movie. From `save_ref`: at about 58 s `A~0.2`, 5 s later `A~0.2` (Load), 30 s later three `A~0.1` 3 s apart, then 12 s to the bridge outside Link's house. There `LUp~3.5`, `A~0.2` (Climb Down) and `LDown~4` three or four times reach the village floor.

## HDR output

With the HDR output setting, on the Mac app to the opening movie (M4 Pro, macOS 26.7.1, chain `cfcc3a82c78b`, 2026-11-06):

- Like [Donkey Kong Bananza](../040074A01BF12000/README.md#hdr-output), the game boots an RGBA8 window (format 0x25, 2560x1440), queries `vi::QueryDisplayHdrStatus`, then makes an RGB10A2 window (0x3d). It asks every frame (1,000 queries in 38 s) and queries the paper white (203 nits).
- It declares SDR 0 to 203 nits and extended 0 to 710, gamut 0 and tone mapping 0. No new `[RED]` line with HDR on.
- On an LG HDR 4K monitor with HDR off in macOS (potential headroom 1.00), `DM_HDR=1` answered SDR and the game kept its RGBA8 window. `DM_HDR=2` (HDR on any screen) made it switch. Not run on a screen with EDR, and the picture was not compared between the modes.
- On a MacBook Pro's XDR panel (M2 Pro, macOS 27.2, potential headroom 16, 2026-11-06) the player judged HDR to work and its intensity right. The declared extended range is min(peak, 3.5 × paper white): `DM_HDR_PEAK=400` gave 0..400, `DM_HDR_PEAK=1600` 0..710, and `DM_HDR_PAPER_WHITE=300` 0..1000 (its standard range 0..300). So the paper white also raises the highlights, and the peak counts only below 3.5 times it. With [HDR peak](../../../docs/settings.md#hdr-peak) Automatic the peak follows the screen's current headroom, which changes this game's range only while the headroom is under 3.5.

## Open

- Resolved: the build left 9 shaders out. Six foliage compute shaders used `ATOMG.CAS` ([Global memory: descriptors, ATOMG.CAS, INC / DEC](../../../docs/reference/shaders.md#global-memory-descriptors-atomgcas-inc--dec)); `1f78730053feb036` and `e172bd7ec218ab8e` nest 259 brackets ([Bracket nesting past the front end's 256](../../../docs/reference/shaders.md#bracket-nesting-past-the-front-ends-256)); `68bbe98b3bfd9876` (`Ampere instruction 481 at 0x0`) and five more map rows were no shaders at all ([A control section's words read as a BAHS entry](../../../docs/reference/shaders.md#a-control-sections-words-read-as-a-bahs-entry)), now gone from the map. None of the eight real ones was used on the walk to Kokiri Forest.
Expand Down Expand Up @@ -96,6 +105,7 @@ From an empty save: at about 45 s `A` (title), `A` (New Game), then the movie. F
- [A pipeline archive on an external drive is read into memory](../../../docs/reference/memory.md#a-pipeline-archive-on-an-external-drive-is-read-into-memory): 3.5 GB of swapped memory, now mapped.
- [A texture in a sparse pool came out CPU-written at its first use](../../../docs/reference/memory.md#a-texture-in-a-sparse-pool-came-out-cpu-written-at-its-first-use): found by the unit test, on this profile's `tex_dirty_upload`.
- [Textures made for GPU use kept from their CPU rewrites](../../../docs/reference/nvn-objects.md#textures-made-for-gpu-use-kept-from-their-cpu-rewrites): the terrain tiles' height, blend and hole maps rewritten as tile slots are reused; flat blue holes in the ground after an hour of play.
- [The status query and the present for an HDR window](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window): the same HDR window as Donkey Kong Bananza.
- [`EventFd` needs no network](../../../docs/reference/services.md#eventfd-needs-no-network)
- [No virtual audio input devices (SDK 22)](../../../docs/reference/audio.md#no-virtual-audio-input-devices-sdk-22)
- [`nn::ndve`'s movie enhancement file](../../../docs/reference/shaders.md#nnndves-movie-enhancement-file)
Expand Down
18 changes: 18 additions & 0 deletions dm/games/040074A01BF12000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,26 @@ Each step below stopped the boot before its fix:
5. Switch 2 SDK calls through services the host does not serve: `hid::InitializeJcms` and the Joy-Con mouse sensor (`hle_hid.c`), `oe::GetCurrentGraphicsScale` (`hle_oe.c`), `audio::IsDeviceOutputVolumeAutoTuneModeEnabled` (`hle_audren.c`), `streamplay` (GameShare, `hle_misc.c`), `vi` HDR / VRR / extended swap interval (`dm/gfx/hle_vi.c`).
6. `nv::InitCheck` (from `main+0xe19d04`, the start of a video decoder, after the first punch) tested the SDK's own flag, which `nv::InitializeGraphics` sets and the host's version of it does not: `hle_nv.c` answers it from the host's record. The same function then starts a video decoder: the Switch 2's `nn::codec` video API and sync point events, served on the host ([`nn::codec` video decoders taken over](../../../docs/reference/movies.md#nncodec-video-decoders-taken-over)).

## HDR output

The HDR output setting (Game section; Switch 2 games, Mac and iPhone) sets `DM_HDR=1`. Measured on this game only.

- The game creates its SDR window (format 0x25), queries `vi::QueryDisplayHdrStatus`, then creates an RGB10A2 window (format 0x3d) of SMPTE ST 2084 (PQ) code values. SDR white is 203 nits (code 594 of 1023 is 202.9 nits), and the extended range it declares is 0 to 1000 nits.
- The window is BT.2020 PQ, and the scene is Display P3 linear before the encoder. The PQ encoder shader (`359ddaa5bb1e298e_b`) reads a 3x3 matrix from constant-buffer entries 17 to 19. That matrix is 203 times the Display P3 to BT.2020 conversion, within 0.00006 RMS. It is the same from the title screen through the mining tunnel, and the encoder is the only shader that writes the window in the captured frames. Read as P3, the window's pixels have no negative channels; read as BT.709, 16% do.
- The game declares gamut 1 (`SetLayerNextHdrContentGamutMetadata`) for its SDR and HDR windows alike. The host drops the metadata calls and logs the first three of each.
- The status answer's format is 1 with HDR on: this game's SDK sets on to (format == 1) and fails a format above 1 with 0x272 (`nn::vi::detail::DefaultDisplay::QueryHdrStatus`, sdk+0x55bd60; found in pull request #1249). The game imports none of the SDK's HDR status event calls.
- It asks for the HDR status every frame (over 1,000 queries in 90 s at 30 fps), as Mario Kart World does, so it can follow the window to another screen, and queries the paper white (203 nits). With the layer's HDR10 metadata, in a window on the built-in screen of a MacBook Pro (M4 Pro, macOS 26.7.1), from the present call to on screen p50 per 300 frames: SDR 49.69 to 49.75 ms, HDR 49.58 to 49.65. Mode select reached either way, no `[RED]` line.
- The RGB10A2 PQ layer against the RGBA16Float one (`DM_HDR_LAYER=float`), same Mac, 90 s each in a window: the same HDR window (0x3d), present call to on screen p50 49.5 to 49.8 ms with either, no `[RED]` line ([the reference entry](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window)).
- `present.metal` decodes the PQ codes to linear light (1.0 at the paper white) into an RGBA16Float layer in extended linear BT.2020, whose HDR10 metadata lets Core Animation map the highlights into the screen's headroom.

## Open

- **Shader tables:** split them again with this game's files and compare: `shader_map.tsv` may hold agl rows that are no shaders ([A control section's words read as a BAHS entry](../../../docs/reference/shaders.md#a-control-sections-words-read-as-a-bahs-entry); `bahs_variations` already met one stray entry in `agl_common`), and if so the NSP script stops at the table check until the split's tables replace them.
- HDR: the gamut metadata value 1 has no name in the SDK modules, so what the game tells the system is unconfirmed. The pixels do not depend on it.
- HDR: the module holds a second row set for the same matrix, chosen by a flag bit in the function at main+0x7e3960. No captured frame used it, and its caller is not traced.
- HDR: only the title screen and the first gameplay area were captured.
- HDR: the peak (`DM_HDR_PEAK`, 1000) is the declared range.
- HDR: the Mac look was judged by eye on one MacBook, with the host's earlier roll-off, not with the metadata. On an iPhone 17 Pro (iOS 27.2, headroom 8) HDR shows on the PQ layer, toggled from the in-game menu. Open there: with HDR on only, the picture jumps back a frame now and then while the frame rate cannot hold 60 or 30, most visibly when the camera pans; with HDR off it holds a frame instead.
- **Video decoding:** the guide movies are VP9 and play (a 180-picture clip on loop in the tutorial's panel, read back as NV12). The player also imports the VP8, H.264 and AV1 decoders: VP8 and H.264 are served too (checked by `t_codec_video` only), AV1 is not ([`nn::codec` video decoders taken over](../../../docs/reference/movies.md#nncodec-video-decoders-taken-over)).
- **The gameplay picture:** the mining tunnel matches a YouTube capture of the same spot ([Rendering](#rendering) 7); nothing past the tunnel's first minute has been compared.
- Full shader build (about 75 minutes on the Mac from an empty cache): 22,852 of 22,852 shaders on chain 6f41726ef36d (SUATOM decoded; 22,850 on chain 3c66991eb439). Chain 9a0726336e9d had 22,834: the Metal compiler refused 11 (too deeply nested jump tables) and 5 used BRXU or REDUX ([Ampere shader code](../../../docs/reference/shaders.md#ampere-shader-code-switch-2)); 2 still do not translate (0x593).
Expand Down Expand Up @@ -95,3 +112,4 @@ Each step below stopped the boot before its fix:
- [Submissions handed to the GPU in segments](../../../docs/reference/frame-rate.md#submissions-handed-to-the-gpu-in-segments): a submission drawing into the target it inherited left those draws out of the segment's draw count (PR #1073).
- [A deferred write under a false guard](../../../docs/reference/shaders.md#a-deferred-write-under-a-false-guard): DK and Pauline bright white between Hilltop's rocks, from terrain captured into the environment cube with a placeholder material (issue #1100; fixed by the translator change found on Yoshi and the Mysterious Book, spot not revisited, reporter's test asked).
- [MUFU.SIN and MUFU.COS of a large number of turns](../../../docs/reference/shaders.md#mufusin-and-mufucos-of-a-large-number-of-turns): the SSAO's kernel rotation, (0, 0) past 2^20 turns, no ambient occlusion in the lower right: a corner wedge at the top of dynamic resolution (1152x648), a fifth of the picture with the effects at full size.
- [The status query and the present for an HDR window](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window): the window is RGB10A2 with PQ code values once the status reports HDR on (the HDR output setting).
15 changes: 15 additions & 0 deletions dm/games/0400C3F00006E000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ Whole groups of trees and bushes vanished or appeared in one frame while the cam

Resolved on the base game, on chain `d5fe9ae8bfba` (M6, 16 GB, another session's game running at the same time): at Crown City the array's `y` stays at or below 0.9 and the sky shots show no panels, and desert scenes checked with an earlier host that remapped the slots show none either. The first race, on the route of `measure.sh`, keeps a frame median of 16.6 to 16.7 ms and a 95th percentile of 17 to 18 ms, with GPU time 7.2 to 7.7 ms and resident memory 11.4 GB. That matches runs from before the fix, so reading real data costs nothing measurable there. One run reached 14 to 15 ms of GPU time and did not repeat. 1.8.0 has not been run here.

## HDR output

With the HDR output setting (`DM_HDR=1`), on the base game to the title screen on the Mac:

- Like [Donkey Kong Bananza](../040074A01BF12000/README.md#hdr-output), the game boots an RGBA8 window (format 0x25), queries `vi::QueryDisplayHdrStatus`, then makes an RGB10A2 window (0x3d). It declares the same luminance ranges, SDR 0 to 203 nits and extended 0 to 1000, and sets no content gamut before the title.
- The present decodes the window as PQ. A screenshot through `DM_NVN_SHOT_OUT` (decoded to SDR) shows the title with its colours and crop. No new `[RED]` line with it on.
- It asks for the HDR status every frame (over 1,000 queries in 80 s) and queries the paper white (203 nits). Its window moved to an SDR monitor (a Dell P3424WEB), the next query answered SDR and the game made its SDR window (0x25) again; moved back to the built-in screen, its HDR window (0x3d). Each move between the two screens dropped 6 to 82 frames of 300 around it; told HDR on any screen (`DM_HDR=2`), so that it never rebuilt its window, it dropped as many (7 to 81). The drops come from the move, not the rebuild.
- On the SDR monitor, its own SDR picture (`DM_HDR=1`) looked less saturated than its HDR picture mapped down by Core Animation (`DM_HDR=2`), by eye side by side. Which is better was left open.
- Its declared extended range is 0 to 1000 nits while it makes the HDR window, then 0 to 1801 at the title.
- Brighter than SDR, by the game's own grade: its title logo, the same image in both modes, is about 1.8 times brighter in linear light and more saturated in the decoded screenshot. That fits its SDR colours taken as Display P3 and drawn near 360 nits.
- The host's own highlight roll-off against Core Animation's mapping by the layer's HDR10 metadata, which replaced it ([the reference entry](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window)): side by side on the built-in screen they looked alike. In a window on the built-in screen of a MacBook Pro (M4 Pro, macOS 26.7.1), 80 s to the title each, `DM_PRESENT_SHOWN=1`. From the present call to on screen, p50 per 300 frames: SDR 49.58 to 49.68 ms, the host's roll-off 49.53 to 49.61, Core Animation 49.52 to 49.59. Every frame reached the display-link tick it was meant for (p50 within 0.03 ms), and each dropped 0 to 3 of 300 frames. The metadata adds no frame here.
- On a MacBook Air M5 (macOS 27.0.1, built-in screen), in play: with the RGBA16Float extended-range layer, black blocks with coloured squares in them flashed over the course map's water, now and then and after ⌘-Tab back to the game; the game's frames were clean. The RGB10A2 PQ layer has none, colours the same by eye ([the reference entry](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window)).

## Driving it on the Mac

The work folder `0400C3F00006E000-work` beside the dump has `rewrite.sh`, `rebuild.sh` (host copy `build/mkwhost`), `split.sh`, `shaders.sh`, `play.sh` (boots headless with `DM_CTL=run/ctl.txt`), `ctl.sh` (control lines; `wait S`, `snap NAME`), `to_race.sh` and `measure.sh <log>`. From a boot at the title (about 80 s): `to_race.sh` presses L+R, then A nine times with waits (Single Player, Grand Prix, Mario, the kart, the Mushroom Cup, 50cc, "Start Grand Prix?"). The opening and the race's start then take about a minute; `A~40` drives. `measure.sh` does all of this, waits for the race (over 1,500 draws a frame, no movie thread), and writes the timing and the `restop` residency lines to `run/<log>.res`. Control presses run in order, so `A~40` holds up later lines.
Expand All @@ -91,6 +104,7 @@ Update 1.8.0 (v917504, SDK 21.4.0) is not on this Mac. Pull request #1116 ported
- **Mesh draws:** `DrawMeshTasks3D` and the indirect forms are not implemented; no run reached them.
- `649e36162cad9e79`, a foliage shader with an 8x8 local size, keeps a first-invocation race: its setup loops over a uniform's count, so [the host cannot make it as stores](../../../docs/reference/shaders.md#a-store-only-a-dispatchs-first-invocation-makes). Its list's count read 0 in every one of 7,350 traced title frames, so the race had nothing to act on there; whether that list should be empty is not known.
- The engine class screen offers 50, 100 and 150cc in this build.
- **HDR:** only the title was run with HDR on. The window's primaries are taken to be BT.2020, as on Donkey Kong Bananza, but are not measured here. On an EDR screen the picture looked slightly brighter than SDR (by eye, one MacBook Pro). Fullscreen is not timed.

## Found on this game

Expand All @@ -105,6 +119,7 @@ Update 1.8.0 (v917504, SDK 21.4.0) is not on this Mac. Pull request #1116 ported
- [Comparisons with .FTZ](../../../docs/reference/shaders.md#comparisons-with-ftz)
- [Variable rate shading ignored](../../../docs/reference/rendering.md#variable-rate-shading-ignored)
- [Image views of the type a shader declares](../../../docs/reference/rendering.md#image-views-of-the-type-a-shader-declares) (the dark box around each kart's shadow, issue #1648)
- [The status query and the present for an HDR window](../../../docs/reference/rendering.md#the-status-query-and-the-present-for-an-hdr-window): the same HDR window as Donkey Kong Bananza's
- [A DualShock 4 that connects after the first stays on Core Haptics](../../../docs/reference/services.md#a-dualshock-4-that-connects-after-the-first-stays-on-core-haptics)
- [Identical controllers that GameController lists as one](../../../docs/reference/services.md#identical-controllers-that-gamecontroller-lists-as-one) (two Pro Controllers over USB, split-screen races)
- [Scaled shared memory addresses](../../../docs/reference/shaders.md#scaled-shared-memory-addresses)
Expand Down
6 changes: 6 additions & 0 deletions dm/games/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def fixups_keys(path): # '# KEY<TAB>value' header rows of a rewriter table
UNKNOWN_LANGUAGES = 'This game\'s files do not list its languages, so some of these may not be in the game. It may then show another one.'


def switch2(patched): # the sdk module names the Switch 2's build spec ("spec: Ounce"). dm_sdk_ounce (dm/host/loader.c) searches the loader's range (read-only data, data, bss) for it; this searches the whole file, a superset that gives the same answer on the local modules
path = Path(patched) / 'sdk.patched.bin'
return path.is_file() and b'spec: Ounce' in path.read_bytes()


def build(gid, patched, control):
platform = os.environ.get('SETTINGS_PLATFORM') or 'ios'
if platform not in ('ios', 'mac'): sys.exit(f'SETTINGS_PLATFORM must be ios or mac: {platform}')
Expand All @@ -75,6 +80,7 @@ def macro(name, n):
def shown(cond, n):
if cond == 'always': return True
if cond == 'languages>1': return len(langs) > 1
if cond == 'switch2': return switch2(patched)
if cond.startswith('fixups:'): return cond[7:] in keys
if cond.startswith('gfxapi:'): return os.environ.get('GFXAPI', '') == cond[7:]
if cond.startswith('platform:'): return platform == cond[9:]
Expand Down
Loading