Skip to content

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

Closed
shamonj03 wants to merge 2 commits into
igawa6:mainfrom
shamonj03:pr/pmd-rescue-team-dx
Closed

shamonj03 wants to merge 2 commits into
igawa6:mainfrom
shamonj03:pr/pmd-rescue-team-dx

Conversation

@shamonj03

@shamonj03 shamonj03 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR makes Pokémon Mystery Dungeon: Rescue Team DX (01003D200BAA2000, base 1.0.0 and update 1.0.2) start and play on
the Android test app, on both GPU drivers. It adds the game's profile and a patch that closes the
Unity 2018 ThreadedStreamBuffer start-hang race on both builds. RickGamer987 asked for the title on Discord.

Why 131 cut sites. Each build inlines the race's two checks into 91 writer sites and 38 reader sites.
Each cut in the profile's patches.py turns one ldr load into ldar, gated by the main.nso build ID
(ca19d0695861144b8a0fd0c438264a76 for 1.0.0, 3ab632dee82d59448599b2291f30994a for 1.0.2), and each checks the word it replaces.
1.0.2 has the same 131 sites, each 0x40 higher, found again by shape in its own main. The race and its handshake are
documented for FINAL FANTASY CRYSTAL CHRONICLES Remastered in docs/reference/threads.md.

One set of 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,
so game.tsv lists shader_versions v0 v131072 and the tables are unchanged.

The measurable difference. On 1.0.0, before the patch, 4 of 6 starts on an AYN Thor hung at random points with no
frame, no audio, and no crash. After it, 20 of 20 starts render, and a five-minute session plays into the
story and saves the game.

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

Checked

All device runs on 2026-11-23 on an AYN Thor (Adreno 740, Android 13, 14.9 GiB RAM), test app
dev.nxnative.android, pack 01003D200BAA2000 base 1.0.0 (v0), APK md5 be707905e761f8f20a13568133c0b674.

  • Python tests: test_game_profile 22 OK, test_patches 16 OK (both with DM_GAME=01003D200BAA2000),
    check-profiles.sh 172 titles OK, check-publish.sh clean, test_docs only the known broken links.
    Also check-runtime-profile.sh 172 profiles OK and upstream-update.sh --check main passes.
  • Turnip 27.0.0-R2, log 01003D200BAA2000-20261123-123914.log: 710+ frames at 29.9 fps, 0 skipped draws, no
    new [RED] lines.
  • Turnip, one five-minute play session, log 01003D200BAA2000-20261123-161915.log: frame 8,466, every fps
    window 29.9-30.0, no watchdog: no progress. Play covered the title screen, Cubone select, the Eevee story
    scene, combat in Tiny Woods, and a save at the base's house. Four screenshots are attached.
  • System driver (Qualcomm Adreno, driver ID 8), log 01003D200BAA2000-20261123-123853.log: clean start past
    audio #0 Start into fs mount PEGASUS, 65 frames at 2.5 fps during the documented lazy-compile window,
    clean suspend.
  • 20 starts on the patched pack: all 20 rendered, zero watchdog: no progress and zero CRASH lines. The
    eight back-to-back launch logs (…-163059 through …-163240) each pass frame 1,070. The unpatched build
    had hung in 4 of 6 starts with no frames at all.
  • 1.0.2, 2026-11-24, Turnip 27.0.0-R2, logs 01003D200BAA2000-20261124-083926.log (7,692 frames) and 01003D200BAA2000-20261124-090219.log: started from the library with no env.txt,
    PN_BUILD_ID=3AB632DEE82D5944.... We played as far as the entrance of Thunderwave Cave, fought enemies and saved the game. Both logs 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.
  • Speed: 29.9-30.0 fps steady on Turnip. First scene 2.5-2.7 fps during shader compile. Worst long frame
    1,061 ms in the first scene.

Docs

  • The finding is written up in the game note dm/games/01003D200BAA2000/README.md,
    docs/reference/threads.md gains its second "Found on" entry, and we ran docs_symptoms.py.
  • No chain tool changed. The maintainer regenerates the chain headers, so test_version_header_current
    fails by design.
  • No game files, keys, saves or data extracted from a game.
  • Source only, the branch starts from the current main. Two commits: the profile with its 1.0.0 cuts, and the 1.0.2 build row and cuts on top.
  • Not a shader-chain change, so no impact report applies. The tested pack binary main.patched.bin has
    md5 49e2eda1917e5c6f1b55095eed4911c6 and was built from this branch's tree.

Not checked

  • Texture content on the system driver. The intro's Pelipper renders nearly untextured and foliage draws
    solid green. It produces no log lines, does not happen on Turnip, and is not caused by this change. A
    separate issue will follow.

Device test

  • Device: AYN Thor, Adreno 740, Android 13, 14.9 GiB RAM, test app dev.nxnative.android, pack
    01003D200BAA2000 base 1.0.0 (v0)
  • Build hash: test APK md5 be707905e761f8f20a13568133c0b674. The tested pack binary main.patched.bin has
    md5 49e2eda1917e5c6f1b55095eed4911c6 and was built from this branch's tree.
  • 1.0.2 pack: a .nup of the base .nsp and the update, --version 131072. cuts 131, 9,913 shader modules valid for spirv-val,
    main.patched.bin md5 c1d1c1b04e57bfb9b10132ba0ace25f6.
  • Driver: Turnip 27.0.0-R2 (Mesa 27.0.0-devel, driver ID 18) and the launcher's system driver (Qualcomm
    Adreno, driver ID 8, version 0x802a4035). Both launched from the library with no env.txt.
  • Commands: ./gradlew apk -PnxApp=peanuts -PnxAppId=peanutstest -PnxLabel="Peanuts test" -PnxGames=01003D200BAA2000 -PnxPackEngine=fake (JDK 21), peanuts/scripts/push-pack.py <pack> --dest "/sdcard/Peanut Roms/<name>", adb install -r <apk>, then a library launch on each driver.
  • Log link: no log file is attached. The figures above come from the test app's own run logs for title
    01003D200BAA2000 on 2026-11-23, in the app's log folder on the device
    (/sdcard/Android/data/dev.nxnative.android.peanutstest/files/logs/): …-123914.log (Turnip),
    …-123853.log (system), …-161915.log (the five-minute play session), and the eight sweep launches
    …-163059 through …-163240.

