Skip to content

perf(libc,agc): skip never-written guest pages in Windows heap mirror zero scans - #15967

Open
sktharunbalaji13-cmd wants to merge 2 commits into
boykopovar:mainfrom
sktharunbalaji13-cmd:perf/windows-known-zero-scans
Open

sktharunbalaji13-cmd wants to merge 2 commits into
boykopovar:mainfrom
sktharunbalaji13-cmd:perf/windows-known-zero-scans

Conversation

@sktharunbalaji13-cmd

@sktharunbalaji13-cmd sktharunbalaji13-cmd commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What

On Windows, the heap mirror zero scans (GuestNonzeroBlocks, GuestBytesZero in ResidentMirror.cpp) read every page of their range, because Windows has no /proc/self/pagemap to skip unpopulated pages the way possiblyNonzero does on Linux. Reading a committed page that was never written makes Windows allocate a physical zero page for it, so a scan over a large, mostly empty heap fills the RAM by itself.

  • The Windows guest arena (WindowsMappings.hpp) keeps a bitmap of the 4 KiB pages it committed fresh under a write watch (Commit with write watch, commitResident) that nothing has written since. Bits are cleared for every page a GetWriteWatch call reports (all calls go through one wrapper), atomically with the reset that replaced ResetWriteWatch where bits remain, and on reset, demote, evict, restored saved content, host writes and host imports (GPU writes through an import are not seen by the write watch). GuestArenaKnownZero_nid_no_patch reports the pages of a range that are still known zero, after a non-resetting GetWriteWatch of the range and taking the arena lock one 2 MiB chunk at a time.
  • possiblyNonzero and GuestBytesZero on Windows skip those pages.
  • On Windows the first read of such a page also sets its write-watch bit (measured: commit 16 pages with MEM_WRITE_WATCH, read pages 0 and 5, GetWriteWatch reports 0 and 5). The old scans read everything early, so that report was consumed before anyone cared. With the scans skipping those pages, the first read could happen after a storage image took its layer generation and then pass for a CPU store, so the flush hook's CPU-kept fast path dropped a GPU result (agc_driver_resident_heap_mirror, StorageImageTests). A reported page that is still known zero and still reads as zero (checked with ReadProcessMemory, only when the report is complete) is therefore no longer reported: its bytes have not changed since the commit.

Generic behaviour: nothing depends on a title, address or size.

Tested

Windows 11 26200, RTX 4060 Laptop GPU (8 GB), NVIDIA driver 617.42, 16 GB RAM, MinGW GCC (winlibs) Release, on main 0540ef0 and on this branch, same machine:

  • New tests in core/libs/tests/WindowsWriteWatch.cpp (CheckKnownZeroPrivate, CheckKnownZeroResident, CheckKnownZeroShared, CheckKnownZeroFirstReads): fresh commits are known zero and clipped to the query, CPU stores, resetting/fresh/armed collects, host write windows, host imports, resets, an evict plus remap with restored bytes, memory without a write watch and shared memory; a first read or a zero store of a fresh page is not collected as a write while a real store is.
  • New test StorageImageZeroStoreTests in ResidentHeapMirror.cpp (review follow-up): an image store into a never-written block, a CPU store of 0, then a read must return 0. It fails without the GPU-write forgetting (the GPU value 0x12345678 wins) and passes with it. Every recorded GPU write (pending writes, fills, label stores, storage image layers, MarkWritten/MarkPossiblyWritten) forgets the range, and a storage image upload reads its still known-zero pages before taking its write generation.
  • ctest -R "windows_write_watch|agc_driver_resident_heap_mirror|heap_mirror|agc_write_tracking$" with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: 12/12 pass (agc_driver_resident_heap_mirror failed with the first version of this change and passes now).
  • 41 more suites around write tracking, imports and guest memory (host_import_*, guest_memory*, guest_owned_memory*, committed_read_mapping, copied_writer_*, linear_target_*, private_collect, write_watch_coverage, storage_write_back_*, read_only_lease_writer, partially_resident_snapshot, copy_guest_bytes): pass, except agc_driver_direct_write_completion, which fails the same way on main on this machine (3 of 3 runs, "the completion of a buffer write dropped image results recorded after it").
  • VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation runs of the focused tests: the 12 focused tests above on main and on this branch: no VUID- errors in either log, and neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • Ghost of Tsushima Director's Cut (PPSA02225), boot to the PlayStation Studios intro, back-to-back runs on the same machine:

tools/trace_digest.py summary lines, APS5_TRACE_SECONDS=0:40, same machine and scene, back-to-back runs (APS5_SKIP_REFUSED_DRAWS=1 APS5_PROFILE_DRAW=1):

main 0540ef0ef2ec: seconds 0:40 from present 0: 206 presents, frame p50 16.9 / p90 87.8 / p99 3326.6 / max 18738.7 ms, GPU busy 19.4 ms per present
this branch d28560cdca1a: seconds 0:40 from present 0: 310 presents, frame p50 17.8 / p90 414.3 / p99 1017.9 / max 5108.1 ms, GPU busy 24.1 ms per present

Traces: main, this branch (summaries: main, this branch). Both traces lost events once their buffers filled (about 35-38 s).

aps5-summary.jsonl lines of the two captures:

