Skip to content

Bring up Trails through Daybreak II 1.0.0 on Android - #581

Open
tapionallanaire wants to merge 2 commits into
igawa6:mainfrom
tapionallanaire:pr/daybreak-ii-rebase-20261125
Open

tapionallanaire wants to merge 2 commits into
igawa6:mainfrom
tapionallanaire:pr/daybreak-ii-rebase-20261125

Conversation

@tapionallanaire

Copy link
Copy Markdown
Contributor

Supersedes #225, rebased onto main (0.1.7).

What and why

Add the base 1.0.0 profile (0100F6701FED4000, v0) with 4,471 shader keys. Keep its Android status at bring-up; this does not add it to the release catalog.

The game rotates three texture pools with 1,048,576 entries each. Adding a texture base to a packed handle can spill into the sampler bits, and dropping registrations above the first pool can select a different image for the same local ID. For the recap this can replace the final composite or the font atlas. The first commit resolves direct bindings against the executing queue's pools and stores sparse registrations with their host IDs. GPU bindless array sizes and the shader translator are unchanged.

What changed in the rebase

  • First commit (the descriptor-pool fix), cherry-picked onto 719d4f7b: applied without a text conflict. main gained code around it since Bring up Trails through Daybreak II 1.0.0 on Android #225's base; I checked that none of it adds a pool base to a bound handle or indexes the texture registry directly (every registry use now goes through treg_lookup / treg_at; vka_tabpool_ids from the Hogwarts Legacy change reads its handles from memory through ubo_tex_id, which already adds the base). One test of main's needed its expectation moved: t_android_shlib's "table through the pool" case binds a separate sampler 11 with samp_base 200 and expected 11, which assumed the base was added at record time; with bound handles kept pool-local the walk returns 211, the same result the other cases of that test already expect. test_vka_tex_registration.py (on main since before Bring up Trails through Daybreak II 1.0.0 on Android #225's base, and broken by Bring up Trails through Daybreak II 1.0.0 on Android #225 as it was) compiled the registration functions against the flat g_treg array; its prelude now includes vka_treg.h, its checks use treg_lookup, and it adds a check that an ID of a later full-size pool is kept on the CPU side without entering the GPU dirty list, and that an ID past the registry is refused.
  • Second commit (the profile): android/app/gradle.properties conflicted with main's Trails in the Sky 1st Chapter entry; the game is appended after it. peanuts/upstream-unmarked.txt kept both sides. readiness.tsv rows now use the <title>: <why> form test_android_readiness.py asks for on main. game.tsv already matched main's keys and layout.
  • The shader tables are Bring up Trails through Daybreak II 1.0.0 on Android #225's original splitter output, unchanged: regenerating them needs the game dump. The current profile, roster and readiness tests accept them.
  • The note now records the descriptor-pool trace and the hardware checkpoints below.

Checked

On this rebased branch:

  • test_vka_tex_registration.py: passes on Windows (clang) and Linux (GCC).
  • t_android_shlib (Linux, GCC with ASan and UBSan): passed, including three overlapping pools and capture ID round-tripping; the optional real-library test was skipped. The same test passes on plain main.
  • Android NDK, arm64: -fsyntax-only of the six changed C translation units (hle_nvn.c, nvn_capture.c, vka_bind.c, vka_capture.c, vka_draw.c, vka_tex.c) with an Android host build's flags: no errors.
  • Linux builds of the other t_android_* host tests: 36 of the 44 build and pass on both this branch and plain main; the other 8 (av, fileback, input, memu, pace, poolslot, spvpatch, zshare) do not build on Linux x86-64 on either tree. The full make -C dm/host/tests run (Apple frameworks) and dm/gfx/tests were not run.
  • The Python suite (python -m unittest discover -s dm/tools/tests), compared with the same run on plain main: 1,580 tests on both. The failing and erroring tests are the same 215 on both (this run was on Windows: macOS-only tools, links to a missing .github/README.md, DM_GAMES_DIR paths with a drive letter). The one test that differed before the port, test_vka_tex_registration, was then ported as above and rerun on its own. test_android_games, test_android_readiness and the generated symptom-index check pass with DM_GAME=0100F6701FED4000.

