perf(agc): shard per-draw statistics counters per thread #19348

Merged
chitters2004 merged 5 commits from upstream-pr/19348 into main 2026-11-14 06:14:50 +00:00
chitters2004 commented 2026-11-13 05:01:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-13T05:01:43Z.


What

Several statistics the AGC driver counts on every draw are single std::atomic counters written from more than one thread. Each relaxed fetch_add from another core takes the counter's cache line away from the thread that wrote it last.

Measured on the machine below with MinGW GCC 15.2 (winlibs, -O3), one shared relaxed fetch_add costs, per add per thread: 1.5-2.0 ns from 1 thread, 12.5-16 ns from 2, 35.5-39 ns from 4, 75-76 ns from 8 and 152-154 ns from 16 (agc_profile_counter_tests --bench N, two runs).

The hot counters and their writers, found by recording the writing thread of each counter in agc_driver_village_draw_cost_tests:

  • DrawPipeline.cpp:
    • The draw-key and draw-shape statistics: the queue worker (Driver::draw → NoteDrawKey), about 3 adds per draw.
    • heldReadRanges: the queue worker, and the draw finisher under APS5_DRAW_PIPELINE, 1 per draw.
    • heldReadQueries and heldReadHits: the guest's own thread, through HeldReads.
      These sit on two adjacent cache lines beside runningCommitters.
  • Recorder.cpp:
    • readsNoted: the draw committer, in NotePendingRead, about 4 adds per draw.
    • readQueries, readHits and readStaleIgnored: the queue workers, in PendingReadOverlaps, for every buffer copy a queue executes.
      These share one cache line.

ProfileCounter (Execution/include/ProfileCounter.hpp) keeps 16 cache-line-aligned slots:

  • A thread takes a slot round-robin once and keeps its index in a HostThreadSlot (the existing libc/include/HostThreadSlot.hpp: a TEB read on Windows x64, a native thread_local elsewhere).
  • Add is a relaxed fetch_add on that thread's slot.
  • Sum adds the slots, for reports.
  • Take adds and resets them, for the 10 s window reports.

Up to 16 threads each own a line; past that, two threads share one slot, never all of them. The counters above are now ProfileCounters. The printed reports and the PipelinedMetadataPasses and HeldReadQueries accessors are unchanged. APS5_SHARED_PROFILE_COUNTERS=1 puts every thread on slot 0, the single shared counter this replaces, so the change can be measured on one build. It is listed in docs/dev/ENVIRONMENT.md.

How the slot is found matters on Windows. A first version used thread_local; MinGW GCC emulates it, so every Add called __emutls_get_address (11-13 ns) and the counter lost to a shared atomic below four threads (13-15 ns against 1.5-1.9 ns on 1 thread, 16-20 against 13 on 2). Variants benched on this machine, ns per add per thread, 1/2/4/8/16 threads, second run:

variant 1 2 4 8 16
shared atomic 2.2 15.9 41.7 85.2 149.2
emulated thread_local slot (first version) 17.0 17.5 17.9 21.9 32.9
TEB thread id hashed to a slot 1.9 2.1 2.1 2.8 5.2
TlsGetValue 2.1 2.3 2.5 3.6 3.9
TEB TlsSlots read (HostThreadSlot, shipped) 1.9 2.0 2.0 2.1 3.5
TEB read, single-writer store (no lock prefix) 0.8 0.6 0.7 1.0 1.7
slot passed in, fetch_add 1.8 1.9 2.2 2.0 3.6
slot passed in, single-writer store 0.4 0.4 0.3 0.5 0.6

The shipped form is 1.5-2.3 ns at every thread count on the final head. The single-writer forms save about 1.5 ns per add but need a context passed to every call site (or exclusive slot ownership); at about 8 adds per draw that is 12 ns of a 31.5 us draw, so they are left out. The thread-id hash collides on the 16 slots (13-15 ns at 8 threads in the first run). The bench source is not part of this pull request.

The first commit names the driver's threads on every platform. PinWorkerThread named the queue workers and the presenter only on Windows, and the draw committer and finisher were never named. On Linux every driver thread kept the process's name. VillageDrawCost, which finds the queue worker and the committer by name, therefore reported a driver CPU of 0.00 there, and perf, top and gdb could not tell the threads apart. NameDriverThread sets the OS name (SetThreadDescription on Windows, pthread_setname_np elsewhere) to names that fit Linux's 15 bytes: qworker 0x<id>, presenter, draw-commit and draw-finish. On Windows the queue workers take the short name instead of queue worker 0x<id>. Tracy and the performance trace keep their names, which tools/trace_digest.py reads.

Performance

Machine: Windows 11 10.0.26320, AMD Ryzen 7 5800X (16 threads), 32 GiB, NVIDIA GeForce RTX 3080 driver 621.14 on PCIe Gen4 x16 (the link reads Gen1 at idle and is Gen4-capable at x16), Windows Defender real-time protection off, Release build (MinGW GCC 15.2). Title PPSA04263 01.011.001, save play1-first-autosave (restored before each boot), 3840x2160, standing scene after the intro. Main is edb7d91caa67 (the merge base of this branch) and the change is 8610baceca75; the libraries of both were built in the same tree, incrementally, and each boot copies its own into the runtime. Window APS5_TRACE_SECONDS=112:30: 20 s after stood_still, which the four boots reached at 88.8 to 93.4 s after process start (nav script with NAV_FAST=1, used by all four arms). One warm-up boot per side after the rebuild (not samples), then main, change, change, main (A1 B1 B2 A2); caches warm. Only APS5_TRACE_SECONDS was set; the harness itself also sets APS5_TRACE_SUMMARY_EVERY=10 for both sides (it is in every summary line below). Every boot checked CLEAN by quiet-check.py. A first ABBA of the same binaries used an anchor 50 s after stood_still (the cold warm-up boot of main stood at 122.6 s and set it), its window ended after the boot did, and it is discarded and not listed.

arm boot frames frame mean ms p50 ms Driver.Draw ms/frame Graphics.Draw ms/frame GPU busy ms/present quiet
main edb7d91caa A1 251 119.70 118.05 86.20 93.88 31.26 CLEAN
change 8610baceca B1 271 111.05 108.60 79.63 86.19 31.14 CLEAN
change B2 267 112.67 110.93 80.41 87.47 31.35 CLEAN
main A2 274 109.65 108.54 77.94 85.35 30.79 CLEAN

Means (n=2 each): main frame 114.67 ms (A1 119.70, A2 109.65), change 111.86 ms (B1 111.05, B2 112.67); Driver.Draw main 82.07 against change 80.02 ms per frame.

Reading: this change makes no measurable difference to GTA frame time. The two main boots differ by 10.1 ms (A1 is slow, A2 is not), the two change boots by 1.6 ms, and the main-against-change gap of 2.8 ms is inside that same-binary spread, so n=2 cannot resolve it. A same-binary control on the earlier head (the switch APS5_SHARED_PROFILE_COUNTERS=1 against the sharded counters, four boots, CLEAN) showed the same: 112.2 ms shared against 112.0 ms sharded, with the sharded boots alone spanning 109.6 to 112.8 ms. That fits the arithmetic: the counters take about 8 adds per draw, 8 x 13-39 ns = 0.1-0.3 us per draw when shared and 0.01 us when sharded, so at about 1,470 draws per frame the most this can move is 0.1-0.4 ms per frame. The change removes cross-thread cache-line traffic that grows with the number of writer threads and with copies running beside draws; it is shown here by the microbenchmark and is not claimed as a GTA speed-up.

Summary lines (aps5-summary.jsonl, the seconds 112:30 line of each run, in the order A1, B1, B2, A2; the traces are kept locally under PPSA04263/perf/c02-pc7b-<boot> and can be attached on request):

{"commit":"edb7d91caa67","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2735,"ms":30043.860},"presents":251,"frame_ms":{"p50":118.046,"p90":126.356,"p99":150.019,"max":157.702},"gpu_busy_ms_per_present":31.263,"worker_busy_pct":{"queue worker 0x0":97.510},"phase_totals_ms":{"Driver.Completion":0.146,"Driver.Dispatch":1279.265,"Driver.Dispatch.capture_resources":86.533,"Driver.Dispatch.decode_key_device_setup":37.247,"Driver.Dispatch.lookup_cache":27.296,"Driver.Dispatch.materialize":14.869,"Driver.Dispatch.prepared_invocation":14.753,"Driver.Draw":21636.891,"Driver.Draw.device_setup":869.717,"Driver.Draw.draw_enqueued":7426.721,"Driver.Draw.post_compile_prepare":144.691,"Driver.Draw.prepare":2247.259,"Driver.Draw.shader_compile_and_link":10305.948,"Driver.EndSubmission":477.456,"Driver.Packet":27999.862,"Driver.Packet.device_lock":172.042,"Driver.Packet.dispatch":2653.335,"Driver.Packet.draw":21876.178,"Driver.Packet.execute":850.423,"Driver.Packet.flip_flush":8.739,"Driver.Packet.flush_between_packets":458.731,"Driver.Packet.memory_wait":4.359,"Driver.Packet.pipeline_drain":258.380,"Driver.Packet.pipeline_prepare":283.879,"Driver.Packet.prepare_memory":241.952,"Driver.Packet.rendering_wait":0.173,"Driver.Present":1492.470,"Driver.Present.acquire_image":3.546,"Driver.Present.device_setup":0.116,"Driver.Present.gpu_mutex_wait":0.616,"Driver.Present.inflight_wait":0.568,"Driver.Present.present_display_buffer":33.489,"Driver.Present.queue_present":104.238,"Driver.Present.release_and_callback":0.432,"Driver.Present.render_fence_wait":1348.811,"Driver.Present.resize":0.411,"Driver.Present.validate":0.072,"Driver.Rewind":818.127,"Driver.Suspend":0.036,"GpuMutex.wait.draw":4.802,"GpuMutex.wait.end":0.657,"GpuMutex.wait.flush":0.048,"GpuMutex.wait.label":0.188,"GpuMutex.wait.present":0.135,"Graphics.Draw":23563.526,"Graphics.Draw.draw_and_resource_release":18646.054,"Graphics.Draw.index_upload":1076.011,"Graphics.Draw.validate":1360.204,"Graphics.Draw.vertex_upload":2202.608,"Graphics.DrawWithRecipe":0.563,"Graphics.DrawWithRecipe.draw_and_resource_release":0.312,"Graphics.DrawWithRecipe.index_upload":0.002,"Graphics.DrawWithRecipe.validate":0.015,"Graphics.DrawWithRecipe.vertex_upload":0.224,"Recorder.Reap":301.960,"Recorder.Submit":976.358,"Recorder.Sync":284.141,"Recorder.WaitSerial":183.087,"Resources.Complete":141.709,"Resources.Prepare":189.742,"Shader.DrawStage":7702.993,"Shader.DrawStage.capture_resources":4381.958,"Shader.DrawStage.materialize":2050.732,"Shader.DrawStage.prepared_invocation":1214.123,"Shader.ResolveGraphicsStagesAbi":5.496,"VideoOut.Flip":1523.343,"VideoOut.Flip.completion_mutex_wait":0.472,"VideoOut.Flip.config_mutex_wait":0.027,"VideoOut.Flip.frame_limit":0.121,"VideoOut.Flip.notify_game":6.382,"VideoOut.Flip.present":1493.945,"VideoOut.Flip.validate":0.318,"VideoOut.Flip.vblank_wait":0.171,"VideoOut.Flip.window_prepare":0.432,"VideoOut.Flip.window_title":21.220,"VideoOut.Readiness":0.502,"VideoOut.Readiness.locks_validate":0.205,"Vulkan.Acquire":3.276,"Vulkan.Acquire.acquire_fence_wait":0.497,"Vulkan.Acquire.acquire_image":2.083,"Vulkan.Acquire.fence_reset":0.473,"Vulkan.Acquire.retired_swapchains":0.136,"Vulkan.Dispatch":307.914,"Vulkan.Dispatch.command_record":133.198,"Vulkan.Dispatch.shader_resources":169.921,"Vulkan.DispatchRecipe":148.782,"Vulkan.DispatchRecipe.command_record":147.144,"Vulkan.DrawFromRecipe":0.578,"Vulkan.GraphicsPipeline":4.420,"Vulkan.GraphicsPipeline.create":4.082,"Vulkan.GraphicsPipeline.modules_and_state":0.336,"Vulkan.GraphicsPipelineLibrary":4.054,"Vulkan.GraphicsPipelineLink":0.009,"Vulkan.Present":12.326,"Vulkan.Present.command_record_scale":5.813,"Vulkan.Present.pixel_upload":0.447,"Vulkan.Present.queue_submit":5.889,"Vulkan.QueuePresent":103.840,"Vulkan.QueuePresent.queue_present":103.384,"Vulkan.Retire":1348.681,"Vulkan.Retire.wait":1344.623},"top_phases_ms_per_frame":{"Driver.Packet":111.553,"Graphics.Draw":93.879,"Driver.Packet.draw":87.156,"Driver.Draw":86.203,"Graphics.Draw.draw_and_resource_release":74.287,"Driver.Draw.shader_compile_and_link":41.060,"Shader.DrawStage":30.689,"Driver.Draw.draw_enqueued":29.589},"owned_draw_counts":{"OwnedDraw.arm_attempt":753,"OwnedDraw.arm_blocks_requested":753,"OwnedDraw.arm_refused":753,"OwnedDraw.evicted_other":3546},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.963,"events_lost":1325374,"totals_full":false},"draw committer":{"events_full_after_s":10.160,"events_lost":512061,"totals_full":false}},"trace":"aps5-trace-edb7d91caa67-37248.json.gz"}
{"commit":"8610baceca75","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2765,"ms":30093.348},"presents":271,"frame_ms":{"p50":108.602,"p90":113.302,"p99":142.030,"max":463.908},"gpu_busy_ms_per_present":31.145,"worker_busy_pct":{"queue worker 0x0":97.359},"phase_totals_ms":{"Driver.Completion":0.144,"Driver.Dispatch":1330.800,"Driver.Dispatch.capture_resources":94.385,"Driver.Dispatch.decode_key_device_setup":38.596,"Driver.Dispatch.lookup_cache":25.202,"Driver.Dispatch.materialize":15.895,"Driver.Dispatch.prepared_invocation":16.148,"Driver.Draw":21579.256,"Driver.Draw.device_setup":912.157,"Driver.Draw.draw_enqueued":7089.305,"Driver.Draw.post_compile_prepare":153.242,"Driver.Draw.prepare":2278.708,"Driver.Draw.shader_compile_and_link":10489.722,"Driver.EndSubmission":452.562,"Driver.Packet":27961.137,"Driver.Packet.device_lock":191.489,"Driver.Packet.dispatch":2660.479,"Driver.Packet.draw":21822.942,"Driver.Packet.execute":856.163,"Driver.Packet.flip_flush":9.431,"Driver.Packet.flush_between_packets":485.142,"Driver.Packet.memory_wait":4.779,"Driver.Packet.pipeline_drain":279.357,"Driver.Packet.pipeline_prepare":291.488,"Driver.Packet.prepare_memory":257.340,"Driver.Packet.rendering_wait":0.169,"Driver.Present":1574.815,"Driver.Present.acquire_image":3.808,"Driver.Present.device_setup":0.127,"Driver.Present.gpu_mutex_wait":0.574,"Driver.Present.inflight_wait":0.629,"Driver.Present.present_display_buffer":34.283,"Driver.Present.queue_present":111.461,"Driver.Present.release_and_callback":0.465,"Driver.Present.render_fence_wait":1422.766,"Driver.Present.resize":0.447,"Driver.Present.validate":0.079,"Driver.Rewind":884.682,"Driver.Suspend":0.036,"GpuMutex.wait.draw":13.424,"GpuMutex.wait.end":0.280,"GpuMutex.wait.flush":0.020,"GpuMutex.wait.label":1.458,"GpuMutex.wait.present":0.060,"Graphics.Draw":23357.933,"Graphics.Draw.draw_and_resource_release":18363.477,"Graphics.Draw.index_upload":1104.956,"Graphics.Draw.validate":1368.820,"Graphics.Draw.vertex_upload":2237.100,"Graphics.DrawWithRecipe":0.320,"Graphics.DrawWithRecipe.draw_and_resource_release":0.243,"Graphics.DrawWithRecipe.index_upload":0.022,"Graphics.DrawWithRecipe.validate":0.004,"Graphics.DrawWithRecipe.vertex_upload":0.049,"Recorder.Reap":313.907,"Recorder.Submit":1013.592,"Recorder.Sync":311.864,"Recorder.WaitSerial":196.300,"Resources.Complete":151.846,"Resources.Prepare":196.581,"Shader.DrawStage":7878.675,"Shader.DrawStage.capture_resources":4495.039,"Shader.DrawStage.materialize":2041.771,"Shader.DrawStage.prepared_invocation":1280.571,"Shader.ResolveGraphicsStagesAbi":6.304,"VideoOut.Flip":1609.367,"VideoOut.Flip.completion_mutex_wait":0.440,"VideoOut.Flip.config_mutex_wait":0.028,"VideoOut.Flip.frame_limit":0.147,"VideoOut.Flip.notify_game":8.160,"VideoOut.Flip.present":1576.319,"VideoOut.Flip.validate":0.347,"VideoOut.Flip.vblank_wait":0.187,"VideoOut.Flip.window_prepare":0.456,"VideoOut.Flip.window_title":23.025,"VideoOut.Readiness":0.504,"VideoOut.Readiness.locks_validate":0.205,"Vulkan.Acquire":3.521,"Vulkan.Acquire.acquire_fence_wait":0.520,"Vulkan.Acquire.acquire_image":2.226,"Vulkan.Acquire.fence_reset":0.534,"Vulkan.Acquire.retired_swapchains":0.142,"Vulkan.Dispatch":310.032,"Vulkan.Dispatch.command_record":137.661,"Vulkan.Dispatch.shader_resources":167.712,"Vulkan.DispatchRecipe":160.379,"Vulkan.DispatchRecipe.command_record":158.944,"Vulkan.DrawFromRecipe":0.323,"Vulkan.GraphicsPipeline":403.518,"Vulkan.GraphicsPipeline.create":400.047,"Vulkan.GraphicsPipeline.modules_and_state":3.459,"Vulkan.GraphicsPipelineLibrary":399.543,"Vulkan.GraphicsPipelineLink":0.075,"Vulkan.Present":13.686,"Vulkan.Present.command_record_scale":6.149,"Vulkan.Present.pixel_upload":0.485,"Vulkan.Present.queue_submit":6.850,"Vulkan.QueuePresent":111.057,"Vulkan.QueuePresent.queue_present":110.599,"Vulkan.Retire":1422.640,"Vulkan.Retire.dump":0.635,"Vulkan.Retire.wait":1418.178},"top_phases_ms_per_frame":{"Driver.Packet":103.178,"Graphics.Draw":86.192,"Driver.Packet.draw":80.527,"Driver.Draw":79.628,"Graphics.Draw.draw_and_resource_release":67.762,"Driver.Draw.shader_compile_and_link":38.707,"Shader.DrawStage":29.073,"Driver.Draw.draw_enqueued":26.160},"owned_draw_counts":{"OwnedDraw.arm_attempt":813,"OwnedDraw.arm_blocks_requested":813,"OwnedDraw.arm_refused":813,"OwnedDraw.evicted_other":3446},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.118,"events_lost":1261171,"totals_full":false},"draw committer":{"events_full_after_s":11.269,"events_lost":427310,"totals_full":false}},"trace":"aps5-trace-8610baceca75-35244.json.gz"}
{"commit":"8610baceca75","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2815,"ms":30081.700},"presents":267,"frame_ms":{"p50":110.929,"p90":118.850,"p99":142.311,"max":149.839},"gpu_busy_ms_per_present":31.348,"worker_busy_pct":{"queue worker 0x0":97.355},"phase_totals_ms":{"Driver.Completion":0.141,"Driver.Dispatch":1315.481,"Driver.Dispatch.capture_resources":98.559,"Driver.Dispatch.decode_key_device_setup":39.699,"Driver.Dispatch.lookup_cache":25.045,"Driver.Dispatch.materialize":18.563,"Driver.Dispatch.prepared_invocation":16.575,"Driver.Draw":21470.430,"Driver.Draw.device_setup":892.724,"Driver.Draw.draw_enqueued":6874.315,"Driver.Draw.post_compile_prepare":153.604,"Driver.Draw.prepare":2301.332,"Driver.Draw.shader_compile_and_link":10582.534,"Driver.EndSubmission":447.485,"Driver.Packet":27962.849,"Driver.Packet.device_lock":188.784,"Driver.Packet.dispatch":2780.972,"Driver.Packet.draw":21725.041,"Driver.Packet.execute":855.856,"Driver.Packet.flip_flush":9.215,"Driver.Packet.flush_between_packets":484.282,"Driver.Packet.memory_wait":5.015,"Driver.Packet.pipeline_drain":278.449,"Driver.Packet.pipeline_prepare":289.498,"Driver.Packet.prepare_memory":249.842,"Driver.Packet.rendering_wait":0.173,"Driver.Present":1562.413,"Driver.Present.acquire_image":3.747,"Driver.Present.device_setup":0.128,"Driver.Present.gpu_mutex_wait":0.568,"Driver.Present.inflight_wait":0.608,"Driver.Present.present_display_buffer":31.026,"Driver.Present.queue_present":108.281,"Driver.Present.release_and_callback":0.446,"Driver.Present.render_fence_wait":1416.914,"Driver.Present.resize":0.433,"Driver.Present.validate":0.082,"Driver.Rewind":875.402,"Driver.Suspend":0.039,"GpuMutex.wait.draw":7.127,"GpuMutex.wait.end":0.222,"GpuMutex.wait.flush":0.009,"GpuMutex.wait.label":0.291,"GpuMutex.wait.present":0.064,"Graphics.Draw":23355.628,"Graphics.Draw.draw_and_resource_release":18265.320,"Graphics.Draw.index_upload":1116.229,"Graphics.Draw.validate":1402.222,"Graphics.Draw.vertex_upload":2278.479,"Graphics.DrawWithRecipe":0.834,"Graphics.DrawWithRecipe.draw_and_resource_release":0.524,"Graphics.DrawWithRecipe.index_upload":0.003,"Graphics.DrawWithRecipe.validate":0.020,"Graphics.DrawWithRecipe.vertex_upload":0.274,"Recorder.Reap":320.408,"Recorder.Submit":1025.343,"Recorder.Sync":338.355,"Recorder.WaitSerial":188.173,"Resources.Complete":150.890,"Resources.Prepare":196.734,"Shader.DrawStage":7952.026,"Shader.DrawStage.capture_resources":4489.161,"Shader.DrawStage.materialize":2157.643,"Shader.DrawStage.prepared_invocation":1246.159,"Shader.ResolveGraphicsStagesAbi":5.695,"VideoOut.Flip":1637.929,"VideoOut.Flip.completion_mutex_wait":0.479,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.144,"VideoOut.Flip.notify_game":48.978,"VideoOut.Flip.present":1563.925,"VideoOut.Flip.validate":0.345,"VideoOut.Flip.vblank_wait":0.189,"VideoOut.Flip.window_prepare":0.466,"VideoOut.Flip.window_title":23.081,"VideoOut.Readiness":0.519,"VideoOut.Readiness.locks_validate":0.220,"Vulkan.Acquire":3.473,"Vulkan.Acquire.acquire_fence_wait":0.512,"Vulkan.Acquire.acquire_image":2.195,"Vulkan.Acquire.fence_reset":0.531,"Vulkan.Acquire.retired_swapchains":0.140,"Vulkan.Dispatch":317.129,"Vulkan.Dispatch.command_record":141.678,"Vulkan.Dispatch.shader_resources":170.290,"Vulkan.DispatchRecipe":139.497,"Vulkan.DispatchRecipe.command_record":137.940,"Vulkan.DrawFromRecipe":0.852,"Vulkan.Present":13.284,"Vulkan.Present.command_record_scale":6.028,"Vulkan.Present.pixel_upload":0.476,"Vulkan.Present.queue_submit":6.585,"Vulkan.QueuePresent":107.900,"Vulkan.QueuePresent.queue_present":107.464,"Vulkan.Retire":1416.809,"Vulkan.Retire.dump":0.557,"Vulkan.Retire.wait":1411.936},"top_phases_ms_per_frame":{"Driver.Packet":104.730,"Graphics.Draw":87.474,"Driver.Packet.draw":81.367,"Driver.Draw":80.414,"Graphics.Draw.draw_and_resource_release":68.409,"Driver.Draw.shader_compile_and_link":39.635,"Shader.DrawStage":29.783,"Driver.Draw.draw_enqueued":25.746},"owned_draw_counts":{"OwnedDraw.arm_attempt":801,"OwnedDraw.arm_blocks_requested":801,"OwnedDraw.arm_refused":801,"OwnedDraw.evicted_other":4798},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.091,"events_lost":1277700,"totals_full":false},"draw committer":{"events_full_after_s":10.991,"events_lost":452519,"totals_full":false}},"trace":"aps5-trace-8610baceca75-31472.json.gz"}
{"commit":"edb7d91caa67","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2787,"ms":30042.737},"presents":274,"frame_ms":{"p50":108.541,"p90":112.433,"p99":132.785,"max":190.019},"gpu_busy_ms_per_present":30.793,"worker_busy_pct":{"queue worker 0x0":97.338},"phase_totals_ms":{"Driver.Completion":0.152,"Driver.Dispatch":1340.112,"Driver.Dispatch.capture_resources":92.894,"Driver.Dispatch.decode_key_device_setup":38.421,"Driver.Dispatch.lookup_cache":24.888,"Driver.Dispatch.materialize":15.952,"Driver.Dispatch.prepared_invocation":15.425,"Driver.Draw":21354.510,"Driver.Draw.device_setup":894.275,"Driver.Draw.draw_enqueued":6938.568,"Driver.Draw.post_compile_prepare":150.738,"Driver.Draw.prepare":2302.124,"Driver.Draw.shader_compile_and_link":10388.871,"Driver.EndSubmission":477.462,"Driver.Packet":27874.003,"Driver.Packet.device_lock":185.868,"Driver.Packet.dispatch":2778.648,"Driver.Packet.draw":21593.779,"Driver.Packet.execute":841.072,"Driver.Packet.flip_flush":9.366,"Driver.Packet.flush_between_packets":484.536,"Driver.Packet.memory_wait":4.868,"Driver.Packet.pipeline_drain":270.307,"Driver.Packet.pipeline_prepare":304.353,"Driver.Packet.prepare_memory":253.933,"Driver.Packet.rendering_wait":0.164,"Driver.Present":1601.923,"Driver.Present.acquire_image":3.911,"Driver.Present.device_setup":0.138,"Driver.Present.gpu_mutex_wait":0.638,"Driver.Present.inflight_wait":0.651,"Driver.Present.present_display_buffer":34.457,"Driver.Present.queue_present":111.294,"Driver.Present.release_and_callback":0.419,"Driver.Present.render_fence_wait":1449.718,"Driver.Present.resize":0.436,"Driver.Present.validate":0.081,"Driver.Rewind":891.331,"Driver.Suspend":0.038,"GpuMutex.wait.draw":13.084,"GpuMutex.wait.end":1.065,"GpuMutex.wait.flush":0.042,"GpuMutex.wait.label":0.237,"GpuMutex.wait.present":0.095,"Graphics.Draw":23385.824,"Graphics.Draw.draw_and_resource_release":18362.481,"Graphics.Draw.index_upload":1092.312,"Graphics.Draw.validate":1385.156,"Graphics.Draw.vertex_upload":2262.402,"Graphics.DrawWithRecipe":0.159,"Graphics.DrawWithRecipe.draw_and_resource_release":0.117,"Graphics.DrawWithRecipe.index_upload":0.000,"Graphics.DrawWithRecipe.validate":0.002,"Graphics.DrawWithRecipe.vertex_upload":0.038,"Recorder.Reap":309.001,"Recorder.Submit":1012.982,"Recorder.Sync":314.391,"Recorder.WaitSerial":195.025,"Resources.Complete":150.438,"Resources.Prepare":207.616,"Shader.DrawStage":7741.394,"Shader.DrawStage.capture_resources":4429.103,"Shader.DrawStage.materialize":2017.125,"Shader.DrawStage.prepared_invocation":1215.484,"Shader.ResolveGraphicsStagesAbi":5.799,"VideoOut.Flip":1637.218,"VideoOut.Flip.completion_mutex_wait":0.423,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.143,"VideoOut.Flip.notify_game":8.620,"VideoOut.Flip.present":1603.449,"VideoOut.Flip.validate":0.343,"VideoOut.Flip.vblank_wait":0.184,"VideoOut.Flip.window_prepare":0.436,"VideoOut.Flip.window_title":23.311,"VideoOut.Readiness":0.532,"VideoOut.Readiness.locks_validate":0.222,"Vulkan.Acquire":3.624,"Vulkan.Acquire.acquire_fence_wait":0.533,"Vulkan.Acquire.acquire_image":2.292,"Vulkan.Acquire.fence_reset":0.549,"Vulkan.Acquire.retired_swapchains":0.150,"Vulkan.Dispatch":322.795,"Vulkan.Dispatch.command_record":141.167,"Vulkan.Dispatch.shader_resources":176.180,"Vulkan.DispatchRecipe":149.187,"Vulkan.DispatchRecipe.command_record":147.491,"Vulkan.DrawFromRecipe":0.161,"Vulkan.Present":13.811,"Vulkan.Present.command_record_scale":6.252,"Vulkan.Present.pixel_upload":0.479,"Vulkan.Present.queue_submit":6.881,"Vulkan.QueuePresent":110.884,"Vulkan.QueuePresent.queue_present":110.422,"Vulkan.Retire":1449.635,"Vulkan.Retire.dump":0.752,"Vulkan.Retire.wait":1444.971},"top_phases_ms_per_frame":{"Driver.Packet":101.730,"Graphics.Draw":85.350,"Driver.Packet.draw":78.809,"Driver.Draw":77.936,"Graphics.Draw.draw_and_resource_release":67.016,"Driver.Draw.shader_compile_and_link":37.916,"Shader.DrawStage":28.253,"Driver.Draw.draw_enqueued":25.323},"owned_draw_counts":{"OwnedDraw.arm_attempt":822,"OwnedDraw.arm_blocks_requested":822,"OwnedDraw.arm_refused":822,"OwnedDraw.evicted_other":3599},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.136,"events_lost":1273464,"totals_full":false},"draw committer":{"events_full_after_s":11.120,"events_lost":435386,"totals_full":false}},"trace":"aps5-trace-edb7d91caa67-3060.json.gz"}

Tested

  • Earlier head 0311ce2b586a (base bb6cb0338e), local Windows ctest -V with the Khronos validation layer (SDK 1.4.335.0), VK_KHRONOS_VALIDATION_VALIDATE_SYNC=1, RTX 3080, same machine for both trees: agc_driver_pipelined_metadata_pass, _draw_pipeline, _plan_verify, agc_driver_queued_index_read_order, agc_driver_village_draw_cost, agc_driver_recorder: 6/6 pass on main and on the change, 0 VUID- lines and 0 sync hazards. Not repeated locally after the rebase onto edb7d91caa; the fork CI run below covers the rebased head. On the rebased head, locally: agc_profile_counter, agc_profile_counter_shared and agc_profile_counter_tls_expansion: 3/3 pass.
  • agc_profile_counter_tests checks that no add is lost from 1, 2, 4, 16 and 20 threads, that up to 16 threads get slots of their own, that the switch puts all threads on one slot, and that Take returns every thread's adds and resets every slot. A counter with one slot, a Sum that reads only the first slot and a Take that does not reset all fail it. --tls-expansion (Windows) takes the first 64 TLS indices so the counter's index is in the TEB expansion slots.
  • Fork CI run https://github.com/chitters2004/AnyPS5/actions/runs/43362799120 on 8610baceca (base edb7d91caa): linux-gate (lavapipe, validation layer) 11/11 pass on the change and 9/9 on main, 0 VUIDs, nothing failing on the change but not on main; windows 11 of 12 pass on the change (the three new agc_profile_counter* tests pass), agc_driver_recorder fails on main as well (lavapipe on the Windows runner), 0 VUIDs; tsan 3 pass, 8 skipped (stubbed in that job). Verdict GREEN.
  • tools/check_conventions.py --base edb7d91caa6 on the change: all checks passed. The branch merges cleanly into origin/main a6fbf9ce96 (git merge-tree).
  • Linux bench: an earlier measurement on a 4-vCPU Linux VM (native thread_local, toolchain not recorded): one shared atomic 4.7 ns from 1 thread, 47 from 2, 115 from 4; ProfileCounter 4.8, 4.7, 4.7. Not repeated on the final head.
  • Not run: macOS.

Windows bench on the rebased head 8610baceca (the first block is the second run), agc_profile_counter_tests --bench N, ns per add per thread, two runs:

threads shared atomic ProfileCounter
1 1.5 / 2.0 2.0 / 2.3
2 12.5 / 16.0 1.7 / 1.6
4 39.3 / 35.5 1.7 / 1.6
8 74.7 / 76.2 1.6 / 1.5
16 153.6 / 152.0 1.7 / 1.7

Conflicts: #17697 is merged and this branch is rebased onto it. Textual overlap remains only with #15456 (DrawPipeline.cpp); whichever merges second keeps both sides' lines.

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
  • 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 (merge order: textual conflict with #15456 only; keep both lines)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080, driver 621.14, Windows 11 10.0.26320; llvmpipe (lavapipe) on Linux CI
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5290351653 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19348). Originally posted by [chitters2004](https://github.com/chitters2004) on 2026-11-13T05:01:43Z. --- ### What Several statistics the AGC driver counts on every draw are single `std::atomic` counters written from more than one thread. Each relaxed `fetch_add` from another core takes the counter's cache line away from the thread that wrote it last. Measured on the machine below with MinGW GCC 15.2 (winlibs, `-O3`), one shared relaxed `fetch_add` costs, per add per thread: 1.5-2.0 ns from 1 thread, 12.5-16 ns from 2, 35.5-39 ns from 4, 75-76 ns from 8 and 152-154 ns from 16 (`agc_profile_counter_tests --bench N`, two runs). The hot counters and their writers, found by recording the writing thread of each counter in `agc_driver_village_draw_cost_tests`: - `DrawPipeline.cpp`: - The draw-key and draw-shape statistics: the queue worker (`Driver::draw` → `NoteDrawKey`), about 3 adds per draw. - `heldReadRanges`: the queue worker, and the draw finisher under `APS5_DRAW_PIPELINE`, 1 per draw. - `heldReadQueries` and `heldReadHits`: the guest's own thread, through `HeldReads`. These sit on two adjacent cache lines beside `runningCommitters`. - `Recorder.cpp`: - `readsNoted`: the draw committer, in `NotePendingRead`, about 4 adds per draw. - `readQueries`, `readHits` and `readStaleIgnored`: the queue workers, in `PendingReadOverlaps`, for every buffer copy a queue executes. These share one cache line. `ProfileCounter` (`Execution/include/ProfileCounter.hpp`) keeps 16 cache-line-aligned slots: - A thread takes a slot round-robin once and keeps its index in a `HostThreadSlot` (the existing `libc/include/HostThreadSlot.hpp`: a TEB read on Windows x64, a native `thread_local` elsewhere). - `Add` is a relaxed `fetch_add` on that thread's slot. - `Sum` adds the slots, for reports. - `Take` adds and resets them, for the 10 s window reports. Up to 16 threads each own a line; past that, two threads share one slot, never all of them. The counters above are now `ProfileCounter`s. The printed reports and the `PipelinedMetadataPasses` and `HeldReadQueries` accessors are unchanged. `APS5_SHARED_PROFILE_COUNTERS=1` puts every thread on slot 0, the single shared counter this replaces, so the change can be measured on one build. It is listed in `docs/dev/ENVIRONMENT.md`. How the slot is found matters on Windows. A first version used `thread_local`; MinGW GCC emulates it, so every `Add` called `__emutls_get_address` (11-13 ns) and the counter lost to a shared atomic below four threads (13-15 ns against 1.5-1.9 ns on 1 thread, 16-20 against 13 on 2). Variants benched on this machine, ns per add per thread, 1/2/4/8/16 threads, second run: | variant | 1 | 2 | 4 | 8 | 16 | |---|---|---|---|---|---| | shared atomic | 2.2 | 15.9 | 41.7 | 85.2 | 149.2 | | emulated `thread_local` slot (first version) | 17.0 | 17.5 | 17.9 | 21.9 | 32.9 | | TEB thread id hashed to a slot | 1.9 | 2.1 | 2.1 | 2.8 | 5.2 | | `TlsGetValue` | 2.1 | 2.3 | 2.5 | 3.6 | 3.9 | | TEB `TlsSlots` read (`HostThreadSlot`, shipped) | 1.9 | 2.0 | 2.0 | 2.1 | 3.5 | | TEB read, single-writer store (no lock prefix) | 0.8 | 0.6 | 0.7 | 1.0 | 1.7 | | slot passed in, `fetch_add` | 1.8 | 1.9 | 2.2 | 2.0 | 3.6 | | slot passed in, single-writer store | 0.4 | 0.4 | 0.3 | 0.5 | 0.6 | The shipped form is 1.5-2.3 ns at every thread count on the final head. The single-writer forms save about 1.5 ns per add but need a context passed to every call site (or exclusive slot ownership); at about 8 adds per draw that is 12 ns of a 31.5 us draw, so they are left out. The thread-id hash collides on the 16 slots (13-15 ns at 8 threads in the first run). The bench source is not part of this pull request. The first commit names the driver's threads on every platform. `PinWorkerThread` named the queue workers and the presenter only on Windows, and the draw committer and finisher were never named. On Linux every driver thread kept the process's name. `VillageDrawCost`, which finds the queue worker and the committer by name, therefore reported a driver CPU of 0.00 there, and perf, top and gdb could not tell the threads apart. `NameDriverThread` sets the OS name (`SetThreadDescription` on Windows, `pthread_setname_np` elsewhere) to names that fit Linux's 15 bytes: `qworker 0x<id>`, `presenter`, `draw-commit` and `draw-finish`. On Windows the queue workers take the short name instead of `queue worker 0x<id>`. Tracy and the performance trace keep their names, which `tools/trace_digest.py` reads. ### Performance Machine: Windows 11 10.0.26320, AMD Ryzen 7 5800X (16 threads), 32 GiB, NVIDIA GeForce RTX 3080 driver 621.14 on PCIe Gen4 x16 (the link reads Gen1 at idle and is Gen4-capable at x16), Windows Defender real-time protection off, Release build (MinGW GCC 15.2). Title PPSA04263 01.011.001, save `play1-first-autosave` (restored before each boot), 3840x2160, standing scene after the intro. Main is `edb7d91caa67` (the merge base of this branch) and the change is `8610baceca75`; the libraries of both were built in the same tree, incrementally, and each boot copies its own into the runtime. Window `APS5_TRACE_SECONDS=112:30`: 20 s after `stood_still`, which the four boots reached at 88.8 to 93.4 s after process start (nav script with `NAV_FAST=1`, used by all four arms). One warm-up boot per side after the rebuild (not samples), then main, change, change, main (A1 B1 B2 A2); caches warm. Only `APS5_TRACE_SECONDS` was set; the harness itself also sets `APS5_TRACE_SUMMARY_EVERY=10` for both sides (it is in every summary line below). Every boot checked CLEAN by `quiet-check.py`. A first ABBA of the same binaries used an anchor 50 s after `stood_still` (the cold warm-up boot of main stood at 122.6 s and set it), its window ended after the boot did, and it is discarded and not listed. | arm | boot | frames | frame mean ms | p50 ms | `Driver.Draw` ms/frame | `Graphics.Draw` ms/frame | GPU busy ms/present | quiet | |---|---|---|---|---|---|---|---|---| | main edb7d91caa67 | A1 | 251 | 119.70 | 118.05 | 86.20 | 93.88 | 31.26 | CLEAN | | change 8610baceca75 | B1 | 271 | 111.05 | 108.60 | 79.63 | 86.19 | 31.14 | CLEAN | | change | B2 | 267 | 112.67 | 110.93 | 80.41 | 87.47 | 31.35 | CLEAN | | main | A2 | 274 | 109.65 | 108.54 | 77.94 | 85.35 | 30.79 | CLEAN | Means (n=2 each): main frame 114.67 ms (A1 119.70, A2 109.65), change 111.86 ms (B1 111.05, B2 112.67); `Driver.Draw` main 82.07 against change 80.02 ms per frame. Reading: this change makes no measurable difference to GTA frame time. The two main boots differ by 10.1 ms (A1 is slow, A2 is not), the two change boots by 1.6 ms, and the main-against-change gap of 2.8 ms is inside that same-binary spread, so n=2 cannot resolve it. A same-binary control on the earlier head (the switch `APS5_SHARED_PROFILE_COUNTERS=1` against the sharded counters, four boots, CLEAN) showed the same: 112.2 ms shared against 112.0 ms sharded, with the sharded boots alone spanning 109.6 to 112.8 ms. That fits the arithmetic: the counters take about 8 adds per draw, 8 x 13-39 ns = 0.1-0.3 us per draw when shared and 0.01 us when sharded, so at about 1,470 draws per frame the most this can move is 0.1-0.4 ms per frame. The change removes cross-thread cache-line traffic that grows with the number of writer threads and with copies running beside draws; it is shown here by the microbenchmark and is not claimed as a GTA speed-up. Summary lines (`aps5-summary.jsonl`, the `seconds 112:30` line of each run, in the order A1, B1, B2, A2; the traces are kept locally under `PPSA04263/perf/c02-pc7b-<boot>` and can be attached on request): ```json {"commit":"edb7d91caa67","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2735,"ms":30043.860},"presents":251,"frame_ms":{"p50":118.046,"p90":126.356,"p99":150.019,"max":157.702},"gpu_busy_ms_per_present":31.263,"worker_busy_pct":{"queue worker 0x0":97.510},"phase_totals_ms":{"Driver.Completion":0.146,"Driver.Dispatch":1279.265,"Driver.Dispatch.capture_resources":86.533,"Driver.Dispatch.decode_key_device_setup":37.247,"Driver.Dispatch.lookup_cache":27.296,"Driver.Dispatch.materialize":14.869,"Driver.Dispatch.prepared_invocation":14.753,"Driver.Draw":21636.891,"Driver.Draw.device_setup":869.717,"Driver.Draw.draw_enqueued":7426.721,"Driver.Draw.post_compile_prepare":144.691,"Driver.Draw.prepare":2247.259,"Driver.Draw.shader_compile_and_link":10305.948,"Driver.EndSubmission":477.456,"Driver.Packet":27999.862,"Driver.Packet.device_lock":172.042,"Driver.Packet.dispatch":2653.335,"Driver.Packet.draw":21876.178,"Driver.Packet.execute":850.423,"Driver.Packet.flip_flush":8.739,"Driver.Packet.flush_between_packets":458.731,"Driver.Packet.memory_wait":4.359,"Driver.Packet.pipeline_drain":258.380,"Driver.Packet.pipeline_prepare":283.879,"Driver.Packet.prepare_memory":241.952,"Driver.Packet.rendering_wait":0.173,"Driver.Present":1492.470,"Driver.Present.acquire_image":3.546,"Driver.Present.device_setup":0.116,"Driver.Present.gpu_mutex_wait":0.616,"Driver.Present.inflight_wait":0.568,"Driver.Present.present_display_buffer":33.489,"Driver.Present.queue_present":104.238,"Driver.Present.release_and_callback":0.432,"Driver.Present.render_fence_wait":1348.811,"Driver.Present.resize":0.411,"Driver.Present.validate":0.072,"Driver.Rewind":818.127,"Driver.Suspend":0.036,"GpuMutex.wait.draw":4.802,"GpuMutex.wait.end":0.657,"GpuMutex.wait.flush":0.048,"GpuMutex.wait.label":0.188,"GpuMutex.wait.present":0.135,"Graphics.Draw":23563.526,"Graphics.Draw.draw_and_resource_release":18646.054,"Graphics.Draw.index_upload":1076.011,"Graphics.Draw.validate":1360.204,"Graphics.Draw.vertex_upload":2202.608,"Graphics.DrawWithRecipe":0.563,"Graphics.DrawWithRecipe.draw_and_resource_release":0.312,"Graphics.DrawWithRecipe.index_upload":0.002,"Graphics.DrawWithRecipe.validate":0.015,"Graphics.DrawWithRecipe.vertex_upload":0.224,"Recorder.Reap":301.960,"Recorder.Submit":976.358,"Recorder.Sync":284.141,"Recorder.WaitSerial":183.087,"Resources.Complete":141.709,"Resources.Prepare":189.742,"Shader.DrawStage":7702.993,"Shader.DrawStage.capture_resources":4381.958,"Shader.DrawStage.materialize":2050.732,"Shader.DrawStage.prepared_invocation":1214.123,"Shader.ResolveGraphicsStagesAbi":5.496,"VideoOut.Flip":1523.343,"VideoOut.Flip.completion_mutex_wait":0.472,"VideoOut.Flip.config_mutex_wait":0.027,"VideoOut.Flip.frame_limit":0.121,"VideoOut.Flip.notify_game":6.382,"VideoOut.Flip.present":1493.945,"VideoOut.Flip.validate":0.318,"VideoOut.Flip.vblank_wait":0.171,"VideoOut.Flip.window_prepare":0.432,"VideoOut.Flip.window_title":21.220,"VideoOut.Readiness":0.502,"VideoOut.Readiness.locks_validate":0.205,"Vulkan.Acquire":3.276,"Vulkan.Acquire.acquire_fence_wait":0.497,"Vulkan.Acquire.acquire_image":2.083,"Vulkan.Acquire.fence_reset":0.473,"Vulkan.Acquire.retired_swapchains":0.136,"Vulkan.Dispatch":307.914,"Vulkan.Dispatch.command_record":133.198,"Vulkan.Dispatch.shader_resources":169.921,"Vulkan.DispatchRecipe":148.782,"Vulkan.DispatchRecipe.command_record":147.144,"Vulkan.DrawFromRecipe":0.578,"Vulkan.GraphicsPipeline":4.420,"Vulkan.GraphicsPipeline.create":4.082,"Vulkan.GraphicsPipeline.modules_and_state":0.336,"Vulkan.GraphicsPipelineLibrary":4.054,"Vulkan.GraphicsPipelineLink":0.009,"Vulkan.Present":12.326,"Vulkan.Present.command_record_scale":5.813,"Vulkan.Present.pixel_upload":0.447,"Vulkan.Present.queue_submit":5.889,"Vulkan.QueuePresent":103.840,"Vulkan.QueuePresent.queue_present":103.384,"Vulkan.Retire":1348.681,"Vulkan.Retire.wait":1344.623},"top_phases_ms_per_frame":{"Driver.Packet":111.553,"Graphics.Draw":93.879,"Driver.Packet.draw":87.156,"Driver.Draw":86.203,"Graphics.Draw.draw_and_resource_release":74.287,"Driver.Draw.shader_compile_and_link":41.060,"Shader.DrawStage":30.689,"Driver.Draw.draw_enqueued":29.589},"owned_draw_counts":{"OwnedDraw.arm_attempt":753,"OwnedDraw.arm_blocks_requested":753,"OwnedDraw.arm_refused":753,"OwnedDraw.evicted_other":3546},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.963,"events_lost":1325374,"totals_full":false},"draw committer":{"events_full_after_s":10.160,"events_lost":512061,"totals_full":false}},"trace":"aps5-trace-edb7d91caa67-37248.json.gz"} {"commit":"8610baceca75","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2765,"ms":30093.348},"presents":271,"frame_ms":{"p50":108.602,"p90":113.302,"p99":142.030,"max":463.908},"gpu_busy_ms_per_present":31.145,"worker_busy_pct":{"queue worker 0x0":97.359},"phase_totals_ms":{"Driver.Completion":0.144,"Driver.Dispatch":1330.800,"Driver.Dispatch.capture_resources":94.385,"Driver.Dispatch.decode_key_device_setup":38.596,"Driver.Dispatch.lookup_cache":25.202,"Driver.Dispatch.materialize":15.895,"Driver.Dispatch.prepared_invocation":16.148,"Driver.Draw":21579.256,"Driver.Draw.device_setup":912.157,"Driver.Draw.draw_enqueued":7089.305,"Driver.Draw.post_compile_prepare":153.242,"Driver.Draw.prepare":2278.708,"Driver.Draw.shader_compile_and_link":10489.722,"Driver.EndSubmission":452.562,"Driver.Packet":27961.137,"Driver.Packet.device_lock":191.489,"Driver.Packet.dispatch":2660.479,"Driver.Packet.draw":21822.942,"Driver.Packet.execute":856.163,"Driver.Packet.flip_flush":9.431,"Driver.Packet.flush_between_packets":485.142,"Driver.Packet.memory_wait":4.779,"Driver.Packet.pipeline_drain":279.357,"Driver.Packet.pipeline_prepare":291.488,"Driver.Packet.prepare_memory":257.340,"Driver.Packet.rendering_wait":0.169,"Driver.Present":1574.815,"Driver.Present.acquire_image":3.808,"Driver.Present.device_setup":0.127,"Driver.Present.gpu_mutex_wait":0.574,"Driver.Present.inflight_wait":0.629,"Driver.Present.present_display_buffer":34.283,"Driver.Present.queue_present":111.461,"Driver.Present.release_and_callback":0.465,"Driver.Present.render_fence_wait":1422.766,"Driver.Present.resize":0.447,"Driver.Present.validate":0.079,"Driver.Rewind":884.682,"Driver.Suspend":0.036,"GpuMutex.wait.draw":13.424,"GpuMutex.wait.end":0.280,"GpuMutex.wait.flush":0.020,"GpuMutex.wait.label":1.458,"GpuMutex.wait.present":0.060,"Graphics.Draw":23357.933,"Graphics.Draw.draw_and_resource_release":18363.477,"Graphics.Draw.index_upload":1104.956,"Graphics.Draw.validate":1368.820,"Graphics.Draw.vertex_upload":2237.100,"Graphics.DrawWithRecipe":0.320,"Graphics.DrawWithRecipe.draw_and_resource_release":0.243,"Graphics.DrawWithRecipe.index_upload":0.022,"Graphics.DrawWithRecipe.validate":0.004,"Graphics.DrawWithRecipe.vertex_upload":0.049,"Recorder.Reap":313.907,"Recorder.Submit":1013.592,"Recorder.Sync":311.864,"Recorder.WaitSerial":196.300,"Resources.Complete":151.846,"Resources.Prepare":196.581,"Shader.DrawStage":7878.675,"Shader.DrawStage.capture_resources":4495.039,"Shader.DrawStage.materialize":2041.771,"Shader.DrawStage.prepared_invocation":1280.571,"Shader.ResolveGraphicsStagesAbi":6.304,"VideoOut.Flip":1609.367,"VideoOut.Flip.completion_mutex_wait":0.440,"VideoOut.Flip.config_mutex_wait":0.028,"VideoOut.Flip.frame_limit":0.147,"VideoOut.Flip.notify_game":8.160,"VideoOut.Flip.present":1576.319,"VideoOut.Flip.validate":0.347,"VideoOut.Flip.vblank_wait":0.187,"VideoOut.Flip.window_prepare":0.456,"VideoOut.Flip.window_title":23.025,"VideoOut.Readiness":0.504,"VideoOut.Readiness.locks_validate":0.205,"Vulkan.Acquire":3.521,"Vulkan.Acquire.acquire_fence_wait":0.520,"Vulkan.Acquire.acquire_image":2.226,"Vulkan.Acquire.fence_reset":0.534,"Vulkan.Acquire.retired_swapchains":0.142,"Vulkan.Dispatch":310.032,"Vulkan.Dispatch.command_record":137.661,"Vulkan.Dispatch.shader_resources":167.712,"Vulkan.DispatchRecipe":160.379,"Vulkan.DispatchRecipe.command_record":158.944,"Vulkan.DrawFromRecipe":0.323,"Vulkan.GraphicsPipeline":403.518,"Vulkan.GraphicsPipeline.create":400.047,"Vulkan.GraphicsPipeline.modules_and_state":3.459,"Vulkan.GraphicsPipelineLibrary":399.543,"Vulkan.GraphicsPipelineLink":0.075,"Vulkan.Present":13.686,"Vulkan.Present.command_record_scale":6.149,"Vulkan.Present.pixel_upload":0.485,"Vulkan.Present.queue_submit":6.850,"Vulkan.QueuePresent":111.057,"Vulkan.QueuePresent.queue_present":110.599,"Vulkan.Retire":1422.640,"Vulkan.Retire.dump":0.635,"Vulkan.Retire.wait":1418.178},"top_phases_ms_per_frame":{"Driver.Packet":103.178,"Graphics.Draw":86.192,"Driver.Packet.draw":80.527,"Driver.Draw":79.628,"Graphics.Draw.draw_and_resource_release":67.762,"Driver.Draw.shader_compile_and_link":38.707,"Shader.DrawStage":29.073,"Driver.Draw.draw_enqueued":26.160},"owned_draw_counts":{"OwnedDraw.arm_attempt":813,"OwnedDraw.arm_blocks_requested":813,"OwnedDraw.arm_refused":813,"OwnedDraw.evicted_other":3446},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.118,"events_lost":1261171,"totals_full":false},"draw committer":{"events_full_after_s":11.269,"events_lost":427310,"totals_full":false}},"trace":"aps5-trace-8610baceca75-35244.json.gz"} {"commit":"8610baceca75","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2815,"ms":30081.700},"presents":267,"frame_ms":{"p50":110.929,"p90":118.850,"p99":142.311,"max":149.839},"gpu_busy_ms_per_present":31.348,"worker_busy_pct":{"queue worker 0x0":97.355},"phase_totals_ms":{"Driver.Completion":0.141,"Driver.Dispatch":1315.481,"Driver.Dispatch.capture_resources":98.559,"Driver.Dispatch.decode_key_device_setup":39.699,"Driver.Dispatch.lookup_cache":25.045,"Driver.Dispatch.materialize":18.563,"Driver.Dispatch.prepared_invocation":16.575,"Driver.Draw":21470.430,"Driver.Draw.device_setup":892.724,"Driver.Draw.draw_enqueued":6874.315,"Driver.Draw.post_compile_prepare":153.604,"Driver.Draw.prepare":2301.332,"Driver.Draw.shader_compile_and_link":10582.534,"Driver.EndSubmission":447.485,"Driver.Packet":27962.849,"Driver.Packet.device_lock":188.784,"Driver.Packet.dispatch":2780.972,"Driver.Packet.draw":21725.041,"Driver.Packet.execute":855.856,"Driver.Packet.flip_flush":9.215,"Driver.Packet.flush_between_packets":484.282,"Driver.Packet.memory_wait":5.015,"Driver.Packet.pipeline_drain":278.449,"Driver.Packet.pipeline_prepare":289.498,"Driver.Packet.prepare_memory":249.842,"Driver.Packet.rendering_wait":0.173,"Driver.Present":1562.413,"Driver.Present.acquire_image":3.747,"Driver.Present.device_setup":0.128,"Driver.Present.gpu_mutex_wait":0.568,"Driver.Present.inflight_wait":0.608,"Driver.Present.present_display_buffer":31.026,"Driver.Present.queue_present":108.281,"Driver.Present.release_and_callback":0.446,"Driver.Present.render_fence_wait":1416.914,"Driver.Present.resize":0.433,"Driver.Present.validate":0.082,"Driver.Rewind":875.402,"Driver.Suspend":0.039,"GpuMutex.wait.draw":7.127,"GpuMutex.wait.end":0.222,"GpuMutex.wait.flush":0.009,"GpuMutex.wait.label":0.291,"GpuMutex.wait.present":0.064,"Graphics.Draw":23355.628,"Graphics.Draw.draw_and_resource_release":18265.320,"Graphics.Draw.index_upload":1116.229,"Graphics.Draw.validate":1402.222,"Graphics.Draw.vertex_upload":2278.479,"Graphics.DrawWithRecipe":0.834,"Graphics.DrawWithRecipe.draw_and_resource_release":0.524,"Graphics.DrawWithRecipe.index_upload":0.003,"Graphics.DrawWithRecipe.validate":0.020,"Graphics.DrawWithRecipe.vertex_upload":0.274,"Recorder.Reap":320.408,"Recorder.Submit":1025.343,"Recorder.Sync":338.355,"Recorder.WaitSerial":188.173,"Resources.Complete":150.890,"Resources.Prepare":196.734,"Shader.DrawStage":7952.026,"Shader.DrawStage.capture_resources":4489.161,"Shader.DrawStage.materialize":2157.643,"Shader.DrawStage.prepared_invocation":1246.159,"Shader.ResolveGraphicsStagesAbi":5.695,"VideoOut.Flip":1637.929,"VideoOut.Flip.completion_mutex_wait":0.479,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.144,"VideoOut.Flip.notify_game":48.978,"VideoOut.Flip.present":1563.925,"VideoOut.Flip.validate":0.345,"VideoOut.Flip.vblank_wait":0.189,"VideoOut.Flip.window_prepare":0.466,"VideoOut.Flip.window_title":23.081,"VideoOut.Readiness":0.519,"VideoOut.Readiness.locks_validate":0.220,"Vulkan.Acquire":3.473,"Vulkan.Acquire.acquire_fence_wait":0.512,"Vulkan.Acquire.acquire_image":2.195,"Vulkan.Acquire.fence_reset":0.531,"Vulkan.Acquire.retired_swapchains":0.140,"Vulkan.Dispatch":317.129,"Vulkan.Dispatch.command_record":141.678,"Vulkan.Dispatch.shader_resources":170.290,"Vulkan.DispatchRecipe":139.497,"Vulkan.DispatchRecipe.command_record":137.940,"Vulkan.DrawFromRecipe":0.852,"Vulkan.Present":13.284,"Vulkan.Present.command_record_scale":6.028,"Vulkan.Present.pixel_upload":0.476,"Vulkan.Present.queue_submit":6.585,"Vulkan.QueuePresent":107.900,"Vulkan.QueuePresent.queue_present":107.464,"Vulkan.Retire":1416.809,"Vulkan.Retire.dump":0.557,"Vulkan.Retire.wait":1411.936},"top_phases_ms_per_frame":{"Driver.Packet":104.730,"Graphics.Draw":87.474,"Driver.Packet.draw":81.367,"Driver.Draw":80.414,"Graphics.Draw.draw_and_resource_release":68.409,"Driver.Draw.shader_compile_and_link":39.635,"Shader.DrawStage":29.783,"Driver.Draw.draw_enqueued":25.746},"owned_draw_counts":{"OwnedDraw.arm_attempt":801,"OwnedDraw.arm_blocks_requested":801,"OwnedDraw.arm_refused":801,"OwnedDraw.evicted_other":4798},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.091,"events_lost":1277700,"totals_full":false},"draw committer":{"events_full_after_s":10.991,"events_lost":452519,"totals_full":false}},"trace":"aps5-trace-8610baceca75-31472.json.gz"} {"commit":"edb7d91caa67","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"112:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 112:30","first_present":2787,"ms":30042.737},"presents":274,"frame_ms":{"p50":108.541,"p90":112.433,"p99":132.785,"max":190.019},"gpu_busy_ms_per_present":30.793,"worker_busy_pct":{"queue worker 0x0":97.338},"phase_totals_ms":{"Driver.Completion":0.152,"Driver.Dispatch":1340.112,"Driver.Dispatch.capture_resources":92.894,"Driver.Dispatch.decode_key_device_setup":38.421,"Driver.Dispatch.lookup_cache":24.888,"Driver.Dispatch.materialize":15.952,"Driver.Dispatch.prepared_invocation":15.425,"Driver.Draw":21354.510,"Driver.Draw.device_setup":894.275,"Driver.Draw.draw_enqueued":6938.568,"Driver.Draw.post_compile_prepare":150.738,"Driver.Draw.prepare":2302.124,"Driver.Draw.shader_compile_and_link":10388.871,"Driver.EndSubmission":477.462,"Driver.Packet":27874.003,"Driver.Packet.device_lock":185.868,"Driver.Packet.dispatch":2778.648,"Driver.Packet.draw":21593.779,"Driver.Packet.execute":841.072,"Driver.Packet.flip_flush":9.366,"Driver.Packet.flush_between_packets":484.536,"Driver.Packet.memory_wait":4.868,"Driver.Packet.pipeline_drain":270.307,"Driver.Packet.pipeline_prepare":304.353,"Driver.Packet.prepare_memory":253.933,"Driver.Packet.rendering_wait":0.164,"Driver.Present":1601.923,"Driver.Present.acquire_image":3.911,"Driver.Present.device_setup":0.138,"Driver.Present.gpu_mutex_wait":0.638,"Driver.Present.inflight_wait":0.651,"Driver.Present.present_display_buffer":34.457,"Driver.Present.queue_present":111.294,"Driver.Present.release_and_callback":0.419,"Driver.Present.render_fence_wait":1449.718,"Driver.Present.resize":0.436,"Driver.Present.validate":0.081,"Driver.Rewind":891.331,"Driver.Suspend":0.038,"GpuMutex.wait.draw":13.084,"GpuMutex.wait.end":1.065,"GpuMutex.wait.flush":0.042,"GpuMutex.wait.label":0.237,"GpuMutex.wait.present":0.095,"Graphics.Draw":23385.824,"Graphics.Draw.draw_and_resource_release":18362.481,"Graphics.Draw.index_upload":1092.312,"Graphics.Draw.validate":1385.156,"Graphics.Draw.vertex_upload":2262.402,"Graphics.DrawWithRecipe":0.159,"Graphics.DrawWithRecipe.draw_and_resource_release":0.117,"Graphics.DrawWithRecipe.index_upload":0.000,"Graphics.DrawWithRecipe.validate":0.002,"Graphics.DrawWithRecipe.vertex_upload":0.038,"Recorder.Reap":309.001,"Recorder.Submit":1012.982,"Recorder.Sync":314.391,"Recorder.WaitSerial":195.025,"Resources.Complete":150.438,"Resources.Prepare":207.616,"Shader.DrawStage":7741.394,"Shader.DrawStage.capture_resources":4429.103,"Shader.DrawStage.materialize":2017.125,"Shader.DrawStage.prepared_invocation":1215.484,"Shader.ResolveGraphicsStagesAbi":5.799,"VideoOut.Flip":1637.218,"VideoOut.Flip.completion_mutex_wait":0.423,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.143,"VideoOut.Flip.notify_game":8.620,"VideoOut.Flip.present":1603.449,"VideoOut.Flip.validate":0.343,"VideoOut.Flip.vblank_wait":0.184,"VideoOut.Flip.window_prepare":0.436,"VideoOut.Flip.window_title":23.311,"VideoOut.Readiness":0.532,"VideoOut.Readiness.locks_validate":0.222,"Vulkan.Acquire":3.624,"Vulkan.Acquire.acquire_fence_wait":0.533,"Vulkan.Acquire.acquire_image":2.292,"Vulkan.Acquire.fence_reset":0.549,"Vulkan.Acquire.retired_swapchains":0.150,"Vulkan.Dispatch":322.795,"Vulkan.Dispatch.command_record":141.167,"Vulkan.Dispatch.shader_resources":176.180,"Vulkan.DispatchRecipe":149.187,"Vulkan.DispatchRecipe.command_record":147.491,"Vulkan.DrawFromRecipe":0.161,"Vulkan.Present":13.811,"Vulkan.Present.command_record_scale":6.252,"Vulkan.Present.pixel_upload":0.479,"Vulkan.Present.queue_submit":6.881,"Vulkan.QueuePresent":110.884,"Vulkan.QueuePresent.queue_present":110.422,"Vulkan.Retire":1449.635,"Vulkan.Retire.dump":0.752,"Vulkan.Retire.wait":1444.971},"top_phases_ms_per_frame":{"Driver.Packet":101.730,"Graphics.Draw":85.350,"Driver.Packet.draw":78.809,"Driver.Draw":77.936,"Graphics.Draw.draw_and_resource_release":67.016,"Driver.Draw.shader_compile_and_link":37.916,"Shader.DrawStage":28.253,"Driver.Draw.draw_enqueued":25.323},"owned_draw_counts":{"OwnedDraw.arm_attempt":822,"OwnedDraw.arm_blocks_requested":822,"OwnedDraw.arm_refused":822,"OwnedDraw.evicted_other":3599},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.136,"events_lost":1273464,"totals_full":false},"draw committer":{"events_full_after_s":11.120,"events_lost":435386,"totals_full":false}},"trace":"aps5-trace-edb7d91caa67-3060.json.gz"} ``` ### Tested - Earlier head 0311ce2b586a (base bb6cb0338ebb), local Windows `ctest -V` with the Khronos validation layer (SDK 1.4.335.0), `VK_KHRONOS_VALIDATION_VALIDATE_SYNC=1`, RTX 3080, same machine for both trees: `agc_driver_pipelined_metadata_pass`, `_draw_pipeline`, `_plan_verify`, `agc_driver_queued_index_read_order`, `agc_driver_village_draw_cost`, `agc_driver_recorder`: 6/6 pass on main and on the change, 0 `VUID-` lines and 0 sync hazards. Not repeated locally after the rebase onto edb7d91caa6; the fork CI run below covers the rebased head. On the rebased head, locally: `agc_profile_counter`, `agc_profile_counter_shared` and `agc_profile_counter_tls_expansion`: 3/3 pass. - `agc_profile_counter_tests` checks that no add is lost from 1, 2, 4, 16 and 20 threads, that up to 16 threads get slots of their own, that the switch puts all threads on one slot, and that `Take` returns every thread's adds and resets every slot. A counter with one slot, a `Sum` that reads only the first slot and a `Take` that does not reset all fail it. `--tls-expansion` (Windows) takes the first 64 TLS indices so the counter's index is in the TEB expansion slots. - Fork CI run https://github.com/chitters2004/AnyPS5/actions/runs/43362799120 on 8610baceca75 (base edb7d91caa67): linux-gate (lavapipe, validation layer) 11/11 pass on the change and 9/9 on main, 0 VUIDs, nothing failing on the change but not on main; windows 11 of 12 pass on the change (the three new `agc_profile_counter*` tests pass), `agc_driver_recorder` fails on main as well (lavapipe on the Windows runner), 0 VUIDs; tsan 3 pass, 8 skipped (stubbed in that job). Verdict GREEN. - `tools/check_conventions.py --base edb7d91caa6` on the change: all checks passed. The branch merges cleanly into origin/main a6fbf9ce963 (`git merge-tree`). - Linux bench: an earlier measurement on a 4-vCPU Linux VM (native `thread_local`, toolchain not recorded): one shared atomic 4.7 ns from 1 thread, 47 from 2, 115 from 4; `ProfileCounter` 4.8, 4.7, 4.7. Not repeated on the final head. - Not run: macOS. Windows bench on the rebased head 8610baceca75 (the first block is the second run), `agc_profile_counter_tests --bench N`, ns per add per thread, two runs: | threads | shared atomic | ProfileCounter | |---|---|---| | 1 | 1.5 / 2.0 | 2.0 / 2.3 | | 2 | 12.5 / 16.0 | 1.7 / 1.6 | | 4 | 39.3 / 35.5 | 1.7 / 1.6 | | 8 | 74.7 / 76.2 | 1.6 / 1.5 | | 16 | 153.6 / 152.0 | 1.7 / 1.7 | Conflicts: #17697 is merged and this branch is rebased onto it. Textual overlap remains only with #15456 (`DrawPipeline.cpp`); whichever merges second keeps both sides' lines. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (merge order: textual conflict with #15456 only; keep both lines) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3080, driver 621.14, Windows 11 10.0.26320; llvmpipe (lavapipe) on Linux CI - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!19348
No description provided.