Skip to content

perf(agc): skip forgetting known-zero pages that no commit marked again - #22506

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
talha-devp:perf/known-zero-forget-skip
Nov 19, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
talha-devp:perf/known-zero-forget-skip

Conversation

@talha-devp

@talha-devp talha-devp commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Each draw that writes a storage texture forgets the known-zero pages of the layers it writes (StorageTexture::markLayersPending calls GuestMemory::ForgetKnownZero). The forget takes the global WindowsMappings mutex, which other threads hold for whole write-watch collects, so on a busy title the draw committer waits on it, although after the first draw over a target the range holds no known-zero bit.

Only WindowsMappings::markZero sets known-zero bits (a fresh watched private commit and a fresh resident run). It now advances an atomic counter after it sets them, read through a new libc export GuestArenaKnownZeroMarks_nid_no_patch (GuestMemory::KnownZeroMarks in the driver; 0 off Windows). Each StorageTexture remembers the counter value it read before its last forget and the range it forgot, and skips the forget when the counter is unchanged and the layers lie inside that range. No bit can have been set in the range since, so the skipped call would have cleared nothing. A counter change or a range outside the remembered one forgets as before.

<atomic> is now included in WindowsMappings.hpp unconditionally (it was only included with APS5_COUNT_MAPPING_QUERIES).

Tested

Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 4060, driver 621.14.

windows_write_watch has a new check: a watched private commit and a fresh resident run advance the counter, ForgetKnownZero and an unwatched commit do not, and the forgotten range is no longer known zero.

GPU tests, same build directory, main 2218a29 and this PR (then on 2218a29; rebased onto 5adb7d2, whose 67 new commits change no file of libc or libSceAgcDriver), ctest -R <197 write-watch and AGC layer, pending, clear, zero, target, alias, readback, writeback and upload tests> -j 4 -V with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer (validation layer 1.4.363):

  • main: 193 passed, 3 skipped, 1 failed (agc_driver_stencil_plane_memory, "a consumed stencil clear was lost on a read-only rebind"), 0 VUID- lines, the layer inserted 256 times, was not found but was requested 0 times.
  • this PR: the same 193 passed, 3 skipped and the same 1 failed, 0 VUID- lines, the layer inserted 256 times, was not found but was requested 0 times.

(agc_driver_upload_cache_read_only_flush does not build on Windows on current main (setenv; #19899, #22366, #22373), so it is not in either run.)

Astroneer (PPSA27623), opening cutscene (#21967), no input, 140 s launches, warm launch of each cold + warm pair, same machine. Plain main aborts or draws this scene wrongly (#21967), so both arms carry the #16053 revert, plus #18293, #18757 and #22001, the open PRs with which the draw committer limits this scene (queue worker 0 is 96 % busy without them): base e7fbc2c890 = main f0c01bc + #16053 revert + #18293 + #18757 + #22001, change 432fd77993 = the same plus this PR's change (without the new test). Switches on both: APS5_DRAW_PIPELINE=1 APS5_PIPELINE_DISPATCH=1 APS5_PIPELINE_DISPATCH_MISSES=1 APS5_PIPELINE_STATS=1 APS5_ARM_BLOCKS=1, relinked with --frame-red-zone (#18293). The 62 main commits after f0c01bc touch no file of libc, AGC, the shader recompiler, VideoOut or the relinker. FPS is the 30-90 s window of the summary clock (the cutscene advances with frames, so a faster arm reaches the faster part of the scene sooner); commits are the [draw] pipelined lines over the same window.

pair arm FPS 30-90 s draw commits per 10 s, 30-90 s committer us per commit
1 base 13.88 326k-350k 26.3-28.5
1 this PR 15.60 385k-429k 21.4-24.1
2 (committer sampled) base 16.14 407k-425k 21.8-22.6
2 (committer sampled) this PR 18.76 505k-547k 16.5-17.6

Launch order: base pair 1, PR pair 1, PR pair 2, base pair 2 (launches of another variant ran between the last two). One more PR warm launch, before PR pair 1, crashed at 20 s during loading in the title's AK::BankManager thread (access violation reading 0x84000008cc) and was run again. This title has crashed with access violations in about 1 of 11 launches on other builds here too (TaskGraphThreadHP, FAsyncLoadingThread), and known-zero bits do not change guest memory: they only let a collect drop a written page whose bytes are still all zero.

Committer samples (APS5_SAMPLE_COMMITTER, pair 2, whole launch): GuestArenaForgetKnownZero_nid_no_patch is in 10988 of 93531 samples (11.7 %) on the base, 9926 of them under StorageTexture::markLayersPending, and in 1615 of 90285 (1.8 %) with this PR, where the remaining forgets come from label, fill and sample-dump writes (Recorder::noteWrite, GuestMemory::MarkWritten). markLayersPending goes from 11.5 % to 1.3 % of the samples.

trace_digest.py of the summary files (the 300:10 trace window starts after the 140 s launches, so no window trace was written):

base pair 1:    **12 intervals**, 0.0 to 120.4 s, 2166 presents
                NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit e7fbc2c8907e
PR pair 1:      **12 intervals**, 0.0 to 120.3 s, 2630 presents
                NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit 432fd7799362
base pair 2:    **12 intervals**, 0.0 to 120.4 s, 2774 presents
                NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit e7fbc2c8907e
PR pair 2:      **12 intervals**, 0.0 to 120.4 s, 3258 presents
                NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit 432fd7799362

Captures with a trace window, for the comparison the Performance report form asks for: the same two builds and switches, one cold + warm launch each (base, then this PR), APS5_TRACE_SECONDS=50:10, warm launches. The window is 50-60 s of the cutscene on both; since the scene advances with frames, the faster build is somewhat further into the same planet-surface part. Warm 30-90 s FPS of these launches: base 13.26, this PR 18.02. tools/performance_compare.py --require-matching-context reports no configuration difference between the two lines.

base e7fbc2c890 this PR 432fd77993 change
presents in 10 s 134 181 +35 %
mean frame (ms) 74.9 55.3 -26 %
frame p50 / p90 (ms) 73.2 / 81.6 52.3 / 66.0
GPU busy per present (ms) 38.5 39.1
Graphics.Draw.draw_and_resource_release (ms per frame) 51.3 28.2 -45 %

Traces: base, this PR.

aps5-summary.jsonl window lines (base, then this PR):

{"commit":"e7fbc2c8907e","dirty":false,"env":{"APS5_ARM_BLOCKS":"1","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_PIPELINE_STATS":"1","APS5_RELINK_RELOCATE_RED_ZONE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"50:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA27623","title":"ASTRONEER","content_version":"01.015.000","resolution":"3840x2160","window":{"spec":"seconds 50:10","first_present":1139,"ms":10032.549},"presents":134,"frame_ms":{"p50":73.224,"p90":81.620,"p99":92.189,"max":101.308},"gpu_busy_ms_per_present":38.470,"worker_busy_pct":{"queue worker 0x0":88.515,"queue worker 0x20":99.975},"phase_totals_ms":{"Driver.Completion":1.633,"Driver.Dispatch":359.364,"Driver.Dispatch.capture_resources":156.177,"Driver.Dispatch.decode_key_device_setup":6.959,"Driver.Dispatch.lookup_cache":1.010,"Driver.Dispatch.materialize":5.596,"Driver.Dispatch.prepared_invocation":4.962,"Driver.Draw":6334.183,"Driver.Draw.device_setup":407.481,"Driver.Draw.draw_handed_off":5154.943,"Driver.Draw.prepare":739.164,"Driver.DrawFinish":8217.107,"Driver.DrawFinish.draw_enqueued":5303.587,"Driver.DrawFinish.post_compile_prepare":56.992,"Driver.DrawFinish.shader_compile_and_link":2802.146,"Driver.EndSubmission":106.836,"Driver.Packet":18801.884,"Driver.Packet.device_lock":92.415,"Driver.Packet.dispatch":696.971,"Driver.Packet.draw":6405.868,"Driver.Packet.execute":619.641,"Driver.Packet.flip_flush":6.473,"Driver.Packet.flush_between_packets":206.049,"Driver.Packet.memory_wait":9582.844,"Driver.Packet.pipeline_drain":473.101,"Driver.Packet.pipeline_prepare":134.150,"Driver.Packet.prepare_memory":193.301,"Driver.Packet.rendering_wait":0.238,"Driver.Present":1848.077,"Driver.Present.acquire_image":2.215,"Driver.Present.device_setup":0.089,"Driver.Present.gpu_mutex_wait":4.553,"Driver.Present.inflight_wait":0.362,"Driver.Present.present_display_buffer":19.729,"Driver.Present.queue_present":64.580,"Driver.Present.release_and_callback":0.272,"Driver.Present.render_fence_wait":1755.899,"Driver.Present.resize":0.238,"Driver.Present.validate":0.040,"Driver.Suspend":0.031,"GpuMutex.wait.dispatch":44.479,"GpuMutex.wait.draw":68.834,"GpuMutex.wait.end":32.587,"GpuMutex.wait.fill":9.646,"GpuMutex.wait.flush":0.456,"GpuMutex.wait.hook":84.234,"GpuMutex.wait.label":50.978,"GpuMutex.wait.other":142.088,"GpuMutex.wait.present":4.266,"GpuMutex.wait.wait":1.507,"Graphics.Draw":8110.434,"Graphics.Draw.draw_and_resource_release":6878.394,"Graphics.Draw.index_upload":361.901,"Graphics.Draw.validate":243.611,"Graphics.Draw.vertex_upload":525.458,"Recorder.Reap":77.674,"Recorder.Submit":279.038,"Resources.Complete":33.202,"Resources.Prepare":35.540,"Shader.DrawStage":2543.718,"Shader.DrawStage.capture_resources":1269.566,"Shader.DrawStage.materialize":703.852,"Shader.DrawStage.prepared_invocation":535.146,"VideoOut.Flip":1861.925,"VideoOut.Flip.completion_mutex_wait":0.212,"VideoOut.Flip.config_mutex_wait":0.013,"VideoOut.Flip.frame_limit":0.102,"VideoOut.Flip.notify_game":3.682,"VideoOut.Flip.present":1849.081,"VideoOut.Flip.validate":0.168,"VideoOut.Flip.vblank_wait":0.105,"VideoOut.Flip.window_prepare":0.218,"VideoOut.Flip.window_title":8.129,"VideoOut.Readiness":0.319,"VideoOut.Readiness.locks_validate":0.127,"Vulkan.Acquire":2.029,"Vulkan.Acquire.acquire_fence_wait":0.292,"Vulkan.Acquire.acquire_image":1.258,"Vulkan.Acquire.fence_reset":0.345,"Vulkan.Acquire.retired_swapchains":0.079,"Vulkan.Dispatch":76.359,"Vulkan.Dispatch.command_record":37.351,"Vulkan.Dispatch.shader_resources":37.799,"Vulkan.Present":14.060,"Vulkan.Present.command_record_scale":6.202,"Vulkan.Present.pixel_upload":1.198,"Vulkan.Present.queue_submit":6.521,"Vulkan.QueuePresent":64.249,"Vulkan.QueuePresent.queue_present":63.982,"Vulkan.Retire":1755.838,"Vulkan.Retire.dump":1.091,"Vulkan.Retire.wait":1752.440},"top_phases_ms_per_frame":{"Driver.Packet":140.313,"Driver.Packet.memory_wait":71.514,"Driver.DrawFinish":61.322,"Graphics.Draw":60.526,"Graphics.Draw.draw_and_resource_release":51.331,"Driver.Packet.draw":47.805,"Driver.Draw":47.270,"Driver.DrawFinish.draw_enqueued":39.579},"owned_draw_counts":{"OwnedDraw.evicted_other":5115},"graphics_track":{"Graphics.Barrier.copy":1751,"Graphics.Barrier.dcc-clear":1876,"Graphics.Barrier.dcc-keys":804,"Graphics.Barrier.dispatch-lead":1077,"Graphics.Barrier.dispatch-trail":1742,"Graphics.Barrier.draw":19108,"Graphics.Barrier.fill":1571,"Graphics.Barrier.fill-clear":804,"Graphics.Barrier.input-mirror":977,"Graphics.Barrier.label-run":38899,"Graphics.Barrier.present-blit":268,"Graphics.Barrier.shadow-publish":268,"Graphics.Barrier.staging-in":938,"Graphics.Barrier.staging-out":402,"Graphics.Barrier.storage-writeback":3648,"Graphics.BarrierMerged.dispatch-lead":665,"Graphics.BarrierMerged.fill":1109,"Graphics.BarrierMerged.label-run":510,"Graphics.BarrierMerged.shadow-publish":268,"Graphics.BarrierMerged.staging-in":268,"Graphics.BarrierMerged.staging-out":402,"Graphics.BarrierMerged.storage-writeback":908,"Graphics.Copy":2451,"Graphics.Copy.bytes":3929240604,"Graphics.RenderPass":10435,"Graphics.RenderPass.Close.command":3145,"Graphics.RenderPass.Close.image":1319,"Graphics.RenderPass.Close.key":756,"Graphics.RenderPass.Close.label":510,"Graphics.RenderPass.Close.new-batch":4705,"Graphics.RenderPass.Continued":243202},"trace_dropped":false,"trace":"aps5-trace-e7fbc2c8907e-8284.json.gz"}
{"commit":"432fd7799362","dirty":false,"env":{"APS5_ARM_BLOCKS":"1","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_PIPELINE_STATS":"1","APS5_RELINK_RELOCATE_RED_ZONE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"50:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA27623","title":"ASTRONEER","content_version":"01.015.000","resolution":"3840x2160","window":{"spec":"seconds 50:10","first_present":1285,"ms":10004.784},"presents":181,"frame_ms":{"p50":52.308,"p90":65.998,"p99":101.594,"max":132.174},"gpu_busy_ms_per_present":39.122,"worker_busy_pct":{"queue worker 0x0":88.403,"queue worker 0x20":99.935},"phase_totals_ms":{"Driver.Completion":2.675,"Driver.Dispatch":566.512,"Driver.Dispatch.capture_resources":269.652,"Driver.Dispatch.decode_key_device_setup":10.938,"Driver.Dispatch.lookup_cache":1.897,"Driver.Dispatch.materialize":7.585,"Driver.Dispatch.prepared_invocation":7.393,"Driver.Draw":5167.748,"Driver.Draw.device_setup":668.807,"Driver.Draw.draw_handed_off":3211.247,"Driver.Draw.prepare":1237.784,"Driver.DrawFinish":7481.016,"Driver.DrawFinish.draw_enqueued":3069.628,"Driver.DrawFinish.post_compile_prepare":90.735,"Driver.DrawFinish.shader_compile_and_link":4247.851,"Driver.EndSubmission":115.372,"Driver.Packet":18724.663,"Driver.Packet.device_lock":144.320,"Driver.Packet.dispatch":1661.043,"Driver.Packet.draw":5274.131,"Driver.Packet.execute":920.846,"Driver.Packet.flip_flush":8.298,"Driver.Packet.flush_between_packets":390.030,"Driver.Packet.memory_wait":8621.744,"Driver.Packet.pipeline_drain":701.351,"Driver.Packet.pipeline_prepare":219.494,"Driver.Packet.prepare_memory":270.256,"Driver.Packet.rendering_wait":0.381,"Driver.Present":2572.144,"Driver.Present.acquire_image":3.187,"Driver.Present.device_setup":0.135,"Driver.Present.gpu_mutex_wait":5.983,"Driver.Present.inflight_wait":0.550,"Driver.Present.present_display_buffer":28.265,"Driver.Present.queue_present":88.413,"Driver.Present.release_and_callback":0.440,"Driver.Present.render_fence_wait":2444.603,"Driver.Present.resize":0.360,"Driver.Present.validate":0.058,"Driver.Suspend":0.127,"GpuMutex.wait.dispatch":46.396,"GpuMutex.wait.draw":111.680,"GpuMutex.wait.end":17.917,"GpuMutex.wait.fill":22.190,"GpuMutex.wait.flush":2.414,"GpuMutex.wait.hook":129.831,"GpuMutex.wait.label":91.114,"GpuMutex.wait.other":73.714,"GpuMutex.wait.present":5.584,"GpuMutex.wait.wait":7.698,"Graphics.Draw":7069.442,"Graphics.Draw.draw_and_resource_release":5110.299,"Graphics.Draw.index_upload":616.795,"Graphics.Draw.validate":363.209,"Graphics.Draw.vertex_upload":832.198,"Recorder.Reap":150.647,"Recorder.Submit":385.725,"Resources.Complete":43.969,"Resources.Prepare":49.715,"Shader.DrawStage":3845.730,"Shader.DrawStage.capture_resources":1828.898,"Shader.DrawStage.materialize":1164.452,"Shader.DrawStage.prepared_invocation":798.105,"Shader.PrepareArtifact":15.155,"Shader.Register":3.211,"Shader.ResolveAbi":0.438,"Shader.ResolveGraphicsAbi":0.044,"Shader.ResolveGraphicsStagesAbi":6.322,"VideoOut.Flip":2601.572,"VideoOut.Flip.completion_mutex_wait":0.400,"VideoOut.Flip.config_mutex_wait":0.073,"VideoOut.Flip.frame_limit":0.135,"VideoOut.Flip.notify_game":12.525,"VideoOut.Flip.present":2573.255,"VideoOut.Flip.validate":0.229,"VideoOut.Flip.vblank_wait":0.134,"VideoOut.Flip.window_prepare":0.312,"VideoOut.Flip.window_title":13.873,"VideoOut.Readiness":0.453,"VideoOut.Readiness.locks_validate":0.186,"Vulkan.Acquire":2.956,"Vulkan.Acquire.acquire_fence_wait":0.439,"Vulkan.Acquire.acquire_image":1.780,"Vulkan.Acquire.fence_reset":0.552,"Vulkan.Acquire.retired_swapchains":0.109,"Vulkan.Dispatch":108.480,"Vulkan.Dispatch.command_record":46.295,"Vulkan.Dispatch.shader_resources":60.325,"Vulkan.GraphicsPipeline":1.069,"Vulkan.GraphicsPipeline.modules_and_state":1.044,"Vulkan.GraphicsPipelinePrebuild":1.133,"Vulkan.Present":21.094,"Vulkan.Present.command_record_scale":8.642,"Vulkan.Present.pixel_upload":1.257,"Vulkan.Present.queue_submit":10.986,"Vulkan.QueuePresent":87.928,"Vulkan.QueuePresent.queue_present":87.582,"Vulkan.Retire":2444.535,"Vulkan.Retire.dump":1.525,"Vulkan.Retire.wait":2439.084},"top_phases_ms_per_frame":{"Driver.Packet":103.451,"Driver.Packet.memory_wait":47.634,"Driver.DrawFinish":41.332,"Graphics.Draw":39.058,"Driver.Packet.draw":29.139,"Driver.Draw":28.551,"Graphics.Draw.draw_and_resource_release":28.234,"Driver.DrawFinish.shader_compile_and_link":23.469},"owned_draw_counts":{"OwnedDraw.evicted_other":15245},"graphics_track":{"Graphics.Barrier.copy":2362,"Graphics.Barrier.dcc-clear":2534,"Graphics.Barrier.dcc-keys":1086,"Graphics.Barrier.dispatch-lead":1465,"Graphics.Barrier.dispatch-trail":2353,"Graphics.Barrier.draw":27042,"Graphics.Barrier.fill":2198,"Graphics.Barrier.fill-clear":1086,"Graphics.Barrier.input-mirror":1715,"Graphics.Barrier.label-run":54211,"Graphics.Barrier.present-blit":362,"Graphics.Barrier.shadow-publish":362,"Graphics.Barrier.staging-in":1268,"Graphics.Barrier.staging-out":543,"Graphics.Barrier.storage-upload":4,"Graphics.Barrier.storage-writeback":4945,"Graphics.BarrierMerged.dispatch-lead":888,"Graphics.BarrierMerged.fill":1426,"Graphics.BarrierMerged.label-run":623,"Graphics.BarrierMerged.shadow-publish":362,"Graphics.BarrierMerged.staging-in":361,"Graphics.BarrierMerged.staging-out":543,"Graphics.BarrierMerged.storage-writeback":1209,"Graphics.Copy":3706,"Graphics.Copy.bytes":5311063680,"Graphics.RenderPass":14728,"Graphics.RenderPass.Close.command":4490,"Graphics.RenderPass.Close.image":1819,"Graphics.RenderPass.Close.key":1051,"Graphics.RenderPass.Close.label":623,"Graphics.RenderPass.Close.new-batch":6745,"Graphics.RenderPass.Continued":390130},"trace_dropped":false,"trace":"aps5-trace-432fd7799362-9212.json.gz"}

trace_digest.py of the two traces:

base:    **seconds 50:10** from present 1139: 134 presents, frame p50 73.2 / p90 81.6 / p99 92.2 / max 101.3 ms, GPU busy 38.5 ms per present
         NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit e7fbc2c8907e, dropped: no
this PR: **seconds 50:10** from present 1285: 181 presents, frame p50 52.3 / p90 66.0 / p99 101.6 / max 132.2 ms, GPU busy 39.1 ms per present
         NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit 432fd7799362, dropped: no

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none (refs perf: Astroneer (PPSA27623) opening cutscene runs at ~10 FPS #21967)
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 10 Pro 22H2 (19045)
  • AI-assisted: yes

StorageTexture::markLayersPending forgets the known-zero pages of the
layers a draw writes. The forget takes the global WindowsMappings mutex
on every draw, although after the first draw the range holds no
known-zero bit. Only markZero sets those bits, so it now advances a
counter, and a texture skips the forget while the counter is unchanged
and the range lies inside the one it last forgot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GtFtGrfcHTXazyD8pfg1n3
@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Nov 17, 2026
@github-actions

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.

@github-actions github-actions Bot added libc agc libSceAgc* labels Nov 17, 2026
@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran the AGC zero, pending, clear, alias, readback, writeback and upload tests with the Khronos validation layer on Linux and NVIDIA's proprietary driver, since the PR was tested on Windows only.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 76f3c9e20d merged onto main 89b0eef7ab with --no-ff, clean merge. Main baseline is a Release build of 89b0eef7ab on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^(agc_.*(known_zero|zero|pending|clear|alias|readback|writeback|write_back|upload)|.*write_watch.*|guest_arena.*)' -V
main 89b0eef7ab this PR
Result 123 passed, 2 skipped (125) 123 passed, 2 skipped (125)
Insert instance layer "VK_LAYER_KHRONOS_validation" 151 151
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

agc_hook_clear_access and agc_hook_clear_access_off skip on both sides (the device reports watched host memory written when it imports or reads it). windows_write_watch, which holds the new check, is Windows-only and is not in this run. Every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 20084 core/libs/tests/WindowsWriteWatch.cpp L1036, L1075
PR 22018 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp L4793-4794

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1835 core/libs/prx/libc/src/GuestArena.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 12746 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 12840 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 13251 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13796 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 15136 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 16753 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 18185 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 18293 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libc/include/GuestArena.hpp
core/libs/prx/libc/include/WindowsMappings.hpp
core/libs/prx/libc/src/GuestArena.cpp
core/libs/tests/WindowsWriteWatch.cpp
PR 18369 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 19054 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libc/src/GuestArena.cpp
PR 19130 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20041 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20183 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libc/include/GuestArena.hpp
core/libs/prx/libc/include/WindowsMappings.hpp
core/libs/prx/libc/src/GuestArena.cpp
PR 20728 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 21238 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 21669 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 22062 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 22434 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 23234 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp

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

Copy link
Copy Markdown
Contributor

GTA V numbers for this change, measured together with #22411 / #22506, because we carry both. The two are in one build, so this is their combined effect, not each one's.

boot p50 ms p90 ms p99 ms presents in 30 s
M 1 116.24 144.94 181.96 245
S 1 111.18 121.53 153.41 263
S 2 111.22 120.42 185.24 262
M 2 112.94 135.32 164.54 254

S − M: p50 −3.4 ± 1.7 ms (−3.0%), p90 −19.2 ± 4.8 ms (standard error of the difference, 2 boots per build). p99 doesn't separate. Thanks for both.

@Colewiz7

Copy link
Copy Markdown
Contributor

Head 76f3c9e20d merged onto main 7c836568c8 as 69dd145ec9, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6206 on the 7900 XT, the 2007 GPU ones on the iGPU), new failures vs main none none
-R '^agc' (1940 tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main. video_out_hdr_present (RAPHAEL, full run), and agc_driver_depth_fast_clear_submit (RAPHAEL, agc-layer run) each failed once in the parallel runs and pass 3/3 solo on main and on this PR.

AI-assisted: yes

@oneandonlydean
oneandonlydean merged commit e72380e into boykopovar:main Nov 19, 2026
24 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants