Repository navigation
Conversation
…ld mirror mirror_make fills a remade pool's new mirror from guest memory, then copies each retired pool's mirror over its whole part (the inheritance from e900faa: what the GPU wrote there and nowhere else, the foliage records). That copy also put the old mirror's words back over pages the CPU had written since that mirror's last sync, and the captures that go over it afterwards hold only the last submissions' pages, while a scene change takes many. Leaving the Deku Tree through the blue warp after Gohma, the dungeon's values came back over what the game wrote while the next area loaded: the forest came out washed white until the Deku Tree's cutscene (issue 508, tracked in 1004). The CPU's writes now also get a generation of their own (stamp_cpu_page: where memory_collect_written stamps the collected pages and where a capture stamps its pages, not memory_stamp, which the GPU's own writes use), and the inheritance copies the runs of pages the CPU has not written since the retired mirror's synced_gen, a clean 2 MB region at a time. What the GPU wrote is inherited as before; a page the CPU wrote stays guest memory's (or a capture's), as the old mirror's next sync would have made it. RX_VK_INHERIT_WHOLE=1: the whole range, as before. Measured on v2.0.11 with this change (RTX 4070 Laptop, NVIDIA 615.78.08, Linux), from an autosave at the blue warp, headless with HOS_INPUT_SCRIPT and RX_VK_SHOTS, as the median luma of the 2 s after the warp's white fade: 197-204 before (3 runs), 85 with this (2 runs), 198-203 with RX_VK_INHERIT_WHOLE=1. RX_VK_NO_INHERIT=1 gives 87-89 too; RX_VK_WB_DIFF=0, RX_VK_MIRROR_MB=1024, RX_VK_NO_READBACK_WAIT=1, RX_VK_WAIT_GPU=1 and 9928d74 leave it at ~200. The inheritances of that run kept the CPU's version of 0 to 267 pages each. tests/test_inherit_cpu_pages.py checks the two stamps, that memory_stamp does not take the CPU's generation, and the inheritance's test. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing: #1127 landed the same fix while this was in draft (same root cause: the inheritance's whole-range copy over pages the CPU wrote since the retired mirror's sync), and it also covers the parallel-replay case this one missed. I checked #1127 against the case this PR was for, #508's washed-out Deku Tree exit after Gohma. I cherry-picked 0266268 onto v2.0.11 (RTX 4070 Laptop, NVIDIA 615.78.08, Linux) and ran the same headless warp test as above. Median luma in the 2 s after the warp's white fade:
So #1127 fixes #508's case as well. One difference, in case it is useful. This PR stamped the CPU's writes with a generation of their own, so pages stamped only by the GPU's own writes kept being inherited. An example is the first page of a bare table entry: its first 64 bytes are marked written, but the rest of the page holds records that are never written back. #1127 tests |
Fixes the washed-out Deku Tree exit after Gohma from #508 (closed as a duplicate, tracked in #1004): leaving through the blue warp, the forest came out washed white, Link and the plants glowing, until the Deku Tree's cutscene. Still there on v2.0.11.
Cause
mirror_makefills a remade pool's new mirror from guest memory, then copies each retired pool's mirror over its whole part. This is the inheritance from e900faa: what the GPU wrote there and nowhere else, the foliage records. That whole-range copy also puts the old mirror's words back over pages the CPU wrote since that mirror's last sync. The captures that go over it afterwards hold only the last submissions' pages, while a scene change takes many. Through the blue warp, the dungeon's values came back over what the game wrote while the next area loaded.Change
stamp_cpu_page), stamped wherememory_collect_writtenstamps the collected pages and where a capture stamps its pages.memory_stampdoes not stamp it, because the GPU's own writes usememory_stamp.synced_gen, skipping clean 2 MB regions whole.RX_VK_INHERIT_WHOLE=1: the whole range, as before.tests/test_inherit_cpu_pages.pychecks the two stamps, thatmemory_stampdoes not take the CPU's generation, and the inheritance's test.Using the plain
page_geninstead also fixed the haze. But it counts the GPU's own stamps: it left thousands of pages per inheritance un-inherited, against 0 to 267 with the CPU-only generation. That would put the foliage records at risk again.Testing
RTX 4070 Laptop (8 GB), NVIDIA 615.78.08, Linux (Wayland). The change was tested on top of v2.0.11, with only
hookshot_vk.sorebuilt (RX_VK_ONLY=1). Onmainit builds, and the new test and the existing checks that readvk_memory.cpppass (tests/run_all.py).The setup:
HOS_INPUT_SCRIPTpresses Continue and Load, walks into the warp and clears Navi's line.RX_VK_SHOTSwrites a shot every 20 presents.RX_VK_INHERIT_WHOLE=1RX_VK_NO_INHERIT=1(2 runs)RX_VK_MIRROR=0RX_VK_WB_DIFF=0,RX_VK_MIRROR_MB=1024,RX_VK_NO_READBACK_WAIT=1,RX_VK_WAIT_GPU=1,RX_VK_MIRROR_KEEP=1Also played through the warp with the fixed build: the forest is lit normally and the Deku Tree's cutscene starts as usual. Not checked: a wide Kokiri shot of the tree canopies, which the inheritance exists for. The change keeps everything the GPU wrote, so they should be as before.
Draft until an interleaved fps A/B is in. The headless runs above drifted with temperature over a long series, by up to 4 fps between runs of the same build, so they are not a fair before/after for fps.
🤖 Generated with Claude Code