Repository navigation
perf(shader): skip redundant fault-buffer discovery - #13570
Conversation
|
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.
|
|
Windows data point for On this PR and on its base The change is a straight |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (3 IDs in 380 tests)Skipped (41)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Checked the diff: |
What
Shader-info collection walks all instructions looking for a 64-bit shared atomic even when the fault-buffer flag is already true. Short-circuit that pure discovery scan once its result cannot affect the flag.
cb28abeb89b added the atomic fault requirement; cd329c060aa made it unconditional on sharedMemoryBytes. That requirement remains, including workgroup-backed LDS. SharedAccessOf is a total pure switch, and the scan is discovery, not validation. Normal Recompile and the diagnostic deserializer receive the same complete ShaderInfo. No guest instruction, FP, EXEC, fault or memory-ordering semantics change.
Tested
Debian 13 / Linux 7.2.12-x64v3-xanmod1, Ryzen 5 7640HS, AMD Radeon 760M, RADV Mesa 25.0.7-2+deb13u1. Main
cde94eb55a65and candidate7fa759dc64ecpass the same five focused tests: agc_shader_memory, agc_spirv_lds_atomic_lock, agc_driver_buffer_descriptor_runtime, agc_driver_lds_mixed_width_atomics and agc_driver_lds_lock_budget. Actual hardware includes mixed-width locking and misalignment faults on device-backed/workgroup LDS. Both arms require Vulkan, disable shader caching and insert Khronos validation on all three Radeon fixtures: zero VUID errors, missing layers or skips. Initial skipped build stubs were detected; the real LDS source was enabled before both final matched checks. These are local results; CI is not claimed.Private same-process checks run the actual original/candidate Collect bodies on the same programs after restoring input ShaderInfo/completion, with a separate baseline pixel-input copy. All 392 complete ShaderInfo, completion flags and pixel-coverage results match. ShaderMemory has 382 calls: 61 already-true inputs and 321 false-to-false. SpirvLdsAtomicLock has 10: six false-to-true and four false-to-false. Atomic-predicate visits 15,666→10,258, with all required false-flag searches unchanged. No new production counter or fixture is added.
Native tradeoff: identical GCC 15.2 Release flags emit the expected flag branch bypassing the search loop. Main grows 1,670→1,674 instructions while bytes fall 8,446→8,442; branches 262→264, static calls 108 unchanged. Cold stays 221 instructions/40 branches/40 calls, bytes 1,136→1,144. Combined bytes 9,582→9,586. Both retain 872 local stack bytes and six saved-GPR pushes; spills were not measured. Production text sections match the uninstrumented private candidate. This is eliminated executed CPU work, with no static code-size, native GPU instruction or elapsed compilation gain claim.
Verified timing-only evidence includes all four original traces, original summaries, upstream digests, protocol, per-run audits, work/native statistics, validation and exact source/library provenance. Raw objects, ISA, cache files, game/save data, screenshots and console logs remain local. The overlap checker could not merge stale PRs #9748/#12619; their exact patches were manually reviewed: target-merge layered image metadata and flat pixel-input aliases respectively, with no shared changed lines or fault-scan mechanism. No dependency is required.
Sons of Sparta (PPSA28997 v01.008.001), restored camp, 1920x1080 native / focused 1152x648 Wayland client, mailbox, 25:12s windows. Both initial warmups use the same retained same-driver RADV cache and empty source shader caches, then independently warm and restart. All four A1/B1/B2/A2 captures pass with no exclusions or replacements: 21.75316→21.74201 FPS (observed -0.051%; pairs +0.173%/-0.275%). GPU busy 42.8125→42.7600 ms/present. The few warmed scene runs do not establish a significant/general gameplay gain or measure cold compilation latency.
Timing used main
4bc9e779aa7aand candidate3815c275a08f. The full candidate runtime set is independently verified: shader library differs; VideoOut differs only in ten bytes of embedded revision text, all other bytes identical. All 50 native/9 guest loaded-library hashes are pinned. Source-revisions.json distinguishes timed builds from submission revisions after any upstream refresh; the collector source is byte-identical through that refresh. The submission refresh changes only the release workflow timeout; runtime sources and build flags are unchanged. Refreshed heads are not claimed to have been timed.Original summaries in A1/B1/B2/A2 order:
{"commit":"4bc9e779aa7a","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"25:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 25:12","first_present":549,"ms":12015.108},"presents":261,"frame_ms":{"p50":45.965,"p90":46.452,"p99":47.622,"max":50.127},"gpu_busy_ms_per_present":42.830,"worker_busy_pct":{"queue worker 0x0":78.428},"top_phases_ms_per_frame":{"Driver.Packet":35.978,"Driver.Packet.draw":33.471,"Driver.Draw":33.431,"Driver.Draw.draw_enqueued":29.765,"Recorder.Sync":28.711,"VideoOut.Flip":9.063,"Driver.Present":9.030,"VideoOut.Flip.present":9.026},"trace_dropped":false,"trace":"aps5-trace-4bc9e779aa7a-3906520.json.gz"} {"commit":"3815c275a08f","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"25:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 25:12","first_present":541,"ms":12040.281},"presents":262,"frame_ms":{"p50":45.936,"p90":46.329,"p99":46.792,"max":47.791},"gpu_busy_ms_per_present":42.747,"worker_busy_pct":{"queue worker 0x0":78.377},"top_phases_ms_per_frame":{"Driver.Packet":35.883,"Driver.Packet.draw":33.374,"Driver.Draw":33.334,"Driver.Draw.draw_enqueued":29.821,"Recorder.Sync":28.574,"VideoOut.Flip":9.075,"Driver.Present":9.064,"VideoOut.Flip.present":9.037},"trace_dropped":false,"trace":"aps5-trace-3815c275a08f-3907543.json.gz"} {"commit":"3815c275a08f","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"25:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 25:12","first_present":546,"ms":12014.509},"presents":261,"frame_ms":{"p50":45.942,"p90":46.601,"p99":47.733,"max":49.419},"gpu_busy_ms_per_present":42.773,"worker_busy_pct":{"queue worker 0x0":78.443},"top_phases_ms_per_frame":{"Driver.Packet":35.974,"Driver.Packet.draw":33.407,"Driver.Draw":33.365,"Driver.Draw.draw_enqueued":29.544,"Recorder.Sync":28.440,"VideoOut.Flip":9.066,"Driver.Present":9.054,"VideoOut.Flip.present":9.027},"trace_dropped":false,"trace":"aps5-trace-3815c275a08f-3908557.json.gz"} {"commit":"4bc9e779aa7a","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"25:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 25:12","first_present":562,"ms":12027.354},"presents":262,"frame_ms":{"p50":45.836,"p90":46.373,"p99":47.437,"max":48.209},"gpu_busy_ms_per_present":42.795,"worker_busy_pct":{"queue worker 0x0":78.435},"top_phases_ms_per_frame":{"Driver.Packet":35.875,"Driver.Packet.draw":33.379,"Driver.Draw":33.338,"Driver.Draw.draw_enqueued":29.490,"Recorder.Sync":28.448,"VideoOut.Flip":9.075,"Driver.Present":9.065,"VideoOut.Flip.present":9.037},"trace_dropped":false,"trace":"aps5-trace-4bc9e779aa7a-3909485.json.gz"}Checklist
main; no other open PR implements the same functionsNotImplemented_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)