perf(shader): pick the f32 NaN result with one quiet and one fallback select #4287
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4287"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-12T04:22:51Z.
What
nanResultF32now picks the AMD NaN result for an f32 instruction with one quieting step and one final select, instead of quieting and selecting once per source. It also tests sources for NaN withFPIsNan32instead of an integerand+ compare.Background. These instructions go through
nanResultF32so that a NaN result matches AMD hardware rather than the host GPU:v_add_f32,v_sub_f32,v_subrev_f32andv_mul_f32;v_fma_f32andv_fma_mix_f32with f32 sources;v_mul_legacy_f32and the legacymad/mac/fmaforms;v_div_fmas_f32.The rule is:
0xffc00000when the result is NaN;For a fused multiply-add whose product is 0 × ∞, the addend doesn't count as a source.
Before, the function started from the fallback and then, for each source from last to first:
(bits & 0x7fffffff) > 0x7f800000;or;The addend's test was also combined with the inverse of the invalid-product flag.
How.
FPIsNan32finds NaN takes its place.isNan(result) ? 0xffc00000 : result.isNan(candidate) ? quiet(candidate) : fallback. So the quietingorand the final select happen once.Why results don't change. The candidate is NaN exactly when some eligible source is NaN, and it is then the first eligible NaN source, in the same order as before:
agc_driver_f32_arithmetic_nanchecks 16 forms and pins both cases:v_fmaak_f32 is 0xffc12345, expected 0x7f812345);{+inf, 0, 0x7fc00003}expects0xffc00000fromv_fma_f32).v_mac_f32andv_mad_f32don't go throughnanResultF32and are unchanged.Before / after on an RTX 4060 Laptop (Ada, driver 591.86). SASS instructions per instruction are derived from the
APS5_PIPELINE_STATSbinary size over a chain of 16 instructions, withFLOAT_MODE0xc0, DX10 clamp on and IEEE mode off:v_mul_f32v_add_f32v_add_f32DPProw_shr:1v_subrev_f32v_sub_f32v_fma_f32v_fma_mix_f32(f32 sources)v_div_fmas_f32v_mac_legacy_f32v_mul_legacy_f32v_mad_legacy_f32orper source where the new code has one in total. That case wasn't measured.v_mul_f3242,491,v_add_f3211,247,v_sub_f327,746,v_subrev_f321,770,v_fma_f32615. Weighted by the counts above, that's about 91,600 fewer SASS instructions across the corpus, as a static count.v_fma_mix_f32, listed as VOP3Pv_fma_f32in the histogram. Only those with f32 sources change, so they're left out of the estimate.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release, this branch on
mainatd146ec1b6. Devices:GALLIUM_OVERRIDE_CPU_CAPS=avx.No new test. The existing tests already pin what this change has to keep. As a check, I made the chain keep a later NaN source over an earlier one.
agc_driver_f32_arithmetic_nanthen failed withlane 0 no float mode v_fmaak_f32 is 0xffc12345, expected 0x7f812345.f32 and NaN tests. These pass on all three devices, except the division modifier tests, which the Intel UHD skips for a missing feature:
agc_driver_f32_arithmetic_nan,agc_driver_nan_quieting,agc_driver_f32_min_max_nan,agc_driver_fma_rounding,agc_driver_fma_legacy;agc_driver_division*,agc_driver_f32_output_modifier,agc_driver_f32_result_clamp,agc_driver_f32_denormal_flush,agc_driver_f32_constant_factor_tininess;vector_fused_multiply_add,vector_mad_legacy,agc_denormal_flush_elimination.Shader and driver tests (
agc_driver_*,agc_shader_*,agc_spirv_*,vector_*,agc_masked_select,agc_validate_program,agc_denormal*,agc_float16_*; 338 tests):agc_driver_flat_loads*,agc_driver_global_loads*,agc_driver_flat_apertures*,agc_driver_pixel_interlock.agc_driver_ds_swizzleandagc_driver_f32_dot2_rounding, which fail the same way onmain.Op sweep. All 363 swept opcodes, compiled from
mainand from this branch, gave the table above.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-12T05:21:01Z.
Tested on my machine (RTX 4090, Linux), on main
d146ec1b6+ this PR.agc_driver_f32_arithmetic_nanpasses.agc_shader_replay --asm, the decoder's names). The f32 add/sub/subrev/mul/mad/mac/fma family this PR changes is 21.9% of Hades II's instructions (PPSA36082, 263 shaders into gameplay, 23,327 instructions;v_mac_f321,375,v_mul_f321,206,v_mad_f321,116,v_add_f32850) and 40.7% of Demon's Souls' (PPSA01341, 2,388 shaders from its first two minutes, 1,051,140 instructions;v_mul_f32180,261,v_mac_f3282,766,v_mad_f3270,470). Every one of those shaders is wave64.Looks good to me, and since it's in the hot path of both titles, I'd like to see it merged.
LLM assistance used.
Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-12T13:01:38Z.
Thanks @Raghav314, especially for Demon's Souls: it's the first title in these counts with that much f32 math.
One correction to the share. This PR changes only the instructions that go through
nanResultF32:v_add/sub/subrev/mul_f32,v_fma_f32and its other encodings, the legacy forms,v_div_fmas_f32andv_fma_mix_f32with f32 sources.v_mac_f32andv_mad_f32becomeFPMad32without it, so they don't change. Taking them out of your counts leaves about 11% of Hades II's instructions and about 26% of Demon's Souls', still withv_mul_f32the largest (1,206 and 180,261).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:42:51Z.
Could you add a frame-time comparison on a title,
mainagainstmainplus this PR alone, same machine and scene? The SASS and SPIR-V sizes show less code, but aperf(PR needs the run-time numbers from the Performance report form. Going by Raghav314's counts, Demon's Souls (PPSA01341) is the title where it should show.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:07:49Z.
Review: DISMISSED
Checked the new chain against the old one: same result (first NaN source, quieted in IEEE mode; 0×∞ drops the addend; fallback
0xffc00000).agc_driver_f32_arithmetic_nan,agc_driver_nan_quieting,agc_driver_fma_*,agc_driver_division*andagc_driver_f32_min_max_nanpass here on CI's lavapipe.One thing is missing, and @oneandonlydean already asked for it: a
perf(PR needs run-time numbers. The SASS counts show less code but not that a frame gets faster. Please addmainvsmain+ this PR on a title (Demon's Souls, per Raghav314's counts), same machine and scene, with the Performance report form. Once that is in, this is ready to merge.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-13T15:56:36Z.
@Raghav314, the review needs one more thing before this can merge: a run-time comparison on a title. Your counts showed the most f32 math in Demon's Souls, so that's the title to measure. Could you capture it?
main(d146ec1b6, this PR's base) and this PR (7aea3fe29).APS5_TRACE_FRAMES=<start>:<count>. Set no otherAPS5_TRACE_*orAPS5_PROFILE_*switch, as the Performance report form describes.aps5-summary.jsonllines and attach the twoaps5-trace-*.json.gzfiles.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T14:14:30Z.
Review: DISMISSED
Rechecked the head (
7aea3fe29): the new chain gives the same result as the old one (first NaN source, quieted in IEEE mode; 0×∞ drops the addend; fallback0xffc00000), and the f32/NaN/fma/division tests pass here. The code is fine.One thing is still missing and it is the only blocker: a
perf(PR needs run-time numbers, as @oneandonlydean asked. The SASS counts show less code, not a faster frame. Please addmainvsmain+ this PR on a title (Demon's Souls, per Raghav314's counts), same machine and scene, using the Performance report form. We can't run titles on our side, so this has to come from someone who can. Once it is in, this is ready to merge.Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-14T15:34:52Z.
I can't test this in Demon's Souls yet, so I ran the comparison on my machine in Hades II (PPSA36082) instead. Why Demon's Souls doesn't work for this right now:
d146ec1can't run Demon's Souls here: it aborts after about 13 s on "DB_RENDER_CONTROL ... resummarize unsupported", which #4049 fixed later. So both builds are currentmain(84b01f9cd), one plain and one with this PR merged in (203bb7730, clean merge).main, Demon's Souls was still on a black screen after 4 minutes of cold shader compiles (about 1,160 shaders compiled, no presents yet), so I had no scene to capture.Hades II is in the counts too (about 11% of its instructions after your correction). Scene: the hub, standing still at the same spot, 1920x1080. Each build ran once to the hub and was restarted, then captured with
APS5_TRACE_SECONDS=200:15and no other trace or profile switch. Same machine, same session, one capture each:main84b01f9cd:main+ this PR (203bb7730):GPU busy per present goes from 5.689 to 5.590 ms (-1.7%). Frame time doesn't move (p50 25.4 vs 25.6 ms) because the hub on
mainis bound by the queue worker (99% busy), not the GPU, so a shader-side change can't show up there. For scale: two earlier captures of mine in the same session with builds that don't touch shader code gave GPU busy 8.630 and 8.631 ms, so 0.1 ms is more than the run-to-run spread I've seen, but this is one capture each. A GPU-bound scene would be the better test, which is what Demon's Souls would have been.I will attach the two traces below.
aps5-trace-84b01f9cd042-378348.json.gz
aps5-trace-203bb7730f97-379144.json.gz
Traces: aps5-trace-84b01f9cd042-378348.json.gz = main
84b01f9cd, aps5-trace-203bb7730f97-379144.json.gz = main + this PR (203bb7730).LLM assistance used.
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T17:14:44Z.
I ran Demon's Souls (PPSA01341) on Linux with an RTX 5080 (NVIDIA 615.78.08), on
maina453108cfand on the same commit with this PR (7aea3fe29) merged.With the PR the title stops on the language select screen. It did so in both runs that lasted long enough, at 379 s and at 589 s after start:
mainwithout the PR reaches the same screen and does not print that line in any of six runs, two of them 600 s long. On the language selectmainhas a frame time p50 of 29.9 ms (trace window 280:3 from the first present,trace_digest.py, warm shader cache). I don't have a number for the PR yet, because both of its long runs threw before or inside that window.I haven't looked into why the f32 NaN change would change the image keys of that compute shader.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T16:36:42Z.
A compile-time data point for this change. It's not the frame-time comparison the review asked for.
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.02. Base is
main66702f1cf; the PR is7aea3fe29merged onto it cleanly.The shader is the largest fragment shader of Afterglow (PPSA47770, homebrew built on the PS5 OpenGL stack). It has 19,373 guest instructions, about 8.2k of them
v_mul_f32, 6.2kv_add_f32and 1.4kv_sub_f32, at the default float mode (f32 denormals flushed, IEEE off). I recompiled its dumped request withagc_shader_replayand timed NVIDIA building its fragment-shader library part in the title. The timer is local, around thatvkCreateGraphicsPipelinescall. Cache was cold, two runs per build:mainmain+ this PRWords drop 1.1%, but the compile drops about 10%.
To show where this shader's compile time goes, I also ran local switches that skip one piece of the f32 emulation each. They change results, so they're for measurement only, not a proposal. One run each, base 24.8 s in that series:
nanResultF32)flushF32Denormal)flushTinyProduct)In this shader the NaN selection is the largest single part of the compile time.
The title exits on a cold cache either way: its own watchdog stops waiting on that submission after about 2 s.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-18T00:57:58Z.
Thanks @milescoviello. A 10% shorter build of Afterglow's (PPSA47770) largest fragment shader is a title measurement I couldn't produce here. The breakdown showing NaN selection as the largest single part of that compile is useful too.
@fma-rc, thanks for the Demon's Souls run. Your base,
a453108cf, predates @Celegans12'sd9e47d1e9, which replaced the 16-slot bindless image table with runtime-indexed image and sampler tables. Since then,mainhas no "distinct keys exceed the 16 slots" stop. I still don't see how this change, which only rewrites hownanResultF32picks the NaN result, could change that shader's image keys. But a stopmaindoesn't have needs explaining before this merges.Could you rerun Demon's Souls on current
mainwith this PR? If it still stops or misrenders there, I'd need that compute shader's dumped request (APS5_DUMP_SHADERS=1, the request for 0x248946900) and theAPS5_TRACE_IMAGE_TABLE=1lines before the stop. I can't run Demon's Souls here, so with those I would replay the shader withagc_shader_replayonmainand with this PR and compare.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-18T08:56:15Z.
I reran Demon's Souls (PPSA01341) on
mainb39d90bf1and on the same commit with this PR merged, RTX 5080 on Linux, 700 s per run. Neither of the two PR runs stopped, and the17 distinct keys exceed the 16 slotsline is gone;mainran three runs without a stop as well. So the stop I reported came from the old base, as you thought. WithAPS5_TRACE_IMAGE_TABLE=1, shader 0x248946900 resolves its 256-record table thousands of times per run on both builds. I didn't capture frames in these runs, so this says nothing about rendering.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T00:01:00Z.
Apple GPU / MoltenVK data point on the switch to
FPIsNan32. The perf question is still open; this is about correctness on Metal.Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head
7aea3fe29. Method: macos-port @ b7eb6b6b + ImportWatched + PR diff, not main (main doesn't build on macOS yet). The PR applies cleanly.The port tests NaN with the bits in
EmitFPIsNan32((bits & 0x7fffffff) > 0x7f800000, from mugurc's macOS commit47bf3675a), where main emitsOpFUnordNotEqual(x, x). So I also ran with main'sEmitFPIsNan32put back into the port, which is what this PR gets on main. Tests:agc_driver_f32_arithmetic_nan,agc_driver_nan_quieting,agc_driver_f32_min_max_nan,agc_driver_fma_legacy,agc_driver_fma_rounding,agc_driver_divisionand the otheragc_driver_f32_*. "pass" below means: same as the unchanged port. Four f32 denormal/tininess tests (f32_constant_factor_tininess,f32_denormal_flush,f32_dot2_rounding,f32_output_modifier) fail there in every row, because MoltenVK doesn't preserve f32 denormals.MVK_CONFIG_FAST_MATH_ENABLED=1EmitFPIsNan32f32_min_max_nanfailsf32_arithmetic_nan,division,fma_legacyandf32_min_max_nanfailWith fast math forced, the failures with the PR are all a canonical NaN where an AMD NaN was expected:
v_add_f32 is 0x7fc00000, expected 0x7f812345v_div_fmas_f32 is 0x7fc00000, expected 0xffc00001v_mad_legacy_f32 |src0| -src2 is 0x7fc00000, expected 0xffc00000Default configuration: no change. MoltenVK compiles the test shaders with
MathMode Safe(its log), since the module declaresSignedZeroInfNanPreserve. MoltenVK main + SPIRV-Cross #2704 also passes.The difference: the current integer test in
nanResultF32gives the same results with Metal fast math on. After this PR, the NaN source selection depends on Metal keepingx != xtrue for a NaN, which fast math doesn't guarantee. The port's commit also reportsx != xas false through MoltenVK for a NaN converted from f16, even with fast math off.With the port's bit test (the PR on the port as is), all of these pass in both modes, and so do
agc_driver_f32_arithmetic_nan's order and 0 × ∞ rows.So on Apple this is fine as long as safe math stays on. A bit-based
FPIsNan32on main would remove the dependency, but that's a separate change.GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704 for the default case)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-20T07:24:29Z.
Ran this on GTA V (PPSA04263 01.010.002), Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, Graphics Mode Performance, the Story prologue after Resume Story, with no input.
main
eaa5c9238against maineaa5c9238+ #4287 at7aea3fe29, same machine and session, two runs each in the order A B A B, window frames 3700:700, caches warm, APS5_TRACE_EVENTS=4194304 (BUILD.md's remedy for full trace buffers), no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected. The harness navigates the menus from frame dumps in boot and load to present 3510 (APS5_DUMP_FRAMES=117, every 30 presents), which stop before the window.Frame p50: main 81.1, 81.4 ms, with #4287 76.3, 76.4 ms (-4.9 ms, -6.0 %). GPU busy per present: 64.8 and 60.3 ms.
p99: main 110.2, 114.8 ms, with #4287 133.9, 133.5 ms. The slowest 1 % of frames got slower in both pairs; what those frames hold was not examined.
Not tested: other scenes, Fidelity mode, other GPUs.
Written with AI assistance (Claude Code); measured on the machine above.
Summary lines (main, then the PR):
{"commit":"eaa5c9238687","dirty":false,"env":{"APS5_DUMP_FRAMES":"117","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3700:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","resolution":"3840x2160","window":{"spec":"frames 3700:700","first_present":3700,"ms":57698.898},"presents":700,"frame_ms":{"p50":81.055,"p90":90.76,"p99":110.229,"max":124.741},"gpu_busy_ms_per_present":64.773,"worker_busy_pct":{"queue worker 0x0":3671.574},"top_phases_ms_per_frame":{"Driver.EndSubmission":2960.755,"Driver.Packet":63.333,"Graphics.Draw":60.468,"Graphics.Draw.draw_and_resource_release":56.906,"Driver.Packet.draw":50.259,"Driver.Draw":50.046,"VideoOut.Flip":26.034,"Driver.Present":26.017},"trace_dropped":false,"trace":"aps5-trace-eaa5c9238687-1297376.json.gz"}
{"commit":"9a357994eac7","dirty":false,"env":{"APS5_DUMP_FRAMES":"117","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3700:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","resolution":"3840x2160","window":{"spec":"frames 3700:700","first_present":3700,"ms":55508.153},"presents":700,"frame_ms":{"p50":76.253,"p90":86.708,"p99":133.868,"max":163.939},"gpu_busy_ms_per_present":60.265,"worker_busy_pct":{"queue worker 0x0":3695.605},"top_phases_ms_per_frame":{"Driver.EndSubmission":2865.206,"Driver.Packet":63.012,"Graphics.Draw":58.603,"Graphics.Draw.draw_and_resource_release":54.679,"Driver.Packet.draw":50.972,"Driver.Draw":50.751,"Driver.Draw.shader_compile_and_link":23.759,"VideoOut.Flip":23.52},"trace_dropped":false,"trace":"aps5-trace-9a357994eac7-1305787.json.gz"}
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T15:37:53Z.
@adriadam10 your remaining point on this PR was a performance number. CPritch has since posted one: p50 about 6% slower, with a worse p99. That run looks like it included first-use shader compiles in its window, though, so it may be measuring a cold cache rather than the change. We've reviewed the current head
7aea3fe29f. On an RTX 4090, main and this PR each pass the 17 f32/NaN/fma/division execution tests, and a mutant that drops the NaN result handling fails 5 of them. We'll also run our own paired GPU test against main on a warm cache and post the result. Could you re-review when you have a moment?Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-21T07:23:58Z.
@adriadam10 @karanvora2599 the main vs main + this PR run you asked for is in my comment above (https://github.com/boykopovar/AnyPS5/pull/4287#issuecomment-6285682656): GTA V on Linux, RTX 5060 Laptop, captured as the Performance report form describes, both summary lines included. Frame p50 81.1, 81.4 -> 76.3, 76.4 ms. p99 rose in both pairs (110.2, 114.8 -> 133.9, 133.5 ms), which I haven't looked into.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-21T13:34:17Z.
Apple GPU / MoltenVK run-time numbers for head
7aea3fe29, on two titles.Machine: Apple M4 Pro (24 GB), macOS 27.0.1, x86-64 build under Rosetta 2, MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), on AC power.
Base: not
main, becausemaindoes not run titles on macOS yet. The base is the community macOS branch at7cf8c610c(the closed #7332) plus #8578, #8567 and the transcendental follow-up of #8612. This PR applies to it cleanly. On that branchEmitFPIsNan32is the integer test(bits & 0x7fffffff) > 0x7f800000, as in the earlier MoltenVK note above, so these numbers cover the shorter select chain only, notmain'sOpFUnordNotEquallowering.Method: fixed scene reached with scripted pad input and no input during the window, warm caches (one warm-up run per arm, a separate
ANYPS5_SHADER_CACHE_DIRper arm), arms alternated A B A B, two runs each, frame data fromAPS5_TRACE_SUMMARY_EVERYsummary lines.No measurable change on this GPU. God of War is GPU-bound here, so a shorter shader would show in its GPU time. Planet of Lana is bound by the queue worker, so its fps cannot show a GPU change.
Tests (
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1) on the base + this PR:agc_driver_f32_arithmetic_nan,agc_driver_nan_quieting(f64 part skipped, noshaderFloat64),agc_driver_f32_min_max_nan,agc_driver_fma_legacy,agc_driver_fma_rounding,agc_driver_float16_fma_roundingandagc_driver_divisionpass.Not checked:
main(titles do not run on macOS there), theVK_LAYER_KHRONOS_validationcomparison, the generated Metal code (so I can't say whether the Metal compiler already folds the old chain), and other titles.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T04:04:16Z.
I'm picking this up alongside @adriadam10 because it is part of a stack that gets PPSA04263 further on current
main. I've started a fresh full CI run on7aea3fe29fmerged into currentmain, and it goes into a gate with the rest of that stack. @karanvora2599, nothing is needed from you unless the run shows a problem; I'll post the result here.Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-22T13:00:18Z.
A second run, on current main, agrees with my first: #4287 is faster on this machine, not slower. In my first run above the p50 went from 81.1, 81.4 to 76.3, 76.4 ms.
GTA V (PPSA04263 01.010.002), Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, Graphics Mode Performance, the Story prologue after Resume Story, with no input.
main
4777caca3+ #9730 ated8a900ca, against that + #4287 at7aea3fe29. #9730 is on both sides because main alone aborts GTA V at start-up insceVoiceSetThreadsParams. Same machine and session, two runs each in the order A B A B, window frames 3300:700, APS5_TRACE_EVENTS=4194304. Each side was warmed until it stopped building pipelines, and no timed run built one.Frame p50: 79.1, 79.0 ms, with #4287 73.8, 74.0 ms (-5.1 ms, -6.5 %). GPU busy per present: 62.9, 62.6 -> 58.9, 58.6 ms.
p99: 104.7, 113.0 ms, with #4287 107.2, 113.1 ms, so no clear change. The p99 rise in my first run did not repeat, here or in a run last night on main
0c6a5bd59(p50 78.2, 77.3 -> 72.6, 72.3 ms; p99 110.7, 110.9 -> 106.1, 103.5 ms).On the cold-cache question:
Driver.Draw.shader_compile_and_linkis in main's top phases too (24.4 ms per frame in its second run here; 23.8 and 24.3 with #4287). Its mark (Draw.cpp:437at4777caca3) closes the span that starts atprepareand includes the draw-cache lookup, so draws that hit the cache are timed in it as well. Its presence alone doesn't show a cold cache.Not tested: other scenes, Fidelity mode, other GPUs.
AI-assisted: yes
Summary lines (main + #9730, then with #4287):