main 0540ef0:

{"commit":"0540ef0ef2ec","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"0:40"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 0:40","first_present":0,"ms":41661.251},"presents":206,"frame_ms":{"p50":16.941,"p90":87.768,"p99":3326.594,"max":18738.701},"gpu_busy_ms_per_present":19.443,"worker_busy_pct":{"queue worker 0x0":68.571,"queue worker 0x40":0.108,"queue worker 0x20":43.126,"queue worker 0x48":2.304,"queue worker 0x38":58.010,"queue worker 0x52":8.212,"queue worker 0x30":11.413},"top_phases_ms_per_frame":{"Driver.Packet":386.779,"Driver.Packet.memory_wait":221.979,"Driver.Packet.dispatch":153.109,"Driver.Dispatch":143.336,"Vulkan.Dispatch":102.638,"Vulkan.Dispatch.shader_resources":101.679,"Shader.Register":24.634,"Driver.Dispatch.prepared_invocation":12.667},"trace_dropped":true,"trace_dropped_threads":{"title":{"events_full_after_s":38.372,"events_lost":29304,"totals_full":false}},"trace":"aps5-trace-0540ef0ef2ec-24556.json.gz"}

this branch d28560c:

{"commit":"d28560cdca1a","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"0:40"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 0:40","first_present":0,"ms":40110.376},"presents":310,"frame_ms":{"p50":17.756,"p90":414.348,"p99":1017.909,"max":5108.052},"gpu_busy_ms_per_present":24.137,"worker_busy_pct":{"queue worker 0x0":64.681,"queue worker 0x40":0.685,"queue worker 0x20":31.676,"queue worker 0x48":3.541,"queue worker 0x38":46.533,"queue worker 0x52":4.772,"queue worker 0x30":7.795},"top_phases_ms_per_frame":{"Driver.Packet":205.300,"Driver.Packet.memory_wait":103.823,"Driver.Packet.dispatch":89.295,"Driver.Dispatch":80.776,"Vulkan.Dispatch":53.573,"Vulkan.Dispatch.shader_resources":52.561,"Shader.Register":16.180,"Recorder.Sync":10.411},"trace_dropped":true,"trace_dropped_threads":{"title":{"events_full_after_s":34.843,"events_lost":35178,"totals_full":false}},"trace":"aps5-trace-d28560cdca1a-25536.json.gz"}
tools/trace_digest.py output, main

seconds 0:40 from present 0: 206 presents, frame p50 16.9 / p90 87.8 / p99 3326.6 / max 18738.7 ms, GPU busy 19.4 ms per present
NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit 0540ef0, dropped: yes

{"commit":"0540ef0ef2ec","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"0:40"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 0:40","first_present":0,"ms":41661.251},"presents":206,"frame_ms":{"p50":16.941,"p90":87.768,"p99":3326.594,"max":18738.701},"gpu_busy_ms_per_present":19.443,"worker_busy_pct":{"queue worker 0x0":68.571,"queue worker 0x40":0.108,"queue worker 0x20":43.126,"queue worker 0x48":2.304,"queue worker 0x38":58.01,"queue worker 0x52":8.212,"queue worker 0x30":11.413},"top_phases_ms_per_frame":{"Driver.Packet":386.779,"Driver.Packet.memory_wait":221.979,"Driver.Packet.dispatch":153.109,"Driver.Dispatch":143.336,"Vulkan.Dispatch":102.638,"Vulkan.Dispatch.shader_resources":101.679,"Shader.Register":24.634,"Driver.Dispatch.prepared_invocation":12.667},"trace_dropped":true,"trace_dropped_threads":{"title":{"events_full_after_s":38.372,"events_lost":29304,"totals_full":false}},"trace":"aps5-trace-0540ef0ef2ec-24556.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • title: 29304 events lost; buffer full at 38372.5 ms

Slowest frames (largest slices inside each, inclusive)

  • present 94: 18738.7 ms at 4137 ms: Driver.WorkerWait (queue worker 0x48) 18690.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 18689.9, Driver.Packet (queue worker 0x0) 17892.8, Driver.Packet.dispatch (queue worker 0x0) 17217.2
  • present 205: 5339.5 ms at 36322 ms: Driver.WorkerWait (queue worker 0x0) 5326.7, Driver.WorkerWait (queue worker 0x48) 5326.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 5326.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5326.4
  • present 103: 3326.6 ms at 26876 ms: Driver.WorkerWait (queue worker 0x48) 3260.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 3260.8, Driver.Packet (queue worker 0x0) 3061.8, Driver.Packet (queue worker 0x38) 3044.9
  • present 8: 1093.0 ms at 1200 ms: Driver.WorkerWait (queue worker 0x20) 1087.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1087.3, Driver.WorkerWait (queue worker 0x48) 1079.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 1079.0
  • present 138: 1032.6 ms at 34064 ms: Driver.WorkerWait (queue worker 0x20) 1026.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1026.2, Driver.WorkerWait (queue worker 0x48) 1019.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 1019.6

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 94: 18738.7 ms at 4137 ms, persistence 18734.2 ms
  • present 205: 5339.5 ms at 36322 ms, persistence 5333.7 ms
  • present 103: 3326.6 ms at 26876 ms, persistence 3299.2 ms
  • present 8: 1093.0 ms at 1200 ms, persistence 1088.5 ms
  • present 4: 1030.9 ms at 132 ms, persistence 1026.2 ms
  • present 138: 1032.6 ms at 34064 ms, persistence 1019.6 ms
  • present 76: 386.6 ms at 3469 ms, persistence 372.9 ms
  • present 0: 87.8 ms at 0 ms, persistence 76.4 ms
  • present 71: 81.3 ms at 3336 ms, persistence 68.9 ms
  • present 125: 71.8 ms at 33765 ms, persistence 61.6 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 13.2 (7 %) 6.9 (3 %) 182.1 0.1 Shader.Register 8.9, Shader.ResolveAbi 3.7
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
queue worker 0x0 125.1 (62 %) 76.5 (38 %) 0.7 1.0 Driver.Packet 138.0, Driver.EndSubmission 0.3
queue worker 0x40 0.2 (0 %) 0.0 (0 %) 202.0 0.0 Driver.Packet 0.2, Driver.EndSubmission 0.0
queue worker 0x20 0.5 (0 %) 201.6 (100 %) 0.1 0.1 Driver.Packet 86.8, Driver.EndSubmission 0.4
draw committer 7.4 (4 %) 2.0 (1 %) 192.8 0.1 Graphics.Draw 5.4, Recorder.Submit 1.2
queue worker 0x48 2.0 (1 %) 200.1 (99 %) 0.2 0.3 Driver.Packet 4.4, Driver.EndSubmission 0.2
presenter 6.4 (3 %) 4.0 (2 %) 191.8 0.1 VideoOut.Flip 10.3, Driver.Present 0.1
queue worker 0x38 17.7 (9 %) 120.0 (59 %) 64.5 0.1 Driver.Packet 117.2, Driver.EndSubmission 0.1
queue worker 0x52 1.3 (1 %) 26.6 (13 %) 174.3 0.0 Driver.Packet 16.6, Driver.EndSubmission 0.0
title 0.2 (0 %) 0.0 (0 %) 202.0 0.0 Shader.ResolveAbi 0.2, Shader.ResolveGraphicsStagesAbi 0.1
title 0.2 (0 %) 0.0 (0 %) 202.0 0.0 Shader.ResolveAbi 0.2, Shader.ResolveGraphicsStagesAbi 0.1
title 0.2 (0 %) 0.0 (0 %) 202.0 0.0 Shader.ResolveAbi 0.2, Shader.ResolveGraphicsStagesAbi 0.1
queue worker 0x30 3.7 (2 %) 26.1 (13 %) 172.4 0.0 Driver.Packet 23.1, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 202.2 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
gpu 19.3 (10 %) 0.0 (0 %) 183.0 0.0 batch 19.3

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 414.1, Driver.WorkerWait.idle_and_completion_poll 413.9, Driver.Packet 386.4, Driver.Packet.memory_wait 222.0, Driver.Packet.dispatch 153.1, Driver.Dispatch 143.3, Vulkan.Dispatch 102.6, Vulkan.Dispatch.shader_resources 101.7, batch 19.3, Driver.Dispatch.prepared_invocation 12.7

Longest waits

  • Driver.WorkerWait (queue worker 0x48) 17860.8 ms at 5015 ms, present 94
  • Driver.Packet.memory_wait (queue worker 0x38) 12939.5 ms at 5014 ms, present 94
  • Driver.Packet.memory_wait (queue worker 0x20) 12793.9 ms at 5011 ms, present 94
  • Driver.WorkerWait (queue worker 0x20) 5329.5 ms at 36318 ms, present 204
  • Driver.WorkerWait (queue worker 0x48) 5327.4 ms at 36321 ms, present 204
  • Driver.WorkerWait (queue worker 0x0) 5326.4 ms at 36322 ms, present 204
  • Driver.WorkerWait (queue worker 0x20) 5110.7 ms at 17807 ms, present 94
  • Driver.WorkerWait (queue worker 0x48) 3028.8 ms at 27201 ms, present 103
  • Driver.Packet.memory_wait (queue worker 0x38) 2178.8 ms at 27136 ms, present 103
  • Driver.Packet.memory_wait (queue worker 0x20) 2103.7 ms at 27137 ms, present 103

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 720: 333.0 ms at 17526 ms, present 94: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 12213.3, Driver.Packet.dispatch (queue worker 0x0) 12212.2, Driver.Dispatch (queue worker 0x0) 12209.0, Vulkan.Dispatch (queue worker 0x0) 11951.0
  • batch 1244: 108.2 ms at 29930 ms, present 103: GPU no ranges; recorded by GpuMutex.wait.end (draw committer) 75.5, Graphics.Draw (draw committer) 3.6, Graphics.Draw.draw_and_resource_release (draw committer) 3.4, Recorder.Submit (draw committer) 0.5
  • batch 719: 95.8 ms at 9212 ms, present 94: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 244.7, Driver.Packet.dispatch (queue worker 0x0) 244.7, Driver.Dispatch (queue worker 0x0) 244.7, Vulkan.Dispatch (queue worker 0x0) 127.0
  • batch 758: 79.6 ms at 22055 ms, present 94: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 81.0, Graphics.Wait (queue worker 0x0) 1.1, Graphics.Wait.fence_wait (queue worker 0x0) 1.1, Recorder.Submit (queue worker 0x0) 0.2
  • batch 1196: 69.2 ms at 29078 ms, present 103: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 70.7, Driver.Dispatch.capture_resources (queue worker 0x0) 43.4, Resources.Prepare (queue worker 0x0) 13.3, Driver.Dispatch.materialize (queue worker 0x0) 3.0
tools/trace_digest.py output, this branch

seconds 0:40 from present 0: 310 presents, frame p50 17.8 / p90 414.3 / p99 1017.9 / max 5108.1 ms, GPU busy 24.1 ms per present
NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit d28560c, dropped: yes

{"commit":"d28560cdca1a","dirty":false,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"0:40"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 0:40","first_present":0,"ms":40110.376},"presents":310,"frame_ms":{"p50":17.756,"p90":414.348,"p99":1017.909,"max":5108.052},"gpu_busy_ms_per_present":24.137,"worker_busy_pct":{"queue worker 0x0":64.681,"queue worker 0x40":0.685,"queue worker 0x20":31.676,"queue worker 0x48":3.541,"queue worker 0x38":46.533,"queue worker 0x52":4.772,"queue worker 0x30":7.795},"top_phases_ms_per_frame":{"Driver.Packet":205.3,"Driver.Packet.memory_wait":103.823,"Driver.Packet.dispatch":89.295,"Driver.Dispatch":80.776,"Vulkan.Dispatch":53.573,"Vulkan.Dispatch.shader_resources":52.561,"Shader.Register":16.18,"Recorder.Sync":10.411},"trace_dropped":true,"trace_dropped_threads":{"title":{"events_full_after_s":34.843,"events_lost":35178,"totals_full":false}},"trace":"aps5-trace-d28560cdca1a-25536.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • title: 35178 events lost; buffer full at 34843.4 ms

Slowest frames (largest slices inside each, inclusive)

  • present 90: 5108.1 ms at 3882 ms: Driver.WorkerWait (queue worker 0x48) 5066.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 5066.3, Driver.Packet (queue worker 0x0) 4968.5, Driver.Packet.dispatch (queue worker 0x0) 4836.2
  • present 237: 4883.2 ms at 32931 ms: Driver.WorkerWait (queue worker 0x40) 4883.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x40) 4883.2, Driver.WorkerWait (queue worker 0x20) 4883.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 4882.9
  • present 131: 1490.4 ms at 25685 ms: Driver.Packet (queue worker 0x0) 1433.2, Driver.Packet (queue worker 0x38) 1425.8, Driver.WorkerWait (queue worker 0x48) 1416.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 1416.0
  • present 8: 1017.9 ms at 1161 ms: Driver.WorkerWait (queue worker 0x20) 1007.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1007.8, Driver.WorkerWait (queue worker 0x48) 995.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 995.4
  • present 4: 1017.7 ms at 109 ms: Driver.WorkerWait (queue worker 0x20) 1016.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1016.5, Driver.WorkerWait (queue worker 0x48) 1013.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x48) 1012.9

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 90: 5108.1 ms at 3882 ms, persistence 5104.5 ms
  • present 237: 4883.2 ms at 32931 ms, persistence 4879.6 ms
  • present 131: 1490.4 ms at 25685 ms, persistence 1463.0 ms
  • present 8: 1017.9 ms at 1161 ms, persistence 1013.4 ms
  • present 4: 1017.7 ms at 109 ms, persistence 1013.0 ms
  • present 163: 905.2 ms at 30678 ms, persistence 892.1 ms
  • present 309: 333.7 ms at 39777 ms, persistence 318.3 ms
  • present 73: 316.7 ms at 3313 ms, persistence 308.9 ms
  • present 290: 266.3 ms at 39038 ms, persistence 248.5 ms
  • present 93: 562.0 ms at 10173 ms, persistence 81.5 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 6.0 (5 %) 4.0 (3 %) 119.4 0.1 Shader.Register 5.5, Shader.ResolveAbi 0.4
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
queue worker 0x0 71.7 (55 %) 56.9 (44 %) 0.8 1.4 Driver.Packet 82.8, Driver.EndSubmission 0.4
queue worker 0x40 0.9 (1 %) 29.1 (23 %) 99.4 0.1 Driver.Packet 0.9, Driver.EndSubmission 0.0
queue worker 0x20 1.4 (1 %) 127.6 (99 %) 0.4 0.1 Driver.Packet 40.5, Driver.EndSubmission 0.4
queue worker 0x48 1.8 (1 %) 127.5 (99 %) 0.1 0.3 Driver.Packet 4.3, Driver.EndSubmission 0.2
draw committer 6.1 (5 %) 2.1 (2 %) 121.2 0.1 Graphics.Draw 2.9, Recorder.Submit 1.3
presenter 9.9 (8 %) 0.2 (0 %) 119.2 0.1 VideoOut.Flip 10.2, Driver.Present 0.0
queue worker 0x38 12.8 (10 %) 71.1 (55 %) 45.5 0.1 Driver.Packet 60.0, Driver.EndSubmission 0.1
queue worker 0x52 0.4 (0 %) 11.7 (9 %) 117.3 0.0 Driver.Packet 6.2, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x30 1.6 (1 %) 12.1 (9 %) 115.7 0.0 Driver.Packet 10.0, Driver.EndSubmission 0.1
title 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 129.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 24.2 (19 %) 0.0 (0 %) 105.2 0.0 batch 24.2

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 320.5, Driver.WorkerWait.idle_and_completion_poll 320.2, Driver.Packet 204.7, Driver.Packet.memory_wait 103.8, Driver.Packet.dispatch 89.3, Driver.Dispatch 80.6, Vulkan.Dispatch 53.5, Vulkan.Dispatch.shader_resources 52.5, batch 24.2, Recorder.Sync 10.4

Longest waits

  • Driver.WorkerWait (queue worker 0x40) 7346.6 ms at 30484 ms, present 151
  • Driver.WorkerWait (queue worker 0x48) 4934.5 ms at 4058 ms, present 90
  • Driver.WorkerWait (queue worker 0x20) 4879.5 ms at 32927 ms, present 236
  • Driver.WorkerWait (queue worker 0x48) 4878.0 ms at 32929 ms, present 236
  • Driver.WorkerWait (queue worker 0x0) 4876.6 ms at 32931 ms, present 236
  • Driver.Packet.memory_wait (queue worker 0x38) 3225.8 ms at 4053 ms, present 90
  • Driver.Packet.memory_wait (queue worker 0x20) 3184.3 ms at 4052 ms, present 90
  • Driver.WorkerWait (queue worker 0x20) 1758.4 ms at 7236 ms, present 90
  • Driver.WorkerWait (queue worker 0x48) 1389.8 ms at 25812 ms, present 131
  • Driver.WorkerWait (queue worker 0x20) 1019.0 ms at 103 ms, present 3

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 690: 59.3 ms at 7221 ms, present 90: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2968.6, Driver.Packet.dispatch (queue worker 0x0) 2968.6, Driver.Dispatch (queue worker 0x0) 2968.6, Vulkan.Dispatch (queue worker 0x0) 2806.5
  • batch 4836: 35.1 ms at 40051 ms, present 309: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 104.4, Driver.Packet.dispatch (queue worker 0x20) 104.3, Driver.Dispatch (queue worker 0x20) 104.3, Driver.Dispatch.materialize (queue worker 0x20) 39.6
  • batch 2989: 34.8 ms at 27610 ms, present 132: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.6, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.4
  • batch 3319: 32.4 ms at 30078 ms, present 137: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.4, Graphics.Draw.draw_and_resource_release (draw committer) 2.3, Recorder.Submit (draw committer) 0.3
  • batch 3120: 31.5 ms at 28646 ms, present 134: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.6, Graphics.Draw.draw_and_resource_release (draw committer) 7.6, Recorder.Submit (draw committer) 0.3, Recorder.Reap (draw committer) 0.1

From the same two runs (APS5_PROFILE_DRAW and the process counters):

main this branch
64 KiB blocks zero-scanned by the first address-based build 70,067 10
longest stall of the frame counter 18 s (12-30 s) 4 s (12-16 s)
presents by 40 s 110 238
lowest free RAM 4 MB 67 MB
PlayStation logo frames captured (4 fps window capture) 0 24

In the main run the game's working set rose from 3.2 to 8.2 GB between 10 and 14 s, during that first build, while its commit stayed at 11.8-12.1 GB: the scan allocating zero pages. A separate check on the same machine: reading 1 GiB of committed, never-written memory adds 1024 MiB to the working set.

Checklist

tools/pr_overlap.py: #15900 also edits WindowsWriteWatch.cpp (a different test); 14 conflicting PRs share ResidentMirror.cpp, GuestArena.cpp or WindowsMappings.hpp and could not be compared automatically; none of them adds a known-zero query (checked by hand: #13809, #15295, #15296, #15900).

🤖 Generated with Claude Code, OpenCode, Command Code and Gemini

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line unblocks title Names a title ID on the Unblocks line labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@sktharunbalaji13-cmd

Copy link
Copy Markdown
Contributor Author

Added to the description under Tested: both aps5-summary.jsonl lines (main 0540ef0 and this branch d28560c, same machine and scene), the full tools/trace_digest.py output of each, and links to both traces.

🤖 Addressed by Claude Code

@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Nov 5, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi sktharunbalaji13-cmd,

Thanks for this. The known-zero bitmap and the single watchWrites wrapper read well, and dropping a fresh page's first-read report only when the report is complete and the page still reads zero is a careful fix.

One ordering I could not settle from the source. A dropped report hides any CPU store that leaves a known-zero page reading zero. Suppose a non-imported resident page is written by the GPU into its device copy (a storage image or buffer takes its layer generation). Nothing clears the page's zero bit until the result is flushed back. If the guest CPU then stores zeros to that page, for example resetting a counter or clearing a readback area, GetWriteWatch reports the page, stillZero reads zero, and the report is dropped. The flush hook's CPU-kept check would then keep the GPU value, while on the console the guest's zeros win.

Could you either point to where a GPU-written range clears its zero bits when the generation is taken, or add a test in the style of the storage-image cases (fresh page, GPU write, CPU stores 0, flush, expect 0)? If that test fails, clearing the bits for the range when a GPU write is recorded would close it.

@github-actions github-actions Bot added libc agc libSceAgc* labels Nov 5, 2026
@JJenkx

JJenkx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Windows check of head d28560cdca, merged onto main 1e24993fa3 (111caef3f8, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • windows_write_watch and windows_write_watch_verify_direct (including the new known-zero checks) pass in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 5, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head d28560c merged onto main 1882108 · tested 2026-11-05 05:23 UTC · 24 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 3,836 passed · 18 failed (0 new, 13 also fail on main, 5 unstable on main) · 68 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 3,922 of 3,960 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1403 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_graphics 120.3 s, ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 120.2 s, ⚠️ public_headers 54.7 s, ⚠️ agc_driver_bda_device 51.6 s
Unstable on main (5, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_array_layer_target_cpu: failed in 2 of the last 10 main runs
agc_driver_graphics: failed in 3 of the last 10 main runs
agc_driver_graphics_maps_fallback: failed in 2 of the last 10 main runs
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 4 of the last 10 main runs
Failing on main too (13, not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_job_manager_compute_capacity
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_recorder: Timeout in the parallel run; also passed only on retry in 28 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 810 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (810 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 802 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (68)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_recorded_draw_staging: skipped, the device does not keep host imports write-watched, so the target is never resident
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_four_k: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_height_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLL
Reproduce
git fetch origin d28560cdca1a286fce14bed38918d0811b9a3ccb 1882108b45b31ae837cf8a3350b0e374fcfc4194
git checkout 1882108b45b31ae837cf8a3350b0e374fcfc4194 && git merge --no-ff d28560cdca1a286fce14bed38918d0811b9a3ccb
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@sktharunbalaji13-cmd

Copy link
Copy Markdown
Contributor Author

@oneandonlydean You were right, and the test reproduces it: a fresh heap block, an image store into it, a CPU store of 0, then a read returned the GPU's 0x12345678.

Fixed in bea14eb:

  • Every recorded GPU write now forgets the known-zero bits of its range: Recorder::noteWrite (pending writes and fills), noteWriteOn (label stores), StorageTexture::markLayersPending (the written layers) and GuestMemory::MarkWritten/MarkPossiblyWritten (direct and import write-backs).
  • Forgetting the bits re-exposed the first-touch report for image ranges, so StorageTexture::upload now reads its still known-zero pages before it takes its write generation; their report is collected, and dropped, before the generation.
  • New test StorageImageZeroStoreTests in ResidentHeapMirror.cpp (your sequence, expects 0). It fails with the forgetting calls removed and passes with them. The other 50 related tests are unchanged (agc_driver_direct_write_completion fails on main on this machine too); no VUID- errors under the validation layer.

🤖 Addressed by Claude Code

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head bea14eb merged onto main 4639eff · tested 2026-11-05 08:42 UTC · 27 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 3,842 passed · 13 failed (0 new, 9 also fail on main, 4 unstable on main) · 69 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 3,924 of 3,962 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1404 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 121.0 s, ⚠️ agc_driver_graphics 71.6 s, ⚠️ agc_driver_graphics_maps_fallback 70.0 s, ⚠️ public_headers 68.4 s, ⚠️ agc_driver_bda_device 48.4 s
Unstable on main (4, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export: failed in 6 of the last 10 main runs
agc_driver_job_manager_compute_capacity: failed in 8 of the last 10 main runs
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 4 of the last 10 main runs
Failing on main too (9, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 810 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (810 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 802 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (69)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_recorded_draw_staging: skipped, the device does not keep host imports write-watched, so the target is never resident
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_net_ctl_disconnected: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_four_k: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_height_only: skipped, n
Reproduce
git fetch origin bea14eb0d06c87fcf32e68325900b476942885fa 4639eff7f4c23325a916875a0e37f1e312fa18f4
git checkout 4639eff7f4c23325a916875a0e37f1e312fa18f4 && git merge --no-ff bea14eb0d06c87fcf32e68325900b476942885fa
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head bea14eb merged onto main 1e24993 · tested 2026-11-05 09:47 UTC · 46 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 3,864 passed · 6 failed (1 new: 1 pass on main with the PR's tests, 3 also fail on main, 2 unstable on main) · 60 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 3,930 of 3,968 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1404 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_bda_device 83.3 s, ⚠️ agc_driver_graphics_maps_fallback 57.0 s, ⚠️ agc_driver_graphics 44.2 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 33.5 s

Failing tests

This PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.

Test With this PR Same test on main 1e24993 (main + this PR's test changes only)
agc_driver_job_manager_compute_capacity ❌ failed ✅ passed
agc_driver_job_manager_compute_capacity: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
[Shaders/ShaderRegistry.cpp:901 ReportPreparedAtUse] Compute shader 0x5d0d1ad01200 was not registered; preparing its artifact at dispatch
barrier capacity work did not finish
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 3 of the last 10 main runs
agc_submit_progress: failed in 2 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (9 IDs in 810 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (810 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 802 more
VUID-vkCmdCopyImage-srcImage-01548 (15 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, and 7 more
VUID-vkCmdCopyImage-srcImage-01551 (15 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, and 7 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08739 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08741 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
Skipped (60)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_net_ctl_disconnected: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_four_k: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_height_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_limit: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_malformed: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_width_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan su
Reproduce
git fetch origin bea14eb0d06c87fcf32e68325900b476942885fa 1e24993fa3a7da25e8fc27152af654687ba64552
git checkout 1e24993fa3a7da25e8fc27152af654687ba64552 && git merge --no-ff bea14eb0d06c87fcf32e68325900b476942885fa
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_driver_job_manager_compute_capacity)$' --parallel 1 -V

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

sktharunbalaji13-cmd and others added 2 commits November 5, 2026 15:22
… zero scans

Windows has no pagemap, so the heap mirror zero scans read every page of
their range, and reading a committed page that was never written makes
Windows allocate a physical zero page for it. The guest arena now keeps
the 4 KiB pages it committed fresh under a write watch that no write
watch report, host write or host import has touched since, and the scans
skip them.

The first read of such a page also sets its write-watch bit, so a later
collect reported it as a CPU store. A reported page that is still known
zero and still reads as zero is no longer reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GPU write lands in a device copy or an import first, so the guest page
keeps its known-zero bit, and a later CPU store of zero to it was dropped
as a first-touch report: the GPU result then won over the CPU store.
Every recorded GPU write (pending writes, fills, label stores, storage
image layers, MarkWritten and MarkPossiblyWritten) now forgets the range,
and a storage image upload reads its still known-zero pages before it
takes its write generation, so their first-touch reports come before it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sktharunbalaji13-cmd
sktharunbalaji13-cmd force-pushed the perf/windows-known-zero-scans branch from bea14eb to 7fd4e17 Compare November 5, 2026 09:53
@sktharunbalaji13-cmd

Copy link
Copy Markdown
Contributor Author

Thanks for the NVIDIA run. I looked at agc_driver_job_manager_compute_capacity and I don't think this PR can reach it on Linux:

  • All new logic is under #ifdef _WIN32: WindowsMappings.hpp, GuestArena*KnownZero, and the Windows branches of possiblyNonzero and GuestBytesZero in ResidentMirror.cpp.
  • The calls added to cross-platform code (GuestMemory::ForgetKnownZero and MaterializeKnownZero in Recorder.cpp, Texture.cpp and GuestMemory.cpp) have empty bodies on non-Windows builds (GuestMemory.cpp, the #else branches only discard their arguments).
  • The failing assertion is JobManagerCompute.cpp:357. After 225 dispatches it waits on a fence with a fixed 3 s deadline (:355). Under VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1, that deadline looks timing-sensitive rather than tied to this change.

I rebased the branch onto current main (7ad9749ed0), which will trigger a fresh run. If it fails again on the new head, I'll dig into the test's timing on Linux.

🤖 Generated with Claude Code, OpenCode, Command Code and Gemini

@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 5, 2026
@sktharunbalaji13-cmd

Copy link
Copy Markdown
Contributor Author

The only failing check on head 7fd4e17013 is relinker (windows-latest, g++): web_release timed out after 20 s and the other 777 relinker tests passed. That job does not build any file this PR changes (the PR touches the Windows guest arena and the AGC driver), and it is timing out on unrelated tests on other PRs in the same hours, for example run 42069484681 (pr_overlap_branch_scan and several check_compile_modes_*).

I do not have rights to re-run it. A maintainer re-run of that job would settle it.

🤖 Generated with Claude Code, OpenCode, Command Code and Gemini

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @sktharunbalaji13-cmd, thanks for the PR and for flagging the red check. The web_release 20 s timeout on the Windows relinker job is a known flake that we don't hold against a PR; the rest of that run (777 of 778) passed. We read the zero-page tracking through the write-watch paths and found no hole; we've started a fresh Windows run on this head to settle CI.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 7fd4e17 merged onto main 080dbd0 · tested 2026-11-05 18:52 UTC · 41 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 3,974 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 60 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 4,039 of 4,077 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1406 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_bda_device 62.1 s, ⚠️ agc_driver_graphics_maps_fallback 30.6 s, ⚠️ agc_graphics_profile_draw 30.5 s, ⚠️ agc_driver_graphics 30.5 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 2 of the last 10 main runs
agc_submit_progress: failed in 1 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (6, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export: Timeout in the parallel run; also passed only on retry in 2 other runs in the last 7 days
agc_driver_job_manager_compute_capacity: Failed in the parallel run; also passed only on retry in 177 other runs in the last 7 days
agc_driver_native_depth_aliased_depth_no_stencil: Timeout in the parallel run; also passed only on retry in 8 other runs in the last 7 days
agc_driver_native_depth_aliased_depth_stencil: Timeout in the parallel run; also passed only on retry in 7 other runs in the last 7 days
agc_driver_submit_progress: Failed in the parallel run; also passed only on retry in 14 other runs in the last 7 days
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: Timeout in the parallel run; also passed only on retry in 1 other runs in the last 7 days
Validation IDs already present on main (9 IDs in 807 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (807 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 799 more
VUID-vkCmdCopyImage-srcImage-01548 (15 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, and 7 more
VUID-vkCmdCopyImage-srcImage-01551 (15 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, and 7 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08739 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08741 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
Skipped (60)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_device_capability: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_four_k: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_height_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_limit: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_malformed: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_width_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
vide
Reproduce
git fetch origin 7fd4e17013d4ae801d382b66f88a6c3bce3c3b3d 080dbd08c6f83be5a1768af7d3342d701bf34d21
git checkout 080dbd08c6f83be5a1768af7d3342d701bf34d21 && git merge --no-ff 7fd4e17013d4ae801d382b66f88a6c3bce3c3b3d
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ AMD GPU test: failed

PR head 7fd4e17 merged onto main e772fb2 · tested 2026-11-05 19:09 UTC · 51 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 3,947 passed · 18 failed (1 new: 1 fail on main with the PR's tests too, 10 also fail on main, 7 unstable on main) · 71 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 4,036 of 4,074 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1408 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 121.5 s, ⚠️ agc_driver_graphics_maps_fallback 120.3 s, ⚠️ agc_driver_graphics 120.1 s, ⚠️ public_headers 67.0 s, ⚠️ agc_graphics_profile_draw 60.1 s

Failing tests

This PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.

Test With this PR Same test on main e772fb2 (main + this PR's test changes only)
agc_graphics_profile_draw ❌ failed ❌ also fails
agc_graphics_profile_draw: Timeout (also failed when re-run alone), assertion and diagnostics
ctest: Timeout

[guestmem] read 0 calls 0 MiB 0.0 s compare 0 calls 0 MiB 0.0 s write 0 calls 0 MiB 0.0 s write-changed 0 calls 0 MiB 0.0 s collect 0 calls 0 MiB 0.0 s verify 1 calls 0 MiB 0.0 s query 0 calls 0 MiB 0.0 s collect-memo hits 0, collect epochs 0 collect-dirty 0 tracker waits 0 / 0 | arena 0x10000+0xfbf
[textures] sampled created: 0 from storage images, 0 cleared on the GPU, 0 snapshots (0 snapshot reads over recorded writes inside cachedTexture, 0 storage-path fallbacks); stage-A records 0: 0 fast hits, 0 full lookups; storage images 0 hits, 0 created, 0 own-object refreshes; image tables 0 reused
[guestmem] read 62 calls 0 MiB 0.0 s compare 0 calls 0 MiB 0.0 s write 44 calls 0 MiB 0.0 s write-changed 5 calls 0 MiB 0.0 s collect 0 calls 0 MiB 0.0 s verify 1712 calls 56 MiB 0.0 s query 0 calls 0 MiB 0.0 s collect-memo hits 0, collect epochs 0 collect-dirty 0 tracker waits 0 / 71 | arena 0x1000
[guestmem] read 135 calls 6 MiB 0.0 s compare 0 calls 0 MiB 0.0 s write 44 calls 0 MiB 0.0 s write-changed 15 calls 0 MiB 0.0 s collect 0 calls 0 MiB 0.0 s verify 110137 calls 598 MiB 0.3 s query 0 calls 0 MiB 0.0 s collect-memo hits 0, collect epochs 0 collect-dirty 0 tracker waits 0 / 74705 | aren
[bufferpool] small: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB); large: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB); device: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB of 512); images: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB of 128)
[buffers] image mirrors: 0 ranges (0.0 MiB, 0 writable, 0 heap 0.0 MiB), 0 address-based builds served, 0 descriptor sub-ranges bound, 0 sparse heaps bound, 0 rebuilds, 33637 refreshes: 0 blocks compared, 0 copied, 0 refresh syncs; heap refills 0, unwatched heaps 33637, 0 heap mirrors evicted for bu
[descriptors] layouts 0 hits / 0 created, sets 0 from 0 pools and 0 dedicated pools, samplers 0 hits / 0 created
[dcc] 54 scans, 0.0 MiB scanned, 0 memo hits, 0 flush syncs, 0.0 ms; uncompressed keys stored: 0 on the GPU (0 with an unaligned head or tail), 17 on the CPU; key proofs: 0 proved, 0 scanned, 0 unstable
Unstable on main (7, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_graphics: failed in 3 of the last 10 main runs
agc_driver_graphics_maps_fallback: failed in 2 of the last 10 main runs
agc_driver_job_manager_compute_capacity: failed in 8 of the last 10 main runs
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 5 of the last 10 main runs
agc_submit_progress: failed in 9 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 9 of the last 10 main runs
Failing on main too (10, not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_emulated_color_compare_srgb_decode: Timeout in the parallel run; also passed only on retry in 47 other runs in the last 7 days
Validated but not compared (1, not in the main baseline's validation pass)
guest_job_manager_worker_spin_scale_0.1
Validation IDs already present on main (4 IDs in 807 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (807 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 799 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (71)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_recorded_draw_staging: skipped, the device does not keep host imports write-watched, so the target is never resident
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_net_ctl_disconnected: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_device_capability: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROL
Reproduce
git fetch origin 7fd4e17013d4ae801d382b66f88a6c3bce3c3b3d e772fb25cc72ee5faf77847f06bbc69533016e82
git checkout e772fb25cc72ee5faf77847f06bbc69533016e82 && git merge --no-ff 7fd4e17013d4ae801d382b66f88a6c3bce3c3b3d
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_graphics_profile_draw)$' --parallel 1 -V

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* libc perf Performance change unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants