From 2f6ff17651e93feb0e4b0a949f444f4f4ed5e57d Mon Sep 17 00:00:00 2001 From: chrg6 Date: Tue, 10 Nov 2026 23:14:10 -0500 Subject: [PATCH] Give each part of the import check in --probe-vkmem its own write-watch epoch. Under shadow storage the copy-in reads each region's write-watch snapshot once per submission. The check ran its two parts in one epoch, so the second part's copy-in did not see the CPU writes made after the first, and the probe failed with NX2NAVI_SHADOW=1 ("GPU read of CPU-written heap differs"). Each part now starts a new epoch, as a submission does. Co-Authored-By: Claude Fable 5.2 --- runtime/tex_probe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/tex_probe.c b/runtime/tex_probe.c index b568e790..1bee0375 100644 --- a/runtime/tex_probe.c +++ b/runtime/tex_probe.c @@ -352,7 +352,11 @@ static int test_import(pool_t *pool) { vk_mem_resolve(a + 0x1000, 0x20000, &sp); mem_written_pages(a, pool->size, pages, 64); vk_mem_gpu_pending(a + 0x1000, 0x20000); - vk_mem_shadow_sync(); // as a submit does: the part's CPU inputs go in before its GPU work + // As a submit does: a new write-watch epoch (the copy-in reads each region's snapshot once per submission, so a + // second sync in the same epoch would not see the CPU writes made since the first), then the part's CPU inputs + // go in before its GPU work. + vk_texture_new_submit(); + vk_mem_shadow_sync(); copy_wait(sb, 0, sp.buffer, sp.offset, 0x20000); vk_gpu_written(a + 0x1000, 0x20000); GCHECK(!memcmp(m + 0x1000, s, 0x20000), "GPU copy into the imported heap range differs from the source"); @@ -370,6 +374,7 @@ static int test_import(pool_t *pool) { // A GPU write noted for the part being submitted must not keep the part's CPU inputs out: a buffer the shaders // add to and the CPU resets (the game's lighting accumulators) depends on the reset reaching the GPU first. vk_mem_gpu_pending(a + 0x30000, 0x4000); + vk_texture_new_submit(); vk_mem_shadow_sync(); copy_wait(sp.buffer, sp.offset, sb, 0, 0x4000); vmaInvalidateAllocation(c->vma, sa, 0, VK_WHOLE_SIZE);