From the earlier tree (#225's head, with the same two changes), not repeated on 0.1.7:

  • A single-title arm64 APK and matching native pack: every one of the 4,471 required shader keys translated; all 11,355 resulting modules passed spirv-val --target-env vulkan1.3. The map, translation results and final library contained the same keys, with none missing or extra. 4,471 distinct map keys, 1,750 vertex/pixel input-coverage pairs and 37 compute launch records validated. The pairs are not a capture of live draws.
  • AYN Thor, Adreno 740, Turnip v27.0.0-R1: before the pool fix, five of eight before-present readbacks from the recap contained colored rectangles and the red corner appeared in 72 of 452 frames of a stationary recap recording; with it, 0 of 602, and materially mismatching dialog frames fell from 148 to 0. The composite and font sources had the expected dimensions in 8 of 8 traced frames each. The opening, office event, field and save tutorials led to Montmart Bistro; forward stick input moved Van through its door onto the street.
  • AYN Odin 2, Adreno 740, Android 13, English base 1.0.0: on both the Qualcomm system driver (Vulkan 1.3.128) and Mesa Turnip v27.0.0-R1 (Vulkan 1.4.363), New Game → Normal → decline import reached the recap. In separate 22-second stationary recordings (661 frames each), neither showed the red corner or a one-frame dialog dropout.
  • System driver: after Skip, the opening cinematic played, then the host reported a GPU hang (VK_ERROR_DEVICE_LOST, submission 13559 at frame 6779) and exited. Field gameplay was not reached on this driver.
  • Turnip: the opening reached the office conversation. After skipping that event and closing the field and save tutorials, two forward-stick inputs moved Van through Montmart Bistro's open door and onto the cobbled street labelled Edith – Old Town. The "Gather info in Riverside" HUD remained visible in a 22-second stationary street recording. This is early field control, not a full-game compatibility claim.
  • The game wrote data into a new isolated save directory. Manual save/load, combat, later areas and water rendering were not verified. Water patch draws remain unsupported; no fallback triangles or shader substitutions are introduced.

Not checked on this branch: an APK build, Prepare, any device run.

Docs

  • Game profile; rendering reference and its symptom index.
  • Source and metadata only. No game files, keys, shader libraries, binaries or prewarm seeds. No shader-chain, chain lock or third-party changes.

Full-size texture pools can put a host texture ID in the sampler bits of a recorded handle. Keep each guest field intact, look up direct bindings in sparse pages, and retain the original host ID when capturing a registration. A host regression rotates three full pools without changing the sampler or enlarging GPU descriptor arrays.

Bound handles now stay pool-local until the walk adds the executing pool's base, so the pool-table case of t_android_shlib expects the based sampler ID (211, not 11). test_vka_tex_registration compiles the registration functions against the sparse registry and checks that an ID of a later full-size pool is kept on the CPU side without entering the GPU dirty list.
Register the base build, its virtual memory layout and shader split metadata. Keep the Android status at bring-up and document how to check the recap and early field route. Water patch rendering and device play on this revision are unverified.
@igawa6

igawa6 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks for rebasing this, and for the trace work on the pool problem.

We can't take it as one PR, because the two commits carry very different risk:

  • The profile (second commit) is a bring-up profile and changes nothing for other games apart from the nxGames entry.
  • The descriptor-pool fix (first commit) changes how every game resolves texture and sampler handles: handles now stay pool-local, the texture registry becomes sparse pages, the 14-bit SID_OF with the pool base added at record time is gone, and the t_android_shlib pool-table case now expects 211 instead of 11. Fire Emblem: Three Houses (second-pool samplers for its window frames, the reason SID_OF was widened) and Hogwarts Legacy (vka_tabpool_ids) both depend on this code, and neither was run on this branch.

What we need to move forward:

  1. Please split the first commit into its own PR against main, rebased onto the current main (0.1.8). We'd like to land it in 0.1.9, after a Thor A/B on release games: Fire Emblem: Three Houses menus and window frames, Hogwarts Legacy, The Legend of Zelda: Breath of the Wild, Tears of the Kingdom and The Witcher 3.
  2. Keep this PR for the profile only, stacked on the fix. The profile renders wrong without the fix, so it lands after it.
  3. Rebase onto the current main. Against dev-0.1.9 this branch conflicts in android/app/gradle.properties (nxGames now has more entries) and peanuts/upstream-unmarked.txt.
  4. One device run on the 0.1.8 runtime with a pack built from the current chain: the opening as far as you reached before. The Qualcomm driver's device lost after the opening should go in the readiness rows or the note as a known limit.

We'll review the split PR first.

@igawa6 igawa6 added new-game Requests and reports for adding games or game profiles bug Something isn't working labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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