Repository navigation
perf(shader): reuse an unwritten image table snapshot read through a pointer - #15655
Merged
oneandonlydean merged 1 commit intoNov 4, 2026
Merged
Conversation
…pointer An image table column's snapshot could not be reused unwritten when the column is addressed through a pointer, or when the capture had already read pages of the table before taking its write stamp: the column took no stamp, or stampWrites refused it, so every capture compared the whole table again. A pointer-addressed column now stamps its remembered read range before the compare. With an explicit span query, stampWrites keeps a stamp over pages the capture already read when they still match memory after the collect; without one it refuses as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
✅ AMD 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 (7, not counted against this PR)Validated but not compared (55, not in the main baseline's validation pass)Validation IDs already present on main (8 IDs in 517 tests)Skipped (57)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
12 tasks done
Contributor
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, 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 (8 IDs in 531 tests)Skipped (50)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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An image table snapshot is remembered per column (
ColumnMemos). It is reused without reading the table again only when it carries a write stamp that the write watch still vouches for. Otherwise each capture reads and compares every record of the table. In two cases a column never got a usable stamp:column.address). Only base-addressed columns took a stamp before the compare.ShaderMemory::stampWritesrefused any range with a page the capture had fetched, because a write between that fetch and the collect would go unseen.Now:
pendingSpan, which the driver always does),stampWritestakes the stamp after the collect and then checks each page the capture already read: every valid word must still equal guest memory. A page read word by word, a page that differs, or a span with a pending GPU write still refuses the stamp. A write between the fetch and the collect therefore shows up as a difference.stampWritesrefuses as before.PPSA18653 reads its bindless table (about 2 MiB) through a pointer, from the page that holds the root. Every draw compared the whole table, about 5e9 word reads over a run, even though the table changes about once per frame. With this change, 2617 of 2625 table snapshots in a 10 s window were reused unwritten, against 0 of about 2250 before.
The new step
pointer table unwritten reuseinagc_shader_memorysets up a pointer-addressed table on a write-watched root page, then captures it with an explicit span query that reports nothing pending:On
mainit fails witha pointer-addressed table nothing wrote was compared again instead of reused. It also fails with either half of the change reverted.Tested
ctest -V -R "shader_memory|image_table|snapshot|capture|bindless|srt|shader_replay|table"withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1, on the same machine. The image table and capture execution tests were built. Each log starts with its tested revision and these variables, and the build settings are attached.05584f417d): 105/105 passed.main1c8c0efc8c, with the new test. 103/105 passed; onlyagc_shader_memoryandagc_shader_bindlessfail, both on the new step (agc_shader_bindlessruns the same binary).VUID-error. The same 7 tests skip in both.VUID-error.APS5_TRACE_SECONDS=20:60after a warm run, with no other trace or profile switch, and the log not redirected.maindoes not reach this screen on its own. Both builds carry fix(agc): copy GPU-side indirect draw records when the packet is processed #15327, the opt-in clock change (APS5_FAIL_UNKNOWN_CLOCKS=1), perf(agc): reuse image tables that hold storage-viewed entries #15563, fix(shader): map image-table entries filled with ones to no record #15611 and two local speed changes. The base is58d69707d7and the change is462334bc76: the same tree plus this commit. Traces attached.Driver.Draw.shader_compile_and_linkper frameShader.DrawStageper frame{"commit":"58d69707d7c1","dirty":false,"env":{"APS5_FAIL_UNKNOWN_CLOCKS":"1","APS5_TRACE_SECONDS":"20:60"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 20:60","first_present":511,"ms":61273.908},"presents":27,"frame_ms":{"p50":2320.976,"p90":2359.531,"p99":2392.416,"max":2392.416},"gpu_busy_ms_per_present":272.669,"worker_busy_pct":{"queue worker 0x0":99.930},"top_phases_ms_per_frame":{"Driver.Packet":2267.522,"Driver.Packet.draw":2202.553,"Driver.Draw":2202.162,"Driver.Draw.shader_compile_and_link":1129.462,"Driver.Draw.draw_and_resource_release":1056.678,"Graphics.Draw":1033.070,"Graphics.Draw.draw_and_resource_release":1025.134,"Resources.Complete":925.705},"trace_dropped":false,"trace":"aps5-trace-58d69707d7c1-30700.json.gz"}{"commit":"462334bc769d","dirty":false,"env":{"APS5_FAIL_UNKNOWN_CLOCKS":"1","APS5_TRACE_SECONDS":"20:60"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 20:60","first_present":503,"ms":60517.607},"presents":29,"frame_ms":{"p50":2100.817,"p90":2219.649,"p99":2263.247,"max":2263.247},"gpu_busy_ms_per_present":274.498,"worker_busy_pct":{"queue worker 0x0":99.935},"top_phases_ms_per_frame":{"Driver.Packet":2085.153,"Driver.Packet.draw":2021.594,"Driver.Draw":2021.203,"Driver.Draw.draw_and_resource_release":1065.119,"Graphics.Draw":1040.327,"Graphics.Draw.draw_and_resource_release":1032.766,"Driver.Draw.shader_compile_and_link":940.006,"Resources.Complete":934.589},"trace_dropped":false,"trace":"aps5-trace-462334bc769d-20744.json.gz"}tools/check_conventions.pypasses.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)aps5-trace-58d69707d7c1-30700.json.gz
aps5-trace-462334bc769d-20744.json.gz
table-stamp-build-settings.txt
table-stamp-change-05584f417d-ctest.log
table-stamp-main-1c8c0efc8c-control-ctest.log
🤖 Generated with Claude Code