Repository navigation
Conversation
…der 5% Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thank you for your contribution! Authors with no pull requests merged into |
|
Need me to update this branch? @oneandonlydean |
|
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.
|
|
Thanks for the measurements and the opt-out switch. Before this can merge it needs a rebase and a fresh measurement, because the draw cache it works around has changed a lot since this branch was cut (it is about 2,600 commits behind Why the current numbers no longer carry over. Since your base,
What the rebase needs to account for. Minor: the window counters ( Measurements we need on the rebased head:
With those, this is a straightforward review. |
|
@oneandonlydean Closing: main has since landed the draw-cache admission and reuse changes listed above, which target the same low hit rate, and on the earlier stack (#494, #1193, #1202) this bypass was already neutral (~-3%, within noise). Thanks for the review. |
|
This pull request is labeled |
|
@bcortezf, thank you for this bypass. I've ported it to current On Resident Evil Village (PPSA01556)'s static main menu (RTX 3070 Laptop GPU, GPU clocks not held, the draw-cache byte budget off in both arms, B A A B), it kept private bytes about 3.8 GB lower at menu +15 min (19.3 to 19.5 GB against 23.2 GB), and the menu ran at 0.47 to 0.48 fps against 0.35 to 0.41 without it, over menu +5 to +15 min. The numbers and summary lines are in #12478. Before it leaves draft, a further commit will count stage hits into the window and pack the window counters into one CAS, as suggested in the review here, and a pair with |
What
The draw cache (
APS5_DRAW_CACHE_ENTRIES, 4096 entries) misses on almost every draw in scenes whose user-data words change every frame: in Red Dead Redemption gameplay it hits 0 to 6% of 120k to 130k lookups per 10 s and spends the time inserting and evicting entries (131k inserts and 300k to 730k evictions per 10 s).Count the lookups in windows of 2,048. When fewer than 5% of a window hit, draws skip the cache (no register key, no lookup, no insert, the same path as
APS5_NO_DRAW_SRT_ENTRIES) for the next 16,384 draws, then the cache is probed again. Scenes that hit (menus and cutscenes, 98 to 100%) are not bypassed.APS5_NO_DRAW_CACHE_BYPASS=1restores the previous behaviour, and[draw-cache] bypassed N drawsis printed withAPS5_PROFILE_DRAW.Related: #5345 (report), #5364 (miss breakdown; independent, may need a rebase in
Draw.cpp).Tested
Windows 11, RTX 4070 SUPER (driver 616.64), Ryzen 7 7800X3D, 3840x2160. PPSA30528, Armadillo after the intro,
APS5_TRACE_SECONDS=100:5, caches warm, same session. The base isAPS5_NO_DRAW_CACHE_BYPASS=1on the same binary.Two earlier rounds on the same machine: 2.63 / 2.61 FPS off, 2.80 / 2.83 FPS on. The queue worker stays at 98.8% busy; the gain is per-draw cost, not a different bottleneck.
trace_droppedis true in these captures (the worker buffer fills within 5 s).Summary lines (off, then on):
{"commit": "981acf21ed70", "dirty": true, "env": {"APS5_NO_DRAW_CACHE_BYPASS": "1", "APS5_PAD_INPUT_FILE": "<path>", "APS5_TRACE_SECONDS": "100:5"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 616.64", "os": "Windows 10.0.26200", "resolution": "3840x2160", "window": {"spec": "seconds 100:5", "first_present": 1791, "ms": 5097.913}, "presents": 13, "frame_ms": {"p50": 392.154, "p90": 406.612, "p99": 413.368, "max": 413.368}, "gpu_busy_ms_per_present": 133.99, "worker_busy_pct": {"queue worker 0x0": 98.886}, "top_phases_ms_per_frame": {"Driver.Packet": 387.509, "Driver.Packet.draw": 360.408, "Driver.Draw": 358.815, "Driver.Draw.draw_and_resource_release": 181.247, "Graphics.Draw": 179.59, "Graphics.Draw.draw_and_resource_release": 154.663, "Driver.Draw.shader_compile_and_link": 126.894, "Shader.DrawStage": 95.646}, "trace_dropped": true, "trace": "aps5-trace-981acf21ed70-20260.json.gz"} {"commit": "981acf21ed70", "dirty": true, "env": {"APS5_PAD_INPUT_FILE": "<path>", "APS5_TRACE_SECONDS": "100:5"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 616.64", "os": "Windows 10.0.26200", "resolution": "3840x2160", "window": {"spec": "seconds 100:5", "first_present": 1673, "ms": 5053.279}, "presents": 14, "frame_ms": {"p50": 362.483, "p90": 371.102, "p99": 373.611, "max": 373.611}, "gpu_busy_ms_per_present": 145.365, "worker_busy_pct": {"queue worker 0x0": 98.813}, "top_phases_ms_per_frame": {"Driver.Packet": 356.413, "Driver.Packet.draw": 329.475, "Driver.Draw": 327.91, "Driver.Draw.draw_and_resource_release": 174.267, "Graphics.Draw": 172.722, "Graphics.Draw.draw_and_resource_release": 148.854, "Driver.Draw.shader_compile_and_link": 106.221, "Shader.DrawStage": 91.167}, "trace_dropped": true, "trace": "aps5-trace-981acf21ed70-6036.json.gz"}python3 tools/check_conventions.py --base origin/main: passed. Not built or run on Linux or macOS.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository