From b9abf199308205e662ca0375704e641f413f6fc7 Mon Sep 17 00:00:00 2001 From: shamonj03 <962202+shamonj03@users.noreply.github.com> Date: Tue, 24 Nov 2026 09:00:45 -0600 Subject: [PATCH] =?UTF-8?q?Pok=C3=A9mon=20Mystery=20Dungeon:=20Rescue=20Te?= =?UTF-8?q?am=20DX:=20a=20build=20row=20and=20cuts=20for=20update=201.0.2?= =?UTF-8?q?=20(v131072)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 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. --- dm/games/01003D200BAA2000/README.md | 19 ++-- dm/games/01003D200BAA2000/game.tsv | 9 +- dm/games/01003D200BAA2000/patches.py | 140 ++++++++++++++++++++++++++- dm/games/README.md | 2 +- docs/agents/game-patches.md | 136 +++++++++++++++++++++++++- docs/reference/threads.md | 2 +- peanuts/UPSTREAM-EDITS.md | 2 +- 7 files changed, 289 insertions(+), 21 deletions(-) diff --git a/dm/games/01003D200BAA2000/README.md b/dm/games/01003D200BAA2000/README.md index 10c01e3d..b9435807 100644 --- a/dm/games/01003D200BAA2000/README.md +++ b/dm/games/01003D200BAA2000/README.md @@ -1,26 +1,27 @@ # Pokémon Mystery Dungeon: Rescue Team DX (`01003D200BAA2000`) -Base game 1.0.0 (`v0`), SDK 7.4.0. **Unity 2018.3.12f1** (IL2CPP) with FMOD, rendering with **NVN**, 64-bit (the NPDM's byte 0xC is 0x17). Modules `main`, `subsdk0` and `sdk`. The closest profiles are the other Unity 2018 ones: [Raging Loop](../010020400E1C2000/README.md) (Unity 2018.3.10f1), [FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition](../0100CE4010AAC000/README.md) (Unity 2018.4.2f1) and [Monster Sanctuary](../0100A0F00DA68000/README.md) (Unity 2018.4.23f1). +Base game 1.0.0 (`v0`) and update 1.0.2 (`v131072`), SDK 7.4.0 in both. **Unity 2018.3.12f1** (IL2CPP) with FMOD, rendering with **NVN**, 64-bit (the NPDM's byte 0xC is 0x17). Modules `main`, `subsdk0` and `sdk`. The closest profiles are the other Unity 2018 ones: [Raging Loop](../010020400E1C2000/README.md) (Unity 2018.3.10f1), [FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition](../0100CE4010AAC000/README.md) (Unity 2018.4.2f1) and [Monster Sanctuary](../0100A0F00DA68000/README.md) (Unity 2018.4.23f1). ## Status -**Provisional.** The profile is the survey's: `scripts/build_ipa_from_nsp.py` with `dm/games/profile_guess.py` wrote `game.tsv` and `shader_split.py` wrote the shader tables beside it. Nothing in it was checked by hand. It runs on an AYN Thor (Snapdragon 8 Gen 2, Turnip 27.0.0-R2) to the game's language-select screen at 30 FPS on the starts that get there; see [Found on this game](#found-on-this-game) for the start hang that patches.py addresses. It is not in any list of supported games. +**Provisional.** The profile is the survey's: `scripts/build_ipa_from_nsp.py` with `dm/games/profile_guess.py` wrote `game.tsv` and `shader_split.py` wrote the shader tables beside it. Nothing in it was checked by hand. On an AYN Thor (Snapdragon 8 Gen 2, Turnip 27.0.0-R2) 1.0.0 and 1.0.2 both start and play: on each we played the first dungeon and the base up to the entrance of Thunderwave Cave, fought enemies and saved the game. See [Found on this game](#found-on-this-game) for the start hang that patches.py addresses and [Open](#open) for what was not tested. It is not in any list of supported games. ## Builds -| Module | Build ID | -|---|---| -| `main` | `ca19d0695861144b8a0fd0c438264a76` | -| `subsdk0` | `baee264d3658fc6b6b581e5cbb662e3a` | -| `sdk` | `e30d2170165e907aba457c79fd83383d` | +| Module | 1.0.0 (`v0`) | 1.0.2 (`v131072`) | +|---|---|---| +| `main` | `ca19d0695861144b8a0fd0c438264a76` | `3ab632dee82d59448599b2291f30994a` | +| `subsdk0` | `baee264d3658fc6b6b581e5cbb662e3a` | `baee264d3658fc6b6b581e5cbb662e3a` | +| `sdk` | `e30d2170165e907aba457c79fd83383d` | `e30d2170165e907aba457c79fd83383d` | -The display version is the base game's: 1.0.0, `v0`. Only the base game is packed: the profile's `build`, `package` and `shader_versions` rows all say `v0`. There is no update row and no DLC imported (see [Open](#open)). +The display version of `v0` is 1.0.0 and of `v131072` 1.0.2. Only `main` differs between them. `package` says `v131072` and `shader_versions` lists `v0 v131072`. The profile has no DLC (see [Open](#open)). ## Shaders - `shader_split.py` found 9,817 programs: 16 compute, 5 geometry, 4,681 pixel, 5,115 vertex, and printed no `[RED]` line. - By source: 9,637 in `data` — 2,671 UnityFS bundles, 1.92 GB, under `Data/StreamingAssets/ab` (`shader_groups /Data/=data`) — and 180 in `main`, taken from 584 GLSLC output magics, of which 180 read whole. +- Splitting 1.0.0 and 1.0.2 together (`shader_split.py` with both RomFS and `main` paths) gives the same 9,817 programs with the same keys as 1.0.0 alone, so the tables are 1.0.0's row for row. Split alone, 1.0.2 differs only in the `main#GLSLC@` offsets in the source column of the 180 programs in `main`. - `shader_pairs.tsv` has 44 variation pairs. - On Turnip a cold start reads the profile's tables and prepares 5,141 programs before the game starts (`shader parts: 5141 programs of the profile (5141 prepared)`); warm runs serve them from the driver's parts @@ -68,5 +69,5 @@ The keys are the survey's, as generated; the heap check that would correct them - On the launcher's system driver the game renders with missing texture content: the intro's Pelippers missing most of its textures, in-game foliage drawing solid green. The logs are silent (no `[RED]` lines, no skipped draws) and Turnip renders both correctly — a host Adreno-740 path issue, filed separately. -- No build row for the update 1.0.2 (`v131072`, `main` build ID `3ab632dee82d59448599b2291f30994a`). +- Update 1.0.2 has its own `main` build ID and 131 cuts: the same sites as 1.0.0, each 0x40 higher, found again by shape in its `main`. On Turnip we played it as far as the entrance of Thunderwave Cave, fought enemies and saved the game (logs `01003D200BAA2000-20261124-083926.log` and `-090219.log`: 29.9 fps median in both, no `watchdog` line, no crash). - The DLC (`01003D200BAA2800`) is not imported. diff --git a/dm/games/01003D200BAA2000/game.tsv b/dm/games/01003D200BAA2000/game.tsv index c32f2127..9786d009 100644 --- a/dm/games/01003D200BAA2000/game.tsv +++ b/dm/games/01003D200BAA2000/game.tsv @@ -1,5 +1,5 @@ -# Provisional game profile of Pokémon Mystery Dungeon: Rescue Team DX (Switch, base game 1.0.0, v0), Unity 2018.3.12f1 IL2CPP with FMOD, SDK 7.4.0, NVN. -# Generated by scripts/build_ipa_from_nsp.py from the survey with dm/games/profile_guess.py, with the shader tables written by shader_split.py from the base NSP v0; not checked by hand and tried on one handheld. README.md beside this file. +# Provisional game profile of Pokémon Mystery Dungeon: Rescue Team DX (Switch, base game 1.0.0 (v0) and update 1.0.2 (v131072)), Unity 2018.3.12f1 IL2CPP with FMOD, SDK 7.4.0, NVN. +# Generated by scripts/build_ipa_from_nsp.py from the survey with dm/games/profile_guess.py, with the shader tables written by shader_split.py from the base NSP v0 (splitting 1.0.2 with it gives the same keys); not checked by hand and tried on one handheld. README.md beside this file. # PEANUTS: new profile, provisional (see README.md) # ---- Identity ---- @@ -13,8 +13,9 @@ app_category public.app-category.games # ---- Versions ---- build v0 1.0.0 main=ca19d0695861144b8a0fd0c438264a76 subsdk0=baee264d3658fc6b6b581e5cbb662e3a sdk=e30d2170165e907aba457c79fd83383d -package v0 -shader_versions v0 +build v131072 1.0.2 main=3ab632dee82d59448599b2291f30994a subsdk0=baee264d3658fc6b6b581e5cbb662e3a sdk=e30d2170165e907aba457c79fd83383d +package v131072 +shader_versions v0 v131072 # ---- Files ---- # every module main imports from diff --git a/dm/games/01003D200BAA2000/patches.py b/dm/games/01003D200BAA2000/patches.py index da3b0125..35079903 100644 --- a/dm/games/01003D200BAA2000/patches.py +++ b/dm/games/01003D200BAA2000/patches.py @@ -7,8 +7,8 @@ # (main+0x1684438 / main+0x1684440, in the function whose AcquireSemaphore call returns to main+0x16844c8: the frame the hung UnityGfxDeviceWorker and BatchDeleteObjects wait in); # a writer stores the write position with a store-release and then checks that flag with a plain load. The mirror pair: a writer short of space sets "writer sleeping" (+0xd8) # and loads the read position (+0x40) again (main+0x16851b0 / main+0x16851b8), and the reader stores the read position and checks that flag. The second access of each side is a -# plain ldr, and AArch64 lets a plain load complete before an earlier store-release is visible, so both sides can read the old value and neither wakes the other. In this build -# the two checks are inlined into 91 writers and 38 readers, so there are 131 sites, not FFCC's 8. On the Snapdragon of the AYN Thor this stopped 4 of 6 game starts (3 of 3 with +# plain ldr, and AArch64 lets a plain load complete before an earlier store-release is visible, so both sides can read the old value and neither wakes the other. In both builds +# (1.0.0 and the 1.0.2 update) the two checks are inlined into 91 writers and 38 readers, so there are 131 sites in each, not FFCC's 8; the offsets named here are 1.0.0's, and each of 1.0.2's is 0x40 higher. On the Snapdragon of the AYN Thor this stopped 4 of 6 game starts (3 of 3 with # DM_WATCH=30) at random points, from just after `audio #0 Start` to after the first frame: no frame, no sound, no crash; four thread dumps are alike: the main thread waits on a # per-job condition variable after posting a command to UnityGfxDeviceWorker, which went back to sleep on its own, its wait one number after the main thread's. Each of those plain # loads becomes a load-acquire (ldar), which a store-release before it orders after the store. Every site was found by shape (stlr of one field, then a plain ldr of the partner field @@ -147,12 +147,146 @@ (0x1aa9ebc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), (0x1aa9f44, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), ], + # update 1.0.2 (v131072): same 131 sites, found by shape in its own main (each offset is 0x40 higher than 1.0.0's) + '3ab632dee82d59448599b2291f30994a': [ + (0x1684480, '080140b9', '08fddf88', 'stream reader going to sleep: ldr w8,[x8] → ldar (write position after the store-release of "reader sleeping")'), + (0x16851f8, '290140b9', '29fddf88', 'stream writer going to sleep: ldr w9,[x9] → ldar (read position after the store-release of "writer sleeping")'), + (0x1684dd8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1684ec8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a8fff0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a90434, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a90a40, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a90dd8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a90f90, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a91278, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a92574, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a92a90, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a92ed8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a93078, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a931f8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a932b0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a93318, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a93390, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a93da4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a93ebc, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9404c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9417c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9466c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a949f8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a94c6c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a94d74, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a94fd0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a952b0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a954e4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a95790, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a95a68, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a95ba4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a95fec, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9610c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a96278, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a96530, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a96758, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a96a08, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a96b58, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a974fc, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a976cc, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a97850, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9796c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a97a9c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98180, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98378, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98448, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98770, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98c18, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a98d44, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a991f0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9931c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a99a50, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a99b6c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9a1a0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9a2cc, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9a444, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9a660, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9aa10, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9adb0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9af2c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9afec, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9b528, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9ba90, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9bb68, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9c264, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9cd24, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9ce80, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9d784, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9d88c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9da88, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9e2f4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9e63c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9e878, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1a9fe70, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa0034, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa02c0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa0478, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa06c4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa08e4, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa0ce0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa0fec, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa1148, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa12d0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa16a0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa1a7c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa1bf0, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa1e18, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aa2154, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1aaa280, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1f2b79c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1f2b91c, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1f2b9d8, '080140b9', '08fddf88', 'stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position)'), + (0x1684a8c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1684b84, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4034, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4140, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa47bc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4870, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa49e4, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4ba8, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4ca4, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa4e30, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5464, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5550, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5610, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa56e0, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa57b0, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa587c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5c48, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5d7c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa5db0, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa68fc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa6b38, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa7150, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa7e30, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa8bcc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa8bf8, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa918c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9248, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa93cc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9428, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa94c8, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa955c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa959c, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa99d4, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9b08, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9d20, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9df4, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9efc, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + (0x1aa9f84, '080140b9', '08fddf88', 'stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position)'), + ], } # How general each patch is and could be (dm/tools/docs_patches.py "Binding", listed in docs/agents/game-patches.md) BINDING = [ {'what': 'ThreadedStreamBuffer load-acquires', 'now': 'build', 'goal': 'engine', 'purpose': 'race', 'why': "the race is in Unity 2018's ThreadedStreamBuffer, engine code other Unity games of that era ship (Cuphead, AI: THE SOMNIUM FILES, Raging Loop, FINAL FANTASY CRYSTAL CHRONICLES " - 'Remastered Edition): a function-matched rule per Unity version would cover them; here 131 sites of main 1.0.0 are listed', + 'Remastered Edition): a function-matched rule per Unity version would cover them; here 131 sites of main 1.0.0 and of main 1.0.2 are listed', 'blocked': 'no game files of those games on the drive to compare'}, ] diff --git a/dm/games/README.md b/dm/games/README.md index 0e57f044..6671bb29 100644 --- a/dm/games/README.md +++ b/dm/games/README.md @@ -152,7 +152,7 @@ One row per profile; the notes are each profile's `README.md`. | [Pokémon Brilliant Diamond](0100000011D90000/README.md) | `0100000011D90000` | 1.3.0 | 11.4.3 | Unity 2019.4.27f1 IL2CPP | NVN | | [Pokémon Legends: Arceus](01001F5010DFA000/README.md) | `01001F5010DFA000` | 1.1.1 | 11.4.0 | Game Freak's engine (between Sword's and Trinity) | NVN | | [Pokémon Legends: Z-A](0100F43008C44000/README.md) | `0100F43008C44000` | 2.0.2 | 19.3.11 | Game Freak's Trinity engine | NVN · [AYN Thor](0100F43008C44000/README.md#peanuts-native-on-android) | -| [Pokémon Mystery Dungeon: Rescue Team DX](01003D200BAA2000/README.md) | `01003D200BAA2000` | 1.0.0 (base) | 7.4.0 | Unity 2018.3.12f1 IL2CPP, FMOD | NVN | +| [Pokémon Mystery Dungeon: Rescue Team DX](01003D200BAA2000/README.md) | `01003D200BAA2000` | 1.0.0 (base), 1.0.2 (update) | 7.4.0 | Unity 2018.3.12f1 IL2CPP, FMOD | NVN | | [Pokémon Pokopia](0400A3A01EE4C000/README.md) | `0400A3A01EE4C000` | v655360 (Switch 2) | 20.5.25 (Ounce) | Koei Tecmo's KTGL | NVN2 | | [Pokémon Scarlet](0100A3D008C5C000/README.md) | `0100A3D008C5C000` | 1.0.0, 4.0.0 | 13.3.5, 13.3.13 | Game Freak's Trinity engine | NVN | | [Pokémon Shining Pearl](010018E011D92000/README.md) | `010018E011D92000` | 1.3.0 | 11.4.3 | Unity 2019.4.27f1 IL2CPP | NVN | diff --git a/docs/agents/game-patches.md b/docs/agents/game-patches.md index 1480d244..3dd0f504 100644 --- a/docs/agents/game-patches.md +++ b/docs/agents/game-patches.md @@ -139,7 +139,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep | [Persona 5 Royal](#persona-5-royal) | 0 | 0 | 0 | 0 | 1 | `build` → `game` | | [Pokemon Pokopia](#pokemon-pokopia) | 0 | 3 | 0 | 0 | 1 | `build` → `game` | | [Pokémon Brilliant Diamond](#pokémon-brilliant-diamond) | 0 | 0 | 0 | 0 | 1 | `build` → `engine` | -| [Pokémon Mystery Dungeon: Rescue Team DX](#pokémon-mystery-dungeon-rescue-team-dx) | 131 | 0 | 0 | 0 | 0 | `build` → `engine` | +| [Pokémon Mystery Dungeon: Rescue Team DX](#pokémon-mystery-dungeon-rescue-team-dx) | 262 | 0 | 0 | 0 | 0 | `build` → `engine` | | [Pokémon Shield](#pokémon-shield) | 4 | 0 | 0 | 0 | 1 | `build` → `game` ×2 | | [Pokémon Shining Pearl](#pokémon-shining-pearl) | 0 | 0 | 0 | 0 | 1 | `build` → `engine` | | [Pokémon Sword](#pokémon-sword) | 0 | 0 | 0 | 0 | 1 | `build` → `game` | @@ -643,7 +643,7 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep [Pokémon Mystery Dungeon: Rescue Team DX](../../dm/games/01003D200BAA2000/README.md), `01003D200BAA2000`, [patches.py](../../dm/games/01003D200BAA2000/patches.py). -- **`build` → `engine`**, race, blocked: no game files of those games on the drive to compare, judgement: ThreadedStreamBuffer load-acquires. The race is in Unity 2018's ThreadedStreamBuffer, engine code other Unity games of that era ship (Cuphead, AI: THE SOMNIUM FILES, Raging Loop, FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition): a function-matched rule per Unity version would cover them; here 131 sites of main 1.0.0 are listed +- **`build` → `engine`**, race, blocked: no game files of those games on the drive to compare, judgement: ThreadedStreamBuffer load-acquires. The race is in Unity 2018's ThreadedStreamBuffer, engine code other Unity games of that era ship (Cuphead, AI: THE SOMNIUM FILES, Raging Loop, FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition): a function-matched rule per Unity version would cover them; here 131 sites of main 1.0.0 and of main 1.0.2 are listed - **1.0.0 `main`** `ca19d069…` ([patches.py:17](../../dm/games/01003D200BAA2000/patches.py#L17)) - cut `+0x1684440`: stream reader going to sleep: ldr w8,[x8] → ldar (write position after the store-release of "reader sleeping") @@ -777,6 +777,138 @@ Every patch bound tighter than it could be: the open gaps, then the blocked, kep - cut `+0x1aa9db4`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) - cut `+0x1aa9ebc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) - cut `+0x1aa9f44`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) +- **1.0.2 `main`** `3ab632de…` ([patches.py:151](../../dm/games/01003D200BAA2000/patches.py#L151)) + - cut `+0x1684480`: stream reader going to sleep: ldr w8,[x8] → ldar (write position after the store-release of "reader sleeping") + - cut `+0x16851f8`: stream writer going to sleep: ldr w9,[x9] → ldar (read position after the store-release of "writer sleeping") + - cut `+0x1684dd8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1684ec8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a8fff0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a90434`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a90a40`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a90dd8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a90f90`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a91278`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a92574`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a92a90`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a92ed8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a93078`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a931f8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a932b0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a93318`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a93390`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a93da4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a93ebc`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9404c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9417c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9466c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a949f8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a94c6c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a94d74`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a94fd0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a952b0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a954e4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a95790`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a95a68`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a95ba4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a95fec`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9610c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a96278`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a96530`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a96758`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a96a08`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a96b58`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a974fc`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a976cc`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a97850`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9796c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a97a9c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98180`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98378`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98448`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98770`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98c18`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a98d44`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a991f0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9931c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a99a50`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a99b6c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9a1a0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9a2cc`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9a444`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9a660`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9aa10`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9adb0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9af2c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9afec`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9b528`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9ba90`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9bb68`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9c264`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9cd24`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9ce80`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9d784`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9d88c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9da88`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9e2f4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9e63c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9e878`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1a9fe70`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa0034`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa02c0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa0478`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa06c4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa08e4`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa0ce0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa0fec`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa1148`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa12d0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa16a0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa1a7c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa1bf0`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa1e18`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aa2154`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1aaa280`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1f2b79c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1f2b91c`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1f2b9d8`: stream writer: ldr w8,[x8] → ldar ("reader sleeping" after the store-release of the write position) + - cut `+0x1684a8c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1684b84`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4034`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4140`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa47bc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4870`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa49e4`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4ba8`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4ca4`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa4e30`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5464`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5550`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5610`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa56e0`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa57b0`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa587c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5c48`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5d7c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa5db0`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa68fc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa6b38`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa7150`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa7e30`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa8bcc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa8bf8`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa918c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9248`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa93cc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9428`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa94c8`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa955c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa959c`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa99d4`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9b08`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9d20`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9df4`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9efc`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) + - cut `+0x1aa9f84`: stream reader: ldr w8,[x8] → ldar ("writer sleeping" after the store-release of the read position) ### Pokémon Shield diff --git a/docs/reference/threads.md b/docs/reference/threads.md index c0f99195..0b11c907 100644 --- a/docs/reference/threads.md +++ b/docs/reference/threads.md @@ -141,7 +141,7 @@ Guest threads, their synchronization and how the host schedules them. Each entry - **Cause:** a memory-order race in the game's code, not a host bug. Unity 2018.4's `ThreadedStreamBuffer` (the ring buffer every Unity worker thread is fed through) wakes a sleeping side with a Dekker handshake: the reader that finds nothing sets "reader sleeping" with a store-release and loads the write position again before sleeping on its semaphore; a writer stores the write position with a store-release and then checks that flag (and the mirror pair for a writer short of space). The second access of each side is a plain `ldr`, and AArch64 lets a plain load complete before an earlier store-release is visible, so both sides can read the old value and neither signals. The Switch's Cortex-A57 allows it too, but Apple cores hit it within seconds. - **Fix:** a per-build cut turns each of those loads into a load-acquire (`ldar`), which a store-release before it orders after the store (eight sites in that build's `patches.py`); 14 of 14 runs boot and keep presenting. - **Found on:** [FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition](../../dm/games/0100CE4010AAC000/README.md) 1.0.0 and 1.0.3 (Unity 2018.4.2f1, SDK 8.2.1; its `patches.py`: 1.0.0 `main+0x1e425b0` and the stream functions after it, the same sites +0x25380 in 1.0.3). -- **Found on:** [Pokémon Mystery Dungeon: Rescue Team DX](../../dm/games/01003D200BAA2000/README.md) 1.0.0 (Unity 2018.3.12f1, SDK 7.4.0) on an AYN Thor: 4 of 6 starts (3 of 3 with `DM_WATCH=30`) stopped with the main thread and `UnityGfxDeviceWorker` waiting one wait apart. This build inlines the two checks into 91 writers and 38 readers, so its `patches.py` has 131 cuts (`main+0x1684440` is the reader going to sleep, in the frame the hung worker waits in). +- **Found on:** [Pokémon Mystery Dungeon: Rescue Team DX](../../dm/games/01003D200BAA2000/README.md) 1.0.0 (Unity 2018.3.12f1, SDK 7.4.0) on an AYN Thor: 4 of 6 starts (3 of 3 with `DM_WATCH=30`) stopped with the main thread and `UnityGfxDeviceWorker` waiting one wait apart. This build inlines the two checks into 91 writers and 38 readers, so its `patches.py` has 131 cuts (`main+0x1684440` is the reader going to sleep, in the frame the hung worker waits in). The 1.0.2 update has the same 131 sites, each 0x40 higher. - **Check:** another Unity title that stops this way: look for `stlr` followed by a plain `ldr` of the other word in its `ThreadedStreamBuffer` (the functions around the `AcquireSemaphore` the worker waits in). ### Trinity's rendezvous loses its release on Apple cores diff --git a/peanuts/UPSTREAM-EDITS.md b/peanuts/UPSTREAM-EDITS.md index 4b1bffcb..9e9fcdb0 100644 --- a/peanuts/UPSTREAM-EDITS.md +++ b/peanuts/UPSTREAM-EDITS.md @@ -103,7 +103,7 @@ not edited (see table above). | `dm/games/0100B63016916000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be: Banana Native has no profile for My Time at Sandrock (provisional: packed on a PC, not run on a device) | | `dm/games/010065301A2E0000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be: Banana Native has no profile for STAR OCEAN THE SECOND STORY R (plays on an AYN Thor, Turnip) | | `dm/games/01003D200BAA2000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be: no profile for this game in igawa6/peanuts-native (provisional: packed on a PC, tried on one handheld) | -| `dm/games/01003D200BAA2000/patches.py` | new: ThreadedStreamBuffer load-acquires, 131 `ldr` to `ldar` cuts of main 1.0.0 (the start hang); `docs/agents/game-patches.md` regenerated, one Found-on bullet in `docs/reference/threads.md`; marked `# PEANUTS:` | could be: the same race, fixed per build, is in FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition's `patches.py` upstream | +| `dm/games/01003D200BAA2000/patches.py` | new: ThreadedStreamBuffer load-acquires, 131 `ldr` to `ldar` cuts for each of main 1.0.0 and main 1.0.2 (the start hang); `docs/agents/game-patches.md` regenerated, one Found-on bullet in `docs/reference/threads.md`; marked `# PEANUTS:` | could be: the same race, fixed per build, is in FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition's `patches.py` upstream | | `dm/games/0100F7E00C70E000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be, once it plays: Banana Native has no profile for Hogwarts Legacy | | `dm/games/0100DAE01E4C8000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be: Banana Native has no profile for STORY OF SEASONS: Grand Bazaar | | `dm/games/0100F4300BF2C000/` (new: `game.tsv`, `README.md`, the shader tables) + its row in `dm/games/README.md` | marked (`game.tsv`, the note, the row); tables allow-listed in `peanuts/upstream-unmarked.txt` | could be: Banana Native has no profile for New Pokemon Snap |