Nintendo Switch Sports Resort (04008E001F098000, Switch 2, v65536) gets its profile, note, games table row and README line: it boots from a dump folder through the safety and strap screens, the title, Select User and the sport menu into a doubles tennis match at 60 fps on the M6 (frame time p50 16.67 / p95 17.3-17.9 ms, CPU about 92% of one core), and starts again from its save; bymaxmarc played matches with motion from a Joy-Con 2 and a DualSense in a 37-minute Mac session (PR #2387). The profile is the NSP script's provisional one (heap check: a 7.47 GB heap, mem_reserve, depth_mode zero; address regions alias +2.82 GB of 4.38 GB in the first 15 s) with render_cond on: the game wraps draws in render conditions, and drawn anyway, Select User's background is grey instead of the court and the outfits black (in the menus only; FifteenPen measured the outfit material reading 0 from R and A of a shadow target the menu blurs under a channel mask of G and B). With the key both are right on the same route from the same save (A/B on the M6), so PR #2273 (a clear under a partial channel mask keeps the other channels) is not needed: what a console does there is not in the game's files, its nvnCommandBufferClearColor (sdk+0x652380) jumps through a pointer the system's NVN driver fills. The shader tables are the build's, byte for byte both port PRs'; pso_manifest.tsv is this Mac's own recording (3,474 shaders, 1,868 render, 41 compute and 22 task / mesh pipelines over a first start, the menus and a match), since none of the PRs' render or mesh pipeline keys matches the current host's. No game patch and no rewriter cut. The reference entries that name the game link its note; the conditional rendering entry lists it. Checked: test_docs, test_nsp_chain, test_env_switches, test_patches; the host test suite (make -k -C dm/host/tests run, 50 programs, 0 failed), check_t_pfv under Metal validation, test_dmsh_ampere_mem with the committed translator (86); lint_python (nothing new) and lint_c tidy on the changed C files (at the baseline after the fixes folded into their commits); regress.py check against 96259d45 (one run per side, headless, M6): Bastion 59.7 / 58.3 fps, its 70 s shot's purple border an old flake of both sides (the same colour in 10 of 19 earlier runs, origin/main's included), Obra Dinn 59.5 / 59.8 fps, CHANGED by animation phase, 0 changed MSL and no new red line on either. Not run: a point played on this Mac (the keyboard cannot serve: Shake and the ten scripted moves of PR #2386 move the racket but do not serve), sports other than tennis, the iPhone.

Co-authored-by: FifteenPen <[email protected]>
Co-authored-by: bymaxmarc <[email protected]>
This commit is contained in:
committed 2026-11-12 14:51:00 +08:00
1 parent 14a4c27385
commit f4b7e77c90
15 files changed
+27731 -14

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ These Switch 2 games have passed Mac gameplay testing. Build them from a [`.nup`
- [Kirby Air Riders](dm/games/040077201BE50000/README.md)
- [Mario Kart World](dm/games/0400C3F00006E000/README.md)
- [Mario Tennis Fever](dm/games/0400D4201C6EA000/README.md)
- [Nintendo Switch Sports Resort](dm/games/04008E001F098000/README.md)
- [Pokémon Pokopia](dm/games/0400A3A01EE4C000/README.md)
- [PRAGMATA](dm/games/0400C76024710000/README.md)
- [Splatoon Raiders](dm/games/0400380020056000/README.md)
+72
View File
@@ -0,0 +1,72 @@
# Nintendo Switch Sports Resort (`04008E001F098000`)
A Switch 2 game: update v65536 over the base game, SDK 22.2.10 built for the Switch 2 (`Ounce`), NVN2. Nintendo EPD's sead / agl / gsys with Havok. Modules `main`, `subsdk0` (the SDK's movie library) and `sdk`; `subsdk1` to `subsdk4` are not loaded.
**Runs on the Mac** (M6, macOS 27.2, 2026-11-12): from the safety and strap screens through the title, Select User, the sport menu and Tennis's settings into a doubles match, at 60 fps; a second start from its save. Scripted input cannot serve, so no point was played here ([Motion controls](#motion-controls)). bymaxmarc played matches with motion from a Joy-Con 2 and a DualSense on an M2 Max in a 37-minute session ([PR #2387](https://github.com/seedds/nxnative/pull/2387), with that pull request's versions of the host changes). Not run on an iPhone or iPad.
## What it needs
| Setting | Where | Why |
|---|---|---|
| `sys_resource 0x2000000` | [`game.tsv`](game.tsv) | the NPDM's 32 MB of system resource: virtual address memory |
| `mem_reserve 0x318000000`, `mem_alias 0x118000000`, `mem_stack 0x10000000`, `app_pool 0x240000000` | `game.tsv` | the Switch 2's 9 GB pool and the 7.47 GB heap the game asks for (the NSP script's heap check). In its first 15 s the game's regions reach alias +2.82 GB of 4.38 GB; bymaxmarc saw +3.26 GB in play |
| `depth_mode zero` | `game.tsv` | the game calls `nvnDeviceSetDepthMode` with near = 0, so the pipeline bases made before it runs take that mode |
| `render_cond on` | `game.tsv` | the game wraps draws in render conditions; drawn anyway, Select User's background is grey and the outfits are black ([Rendering](#rendering)) |
There is no game-specific patch and no rewriter cut. Everything else it needed is in the host, in general: see [Found on this game](#found-on-this-game).
## Files
- A dump folder (`base/`, `updates/65536/`): `build_ipa_from_nsp.py <folder> --platform mac` packs it with no keys. The display version is not known (a dump has no control data): the `build` row has `?`.
- The RomFS holds 48,576 files, 9.7 GB packed; the marker is `Tex/RBake_Scene_AnnaBoxingDesign00Scene_d1_t0.bntx.zs`.
- An FTP dump keeps a `.listing` in every folder. Packed with them, the game crashed at `main+0x9d7c60` listing its `Parameter` folders; the packer now leaves them out ([A dump tool's `.listing` files in the game's folders](../../../docs/reference/packing.md#a-dump-tools-listing-files-in-the-games-folders)).
## Shaders
- 11,059 shaders (`Nin_Ounce_NVN2` BNSH) in [`shader_map.tsv`](shader_map.tsv); a full Mac build takes about 9 minutes on the M6, 4:46 for a second one.
- 6 are refused (4 task, 2 mesh shaders of the sea, agl `AnnaSea`): their task payloads (21-28 KB) are past Metal's 16 KB ([issue #1753](https://github.com/seedds/nxnative/issues/1753); FifteenPen's [PR #2264](https://github.com/seedds/nxnative/pull/2264) passes them through a device buffer). No draw has been seen to use them.
- 612 pixel shaders read the fragment's shading-rate size; until it read 1 x 1 the sea and the avatars' hair and clothes were black ([The fragment's shading-rate size reads 1 x 1](../../../docs/reference/shaders.md#the-fragments-shading-rate-size-reads-1-x-1)).
- [`pso_manifest.tsv`](pso_manifest.tsv) is this Mac's own list (3,474 shaders, 1,868 render, 41 compute and 22 task / mesh pipelines): a first start, the menus and a doubles match. The pull requests' lists were recorded by an older host: none of their render or mesh pipeline keys matches the current one's.
## Rendering
- **Render conditions.** Drawn unconditionally (no `render_cond`), Select User's background is grey instead of the court and the outfits are black, in the menus only. FifteenPen measured why the outfits are black: their material shader `c30f0edd6c669a61` reads R and A of a screen-space shadow target that the menu blurs under a channel mask of G and B, and both read 0 there. With `render_cond on` the background and the outfits are right, on the same route from the same save (A/B, 2026-11-12) ([Conditional rendering evaluated at replay](../../../docs/reference/rendering.md#conditional-rendering-evaluated-at-replay)). FifteenPen's [PR #2273](https://github.com/seedds/nxnative/pull/2273), a clear under a partial channel mask that keeps the other channels, is not needed with it. What a console does with a clear under a channel mask is not known: the game's `nvnCommandBufferClearColor` (`sdk+0x652380`) jumps through a pointer the system's NVN driver fills, so the game's files do not show it.
- agl's upscaler packs its input into an RGB9E5 texture through an R32_UI render-target view; drawn in the base format the picture was solid red ([A render-target view of another class](../../../docs/reference/rendering.md#a-render-target-view-of-another-class-the-texture-is-upgraded-not-drawn-in-its-base-format)).
- `[RED] texture type mismatch` for shader `7309860342dd3b14_b` (a 2D texture declared where a 2D array is bound), once in a match; its effect is not checked.
## Frame rate
- In the doubles match on the M6 (window, 2026-11-12): frame time p50 16.67 / p95 17.3-17.9 ms, NVN submit and present about 3.4 ms, CPU about 92% of one core.
- bymaxmarc's measurements on the M2 Max (scene loads of 110-225 ms, a 250 ms GPU frame at boot) are in [PR #2387](https://github.com/seedds/nxnative/pull/2387)'s note.
- Out of focus the game pauses and its GPU queues wait on it for 6-10 s at a time (`[RED] queue 4: an event wait has held it …`); runs set `DM_FOCUS_KEEP=1`.
## Motion controls
- The game reads motion through the SDK's sensor fusion (`hid::UpdateSensorFusion` → `GetNpadImuSamples`) and supports Handheld | JoyDual only, so the keyboard, a DualSense or a single Joy-Con is shown to it as a Joy-Con pair ([The Npad IMU sample holds the acceleration first](../../../docs/reference/services.md#the-npad-imu-sample-holds-the-acceleration-first), [A controller in a style the game does not support](../../../docs/reference/services.md#a-controller-in-a-style-the-game-does-not-support)).
- Without a motion controller a point cannot be played. `Shake` does not serve; nor did any of ten scripted moves of bymaxmarc's [PR #2386](https://github.com/seedds/nxnative/pull/2386) (swings about ±x, ±y, ±z and a lift, in one 60 s and one 90 s run): the racket follows them, and the serve prompt stays.
## Driving it on the Mac
The work folder `04008E001F098000-work` beside the dump has `run/boot.sh <log> <secs> [VAR=value…]` (`DMHOST=` for another host), `run/go.sh <shot> <wait> <presses…>` for a run with `DM_CTL`, `run/to_select.sh` and `run/play.sh <prefix> <host> <secs>`: from the save in `run/save`, A presses through the title, Select User, Tennis's match settings and the court into a doubles match at its serve prompt (about 2 minutes), then `Shake` every 2 s with a shot every 30 s.
## Open
- A point played on the Mac in this tree (needs a motion controller, or scripted moves that serve).
- Sports other than tennis.
- The system data the game mounts as `MiiResource` (`0400000000000849`): `[RED] fs mount system data MiiResource: the host has no 0400000000000849`. FifteenPen's [PR #2274](https://github.com/seedds/nxnative/pull/2274) reads it and the Mii database from the player's own console files.
- The 6 refused mesh shaders, above.
- iPhone and iPad: no IPA built.
## Found on this game
- [A dump tool's `.listing` files in the game's folders](../../../docs/reference/packing.md#a-dump-tools-listing-files-in-the-games-folders)
- [File calls on a mount in the SDK's own table](../../../docs/reference/services.md#file-calls-on-a-mount-in-the-sdks-own-table)
- [A read-only mount of the game's own save data](../../../docs/reference/services.md#a-read-only-mount-of-the-games-own-save-data)
- [The virtual output device's properties, and the OutputStream open without flags](../../../docs/reference/audio.md#the-virtual-output-devices-properties-and-the-outputstream-open-without-flags) and [The output device notification under its SDK 21 and 22 name](../../../docs/reference/audio.md#the-output-device-notification-under-its-sdk-21-and-22-name)
- [A controller in a style the game does not support](../../../docs/reference/services.md#a-controller-in-a-style-the-game-does-not-support)
- [Switch 2 hid calls that open the hid service](../../../docs/reference/services.md#switch-2-hid-calls-that-open-the-hid-service), [The SDK's IMU handles are the console's six-axis handles](../../../docs/reference/services.md#the-sdks-imu-handles-are-the-consoles-six-axis-handles), [The Npad IMU sample holds the acceleration first](../../../docs/reference/services.md#the-npad-imu-sample-holds-the-acceleration-first), [The SDK's sensor fusion needs sensor noise and a stored calibration](../../../docs/reference/services.md#the-sdks-sensor-fusion-needs-sensor-noise-and-a-stored-calibration)
- [Home button protection on a Switch 2 controller](../../../docs/reference/services.md#home-button-protection-on-a-switch-2-controller)
- [The fragment's shading-rate size reads 1 x 1](../../../docs/reference/shaders.md#the-fragments-shading-rate-size-reads-1-x-1)
- [A render-target view of another class: the texture is upgraded, not drawn in its base format](../../../docs/reference/rendering.md#a-render-target-view-of-another-class-the-texture-is-upgraded-not-drawn-in-its-base-format)
- [Conditional rendering evaluated at replay](../../../docs/reference/rendering.md#conditional-rendering-evaluated-at-replay)
- [Tests of one uniform word folded into switches](../../../docs/reference/shaders.md#tests-of-one-uniform-word-folded-into-switches) and [Specialized second functions in the offline pipeline archive](../../../docs/reference/shaders.md#specialized-second-functions-in-the-offline-pipeline-archive)
+1
View File
@@ -0,0 +1 @@
# generated
1 # generated
+43
View File
@@ -0,0 +1,43 @@
# Game profile of Nintendo Switch Sports Resort (Switch 2, update v65536, which holds the whole game). Plays on the Mac: see README.md
# Format: see dm/games/README.md
# Nintendo EPD's sead / agl / gsys with Havok, SDK 22.2.10 built for the Switch 2 (Ounce), NVN2. From the NSP script's provisional profile (its heap and address-region checks), plus render_cond
# ---- Identity ----
title_id 04008E001F098000
program_id 04008E001F098000
# ---- App ----
# Game name: only a label for profile listings and the Mac window title; the app's name comes from the package's control data (the NUP has none: the NSP script takes --app-name)
name Nintendo Switch Sports Resort
ipa NintendoSwitchSportsResort.ipa
app_category public.app-category.sports-games
# ---- Versions ----
build v65536 ? main=3941550a42845731651bcd05edbb4703 subsdk0=d5bc474e0cefa2140efbe3a300aff60d sdk=0c5ec6021e995368f68fba79c3ed0c5b
package v65536
shader_versions v65536
# ---- Files ----
# not loaded, main takes nothing from them the host does not supply: subsdk1 (nn::camera), subsdk2 (C / libc), subsdk3 (C / libc), subsdk4 (other C++)
modules main subsdk0 sdk
romfs_marker Tex/RBake_Scene_AnnaBoxingDesign00Scene_d1_t0.bntx.zs
zip_store .bwav:.rs:.webm:.zs:.metallib
# ---- Memory ----
# the Switch 2's 9 GB application pool; the NPDM declares 32 MB of system resource (virtual address memory). The game asks for a 7.47 GB heap (the NSP script's heap check,
# 2026-11-12), so the block is 12.4 GB with a 4.38 GB alias region; in its first 15 s the game's regions reach alias +2.82 GB (address-region check, 2026-11-12)
mem_reserve 0x318000000
mem_alias 0x118000000
mem_stack 0x10000000
app_pool 0x240000000
sys_resource 0x2000000
# ---- Shader split ----
shader_groups /BowlingReplay/=bowlingreplay /Tex/=tex /Bake/=bake /Parameter/=parameter /Voice/=voice /Model/=model /Pack/=pack /Banc/=banc /Phive/=phive /UI/=ui /Layout/=layout /Sound/=sound /VoiceText/=voicetext /gsys/=gsys /Event/=event /Mii/=mii /Scene/=scene /System/=system /GameParameter/=gameparameter /agl/=agl /GolfSwing/=golfswing /AnimationEvent/=animationevent /CameraAnimation/=cameraanimation /Mals/=mals
shader_note Nintendo Switch Sports Resort shaders
# ---- Graphics ----
# the game calls nvnDeviceSetDepthMode with near = 0: the pipeline bases made before it runs are made for that mode
depth_mode zero
# the game wraps draws in render conditions; drawn anyway, the Select User background is grey and the outfits black (README.md, Rendering)
render_cond on
1 # Game profile of Nintendo Switch Sports Resort (Switch 2, update v65536, which holds the whole game). Plays on the Mac: see README.md
2 # Format: see dm/games/README.md
3 # Nintendo EPD's sead / agl / gsys with Havok, SDK 22.2.10 built for the Switch 2 (Ounce), NVN2. From the NSP script's provisional profile (its heap and address-region checks), plus render_cond
4 # ---- Identity ----
5 title_id 04008E001F098000
6 program_id 04008E001F098000
7 # ---- App ----
8 # Game name: only a label for profile listings and the Mac window title; the app's name comes from the package's control data (the NUP has none: the NSP script takes --app-name)
9 name Nintendo Switch Sports Resort
10 ipa NintendoSwitchSportsResort.ipa
11 app_category public.app-category.sports-games
12 # ---- Versions ----
13 build v65536 ? main=3941550a42845731651bcd05edbb4703 subsdk0=d5bc474e0cefa2140efbe3a300aff60d sdk=0c5ec6021e995368f68fba79c3ed0c5b
14 package v65536
15 shader_versions v65536
16 # ---- Files ----
17 # not loaded, main takes nothing from them the host does not supply: subsdk1 (nn::camera), subsdk2 (C / libc), subsdk3 (C / libc), subsdk4 (other C++)
18 modules main subsdk0 sdk
19 romfs_marker Tex/RBake_Scene_AnnaBoxingDesign00Scene_d1_t0.bntx.zs
20 zip_store .bwav:.rs:.webm:.zs:.metallib
21 # ---- Memory ----
22 # the Switch 2's 9 GB application pool; the NPDM declares 32 MB of system resource (virtual address memory). The game asks for a 7.47 GB heap (the NSP script's heap check,
23 # 2026-11-12), so the block is 12.4 GB with a 4.38 GB alias region; in its first 15 s the game's regions reach alias +2.82 GB (address-region check, 2026-11-12)
24 mem_reserve 0x318000000
25 mem_alias 0x118000000
26 mem_stack 0x10000000
27 app_pool 0x240000000
28 sys_resource 0x2000000
29 # ---- Shader split ----
30 shader_groups /BowlingReplay/=bowlingreplay /Tex/=tex /Bake/=bake /Parameter/=parameter /Voice/=voice /Model/=model /Pack/=pack /Banc/=banc /Phive/=phive /UI/=ui /Layout/=layout /Sound/=sound /VoiceText/=voicetext /gsys/=gsys /Event/=event /Mii/=mii /Scene/=scene /System/=system /GameParameter/=gameparameter /agl/=agl /GolfSwing/=golfswing /AnimationEvent/=animationevent /CameraAnimation/=cameraanimation /Mals/=mals
31 shader_note Nintendo Switch Sports Resort shaders
32 # ---- Graphics ----
33 # the game calls nvnDeviceSetDepthMode with near = 0: the pipeline bases made before it runs are made for that mode
34 depth_mode zero
35 # the game wraps draws in render conditions; drawn anyway, the Select User background is grey and the outfits black (README.md, Rendering)
36 render_cond on
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+292
View File
@@ -0,0 +1,292 @@
# Answer table for translation queries (generated by dm/gfx/tools/shader_split.py, do not edit): key <TAB> fact JSON. No PC shader pairing supplied: only the thread group / shared memory of compute shaders (taken from the control section); other queries get the translator defaults
014c6d7d14b41961 {"local":[256,1,1],"shared":8192}
01842b552bb9db18 {"local":[32,1,1],"shared":0}
01a5a4dcc78a076f {"local":[32,1,1],"shared":0}
0253bd17deceee79 {"local":[128,1,1],"shared":5584}
0385e6234427bdfc {"local":[1,1,1],"shared":0}
04f365cc62a911bf {"local":[32,1,1],"shared":0}
05cb55e0e1ccd41d {"local":[16,16,1],"shared":0}
06a9a7215d6c6d5f {"local":[32,1,1],"shared":0}
07494808cad6105b {"local":[16,16,1],"shared":15360}
07623ffcf79ef30b {"local":[512,1,1],"shared":16384}
07997468425a4924 {"local":[8,8,1],"shared":0}
07b10719f8e64003 {"local":[32,1,1],"shared":0}
085bd60aee508c91 {"local":[8,8,1],"shared":0}
085c6fddc9443e70 {"local":[128,1,1],"shared":8704}
08a3daf8cf8e8064 {"local":[8,8,1],"shared":0}
09d6941153892323 {"local":[32,1,1],"shared":0}
09ddd7f3f7560787 {"local":[32,1,1],"shared":0}
0ac5e13d25c99cf9 {"local":[16,16,1],"shared":9216}
0b63f7888d711e7d {"local":[16,16,1],"shared":13312}
0bee6e81cf129af0 {"local":[32,1,1],"shared":0}
0d702bece1ff0235 {"local":[32,1,1],"shared":0}
0eb2d7a3bfe3b555 {"local":[32,8,1],"shared":1024}
123892161b7423f4 {"local":[32,1,1],"shared":640}
128cd03450f2aac6 {"local":[16,16,1],"shared":9216}
14d578472c358f21 {"local":[4,16,1],"shared":0}
157d64f7dafdf2bb {"local":[32,1,1],"shared":0}
179987633dc4f672 {"local":[16,16,1],"shared":9216}
18270b4a0472923f {"local":[16,16,1],"shared":13312}
18464a37bcbe7397 {"local":[256,1,1],"shared":0}
1872c95d05636db4 {"local":[32,1,1],"shared":0}
196dfe02185a7518 {"local":[128,1,1],"shared":4608}
1a14e5f4111cec3f {"local":[32,1,1],"shared":0}
1d5936ea397ac2e8 {"local":[32,1,1],"shared":0}
1d6f2260b30b0e86 {"local":[8,8,1],"shared":0}
1de46fd043db88c6 {"local":[16,16,1],"shared":9216}
1eab8023e0db60d5 {"local":[1,1,1],"shared":0}
1f78730053feb036 {"local":[32,1,1],"shared":1168}
21016f70a4133bd6 {"local":[32,1,1],"shared":0}
2325391697d692ef {"local":[16,16,1],"shared":0}
23b03f7ee92b8725 {"local":[1,1,1],"shared":0}
266fa084145786d0 {"local":[32,1,1],"shared":0}
2684569291a5c027 {"local":[16,16,1],"shared":0}
26f1fa8dab78e329 {"local":[32,1,1],"shared":0}
2722ddbb875f6b86 {"local":[16,16,1],"shared":15360}
273746820f54a657 {"local":[16,16,1],"shared":0}
28f14afa9e2bf7f5 {"local":[16,16,1],"shared":0}
2931f56608980ca4 {"local":[256,1,1],"shared":0}
295b288b803a3b4d {"local":[64,1,1],"shared":0}
295f06ebb0ba8060 {"local":[16,16,1],"shared":0}
29d432757707d9c9 {"local":[64,1,1],"shared":0}
2b4e00a8ee2e432f {"local":[8,8,1],"shared":0}
2f5373afbf88d9df {"local":[32,1,1],"shared":0}
2fa8d11e36327736 {"local":[32,1,1],"shared":0}
30728e654b13c819 {"local":[4,16,1],"shared":0}
30d8ee33de9dee85 {"local":[128,1,1],"shared":8064}
30ea2b84b346b99f {"local":[32,8,1],"shared":1024}
31938496fd606c00 {"local":[32,1,1],"shared":0}
32dc550ef4b6644e {"local":[32,1,1],"shared":0}
336305fc13e9b4e5 {"local":[16,16,1],"shared":0}
33cc90c9d4be52c1 {"local":[128,1,1],"shared":10496}
3484894702f45244 {"local":[16,16,1],"shared":0}
34b1b15b5833134b {"local":[128,1,1],"shared":4096}
34e0964519e32068 {"local":[16,16,1],"shared":0}
36f73d091d87e443 {"local":[256,1,1],"shared":0}
37673c101638f30e {"local":[8,8,1],"shared":0}
388e02dcc514a68c {"local":[128,1,1],"shared":4096}
3b92b3c0c2774877 {"local":[32,1,1],"shared":0}
3bf040de1069f051 {"local":[4,16,1],"shared":0}
3e72f1b1061c7004 {"local":[256,1,1],"shared":1152}
3fe6b091bb8c40ce {"local":[128,1,1],"shared":8064}
40a5b285cfc1ff9f {"local":[32,1,1],"shared":0}
411cb2b8d108cbd9 {"local":[4,16,1],"shared":0}
42e1091f70c368e8 {"local":[32,1,1],"shared":0}
43cdd994c722587d {"local":[16,16,1],"shared":13312}
43e2ba258574101e {"local":[16,8,1],"shared":0}
4401bb660550a7ce {"local":[8,8,1],"shared":0}
4432294e1b05a285 {"local":[256,1,1],"shared":4096}
44612af35da2fcba {"local":[16,16,1],"shared":0}
45cf48c65537d3c3 {"local":[16,16,1],"shared":0}
4825ebcc7a6526f3 {"local":[4,16,1],"shared":0}
48c8a4238ea3ba2d {"local":[8,4,1],"shared":0}
4981013c3d0a16a9 {"local":[32,1,1],"shared":0}
49ca16f7e82d3b94 {"local":[32,1,1],"shared":0}
49d128d3232b87e6 {"local":[16,16,1],"shared":0}
4a197ba1df099035 {"local":[32,1,1],"shared":0}
4acef5afefba098b {"local":[128,1,1],"shared":5504}
4bb3de4cd80c2231 {"local":[64,1,1],"shared":0}
4c6be461bfc5f6ee {"local":[4,16,1],"shared":0}
4c85deb721b548ac {"local":[64,1,1],"shared":0}
4c896727e44a1c7d {"local":[64,1,1],"shared":0}
4d5bf9b2e68022e9 {"local":[8,8,1],"shared":0}
4e1f85d21e717f86 {"local":[32,1,1],"shared":0}
4e998b25b9e03daa {"local":[64,1,1],"shared":0}
4f21fd9e5886fe22 {"local":[8,8,1],"shared":512}
4fabdbc45744db9a {"local":[8,8,1],"shared":0}
504199290aa0745e {"local":[16,16,1],"shared":0}
50bcf9eda265da72 {"local":[8,8,1],"shared":0}
53636d37a5274863 {"local":[32,1,1],"shared":1024}
546f2576bcc31ca8 {"local":[128,1,1],"shared":11008}
55fcda025feae496 {"local":[16,16,1],"shared":1600}
563a34204fbf96f9 {"local":[32,8,1],"shared":1024}
58ece01ce358ee26 {"local":[16,16,1],"shared":15360}
5a7d9c7862835f94 {"local":[16,8,1],"shared":0}
5acab3373bfec6bc {"local":[4,16,1],"shared":0}
5b6d8ba5b3511d61 {"local":[128,1,1],"shared":4096}
5bb825d702be46dd {"local":[8,8,1],"shared":0}
5c3d8c0ca964762e {"local":[16,16,1],"shared":0}
5c7a86728b475517 {"local":[32,1,1],"shared":1152}
5ceba177994214f7 {"local":[32,8,1],"shared":1024}
5d3e27634662df98 {"local":[256,1,1],"shared":4096}
5d8b0025065074a1 {"local":[16,16,1],"shared":11264}
5e87e6b296935857 {"local":[32,1,1],"shared":0}
5e970b3f9d0b1d34 {"local":[256,1,1],"shared":1152}
60f3f31a0e0132e1 {"local":[128,1,1],"shared":8064}
611f2ce8a63219ae {"local":[8,4,1],"shared":0}
621f94b2bd49533c {"local":[16,16,1],"shared":0}
63c503a42355558a {"local":[32,1,1],"shared":1536}
65fbd0fa50251e48 {"local":[32,1,1],"shared":0}
6645ca5ad1024014 {"local":[8,4,1],"shared":0}
679b73e8c59723dc {"local":[32,1,1],"shared":0}
696c8eadcb90f2a8 {"local":[16,16,1],"shared":0}
6a264df0028a2d9c {"local":[4,16,1],"shared":0}
6b1560fdfbf5b694 {"local":[8,4,1],"shared":0}
6b2fde1af4bef561 {"local":[32,8,1],"shared":1024}
6c81e40b4302e1de {"local":[8,8,1],"shared":0}
6c8303a2031b215d {"local":[8,8,1],"shared":0}
6c98665f0acd3b57 {"local":[32,1,1],"shared":0}
6e01045e823cd37a {"local":[16,16,1],"shared":128}
6e33c04f09907407 {"local":[16,16,1],"shared":0}
6e9a121183987738 {"local":[1,1,1],"shared":0}
70f8568719810874 {"local":[32,1,1],"shared":0}
71986d13ddf9a9b3 {"local":[64,1,1],"shared":0}
725bcf5c3f4bb3f3 {"local":[128,1,1],"shared":11232}
728a3e51b4e4d8b5 {"local":[32,1,1],"shared":0}
73dec8e0f4095331 {"local":[128,1,1],"shared":10496}
7641aa708cfb25f4 {"local":[8,8,1],"shared":0}
7805fd00489aaf68 {"local":[32,32,1],"shared":0}
7b128bc51626eb90 {"local":[16,16,1],"shared":9216}
7be276b3fa6ce459 {"local":[8,8,1],"shared":0}
7cf41741542b1b02 {"local":[8,8,1],"shared":0}
7dedbd972b7a6e16 {"local":[1,1,1],"shared":0}
7e7cefcfd105ff95 {"local":[16,16,1],"shared":0}
7fe7e9c86dbedf95 {"local":[32,8,1],"shared":1024}
80d1decfd0b5cfc7 {"local":[256,1,1],"shared":4096}
80f5c3c85bdf43bb {"local":[128,1,1],"shared":4096}
8116226c7568fceb {"local":[4,16,1],"shared":0}
82a8cbfc2f20e995 {"local":[4,16,1],"shared":0}
83182f5146c335a5 {"local":[8,8,1],"shared":0}
8382ecea6ec9fd98 {"local":[16,16,1],"shared":0}
84163dfe9ac00510 {"local":[8,128,1],"shared":0}
841ad2f6533923a7 {"local":[32,1,1],"shared":0}
84adcffc236e35a4 {"local":[1,1,1],"shared":0}
860c4503d0e6cbd5 {"local":[128,1,1],"shared":4096}
8661f7e957eb23eb {"local":[4,16,1],"shared":0}
8747200ca25929bc {"local":[8,4,1],"shared":0}
8761a0c8cf6439db {"local":[512,1,1],"shared":16384}
87819f1d0438e5fb {"local":[64,1,1],"shared":0}
881051d1507806c3 {"local":[8,4,1],"shared":0}
8ac3b26a0e56958d {"local":[8,8,1],"shared":0}
8caec208ca58e484 {"local":[8,8,1],"shared":0}
8eb06dfea85748db {"local":[64,1,1],"shared":0}
8ebdd9d9e1b3b6d0 {"local":[8,8,1],"shared":0}
8f15455f0f288b63 {"local":[64,1,1],"shared":0}
8fbc704df46a5b62 {"local":[4,16,1],"shared":0}
9021da9619780a97 {"local":[32,1,1],"shared":0}
93137152d68bfebf {"local":[16,16,1],"shared":11264}
93742ed0eb997418 {"local":[64,1,1],"shared":0}
93954e29d1f8060b {"local":[4,16,1],"shared":0}
93b8cf2a4840b5f2 {"local":[32,1,1],"shared":0}
95e413bb8f915eaf {"local":[32,1,1],"shared":0}
9640e941876c52c0 {"local":[16,16,1],"shared":0}
964dd8ba72091ffb {"local":[16,16,1],"shared":15360}
9679f8bad72851d4 {"local":[32,1,1],"shared":0}
98ebbb8f866287d4 {"local":[128,1,1],"shared":4096}
9904819b2459a193 {"local":[128,1,1],"shared":4096}
99951da6e5cd38f5 {"local":[8,4,1],"shared":0}
99e7a7877c51b2d3 {"local":[8,8,1],"shared":0}
9cf7c6a5b13c4f4c {"local":[128,1,1],"shared":5440}
9d76ccdc5044cca7 {"local":[256,1,1],"shared":1152}
9da26c328906ee4a {"local":[8,8,1],"shared":0}
9e937fcce345ee96 {"local":[4,16,1],"shared":0}
a0bf1cec48e1b1ab {"local":[256,1,1],"shared":8192}
a1361112b65fbea4 {"local":[16,16,1],"shared":0}
a26355ad51af1d04 {"local":[16,16,1],"shared":0}
a2a1107a794224ef {"local":[4,16,1],"shared":0}
a2d772c5d647dc62 {"local":[32,8,1],"shared":1024}
a2daae5fc273d58c {"local":[16,16,1],"shared":0}
a2df831512646c91 {"local":[4,16,1],"shared":0}
a361c4347e39b1c3 {"local":[32,1,1],"shared":0}
a443d78ea0c09984 {"local":[8,8,1],"shared":0}
a4630159f587edc6 {"local":[32,1,1],"shared":0}
a4e6f305f3d71c75 {"local":[256,1,1],"shared":4096}
a7a17dcc3d0318ec {"local":[16,16,1],"shared":0}
a8f5e4bbf2af87ce {"local":[8,8,1],"shared":0}
a8fbb71dab6446f6 {"local":[16,16,1],"shared":0}
a9fb67dd4275fbda {"local":[8,8,1],"shared":0}
aa650b48b1696a89 {"local":[16,16,1],"shared":0}
aaa785ced92a88ef {"local":[8,4,1],"shared":0}
aaab36de5d650c2e {"local":[32,1,1],"shared":0}
ab06ab9b8362a701 {"local":[16,16,1],"shared":0}
abef20ad0d9a9b12 {"local":[128,1,1],"shared":10016}
ad213ed4a390477a {"local":[8,8,1],"shared":0}
ad8cf46fc3dbdead {"local":[8,8,1],"shared":0}
ade5ad70df574e31 {"local":[16,16,1],"shared":0}
ae93f495007ccc57 {"local":[32,1,1],"shared":0}
aebe601429ee064c {"local":[16,16,1],"shared":0}
afa2638d94bacb98 {"local":[4,16,1],"shared":0}
b0834852458e35e0 {"local":[32,1,1],"shared":0}
b19f2cbc0b9f417a {"local":[64,1,1],"shared":0}
b4320061af67dac0 {"local":[32,1,1],"shared":0}
b54aaf0d96b607a7 {"local":[32,1,1],"shared":0}
b54b7dcf4e362256 {"local":[4,16,1],"shared":0}
b83b42f42e2aa87e {"local":[1,1,1],"shared":0}
b89bb86a43d87d6c {"local":[16,16,1],"shared":0}
b97de014e734c16d {"local":[8,4,1],"shared":0}
bc536428f2446a96 {"local":[32,1,1],"shared":0}
c1b8edc09e3313b1 {"local":[128,1,1],"shared":8064}
c209792a45150966 {"local":[16,16,1],"shared":4624}
c40dddd4e1aaf503 {"local":[16,16,1],"shared":11264}
c474a50b13e12beb {"local":[32,32,1],"shared":0}
c57ef67a789ed13c {"local":[32,1,1],"shared":0}
c58be4c13dd41495 {"local":[16,16,1],"shared":0}
c6820020f805d89f {"local":[4,16,1],"shared":0}
c78798281d3519c1 {"local":[128,1,1],"shared":7040}
c7e7a4c1ebb1644e {"local":[8,8,1],"shared":0}
c7e83a6652e70cd1 {"local":[64,1,1],"shared":0}
c9545c834b18a96e {"local":[1,1,1],"shared":0}
ca863d2286464b46 {"local":[64,1,1],"shared":2048}
cb3ee15896efac79 {"local":[4,16,1],"shared":0}
cc0ffaa6c5c10f67 {"local":[128,1,1],"shared":0}
cc879d3842ce8610 {"local":[32,1,1],"shared":0}
cce09c2c1093a8e9 {"local":[16,16,1],"shared":0}
ce8270569d33a7af {"local":[16,16,1],"shared":1600}
cf5c0ab6811c4b48 {"local":[8,8,1],"shared":0}
cfd4169d5d3b5dff {"local":[16,16,1],"shared":0}
cfd6d53e52192a0a {"local":[128,1,1],"shared":4096}
d051f5808cce9aff {"local":[32,1,1],"shared":0}
d108ecf6197f7327 {"local":[128,1,1],"shared":4096}
d1b691eed908c945 {"local":[32,1,1],"shared":0}
d440fcb52129e32a {"local":[16,16,1],"shared":15360}
d4667a3063347869 {"local":[16,16,1],"shared":0}
d4846d1794be56e2 {"local":[8,8,1],"shared":0}
d58e0fef3b381bda {"local":[32,1,1],"shared":0}
d5d7cbfd0add31f6 {"local":[8,8,1],"shared":512}
d65e9cf96b1f2e0e {"local":[4,16,1],"shared":0}
d7579b4572567bab {"local":[64,1,1],"shared":2048}
d76714951c35b120 {"local":[32,1,1],"shared":0}
d7d9cbc8b0e932f7 {"local":[16,16,1],"shared":15360}
dba35a23dd715f3c {"local":[32,1,1],"shared":0}
ddc729bcdb4c8df9 {"local":[128,1,1],"shared":12672}
e021706e6ca1e87c {"local":[32,1,1],"shared":0}
e124fe4b4064ac83 {"local":[32,1,1],"shared":4864}
e14353c04274a70d {"local":[32,1,1],"shared":0}
e172bd7ec218ab8e {"local":[32,1,1],"shared":1168}
e24cd5bc0cb13974 {"local":[64,1,1],"shared":0}
e2a63ab95b10951f {"local":[128,1,1],"shared":8064}
e2bd4002849d3f5d {"local":[8,8,1],"shared":0}
e3028689a36edf98 {"local":[32,1,1],"shared":0}
e3205ad7530de558 {"local":[256,1,1],"shared":1152}
e32168d23c3d3fb3 {"local":[8,8,1],"shared":0}
e4e786a12496551e {"local":[1,1,1],"shared":0}
e8ff743d0cde894c {"local":[1,1,1],"shared":0}
e97e43383ed843b6 {"local":[128,1,1],"shared":11008}
ea4b855882ad4769 {"local":[32,1,1],"shared":0}
ea950ceee4815efa {"local":[16,16,1],"shared":9216}
ec25cbf0708fd8a7 {"local":[16,16,1],"shared":0}
ed8d0ced29f58f9c {"local":[32,1,1],"shared":0}
edad73294ae479ab {"local":[32,1,1],"shared":0}
ef0e5c68d291ee71 {"local":[32,1,1],"shared":0}
f01c48ebee95d3ac {"local":[4,16,1],"shared":0}
f01da77c0b75e787 {"local":[32,1,1],"shared":0}
f2545de1f5cd884d {"local":[16,16,1],"shared":128}
f2d6c5cfbdcf3f71 {"local":[128,1,1],"shared":9024}
f452bb839d801325 {"local":[32,8,1],"shared":1024}
f4637b6cf5f563a6 {"local":[32,1,1],"shared":0}
f625678f05367279 {"local":[32,1,1],"shared":0}
f787e7630c66bd94 {"local":[128,1,1],"shared":4096}
f7a8284ab864bafd {"local":[32,32,1],"shared":0}
f87592cca6a9dd17 {"local":[128,1,1],"shared":8064}
f894f4132be970e4 {"local":[4,16,1],"shared":0}
f96e6ee1c17d2d8f {"local":[32,1,1],"shared":0}
fa072659664b2d38 {"local":[8,4,1],"shared":0}
fa876f9183ec058a {"local":[32,1,1],"shared":1024}
fae15a1d0fb29940 {"local":[16,16,1],"shared":0}
fb416a0ea6cb35d7 {"local":[32,1,1],"shared":0}
fbe032652625dbcc {"local":[64,1,1],"shared":0}
fca787747f21718b {"local":[64,1,1],"shared":0}
fd938b6779ad17a2 {"local":[4,16,1],"shared":0}
fea37198d25f7428 {"local":[32,32,1],"shared":0}
ff14ea55c06b0dff {"local":[32,32,1],"shared":0}
ff1a6f3584c61579 {"local":[1,1,1],"shared":0}
Can't render this file because it contains an unexpected character in line 2 and column 19.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,2 @@
# kind: evidence control-section key conflict rulings: empty
dm_ctl_sha16 chosen_pc class candidates records
1 # kind: evidence control-section key conflict rulings: empty
2 dm_ctl_sha16 chosen_pc class candidates records
File diff suppressed because it is too large. Load diff
+1
View File
@@ -130,6 +130,7 @@ One row per profile; the notes are each profile's `README.md`.
| [Need for Speed: Hot Pursuit Remastered](010029B0118E8000/README.md) | `010029B0118E8000` | 1.0.3 | 10.4.1 | Criterion's engine (Stellar Entertainment port) | NVN |
| [NieR:Automata The End of YoRHa Edition](010056B015FE8000/README.md) | `010056B015FE8000` | 1.0.3 | 12.3.9 | PlatinumGames' engine | NVN |
| [NieR:Automata The End of YoRHa Edition, Asian release](0100B8E016F76000/README.md) | `0100B8E016F76000` | 1.0.3 | 12.3.9 | PlatinumGames' engine | NVN |
| [Nintendo Switch Sports Resort](04008E001F098000/README.md) | `04008E001F098000` | v65536 (Switch 2) | 22.2.10 (Ounce) | sead / agl / gsys, Havok | NVN2 |
| [OCTOPATH TRAVELER](010057D006492000/README.md) | `010057D006492000` | 1.0.5 | 3.5.1 | Unreal Engine 4.18 | NVN |
| [Octopath Traveler 0](01005270232F2000/README.md) | `01005270232F2000` | 1.0.5 | 19.3.13 | Unreal Engine 5 | NVN |
| [OCTOPATH TRAVELER II](0100A3501946E000/README.md) | `0100A3501946E000` | 1.1.1 | 12.3.2 | Unreal Engine 4.27 | NVN |
+2 -2
View File
@@ -311,7 +311,7 @@ For a replaced DSP renderer the size query keeps the service's work-buffer contr
- **Cause:** SDK 21 and 22 name the output device notification `AcquireAudioOutputDeviceNotification` (older SDKs: `AcquireAudioDeviceNotificationForOutput`, and SDK 7's `AcquireAudioDeviceSwitchNotification`). SDK 22.2.0's version (`sdk+0x1f1e00`) opens a user session with `aud:u`, which the host does not serve, asks it for a read end and attaches it AutoClear. It keeps no per-process flag (the service keys each acquire by its event) and returns a Result.
- **Fix:** `hle_audren.c` takes the name over, first for SDK 21 (Splatoon Raiders); the same takeover serves SDK 22. The event is bound and never signaled, and the Result is 0. The takeover keeps the older names' once-per-process flag, so a second acquire returns 0x499 where SDK 22.2.0's code would bind again. No game has been seen to acquire twice.
- **The release:** `ReleaseAudioOutputDeviceNotification` (`sdk+0x1f2ac0` in Nintendo Switch Sports Resort's sdk) asks `aud:u` through the device session coordinator, then destroys the event. The game destroys the event itself only if it is still initialized afterwards (`main+0x3af11a0`). `hle_audren.c` takes it over: it destroys the event it bound (which drops the binding) and clears the flag, so a later acquire binds again. With nothing acquired it does nothing. `t_audren_work` covers acquire, the refused second acquire, release and acquire again.
- **Found on:** [Fire Emblem Fortune's Weave](../../dm/games/04007EF01F8AE000/README.md) (Switch 2, SDK 22.2.0, `main+0xe7b9c`); Nintendo Switch Sports Resort (`04008E001F098000`, no profile yet: the release, `main+0x3af119c`).
- **Found on:** [Fire Emblem Fortune's Weave](../../dm/games/04007EF01F8AE000/README.md) (Switch 2, SDK 22.2.0, `main+0xe7b9c`); [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`: the release, `main+0x3af119c`).
### No audio input devices
@@ -351,7 +351,7 @@ For a replaced DSP renderer the size query keeps the service's work-buffer contr
- **The properties:** `VirtualDeviceProperties` is 0x110 bytes, filled from the profile at `sdk+0x224cd4`: the name asked about (+0x00, 0x100 bytes); the profile's +0x218 at +0x100, the device's shortest stream as a duration in ns (`OutputStreamImpl::Open` refuses a capacity under ceil(duration x rate / 1e9) frames with 0x899, `sdk+0x225a94`; the input stream open the same); and the profile's +0x108 at +0x108, a 32-bit word nothing in the sdk reads. Both of the game's callers, and Donkey Kong Bananza's two (`main+0x57cadc`, `main+0x187cee4`), only test the Result.
- **Fix:** `hle_audio.c` answers for its one device, `AudioVirtualOutput`: the name, a shortest stream of 10 ms (one period as Xenoblade Chronicles 2 and Star Fox write it; the host's own open sets no minimum) and 0 in the unidentified word. Any other name gets a red line and a failure. The overload without flags opens like the others. `t_output_stream` covers both.
- **Open:** what the +0x108 word means; no caller seen reads it.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, no profile yet; SDK 20+).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`; SDK 20+).
## Codecs
+2 -1
View File
@@ -434,7 +434,7 @@ The replay on Metal (`dm/gfx/nvn/nvn_mtl.m`) and the Vulkan and OpenGL layers. E
- **Cause:** agl's NDSR packs its input into an `RGB9E5F` texture (534x1200 for a 1600x900 input) through an `R32_UI` render-target view, with a fragment shader (`401877446d25d079` in `agl_ndsr.pck`) whose output is the packed bits as uint: NVIDIA's GPUs have no RGB9E5 colour target. Colour textures are made without `MTLTextureUsagePixelFormatView`, and `attach` drew such a view in the base format instead. The pipeline then took the shader's float entry (`main0`, `as_type<float>(bits)` in red, 0 in green and blue) for an `RGB9E5Float` attachment, which stored the float value of the bits: red in the millions or infinite. The network turned that into a red picture; the UI's lost red is most likely 0 × ∞ = NaN where the UI, blended over that picture, is opaque (not traced further: it went with the fix). A uint output into an `RGB9E5Float` attachment is no way out either: Metal refuses the pipeline (`output of type uint4 is not compatible`).
- **Fix:** `attach` (`rt_view_upgrade` in `nvn_mtl.m`) upgrades a texture without the usage to it before the pass opens when the view's format has the same texel size, as clears and images of another class do, and attaches the view, so the pipeline takes the uint entry (`main0_u`) and the stored bits are the shader's. An `RGB9E5` texture the GPU writes has the usage from its creation (`tex_desc`): the game makes a new one at each size of its dynamic resolution, and each was upgraded (copied) once, 27 in 80 s of its menus. Every colour slot of a pass is upgraded before any is attached (`rt_view_upgrade_all`): an upgrade moves every serial sharing the texture's storage to the new texture, so a slot attached first would keep the retired one. Textures, descriptors and argument tables resolved before the upgrade follow it: `tex_upgrade` bumps `g_ser_gen` with no note, so the texture ID cache starts a new epoch (`ser_sync`, `tex_by_id` / `tex_fast`), and the argument blocks (`args_sync_dirty`) and pool tables (`pool_gpu`) are rebuilt. A format pair Metal makes no view for after an upgrade, and a texture whose upgrade fails or is refused (a placement sparse texture), are remembered and not tried again. The pipeline prediction (`rt_view_fmt_predict`) gives the view's format for a slot that will be upgraded. A view of another texel size still draws in the base format with the red line. Two costs, accepted: any game whose render-target views change the format within the same texel size now gets the view (and the upgrade's copy once per texture) where it was drawn in the base format before, which changes what such passes store; and RGB9E5 textures the GPU writes lose Apple's lossless compression.
- **Check:** `make -C dm/gfx/tests GAME=<id> check_t_pfv`: an `R32_UI` view of an `RGB9E5F` texture (made with the usage) and of an `RG16F` one (upgraded) is attached as `R32Uint` and stores a uint draw's bits, and a texture ID registered before the pass samples the new texture and those bits after it; an `RGBA16F` texture is left as it was; two serials over one texture in two slots both end on the upgraded texture; a refused pair or texture is not upgraded again; the prediction gives `R32Uint` before the upgrade. In the game, from a new save with `DM_KEYS="20:A*60/3"` and a screenshot every 4 frames from 1800 to 2800: before, 21 of the 27 screenshots taken while the packing shader ran (`DM_NVN_KEYDUMP=401877446d25d079`) were 12-59 % pure red; after, none of 30.
- **Found on:** Nintendo Switch Sports Resort (Switch 2, `04008E001F098000`, v65536; no profile yet).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (Switch 2, `04008E001F098000`, v65536).
### Textures of an sRGB / linear pair over the same storage
@@ -1448,6 +1448,7 @@ The replay on Metal (`dm/gfx/nvn/nvn_mtl.m`) and the Vulkan and OpenGL layers. E
- **Found on:**
- [The Legend of Zelda: Tears of the Kingdom](../../dm/games/0100F2C0115B6000/README.md): TOTK wraps nearly every `ClearColor` / `ClearDepthStencil` this way; each clear is followed by `ReportCounter(TIMESTAMP_TOP, rec)`, the CPU sets `rec` to 1 when a target needs a clear, and `rec + 16` is never written, so after one clear the two are equal and later conditional clears of that target are skipped. The first tile-lighting round, the half-resolution scene depth the light volumes test against (back faces `GREATER` against a buffer just cleared to 1.0 can never pass) and the light accumulation were all cleared before the composite read them.
- [Mario vs. Donkey Kong](../../dm/games/0100B99019412000/README.md) (it skips clears under render conditions, as Tears of the Kingdom and Animal Crossing: New Horizons do).
- [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md#rendering) (Switch 2): drawn unconditionally, its Select User background is grey and the outfits black (in the menus only). The outfits' material reads R and A of a screen-space target the menu blurs under a channel mask of G and B, and those read 0. The background and the lit outfits come back with the key.
- Drawn unconditionally with no `render_cond`, nothing looked wrong in [Big Brain Academy: Brain vs. Brain](../../dm/games/0100620012D6E000/README.md) (no screen played looked wrong) or [DARK SOULS: REMASTERED](../../dm/games/01004AB00A260000/README.md) (nothing seen).
- [Portal 2](../../dm/games/0100ABD01785C000/README.md) needs no `render_cond` and must not get it: NVIDIA's occlusion culling in its D3D9 layer (`IDirect3DDevice9::SetOcclusionShape`, `materialsystem.nro+0xc1130`) puts a mesh under `SetRenderEnableConditional(RENDER_IF_NOT_EQUAL, pair)` when its shape has a query, else `SetRenderEnable(true)`, so drawing everything only costs GPU time. With the key on, those conditions read 0 / 0 at replay (no report in the submission writes the pairs; memory later held `0xffff` / 0) and visible furniture vanished. **Open:** who writes those pairs and when.
+8 -8
View File
@@ -109,7 +109,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Cause:** `nn::fs::MountRamDisk` runs in `sdk` and registers in the SDK's own mount table ([A mount in the SDK's own table stays until the SDK releases it](#a-mount-in-the-sdks-own-table-stays-until-the-sdk-releases-it)), while every file call the host takes over looked in the host's table only. Nintendo Switch Sports Resort mounts its VoiceText speech data as the RAM disk `vtapi`, copies `VoiceText/` from `content:` into it at boot and aborted on its first `GetEntryType` (`main+0x414dbc`).
- **Fix:** a path whose mount name the host does not hold but the SDK's `IsMounted` does goes to the SDK's own call (`sdk_path_call` in `hle_fs.c`; `guest_sym` gives the module's definition, not the host's take-over), with no host lock held. The file and directory handles that call opens are listed (`sdk_handle_add`, up to 256 open at once; past that the open is closed in the SDK and fails), and the calls that take a handle go to the SDK when it is listed; a close forgets the handle before the SDK frees it. `IsMounted` and `IsPathMounted` answer from both tables. A rename between the SDK's mount and another fails without reaching either. A path on a host mount never asks the SDK. `t_fs.c` (⑩) covers routing, handle tracking and isolation.
- **Note:** Paper Mario: The Thousand-Year Door's file cache (the RAM disk `cache`) takes this path as well: its `CreateFile` on `cache:/<hash>` was "path not found" and the game skipped the cache ([its note](../../dm/games/0100ECD018EBE000/README.md)); not checked on that game.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, no profile yet).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`).
### File handles with low bits set, and backslash paths
@@ -254,7 +254,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Cause:** the game mounts its own account save read-only as `SaveReadOnly` at boot (`fs::MountSaveDataReadOnly` with its own application ID; `fs::IsSaveDataExisting` had told it the save exists). The host answered every such mount TargetNotFound. Once an account save existed, the game read through that mount and aborted where it checks the mount's name against `SaveReadOnly` (main+0x349d880 → main+0x3917260).
- **Fix:** `hle_fs.c` mounts the game's own save data read-only on its committed save directory (`DM_SAVE`, not the transaction's work directory), creating it empty on a first start, as the console creates the save data; another program's save data is still TargetNotFound, and so is the game's own when `DM_SAVE` is unset or its folder cannot be made (a red line, no exit).
- **Check:** `make -C dm/host/tests GAME=<id> run` (`t_fs_case`): the own save mounts read-only, reads the committed files and not the uncommitted ones, refuses writes; another program's gets TargetNotFound; a first start mounts an empty save; no `DM_SAVE`, or a file in its place, gets TargetNotFound. In the game, a start with the save the abort happened on runs past it.
- **Found on:** Nintendo Switch Sports Resort (Switch 2, `04008E001F098000`, v65536).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (Switch 2, `04008E001F098000`, v65536).
### Device save data on the account save's directory
@@ -394,7 +394,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Symptom:** docked, the game opens the controller applet again every frame and never leaves the screen behind it. The log repeats `oe library applet: controller support`, `hid controller applet: 1 to 1 players wanted, 1 connected` and focus 2, then 1, thousands of times (7,162 in 3 minutes), after `hid supported controller styles 0x6`.
- **Cause:** the host showed every whole controller (the keyboard, a Pro-like pad, a Joy-Con pair the game supports no Joy-Con style for) as full-key on No1..No8, whatever styles the game supports. The hid service connects a controller only in a supported style, so a game may take any connected npad as one of its own. Nintendo Switch Sports Resort sets Handheld | JoyDual (0x6) for its Tennis lobby (`main+0xa9e940`); its player check (`main+0x58d0f0`) found no usable player 1 on a full-key No1, so its caller (`main+0x3f9d120`) opened `ShowControllerSupport` again, and the applet's answer (one player, No1) could not change that.
- **Fix:** on No1..No8, a whole controller is shown as a JoyDual pair when the game supports JoyDual but not full-key (`pad_style`, `hle_hid.c`): JoyDual is the only other style with all its buttons and both sticks. Its JoyDual state, two six-axis sensors, type 5 vibration handles and the applet's selected npad follow; full-key handles taken earlier still reach its motors. A change of supported styles that changes an npad's style signals that npad's style update event. This holds in both modes: in handheld mode players 2..8 (No2..No8) are shown as JoyDual too, and only player 1's Handheld npad stays Handheld. A game that supports full-key, or neither style, is unchanged.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile in the repository yet), on the Mac with the keyboard and `DM_KEYS`: after the fix the applet is not opened once in 220 s, and Play leads to its one-controller screen ("press the button") and into a doubles Tennis match at its serve prompt.
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536), on the Mac with the keyboard and `DM_KEYS`: after the fix the applet is not opened once in 220 s, and Play leads to its one-controller screen ("press the button") and into a doubles Tennis match at its serve prompt.
- **Check:** `t_hid` (`t_unsupported_style`).
### Live controller motion
@@ -488,14 +488,14 @@ Most service calls can be found before they crash, before the first boot or the
- `GetSixAxisSensorIcInformation`: the fusion's initialization (`sdk+0x6d7db0`) asks it through the hid service and, when it fails, never reads a sample (`sdk+0x6d7e40`). The 0xc8 bytes are, per sensor, its range, zero-offset bounds and sensitivity bounds (read at `+0x00`, `+0x10`, `+0x40`, `+0x44`, `+0x64`, `+0x74`, `+0xa4`, `+0xa8` into `nn::imu::SixAxisSensorInformation`, `sdk+0x6fed30`); a sample past twice the range resets the fusion. The host answers yuzu's values for this layout: 2000 deg/s and 8 G (the Switch six-axis IC's full scale), offsets within ±10 deg/s and ±0.0612 G, sensitivity 0.95 to 1.05 with ±0.003 cross-axis.
- `IsSixAxisSensorDeviceNewlyAssigned` (from hid shared memory, `sdk+0x6c1330`): no, so the fusion is not reset each update; `ResetIsSixAxisSensorDeviceNewlyAssigned`: nothing to clear. `StoreSixAxisSensorCalibrationParameter` keeps the fusion's 0x744-byte gyro bias calibration per device for the run and `LoadSixAxisSensorCalibrationParameter` gives it back ([The SDK's sensor fusion needs sensor noise and a stored calibration](#the-sdks-sensor-fusion-needs-sensor-noise-and-a-stored-calibration) for a device with nothing stored). Six-axis handles are checked as the SDK's `VerifyValidSixAxisSensorHandle` does (`sdk+0x6d8440`: also device index 0 to 2, else `0xd6ca`).
- **Note:** the Home button protection calls, which the same game asks at boot, are answered as in [Home button protection on a Switch 2 controller](#home-button-protection-on-a-switch-2-controller). Unconfirmed against a console: which Joy-Con a pair's device index 0 and 1 are (the host takes 0 as the left, as for six-axis handles), the IC bounds besides the ranges (not read from a Switch 2 controller), and the Result a console gives for a device with no stored calibration (the only caller tests for 0).
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile in the repository yet). `t_hid.c` covers each call, the sample window and numbering, unit conversion, sign switches and concurrent readers.
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536). `t_hid.c` covers each call, the sample window and numbering, unit conversion, sign switches and concurrent readers.
### The SDK's IMU handles are the console's six-axis handles
- **Symptom:** a Switch 2 game's motion controls stay still and its motion calibration fails: Nintendo Switch Sports Resort's "Calibrar los sensores de movimiento de los mandos Joy-Con" ("place the Joy-Con on a flat surface") ends after 30 s with "No se ha podido completar la calibracion" every time, though `GetNpadImuSamples` is called thousands of times; `StoreSixAxisSensorCalibrationParameter` is never called (`DM_HLECOUNT`).
- **Cause:** the sensor fusion's handle is made by the SDK itself (`GetSensorFusionHandles` → `GetNpadImuHandles`, `sdk+0x6ca570` → `nn::hid::utility::GetSixAxisSensorHandle`, `sdk+0x6d8490`; the SDK's own `GetSixAxisSensorHandles` calls the same utility). That is the console's `SixAxisSensorHandle`: byte 0 the `NpadStyleIndex` (3 full key, 4 handheld, 5 Joy-Con pair, 6 left, 7 right), byte 1 the npad id, byte 2 the device (0 left and 1 right of two sensors; SDK 22 gives full key and handheld one sensor, device 2). The host's `GetSixAxisSensorHandles` put the style's bit number in byte 0 instead, and `GetNpadImuSamples` read the SDK's handle that way: a pair on No1 (`0x5`, `0x10005`) was style bit 5, never connected, so every call answered 0 samples and the fusion left at `sdk+0x6d777c` without feeding anything.
- **Fix:** the host's six-axis handles use the console's numbering too (`six_style_index`, `six_style_bit` in `hle_hid.c`; devices 0 to 2 for every style, as SDKs differ in the device they give; a style set of several styles gets the one the npad is shown in; the stored calibration of device 2 is device 0's), so the SDK's handles and the host's read the same everywhere; `t_hid.c` checks both kinds, player 2's npad and a split pair's left and right Joy-Cons.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile in the repository yet).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536).
### The Npad IMU sample holds the acceleration first
@@ -503,7 +503,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Cause:** `NpadImuSample` (0x28 bytes, `sdk+0x6ca8b8`) is the sampling number, the ns since the previous sample, the acceleration in m/s² at +0x10 and the angular velocity in rad/s at +0x1c. `UpdateSensorFusion` copies +0x10 negated (`sdk+0x6d7334`) to nn::imu's sample +0x24, which nerd's `FeedSixAxisSensorValues` (`sdk+0x6ffac0`) and `GyroPointing::FeedImuSampleNoUpdate` (`sdk+0x700e90`, `sdk+0x700f84`) take as the acceleration, and +0x1c as it is to +0x18, the angular velocity. The host wrote the angular velocity first and both negated, so the fusion took gravity (9.8 m/s²) for a 9.8 rad/s turn about the vertical (562 deg/s), its stable orientation turned at that rate and `GyroPointingCore::Recover` (`sdk+0x712aa0`) ran about once a second.
- **Fix:** `GetNpadImuSamples` writes the acceleration (G × 9.80665, −9.8 m/s² on z lying face up) at +0x10 and the angular velocity (revolutions/s × 2π) at +0x1c, in the six-axis state's own signs: the fusion negates the acceleration into a specific force and reports it as −m/s² / 9.80665 G (`sdk+0x6d74a0`), so its outputs read as the six-axis state does. The time step is the sample timestamps' (`(t − t_prev) / 1e9`, `sdk+0x700ff0`, from the samples' `delta_ns`). `DM_IMU_ACC_SIGN` / `DM_IMU_GYRO_SIGN` (`-1`) negate either and `DM_IMU_AXES` permutes the axes, for a test.
- **Check:** the same synthetic run then read an angular velocity of −0.004 deg/s (5 to 95% within ±0.17), −1.000 G on z, a stable orientation turning 0.16 deg/s, the fusion's ready flag (bit 1 of the orientation's flags word, `sdk+0x6d78f8`) set, no `Recover`, and the game's calibration passed. With a right Joy-Con 2 and with a DualSense the calibration passes and the paddle follows the controller in matches. `t_hid` (`t_imu_conversion`: a known pose through the whole conversion to the bytes the fusion reads).
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile in the repository yet).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536).
### The SDK's sensor fusion needs sensor noise and a stored calibration
@@ -511,7 +511,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Cause:** samples that never change. The fusion's stillness detector (`GyroPointingStateDetector::UpdateMovingDetection`, `sdk+0x736260`) calls the controller moving when the lag-1 autocovariance of the last 64 accelerations on x and z (m/s²) is beyond 1e-6, and its bias calibration needs the Kalman filter's bias deviation under 0.01 rad/s (`GyroPointingKalmanFilter::GetCalibrationState`, thresholds at `sdk+0xbb85b8` / `+0xbb7df8`), which an exactly constant input does not give it. On a console the fusion rarely has to learn the bias: `LoadSixAxisSensorCalibrationParameter` gives it the controller's stored calibration, which it takes as its initial bias (`sdk+0x6d7f7c`) and counts as calibrated (`+0x538`); the host answered none (`0xd8ca`). A GameController (DualSense: 0.34, 0.20, −0.66 deg/s at rest) reports its gyro with its rest offset, which a zero bias would then leave in.
- **Fix:** `GetNpadImuSamples` adds fixed Gaussian noise to the host's own samples (gyro 0.1 deg/s, acceleration 0.05 mG, a hash of the tick, device and axis, so a tick read again reads the same; `DM_IMU_NOISE=0` removes it, `=<deg/s>,<mG>` sets other spreads, also through `DM_CTL`'s `env`). A live controller carries its own noise: its interpolated ticks are left as they are, and only a tick with no change of its own (a held sample, or between two that read alike) gets a tenth of the host's noise. `LoadSixAxisSensorCalibrationParameter` answers a device with nothing stored this run with the ideal sensor's calibration (zeros, a zero bias) when the sensor's gyro offset is taken off (`six_offset_known`: the host's own sensor, a HID or Joy-Con 2 stream, the phone, a GameController once its offset is learned), else `0xd8ca` as before. The host learns a GameController's rest offset and takes it off (`motion_rest`, `motion_fusion.h`: a first offset from two agreeing still seconds, at most 2 deg/s so a slow steady turn is not taken for one, later ones only within 1.25 deg/s of it, ramped in over 0.75 s; forgotten when the stream goes stale or another controller takes the player), and drops a stream's first all-zero sample (a Joy-Con 2's first report; later zeros can be a free fall).
- **Check:** `t_hid` (`t_imu_noise`: spread, whiteness and the stillness criterion; `t_live_rest`, `t_live_still_dither`, `t_six_ic_info`, the calibration load and store) and `t_motion` (`rest_checks`). With a DualSense, over 1,876 still answers the game got a mean gyro of 0.00, −0.04, −0.00 deg/s after its offset (0.6, 0.1, −0.7 deg/s) was learned.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile in the repository yet).
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536).
### `nfp`'s extended application area
@@ -1275,7 +1275,7 @@ Most service calls can be found before they crash, before the first boot or the
- **Symptom:** a Switch 2 game crashes as a Joy-Con 2 joins: `[RED] sf: the game connects to service hid itself, which the host does not serve`, then `CRASH sig=11 addr=0` at `sdk+0x63ce10`, called from `nn::hid::EnableUnintendedHomeButtonInputProtection`.
- **Cause:** `nn::hid::EnableUnintendedHomeButtonInputProtection(const NpadIdType&, bool)` turns on a guard against a Home press made by accident on that controller. It returns nothing; the SDK's own sets the flag through the hid service, which the host does not serve, and calls through the null session.
- **Fix:** the host answers it (`hle_hid.c`), records the setting per npad (No 1-8, Other, Handheld) and logs it (`hid: EnableUnintendedHomeButtonInputProtection npad 0 on`). The question, `IsUnintendedHomeButtonInputProtectionEnabled(const NpadIdType&)`, whose SDK function asks the service too, answers what the game set, off by default. The host handles the Home button itself ([home_quit.h](../../dm/host/home_quit.h)), so nothing else changes.
- **Found on:** Drag x Drive (040041601D83A000, v196608, SDK 20; no profile in the repository yet): 43 s in, as player 1's Joy-Con 2 pair joined (`main+0x2c80c4`). Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile yet) asks the question at boot: the SDK's own aborted on its error (`Result 0x58cca` at `sdk+0x6ca40c`).
- **Found on:** Drag x Drive (040041601D83A000, v196608, SDK 20; no profile in the repository yet): 43 s in, as player 1's Joy-Con 2 pair joined (`main+0x2c80c4`). [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536) asks the question at boot: the SDK's own aborted on its error (`Result 0x58cca` at `sdk+0x6ca40c`).
- **Check:** `make -C dm/host/tests GAME=<id> run` (`t_hid`).
### GameShare guest displays
+3 -3
View File
@@ -833,7 +833,7 @@ Finding, keying and translating shaders (`dm/gfx/tools/shader_split.py`, `dmsh_b
- **Symptom:** the Mac app's (or the iPhone build's) pipeline archive step stops in its first group with `[RED] pso_offline: metal-tt failed for applegpu_<arch> (exit 1): applegpu-nt: error: cannot find private metadata at offset '8' in '…/<key>_bp.metallib'`, and the app is packed without an archive, compute pipelines included. The host's prebuild then makes every base on the first start. Only a game with the near = 0 depth mode (`depth_mode zero`) whose vertex shaders declare the border corrections' constant.
- **Cause:** `pso_offline.py` specializes a function that declares the [border corrections' constant](rendering.md#unused-border-corrections-retain-sample-registers) `dm_border_off` as the host's prebuild does (`HOST_CONSTANTS`, `pre_fn` in `nvn_mtl.m`). `metal-tt` 32023.922 specializes only a library's first function: it does not find a later function's private metadata (offset 8 is the second function's entry), also in a library linked by Apple's own `metallib`. The same function with the library's two functions swapped compiles, and the then-second `main0` fails, so it is the position, not the entry. A near = 0 game asks for `main0_z`, the second function of each pulling library `<key>_bp`; Ocarina of Time, where the specialization was first checked, uses `main0`, and a pixel library's base is its first function. One failing pipeline fails its group, and a failed group ends the step.
- **Fix:** a workaround for Apple's compiler: a specialized function that is not its library's first is specialized from a library of its own (`needs_cut`, `cut_entries`). `real_libraries` writes `<library>@<entry>.metallib` with that function alone (`dmsh_side.cut`, the bytes `metallib --function-name` gives) beside links to the group's other libraries. The archive serves the host's lookup through the whole library, as a base is found by its function, not by its library file. The script and the archive key do not change for a game whose specialized functions all come first.
- **Found on:** Bayonetta Origins: Cereza and the Lost Demon (`0100CF5010FEC000`, no profile yet; [issue #2337](https://github.com/seedds/nxnative/issues/2337), `applegpu_g14s`: 492 of 4,772 bases); [Pokémon Legends: Z-A](../../dm/games/0100F43008C44000/README.md#found-on-this-game) and [Castlevania: Belmont's Curse](../../dm/games/0100BA4026E94000/README.md#found-on-this-game) (`applegpu_g16s`); Nintendo Switch Sports Resort (`04008E001F098000`, no profile yet; [PR #2371](https://github.com/seedds/nxnative/pull/2371): 2,401 of 11,075 bases, from 124 such libraries); reproduced on an Apple M6, macOS 27.2, compiling a two-function library built by Xcode for `applegpu_g17p`. With the fix, Switch Sports Resort's 2,401 bases compiled in 96 s, and 11 sampled bases were found through the whole libraries.
- **Found on:** Bayonetta Origins: Cereza and the Lost Demon (`0100CF5010FEC000`, no profile yet; [issue #2337](https://github.com/seedds/nxnative/issues/2337), `applegpu_g14s`: 492 of 4,772 bases); [Pokémon Legends: Z-A](../../dm/games/0100F43008C44000/README.md#found-on-this-game) and [Castlevania: Belmont's Curse](../../dm/games/0100BA4026E94000/README.md#found-on-this-game) (`applegpu_g16s`); [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`; [PR #2371](https://github.com/seedds/nxnative/pull/2371): 2,401 of 11,075 bases, from 124 such libraries); reproduced on an Apple M6, macOS 27.2, compiling a two-function library built by Xcode for `applegpu_g17p`. With the fix, Switch Sports Resort's 2,401 bases compiled in 96 s, and 11 sampled bases were found through the whole libraries.
- **Check:** `test_pso_offline.py` (`test_a_specialized_function_after_the_first_has_a_library_of_its_own`, and with Xcode `test_the_cut_library_holds_the_function_alone`); `t_pso_bundle` (a pulling library whose `main0` and `main0_z` declare the constant, archived for near = 0: `pre_desc` finds its `main0_z` base and no `main0` base; without the fix `pso_offline.py` fails).
### Tests of one uniform word folded into switches
@@ -841,7 +841,7 @@ Finding, keying and translating shaders (`dm/gfx/tools/shader_split.py`, `dmsh_b
- **Symptom:** the Mac app's (or the iPhone build's) pipeline archive step runs for many hours: a group of 1,000 bases runs past its time limit, and `compile_split` leaves out single pipelines that each ran past theirs (`[RED] pso_offline: applegpu_<gpu>: left out of the archive, the device builds it`), while `air-nt` grows past the Mac's memory and swap fills. Alone, such a pipeline does not finish in 10 minutes and takes 10 to 13 GB, where the build before took seconds. On the device, the same pipelines would hold `Preparing pipelines` for as long.
- **Cause:** a game's material shader chooses a branch by a uniform word, and the translator writes the GLSL switch as Ryujinx's structurizer gives it: one test of the word for each case, with flags for the fall-throughs and each case nested in the next (`bool _6240 = as_type<int>((*spvDescriptorSet0.fp_c5)._m0[16].w) != 102; if (!_6240) { … }`). The Metal front end's SimplifyCFG (which runs at [-O1](#front-end-at--o1-apples-control-flow-lowering) too) folds a chain of blocks that each hold only such a test of one value into a `switch`, whose cases jump into the nested blocks past their joins, and Apple's GPU compiler (`applegpu-nt`, AIR-TT 32023.922) takes that graph for hours. Turning the switches back into compares (`metal-opt -passes=lowerswitch`) does not help: the graph is the cost, not the instruction. Before the host bounded [reads at fixed offsets](#reads-past-a-uniform-bindings-size) (chain `b7249b1c2b66`), each read's bounds test sat in the test's own block, so no chain was folded; with the reads plain, Nintendo Switch Sports Resort's pixel shader `692008b305ce264f` has 42 switches in its IR (none before) and `7c2becb054a53765` 66 (6 before).
- **Fix:** every game, a chain change. `dmsh_rewrite.uniform_tests`, called by `dmsh_build.py` after the other rewrites (and on the geometry stage and its reader), reads a word of a game uniform slot (`c3` and up; the driver's banks are left as written) that the shader tests for equality with an integer constant more than once through `dm_uword`, a volatile load of that word for each test (`as_type<int>(dm_uword((*spvDescriptorSet0.fp_c5)._m0[16], 3)) != 102`). The front end can neither merge one test's load with the next nor move it out of its block, so it folds no chain. A uniform load per test is less than the bounds test each read had before. A word tested once, a test against a variable, and an ordering test are left as they are.
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, no profile yet): with chain `b7249b1c2b66` the Mac app's archive ran 15 hours in its first group (vertex `1f0649e274faa626`, `1552eae0ea641bcd` and `24ce8042ec8edfff` with pixel `7c2becb054a53765`, vertex `2265ca4db20439bf` with pixel `692008b305ce264f`, each left out after about 30 minutes alone), where chain `592225da745b` had built 1,000 bases in about 3 minutes. Measured alone with `metal-tt` 32023.922 (`applegpu_g14s`, macOS 27.2, M2 Max with 32 GB), `2265ca4db20439bf` + `692008b305ce264f`: chain `592225da745b` 7.4 s and 0.25 GB; chain `b7249b1c2b66` stopped at 10 minutes and 13.4 GB; that chain's vertex library with the old pixel library 4.2 s, the old vertex library with the new pixel library stopped at 5 minutes and 10 GB; the old MSL with the fixed-offset bounds tests taken out stopped at 5 minutes; the same with the tests kept only on the 910 reads that feed an equality test, 3.1 s; with `uniform_tests`, 6.3 s and 0.21 GB. `1f0649e274faa626` + `7c2becb054a53765` with `uniform_tests`: 11.5 s and 0.45 GB.
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`): with chain `b7249b1c2b66` the Mac app's archive ran 15 hours in its first group (vertex `1f0649e274faa626`, `1552eae0ea641bcd` and `24ce8042ec8edfff` with pixel `7c2becb054a53765`, vertex `2265ca4db20439bf` with pixel `692008b305ce264f`, each left out after about 30 minutes alone), where chain `592225da745b` had built 1,000 bases in about 3 minutes. Measured alone with `metal-tt` 32023.922 (`applegpu_g14s`, macOS 27.2, M2 Max with 32 GB), `2265ca4db20439bf` + `692008b305ce264f`: chain `592225da745b` 7.4 s and 0.25 GB; chain `b7249b1c2b66` stopped at 10 minutes and 13.4 GB; that chain's vertex library with the old pixel library 4.2 s, the old vertex library with the new pixel library stopped at 5 minutes and 10 GB; the old MSL with the fixed-offset bounds tests taken out stopped at 5 minutes; the same with the tests kept only on the 910 reads that feed an equality test, 3.1 s; with `uniform_tests`, 6.3 s and 0.21 GB. `1f0649e274faa626` + `7c2becb054a53765` with `uniform_tests`: 11.5 s and 0.45 GB.
- **Check:** `python3 dm/gfx/tests/test_dmsh_uniform_tests.py` (the forms it rewrites and leaves; with Xcode, the plain shader's IR has a switch with `dmsh_build.py`'s and `ios_metal.py`'s commands and the rewritten one none).
### Bracket nesting past the front end's 256
@@ -1474,7 +1474,7 @@ Finding, keying and translating shaders (`dm/gfx/tools/shader_split.py`, `dmsh_b
- **Symptom:** a Switch 2 game's water or another full-screen surface draws black (or as a flat dark colour under the fog) while its normals and depth are right; a texture dump of the target shows the colour channel at 0 where the surface is, and building the shader without fast maths changes nothing.
- **Cause:** S2UR of system register 0x84 (Mesa NAK's `NAK_SV_VARIABLE_RATE`): the fragment's size in pixels, X in bits 8..15 and Y in bits 16..23, which variable rate shading makes 2 or 4. The translator did not know the register and gave 0, the default for an unknown one. Nintendo Switch Sports Resort's sea shaders divide a blend weight by the fragment's area: 0, an infinite weight, and the colour came out NaN, which `blend_zero` (`dm_az`) writes as 0.
- **Fix:** `SReg.VariableRate` (132, `Decoders/InstDecoders.cs`) reads `0x10100` in `EmitSReg` (`Instructions/InstEmitMove.cs`): the host shades every pixel, so 1 x 1 (chain change).
- **Found on:** Nintendo Switch Sports Resort (`04008E001F098000`, v65536; no profile yet): 612 of its 11,059 shaders, all pixel shaders, read the register; its title screen's sea was black and draws blue with the change, on the Mac.
- **Found on:** [Nintendo Switch Sports Resort](../../dm/games/04008E001F098000/README.md) (`04008E001F098000`, v65536): 612 of its 11,059 shaders, all pixel shaders, read the register; its title screen's sea was black and draws blue with the change, on the Mac.
- **Check:** `test_dmsh_ampere_mem.py` (`ShadingRate`, with `DMSH_TEST_XLATE`).
### VOTEU writes the uniform predicate