Skip to content

Pokémon Mystery Dungeon: Rescue Team DX: a build row and cuts for update 1.0.2 (v131072) - #568

Closed
shamonj03 wants to merge 2 commits into
igawa6:mainfrom
shamonj03:pr/pmd-update-1.0.2-on-502
Closed

shamonj03 wants to merge 2 commits into
igawa6:mainfrom
shamonj03:pr/pmd-update-1.0.2-on-502

Conversation

@shamonj03

Copy link
Copy Markdown
Contributor

Summary

This PR makes Pokémon Mystery Dungeon: Rescue Team DX update 1.0.2 (v131072) a build of the existing profile, with its own start-hang cuts. The profile in #502 covers the base game 1.0.0 only, and 1.0.2 has a different main, so its starts had no fix. The review of #502 asked for this.

Stacked on #502. The branch is #502's commit (dfd5a8c7, unchanged) and one commit on top, b9853c1f. Review that commit. The game note keeps the wording of the maintainer's edit to #502's note (the 0.1.8 list, no em dashes) and adds 1.0.2 on top, so it merges with either order.

Why the same 131 cuts. 1.0.2's main (build ID 3ab632dee82d59448599b2291f30994a) has the same 91 writer and 38 reader sites of the ThreadedStreamBuffer handshake as 1.0.0, found again by shape. Every site is exactly 0x40 higher than in 1.0.0. patches.py gets a second key with the 131 ldr to ldar cuts, and the rewriter checks each cut's original word as before.

No new shader tables. Splitting 1.0.0 and 1.0.2 together with shader_split.py gives the same 9,817 programs and the same keys as 1.0.0 alone. Only the main#GLSLC@ offsets in the source column of the 180 programs in main differ when 1.0.2 is split alone. game.tsv lists shader_versions v0 v131072; subsdk0 and sdk are the same build IDs.

No shader-chain change. The chain headers and dmsh_chain.lock are untouched.

Checked

  • Python tests: test_game_profile 22 OK and test_patches 16 OK (both with DM_GAME=01003D200BAA2000), check-profiles.sh 172 titles OK, check-runtime-profile.sh 172 profiles OK, upstream-update.sh --check main passes, check-publish.sh clean, docs_patches.py --check current.
  • Pack of 1.0.2 from a .nup of the base .nsp and the update: cuts 131 in the rewrite log, 9,913 shader modules valid for spirv-val. main.patched.bin md5 c1d1c1b04e57bfb9b10132ba0ace25f6.
  • AYN Thor, Turnip 27.0.0-R2, 2026-11-24, PN_BUILD_ID=3AB632DEE82D5944..., started from the library with no env.txt. 1.0.2 was played as far as the entrance of Thunderwave Cave, with fights and a save, in two sessions: logs 01003D200BAA2000-20261124-083926.log (7,692 frames) and 01003D200BAA2000-20261124-090219.log. Both show a 29.9 fps median (p95 34.0 and 35.2 ms, worst long frame about 1,094 ms in the first scene), no watchdog line and no CRASH.
  • The threads.md line for this game now carries a PEANUTS marker, which upstream-update.sh --check main asks for and Add a profile for Pokémon Mystery Dungeon: Rescue Team DX (01003D200BAA2000), with the patch that fixes its start hang on 1.0.0 and 1.0.2 #502's line lacked.

Docs

Device test

  • Device: AYN Thor, Adreno 740, Android 13, 14.9 GiB RAM, test app dev.nxnative.android.peanutstest.
  • Driver: Turnip 27.0.0-R2 (Mesa 27.0.0-devel, driver ID 18), launched from the library.
  • Commands: python3 scripts/pack_android.py <nup> --version 131072 --shader-pkg <split>, peanuts/scripts/push-pack.py <pack> --game <nup> --dest "/sdcard/ROMs/switch/<name>", ./gradlew apk -PnxApp=peanuts -PnxAppId=peanutstest -PnxLabel="Peanuts test" -PnxGames=<ids> -PnxPackEngine=fake (JDK 21), adb install -r <apk>, then a library launch.
  • Logs: no log file is attached; the figures come from the test app's own run logs named above.

…AA2000), with the patch that fixes its start hang

The game is Unity 2018.3.12f1 IL2CPP with FMOD, SDK 7.4.0, built 64-bit. The
profile is provisional: packed from our own .nup (v0 dump, SDK 7.4.0), 9,817
shaders, matching the count in seedds/nxnative PR #1868 (closed, not merged);
our tables were generated on this dump, not copied from that PR.

The game's own build carries the start-hang race that FINAL FANTASY CRYSTAL
CHRONICLES Remastered Edition showed: Unity 2018's ThreadedStreamBuffer wakes a
sleeping side with a Dekker handshake, and each side's second access is a plain
ldr that AArch64 may complete before the earlier store-release is visible, so
neither side wakes the other. On an AYN Thor this stopped 4 of 6 starts, 3 of
3 with DM_WATCH=30: the main thread and UnityGfxDeviceWorker waited on their own
semaphores one wake-up apart, no frame, no sound, no crash. This build inlines
the two checks into 91 writers and 38 readers, so patches.py carries 131 cuts
(not FFCC's 8), each gated by the main.nso build ID
ca19d0695861144b8a0fd0c438264a76: every site was found by shape in the
decompressed main (stlr of one field, then a plain ldr of the partner field from
the same base), and the rewriter checks each cut's original word before applying.
Every site becomes a load-acquire (ldar).

Checked 2026-11-23: test_game_profile 22 tests OK (DM_GAME=01003D200BAA2000),
test_patches 16 OK, check-profiles.sh 172 titles OK, check-runtime-profile.sh
172 profiles OK, upstream-update.sh --check main passes the hunk-marker check,
check-publish.sh clean, test_docs shows the 40 known broken links and none new.
On the phone (AYN Thor, Adreno 740, Android 13, 14.9 GiB): the first launch on
Turnip prepared 5,141 shader programs in 2.2 s and showed the game's own
language-select screen at 30 FPS, GPU 2.3 ms, no crash; two trial starts and a
play-test on the patched pack ran 29.9 fps with zero watchdog events, the
play-test past 634 frames with 0 dropped frames. The old hang window is gone.

Not checked: 20 consecutive starts (planned, not run); play beyond the
language-select screen (deliberate: it writes the only save); in-game scenes
beyond the intro. Known open issue, documented in the game note: on the
launcher's system (Qualcomm) driver the game renders with missing texture
content (the intro's Pelippers, in-game foliage draws solid green); Turnip
renders both scenes correctly. The cause is in the host's Adreno-740 path,
not this profile.

The chain headers and dmsh_chain.lock are untouched, by design: a PR adds a
game's profile tables, and the maintainer regenerates the chain;
test_version_header_current is not affected by this change.
…ate 1.0.2 (v131072)

The start-hang fix of the profile covered only the base game 1.0.0, whose main
build ID is ca19d069.... Update 1.0.2 has a new main (3ab632de...), so its
starts could hang with no fix. game.tsv now has a build row for it, and
patches.py a second key with the same 131 ldr to ldar cuts. They are the same
sites as in 1.0.0, found again by shape in the update's main: every one is
0x40 higher than in 1.0.0. The rewriter checks each cut's original word before
applying it.

subsdk0 and sdk are the same build IDs. Splitting 1.0.0 and 1.0.2 together with
shader_split.py gives the same 9,817 programs with the same keys as 1.0.0
alone (only the main#GLSLC@ offsets in the source column of the 180 programs
in main differ when 1.0.2 is split alone), so the shader tables are unchanged
and shader_versions lists v0 v131072. package says v131072.

The game note keeps the wording of the maintainer's edit to the igawa6#502 note (the
0.1.8 list, no em dashes) and adds 1.0.2 on top. The game note, the row in dm/games/README.md, UPSTREAM-EDITS.md and the Found-on
entry in docs/reference/threads.md name both builds; game-patches.md is
regenerated. The threads.md line now carries a PEANUTS marker, which
upstream-update.sh --check main asks for.

Checked on an AYN Thor (Adreno 740, Android 13), 2026-11-24: pack from a .nup
of the base .nsp and the update, cuts 131, 9,913 shader modules valid for
spirv-val. On Turnip 27.0.0-R2, PN_BUILD_ID 3AB632DE..., 1.0.2 was played as
far as the entrance of Thunderwave Cave, with fights and a save, in two
sessions (logs 01003D200BAA2000-20261124-083926.log and -090219.log): 29.9 fps
median in both, no watchdog line, no crash. test_game_profile 22 OK,
test_patches 16 OK, check-profiles.sh 172 titles OK, check-runtime-profile.sh
172 profiles OK, upstream-update.sh --check main passes, docs_patches.py
current. The game note's Status line now describes both versions as played the
same way.
@shamonj03

Copy link
Copy Markdown
Contributor Author

Closing this: the 1.0.2 change goes into #502 instead.

@shamonj03 shamonj03 closed this Nov 24, 2026
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.

1 participant