Attachments

2026-11-23-111126-turnip-title-screen 2026-11-23-111304-turnip-cubone-select 2026-11-23-111503-turnip-story-scene-eevee 2026-11-23-111601-turnip-tiny-woods-b1f-combat

…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.
@igawa6 igawa6 added the new-game Requests and reports for adding games or game profiles label Nov 24, 2026
igawa6 added a commit that referenced this pull request Nov 24, 2026
…list; its note says to build from 1.0.0

release-titles.txt and games.tsv rows; README tables, games.json, the issue forms and game-patches.md regenerated; its frame rate list pinned. Its note said it was on no list and stopped at the language-select screen: it is on 0.1.8's list and plays past the start hang, which is fixed for 1.0.0's code only (update 1.0.2 has no build row and no fix, so a build with it can hang). No em dashes in the note (review of #502).
igawa6 added a commit that referenced this pull request Nov 24, 2026
#502: Pokémon Mystery Dungeon: Rescue Team DX, with the patch that fixes its start hang (1.0.0). #540: Engage 2.0.0 takes the SDK-wide region rules (node area and 2 MB alignment); AYN Thor, Turnip: both rules matched at their 5 sites, the address region at alias +0.06 GB, intro and attract demo at 60 fps for 5 minutes with no crash (the prologue battle and save/load not run).
Held from this batch after review: #526 (LSFG pacing), #528 (add-on unmount), #530 (DRAGON BALL FIGHTERZ).
@igawa6

igawa6 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Landed in dev-0.1.8 for 0.1.8 (commit a5aebaa in merge 37a6a59), you as its author, and the game is on the 0.1.8 list.

We fixed the note in a commit of ours (d569bab): its Status line still said the game was on no list and stopped at language-select, and it now says to build from the base game 1.0.0, since the hang fix is for 1.0.0's code only and update 1.0.2 has no build row yet. We also took out the em dashes.

From the review, if you get to it: a build row (with its own cuts, or a function-matched rule) for update 1.0.2 would help most players, and the logs of the 20 starts would back the note (the landed commit message said they were planned, the note says they were run). Thanks!

@igawa6 igawa6 added the landed-0.1.8 Landed on the dev-0.1.8 line by cherry-pick; close when 0.1.8 is published label Nov 24, 2026
@shamonj03

shamonj03 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Good catch and apologize for the mismatching stories, the PR body is correct. I should have reviewed closer. Also, I have the update/dlc. I'll try it out after work today, looks like I just never loaded it on the dev/test app.

…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 shamonj03 changed the title Add a profile for Pokémon Mystery Dungeon: Rescue Team DX (01003D200BAA2000), with the patch that fixes its start hang 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 Nov 24, 2026
@shamonj03

shamonj03 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Landed in dev-0.1.8 for 0.1.8 (commit a5aebaa in merge 37a6a59), you as its author, and the game is on the 0.1.8 list.

We fixed the note in a commit of ours (d569bab): its Status line still said the game was on no list and stopped at language-select, and it now says to build from the base game 1.0.0, since the hang fix is for 1.0.0's code only and update 1.0.2 has no build row yet. We also took out the em dashes.

From the review, if you get to it: a build row (with its own cuts, or a function-matched rule) for update 1.0.2 would help most players, and the logs of the 20 starts would back the note (the landed commit message said they were planned, the note says they were run). Thanks!

Alright, I updated the PR with the 1.0.2 cuts and some corrections to the notes/comments. I got a little torn on if it should be a new pr or not given you already cherry picked this to the devel branch so I ended up just closing that other PR and building off of this one.

igawa6 added a commit that referenced this pull request Nov 24, 2026
…list; its note says to build from 1.0.0

release-titles.txt and games.tsv rows; README tables, games.json, the issue forms and game-patches.md regenerated; its frame rate list pinned. Its note said it was on no list and stopped at the language-select screen: it is on 0.1.8's list and plays past the start hang, which is fixed for 1.0.0's code only (update 1.0.2 has no build row and no fix, so a build with it can hang). No em dashes in the note (review of #502).
igawa6 added a commit that referenced this pull request Nov 24, 2026
shamonj03 (#502, #419, #420, #417, #418), fireworksordie (#245), nomnomab
(#332, its profile), danielcamilo1 (#397), g0giberry (#521) and gerdguerrero
(#540), each the author of the commits that landed on this branch. README.md,
its GitHub mirror and AboutData.CONTRIBUTED together, as the About test ties
them.
@igawa6

igawa6 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks! This is part of Peanuts Native 0.1.8, released today: https://github.com/igawa6/peanuts-native/releases/tag/v0.1.8-1

Closing as released. If something is not working as it should in 0.1.8, please open an issue.

@igawa6 igawa6 closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

landed-0.1.8 Landed on the dev-0.1.8 line by cherry-pick; close when 0.1.8 is published new-game Requests and reports for adding games or game profiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants