Repository navigation
Conversation
…::Reap Every submitted batch signals the recorder's timeline semaphore with its serial. Reap now reads the timeline value first and stops without calling vkGetFenceStatus while the front batch's serial has not been reached; the fence is still checked before a batch is retired. Without a timeline, or when reading it fails, Reap polls the fence as before.
milescoviello
left a comment
There was a problem hiding this comment.
Reviewed head 26332fb29e by reading; I didn't build or run it.
Checked in Recorder.cpp:
- The skip is safe. Every batch reaches
inFlightonly through the onepush_backaftervkQueueSubmit, and that submit signalstimelinewith the batch's serial whenevertimelineexists. A timeline value below the front batch's serial therefore means that batch hasn't completed, and nothing is skipped that the fence would have reported done. - Retirement is unchanged. A batch still retires only on its fence, so an out-of-order or failed timeline read can delay a reap but never retire a batch early.
- The fallbacks hold. A failed
vkGetSemaphoreCounterValueKHR(for example on device loss) setsreachedto the maximum and drops back to polling the fence. Without timeline semaphores, or when creating the semaphore fails, the pointer stays null andReapbehaves as onmain. The new earlyreturnin the constructor only skips the lookup on that failure path. reachedis re-read only when the next front serial passes it, so the loop makes at most one extra counter read per retired batch.
No changes needed from my side. The overlap with #20066 in Reap is already noted in the body.
AI-assisted: yes
|
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.
|
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The timeline gate appears consistent with the submission serials and retains the fence check, but I did not run the checks needed to support a formal approval.
What I ran
Reviewed head 26332fb29e3f0c18b3e1a1d6877338eb7cce709d using the prepared description, commit list, manifest, diff, and targeted reads through repo_read.py. No tests or builds were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Three changed files inspected |
| Build and tests | not run | Author-reported results were not rerun |
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The changed files’ full texts were included in the review bundle, but only relevant ranges were read. files.json was not available; the manifest and file listing show all three changed files included, with no excluded changed files. Build, tests, runtime behavior, and the reported performance measurements were not independently verified.
To get this to a good state
Nothing is required.
|
This passed review on 26332fb, but it now conflicts with main in Recorder.cpp, RecorderKeptBytes.cpp. Please merge main into the branch and push; it goes back to the merge queue on the new head. |
|
Main now retires batches from the timeline without polling a fence by default (#20066), so the timeline read before the fence poll here only affects the APS5_BATCH_FENCES path. If you still want that path faster, please merge main, keep the change to the fence path only, and post a before and after from the same machine and scene with APS5_BATCH_FENCES=1. I will review it on the new head. |
|
@oneandonlydean About your comment:
Thanks for the offer. I'm closing this PR instead, as its description proposed: "If #20066 merges first, this one should be closed".
Thanks for the reviews and the test run. |
What
Recorder::Reapretires the batches the GPU has finished. The draw committer calls it before each occlusion counter dump and each label it writes on the GPU for queue 0 (DumpSamplesOnGpuandWriteLabelOnGpu, throughOpportunisticReap). Each call polls the oldest batch's fence withvkGetFenceStatus, even when no batch has finished since the last call.Every submitted batch also signals the recorder's timeline semaphore with its serial.
Reapnow reads the timeline value first. While it is below the oldest batch's serial,Reapstops without polling the fence. A batch is still retired only once its fence is signaled. Without a timeline, or when reading it fails,Reappolls the fence as before.Overlap with #20066. #20066 (open, meh7an) changes the same
Reaplines and goes further: it drops the fence per batch and asks the timeline everywhere. This PR is the narrower variant: it keeps the fences, adds no switch and changes no other function. I measured both on the same level and posted the numbers on that thread:Recorder.Reapper frame was 8.6 ms onmain, 3.5 with this change and 3.3 with #20066, and the frame went from 227.4 to 222.8 and 222.9 ms. I am not claiming this PR is better. If #20066 merges first, this one should be closed; whichever merges second has to resolve the conflict inReap.On this machine's NVIDIA driver,
vkGetFenceStatustakes 214 to 217 ns per call andvkGetSemaphoreCounterValue23 ns, whether the work is pending or done (a standalone loop,fencebench.cppin the gist). On the level below, one 10 sAPS5_PROFILE_DRAW=1report onmaineb20410673counts 838,146 counter dumps and 470,818 end-of-pipe labels on the committer, next to 609,977 draws.The new test in
RecorderKeptBytes.cppgives a mock recorder a timeline and checks four things: no fence poll while the timeline has reached no batch, no retire while a reached batch's fence is unsignaled, the retire of exactly the batch both report finished, and the fence fallback when the timeline read fails.Tested
Windows 10.0.26300, AMD Ryzen 5 9600X (12 threads, 31861 MiB), NVIDIA GeForce RTX 5070 Ti, driver 621.14, display 2560x1440 at 164 Hz, AC power, 2026-11-18. PPSA21564 01.007.000, default settings, 3840x2160 output, no input, caches warm. Unless a line says otherwise, the timings compare
maina37edff43cwithd36706e188(this PR on thatmain), both built here and run from the same relinked executable. The head,26332fb29e, isd36706e188rebased onto0d15c76106:tools/rebase_verify.pykeeps every line, none of the commits in between touchescore/libs/prx/libSceAgcDriverorcore/shader, andagc_recorder_kept_bytespasses on the rebased head. I did not time the rebased head.Why this level. I ran 84 levels of PPSA21564 (
-lvl <name>, 120 s each, one run,APS5_PROFILE_DRAW=1,maineb20410673). Then I ran the 12 slowest, andspeedrun_inflator, twice more for 150 s with warm caches.shuriken_ninja_castlewas the slowest in both runs: frame p50 247 and 250 ms over the last six 10 s intervals. Next werebig_hand_pirate_island(243, 244) andspring_punch_monster_cave(206, 204).speedrun_inflatorstopped in an access violation on the title'sDraw Geometrythread in all three runs (28, 46 and 60 s after start), andpath_maker_mana_treeaborted 34 s after start in both runs of the second pass, so I could not rank them. The tables are inlevel-sweep.txtin the gist.Where the time goes. On this level the GPU is busy about 117 ms of a 228 ms frame. Queue 0's packet worker and the draw committer share the rest: about 15,000 draws per frame, plus the dumps and labels above. Without the opportunistic reap (
APS5_NO_OPPORTUNISTIC_REAP=1) the level is slower, at 251 ms per frame against 228 ms (two runs each oneb20410673). So the reap has to stay; this change only makes it cheaper. A sampler on the committer (APS5_SAMPLE_COMMITTER, about 80 s per side, oneb20410673with and without the code change) put 478 of 5,124 samples inside the NVIDIA driver underReaponmain, and 0 with the change. That sampler overcounts time spent in kernel calls, so these counts only show that the poll is gone, not its share of the frame.PPSA21564
-lvl shuriken_ninja_castle: frame p50 went from 225.8 to 220.5 ms and the mean frame from 233.7 to 227.2 ms, in four alternating window captures; every run of the change had a lower p50 than every run ofmain.-lvl shuriken_ninja_castle, no input (the level plays on by itself). The window is 60 to 68 s after the first present.APS5_TRACE_SECONDS=60:8andAPS5_TRACE_DIR, no otherAPS5_TRACE_*orAPS5_PROFILE_*switch,ANYPS5_GPU=NVIDIA,ANYPS5_DISPLAY_INDEX=0,ANYPS5_VOLUME=0, andAPS5_PAD_INPUT_FILEpointing at a file nothing wrote. One warm-up run per side, then the order main, change, four times (alwaysmainfirst). Each run was stopped 96 s after start; no trace dropped events.libSceAgcDriver(the change), andlibc,libkernel,libSceAgc,libSceGnmDriver,libSceJobManager,libSceSystemService,libSceVideoOut(the commit they embed).a37edff43cfad36706e1889ba37edff43cfad36706e1889ba37edff43cfad36706e1889ba37edff43cfad36706e1889bSummary lines of round 2 (all eight lines, the two traces of round 2, their
trace_digest.pyoutput and theperformance_compare.pyreport are in this gist):{"commit":"a37edff43cfa","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:8"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 60:8","first_present":719,"ms":8119.837},"presents":35,"frame_ms":{"p50":223.339,"p90":241.508,"p99":475.466,"max":475.466},"gpu_busy_ms_per_present":117.469,"worker_busy_pct":{"queue worker 0x0":95.810,"queue worker 0x40":97.522,"queue worker 0x48":96.514,"queue worker 0x46":0.612},"phase_totals_ms":{"Driver.Completion":4.661,"Driver.Dispatch":1272.591,"Driver.Dispatch.capture_resources":91.049,"Driver.Dispatch.decode_key_device_setup":183.750,"Driver.Dispatch.lookup_cache":13.365,"Driver.Dispatch.materialize":259.202,"Driver.Dispatch.prepared_invocation":10.942,"Driver.Draw":4352.095,"Driver.Draw.device_setup":289.704,"Driver.Draw.draw_enqueued":1143.538,"Driver.Draw.post_compile_prepare":42.936,"Driver.Draw.prepare":687.432,"Driver.Draw.shader_compile_and_link":2014.855,"Driver.EndSubmission":36.201,"Driver.Packet":23542.783,"Driver.Packet.device_lock":72.669,"Driver.Packet.dispatch":1280.263,"Driver.Packet.draw":4422.559,"Driver.Packet.execute":310.156,"Driver.Packet.flip_flush":1.346,"Driver.Packet.flush_between_packets":174.807,"Driver.Packet.memory_wait":15105.195,"Driver.Packet.pipeline_drain":109.392,"Driver.Packet.pipeline_prepare":99.107,"Driver.Packet.prepare_memory":576.739,"Driver.Packet.rendering_wait":0.089,"Driver.Present":41.813,"Driver.Present.acquire_image":0.486,"Driver.Present.device_setup":0.015,"Driver.Present.gpu_mutex_wait":0.075,"Driver.Present.inflight_wait":0.091,"Driver.Present.present_display_buffer":5.016,"Driver.Present.queue_present":23.586,"Driver.Present.release_and_callback":0.033,"Driver.Present.render_fence_wait":12.416,"Driver.Present.resize":0.068,"Driver.Present.validate":0.010,"Driver.Suspend":1.119,"GpuMutex.wait.dispatch":34.177,"GpuMutex.wait.draw":130.450,"GpuMutex.wait.end":8.185,"GpuMutex.wait.fill":0.118,"GpuMutex.wait.flush":2.123,"GpuMutex.wait.hook":7.236,"GpuMutex.wait.indirect":0.750,"GpuMutex.wait.label":21.869,"GpuMutex.wait.present":0.011,"GpuMutex.wait.wait":4.689,"Graphics.Draw":2272.240,"Graphics.Draw.draw_and_resource_release":1518.631,"Graphics.Draw.index_upload":175.496,"Graphics.Draw.validate":141.007,"Graphics.Draw.vertex_upload":181.624,"Graphics.DrawWithRecipe":1285.364,"Graphics.DrawWithRecipe.draw_and_resource_release":1196.526,"Graphics.DrawWithRecipe.index_upload":10.543,"Graphics.DrawWithRecipe.validate":44.767,"Graphics.DrawWithRecipe.vertex_upload":16.733,"Recorder.Reap":292.783,"Recorder.Submit":394.746,"Recorder.WaitSerial":204.162,"Resources.Complete":53.634,"Resources.Prepare":41.164,"Shader.DrawStage":1354.662,"Shader.DrawStage.capture_resources":884.974,"Shader.DrawStage.materialize":322.732,"Shader.DrawStage.prepared_invocation":131.487,"Shader.PrepareArtifact":2.822,"Shader.ResolveAbi":6.641,"Shader.ResolveGraphicsAbi":2.030,"Shader.ResolveGraphicsStagesAbi":65.222,"VideoOut.Flip":44.199,"VideoOut.Flip.completion_mutex_wait":0.035,"VideoOut.Flip.config_mutex_wait":0.003,"VideoOut.Flip.frame_limit":0.019,"VideoOut.Flip.notify_game":1.563,"VideoOut.Flip.present":40.560,"VideoOut.Flip.validate":0.036,"VideoOut.Flip.vblank_wait":0.020,"VideoOut.Flip.window_prepare":0.062,"VideoOut.Flip.window_title":1.876,"VideoOut.Readiness":0.084,"VideoOut.Readiness.locks_validate":0.036,"Vulkan.Acquire":0.450,"Vulkan.Acquire.acquire_fence_wait":0.056,"Vulkan.Acquire.acquire_image":0.311,"Vulkan.Acquire.fence_reset":0.058,"Vulkan.Acquire.retired_swapchains":0.012,"Vulkan.Dispatch":451.807,"Vulkan.Dispatch.command_record":127.640,"Vulkan.Dispatch.shader_resources":322.596,"Vulkan.DispatchRecipe":17.228,"Vulkan.DispatchRecipe.command_record":17.136,"Vulkan.DrawFromRecipe":1341.136,"Vulkan.GraphicsPipeline":6.476,"Vulkan.GraphicsPipeline.create":3.087,"Vulkan.GraphicsPipeline.modules_and_state":3.379,"Vulkan.GraphicsPipelineLibrary":2.755,"Vulkan.GraphicsPipelineLink":0.153,"Vulkan.Present":3.502,"Vulkan.Present.command_record_scale":1.601,"Vulkan.Present.pixel_upload":0.084,"Vulkan.Present.queue_submit":1.794,"Vulkan.QueuePresent":23.541,"Vulkan.QueuePresent.queue_present":23.503,"Vulkan.Retire":12.413,"Vulkan.Retire.wait":11.636},"top_phases_ms_per_frame":{"Driver.Packet":672.651,"Driver.Packet.memory_wait":431.577,"Driver.Packet.draw":126.359,"Driver.Draw":124.346,"Graphics.Draw":64.921,"Driver.Draw.shader_compile_and_link":57.567,"Graphics.Draw.draw_and_resource_release":43.389,"Shader.DrawStage":38.705},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":715,"Graphics.Barrier.dcc-clear":370,"Graphics.Barrier.dcc-keys":370,"Graphics.Barrier.dispatch-lead":8552,"Graphics.Barrier.dispatch-trail":14149,"Graphics.Barrier.draw":50368,"Graphics.Barrier.fill":1686,"Graphics.Barrier.fill-clear":686,"Graphics.Barrier.indirect-args":315,"Graphics.Barrier.input-mirror":2803,"Graphics.Barrier.label-run":411416,"Graphics.Barrier.present-blit":70,"Graphics.Barrier.shadow-publish":370,"Graphics.Barrier.staging-in":34517,"Graphics.Barrier.staging-out":14351,"Graphics.Barrier.storage-upload":2102,"Graphics.Barrier.storage-writeback":6295,"Graphics.BarrierMerged.dispatch-lead":6227,"Graphics.BarrierMerged.fill":362,"Graphics.BarrierMerged.label-run":43,"Graphics.BarrierMerged.shadow-publish":254,"Graphics.BarrierMerged.staging-in":11118,"Graphics.BarrierMerged.staging-out":14351,"Graphics.BarrierMerged.storage-writeback":909,"Graphics.Copy":37573,"Graphics.Copy.bytes":4452626480,"Graphics.RenderPass":17275,"Graphics.RenderPass.Close.command":11557,"Graphics.RenderPass.Close.image":187,"Graphics.RenderPass.Close.key":125,"Graphics.RenderPass.Close.label":43,"Graphics.RenderPass.Close.new-batch":5363,"Graphics.RenderPass.Continued":499166},"trace_dropped":false,"trace":"aps5-trace-a37edff43cfa-23184.json.gz"} {"commit":"d36706e1889b","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:8"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 60:8","first_present":722,"ms":8041.937},"presents":36,"frame_ms":{"p50":218.981,"p90":228.093,"p99":452.971,"max":452.971},"gpu_busy_ms_per_present":114.941,"worker_busy_pct":{"queue worker 0x0":95.786,"queue worker 0x40":97.527,"queue worker 0x48":96.666,"queue worker 0x46":0.590},"phase_totals_ms":{"Driver.Completion":4.703,"Driver.Dispatch":1311.792,"Driver.Dispatch.capture_resources":93.151,"Driver.Dispatch.decode_key_device_setup":192.264,"Driver.Dispatch.lookup_cache":12.958,"Driver.Dispatch.materialize":256.524,"Driver.Dispatch.prepared_invocation":11.346,"Driver.Draw":4356.592,"Driver.Draw.device_setup":284.942,"Driver.Draw.draw_enqueued":1150.682,"Driver.Draw.post_compile_prepare":43.548,"Driver.Draw.prepare":683.525,"Driver.Draw.shader_compile_and_link":2018.340,"Driver.EndSubmission":39.926,"Driver.Packet":23320.595,"Driver.Packet.device_lock":72.817,"Driver.Packet.dispatch":1319.386,"Driver.Packet.draw":4428.893,"Driver.Packet.execute":310.998,"Driver.Packet.flip_flush":1.336,"Driver.Packet.flush_between_packets":172.914,"Driver.Packet.memory_wait":14939.114,"Driver.Packet.pipeline_drain":109.490,"Driver.Packet.pipeline_prepare":93.989,"Driver.Packet.prepare_memory":598.002,"Driver.Packet.rendering_wait":0.046,"Driver.Present":42.788,"Driver.Present.acquire_image":0.515,"Driver.Present.device_setup":0.015,"Driver.Present.gpu_mutex_wait":0.097,"Driver.Present.inflight_wait":0.093,"Driver.Present.present_display_buffer":5.428,"Driver.Present.queue_present":23.078,"Driver.Present.release_and_callback":0.035,"Driver.Present.render_fence_wait":13.432,"Driver.Present.resize":0.069,"Driver.Present.validate":0.010,"Driver.Suspend":2.127,"GpuMutex.wait.dispatch":49.691,"GpuMutex.wait.draw":127.810,"GpuMutex.wait.end":9.442,"GpuMutex.wait.fill":0.170,"GpuMutex.wait.flush":1.967,"GpuMutex.wait.hook":4.418,"GpuMutex.wait.indirect":0.878,"GpuMutex.wait.label":21.430,"GpuMutex.wait.present":0.030,"GpuMutex.wait.wait":4.075,"Graphics.Draw":2317.599,"Graphics.Draw.draw_and_resource_release":1551.303,"Graphics.Draw.index_upload":179.470,"Graphics.Draw.validate":146.257,"Graphics.Draw.vertex_upload":184.518,"Graphics.DrawWithRecipe":1299.984,"Graphics.DrawWithRecipe.draw_and_resource_release":1212.267,"Graphics.DrawWithRecipe.index_upload":10.640,"Graphics.DrawWithRecipe.validate":44.470,"Graphics.DrawWithRecipe.vertex_upload":16.142,"Recorder.Reap":123.091,"Recorder.Submit":392.967,"Recorder.WaitSerial":225.081,"Resources.Complete":50.996,"Resources.Prepare":37.922,"Shader.DrawStage":1356.568,"Shader.DrawStage.capture_resources":886.535,"Shader.DrawStage.materialize":321.916,"Shader.DrawStage.prepared_invocation":132.248,"Shader.PrepareArtifact":3.585,"Shader.ResolveAbi":7.024,"Shader.ResolveGraphicsAbi":3.938,"Shader.ResolveGraphicsStagesAbi":66.303,"VideoOut.Flip":45.398,"VideoOut.Flip.completion_mutex_wait":0.036,"VideoOut.Flip.config_mutex_wait":0.004,"VideoOut.Flip.frame_limit":0.020,"VideoOut.Flip.notify_game":2.095,"VideoOut.Flip.present":41.224,"VideoOut.Flip.validate":0.036,"VideoOut.Flip.vblank_wait":0.022,"VideoOut.Flip.window_prepare":0.062,"VideoOut.Flip.window_title":1.875,"VideoOut.Readiness":0.084,"VideoOut.Readiness.locks_validate":0.035,"Vulkan.Acquire":0.478,"Vulkan.Acquire.acquire_fence_wait":0.062,"Vulkan.Acquire.acquire_image":0.324,"Vulkan.Acquire.fence_reset":0.065,"Vulkan.Acquire.retired_swapchains":0.015,"Vulkan.Dispatch":467.257,"Vulkan.Dispatch.command_record":126.973,"Vulkan.Dispatch.shader_resources":338.670,"Vulkan.DispatchRecipe":19.614,"Vulkan.DispatchRecipe.command_record":19.516,"Vulkan.DrawFromRecipe":1356.091,"Vulkan.GraphicsPipeline":6.667,"Vulkan.GraphicsPipeline.create":3.147,"Vulkan.GraphicsPipeline.modules_and_state":3.509,"Vulkan.GraphicsPipelineLibrary":2.776,"Vulkan.GraphicsPipelineLink":0.169,"Vulkan.Present":3.702,"Vulkan.Present.command_record_scale":1.645,"Vulkan.Present.pixel_upload":0.102,"Vulkan.Present.queue_submit":1.927,"Vulkan.QueuePresent":23.024,"Vulkan.QueuePresent.queue_present":22.986,"Vulkan.Retire":13.428,"Vulkan.Retire.wait":12.680},"top_phases_ms_per_frame":{"Driver.Packet":647.794,"Driver.Packet.memory_wait":414.975,"Driver.Packet.draw":123.025,"Driver.Draw":121.016,"Graphics.Draw":64.378,"Driver.Draw.shader_compile_and_link":56.065,"Graphics.Draw.draw_and_resource_release":43.092,"Shader.DrawStage":37.682},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":717,"Graphics.Barrier.dcc-clear":384,"Graphics.Barrier.dcc-keys":384,"Graphics.Barrier.dispatch-lead":8744,"Graphics.Barrier.dispatch-trail":14563,"Graphics.Barrier.draw":49064,"Graphics.Barrier.fill":1743,"Graphics.Barrier.fill-clear":706,"Graphics.Barrier.indirect-args":324,"Graphics.Barrier.input-mirror":2888,"Graphics.Barrier.label-run":412294,"Graphics.Barrier.present-blit":72,"Graphics.Barrier.shadow-publish":382,"Graphics.Barrier.staging-in":35308,"Graphics.Barrier.staging-out":14679,"Graphics.Barrier.storage-upload":2184,"Graphics.Barrier.storage-writeback":6512,"Graphics.BarrierMerged.dispatch-lead":6467,"Graphics.BarrierMerged.fill":371,"Graphics.BarrierMerged.label-run":43,"Graphics.BarrierMerged.shadow-publish":266,"Graphics.BarrierMerged.staging-in":11354,"Graphics.BarrierMerged.staging-out":14679,"Graphics.BarrierMerged.storage-writeback":932,"Graphics.Copy":37949,"Graphics.Copy.bytes":4742966282,"Graphics.RenderPass":17291,"Graphics.RenderPass.Close.command":11635,"Graphics.RenderPass.Close.image":203,"Graphics.RenderPass.Close.key":128,"Graphics.RenderPass.Close.label":43,"Graphics.RenderPass.Close.new-batch":5282,"Graphics.RenderPass.Continued":501834},"trace_dropped":false,"trace":"aps5-trace-d36706e1889b-12368.json.gz"}A second series with
APS5_TRACE_SUMMARY_EVERY=10(no trace; mean over the last six 10 s intervals of 150 s runs), same scene, three alternating rounds: mean frame 228.5, 228.2 and 228.4 ms onmain, 224.8, 224.0 and 222.9 ms with the change. GPU busy was 117.1 to 117.5 ms per present on both sides. Two more rounds with the order reversed (change first) gave 226.1 and 227.6 ms onmainagainst 222.7 and 224.2 ms with the change, so the gain does not follow the run order. In those summary runsRecorder.Reaptook 8.55 to 8.60 ms per frame onmainand 3.50 to 3.61 ms with the change (phase_totals_msover the same intervals, in thetables.txtof the #20066 gist); in the window captures 8.35 to 8.43 against 3.47 to 3.50. On the second slowest level,big_hand_pirate_island, two alternating rounds gave 219.2 and 206.2 ms onmain, 200.7 and 202.8 ms with the change: no slowdown, but too noisy to claim a gain.Tests.
Reapas onmain, stopping at the reached serial too (>=), retiring without the fence check, no fence fallback after a failed timeline read, and the timeline read never resolved. Each break failedagc_recorder_kept_bytes. The unchanged branch passed before and after.^(agc_.*(recorder|label|sample_dump|kept_bytes)|video_out_flip_labels)onmainand on the change, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,VK_LOADER_LAYERS_DISABLE=~implicit~and validation layer 1.4.368. Both passed 56 of 56. Each log shows the loader inserting the layer (65 times) and never reports it missing, and neither has aVUID-message. The GPU line isSelected GPU name=NVIDIA GeForce RTX 5070 Ti vendor=0x10de device=0x2c05 subgroup=32.tools/select_tests.pypicked 3224 tests for the changed files. Both sides failed the same 99 tests and no others. 75 did not run because their executables were not built here: Windows Defender flagged freshly linked AGC test executables (objcopythen fails withInvalid argument), andUploadCacheReadOnlyFlush.cppcallssetenv, which this MinGW does not declare. The other 24 fail onmaintoo. One of them,agc_driver_store_over_untracked, fails at random under parallel load: run six at a time oneb20410673, it failed 18 of 120 runs onmainand 23 of 120 with the change, always in its "second store" case.Not covered. Only this machine and GPU: not the AMD iGPU, not Linux, not lavapipe. Only PPSA21564, and timings on two levels.
Reapcan now miss a batch whose fence is signaled while the timeline value read just before it was still below its serial; that batch is retired at the nextReap. I did not measure how often that happens. The other fence polls inRecorder.cpp(signaled,unsignaledand the pending-write lookup) are unchanged.Checklist
main; no other open PR implements the same functions (perf(agc): drop per-batch fences when a timeline tracks completion #20066 overlaps; see What)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)