Repository navigation
perf(agc): demand-driven texture cache budgets behind a switch - #22580
oneandonlydean merged 3 commits into
Conversation
…DGET_DEMAND The sampled texture budget reserves what the storage image cache holds plus 256 MiB instead of a quarter of the heap, the storage image budget counts at most 2 GiB of sampled textures against itself, and both keep a sixteenth of the heap budget free. Default off.
|
This pull request is labeled |
|
Found a feature-on fixture failure on Linux/RADV while preparing the requested lower-VRAM title comparison. On PR head
Support commit
Each 26-case arm has 23 Vulkan cases and three CPU cases (PM4 protocol, device selection and the Graphics formula/mock fixture). Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT 8 GB / RADV Mesa 26.2.7, Khronos layer 1.4.363; required Vulkan and disabled shader caches. Loader/device evidence is checked for every Vulkan case. Zero skips, VUIDs or validation errors. The memory tests use deterministic mocked heap-budget queries while allocating actual Vulkan textures; these are correctness results, not physical-VRAM performance measurements. All frozen SDK/fixture hashes and kernel restoration checks pass. The fixture was rebuilt separately, without another SDK rebuild. Conventions pass against the parent and Fetchable integration and support commit. Build/test logs, JUnit, actual CMake registrations, loader bindings, manifests, patch and production-equivalence proof, SHA-256 No feature-on title performance or gameplay gain is established yet. The pirate-island pilot with the separate #12575 integration reached its arrival sequence at severe cache pressure, so I am working on reaching a repeatable scene before supplying a performance comparison. AI-assisted: yes. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
@JJenkx you are right, the On the title comparison: |
|
Actual 8 GB title measurements, in A–B–A order, after the fixture coverage refresh above. These are exploratory results with the observed headroom and camera differences retained. ASTRO BOT PPSA21564 01.018.000,
Allocation-pressure result: B1 logs device-local allocations falling back to host memory as the heap reaches its reported budget. The last such report says eight allocations / 27 MiB, a lower bound because this logger prints the first five and then powers of two. Neither control has a Both main controls remain slow, while the enabled arm has lower measured frame times and less resource preparation per present. A2 starts with more reported heap budget than B1, so the first pair's result cannot simply be explained by the enabled run starting with more available budget. During B1 the reported budget grows further; these recordings do not distinguish policy/residency feedback from outside GPU memory use. The enabled late image also shows more sky/horizon than the two controls. I therefore do not infer a reliable percentage gain or a general 8 GB recommendation from this series. All three arms and captures are supplied, including the first lower-headroom control. No landing or gameplay qualification is claimed. Full three-arm traces, original native captures near/after the trace window, producer summaries, Producer summary lines, copied as recorded: A1 {"commit":"291a878fd221","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"0","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":705,"ms":79924.471},"presents":3,"frame_ms":{"p50":25835.978,"p90":29681.033,"p99":29681.033,"max":29681.033},"gpu_busy_ms_per_present":1686.110,"worker_busy_pct":{"queue worker 0x0":99.938,"queue worker 0x48":69.526,"queue worker 0x40":67.713,"queue worker 0x46":0.008},"phase_totals_ms":{"Driver.Completion":0.232,"Driver.Dispatch":7479.683,"Driver.Dispatch.capture_resources":9.020,"Driver.Dispatch.decode_key_device_setup":7332.872,"Driver.Dispatch.lookup_cache":9.084,"Driver.Dispatch.materialize":1.871,"Driver.Dispatch.prepared_invocation":0.987,"Driver.Draw":71275.661,"Driver.Draw.device_setup":45.014,"Driver.Draw.draw_enqueued":68895.355,"Driver.Draw.post_compile_prepare":7.710,"Driver.Draw.prepare":145.285,"Driver.Draw.shader_compile_and_link":868.258,"Driver.EndSubmission":16.014,"Driver.Packet":189553.293,"Driver.Packet.device_lock":2.983,"Driver.Packet.dispatch":7481.322,"Driver.Packet.draw":71291.283,"Driver.Packet.execute":90.107,"Driver.Packet.flip_flush":0.696,"Driver.Packet.flush_between_packets":30.451,"Driver.Packet.memory_wait":109482.794,"Driver.Packet.pipeline_drain":112.679,"Driver.Packet.pipeline_prepare":7.764,"Driver.Packet.prepare_memory":132.588,"Driver.Packet.rendering_wait":0.024,"Driver.Present":137.260,"Driver.Present.acquire_image":0.171,"Driver.Present.device_setup":0.003,"Driver.Present.gpu_mutex_wait":0.406,"Driver.Present.inflight_wait":0.009,"Driver.Present.present_display_buffer":1.020,"Driver.Present.queue_present":0.057,"Driver.Present.release_and_callback":0.009,"Driver.Present.render_fence_wait":135.544,"Driver.Present.resize":0.006,"Driver.Present.validate":0.001,"Driver.Suspend":0.001,"GpuMutex.wait.dispatch":38.299,"GpuMutex.wait.draw":30.731,"GpuMutex.wait.end":18.321,"GpuMutex.wait.fill":0.016,"GpuMutex.wait.flush":17.256,"GpuMutex.wait.hook":9.119,"GpuMutex.wait.indirect":0.078,"GpuMutex.wait.label":76.872,"GpuMutex.wait.other":6.539,"GpuMutex.wait.present":0.165,"GpuMutex.wait.wait":0.088,"Graphics.Draw":77260.056,"Graphics.Draw.draw_and_resource_release":58343.104,"Graphics.Draw.index_upload":158.306,"Graphics.Draw.validate":386.664,"Graphics.Draw.vertex_upload":89.035,"Graphics.DrawWithRecipe":397.635,"Graphics.DrawWithRecipe.draw_and_resource_release":363.339,"Graphics.DrawWithRecipe.index_upload":1.173,"Graphics.DrawWithRecipe.validate":14.328,"Graphics.DrawWithRecipe.vertex_upload":8.207,"Recorder.Reap":134.990,"Recorder.Submit":1046.964,"Recorder.WaitSerial":71.061,"Resources.Complete":69237.731,"Resources.Prepare":520.290,"Shader.DrawStage":743.555,"Shader.DrawStage.capture_resources":204.476,"Shader.DrawStage.materialize":498.079,"Shader.DrawStage.prepared_invocation":38.501,"Shader.ResolveAbi":0.714,"Shader.ResolveGraphicsAbi":0.205,"Shader.ResolveGraphicsStagesAbi":5.418,"VideoOut.Flip":110.693,"VideoOut.Flip.completion_mutex_wait":0.002,"VideoOut.Flip.config_mutex_wait":0.000,"VideoOut.Flip.frame_limit":0.005,"VideoOut.Flip.notify_game":0.272,"VideoOut.Flip.present":110.224,"VideoOut.Flip.validate":0.004,"VideoOut.Flip.vblank_wait":0.002,"VideoOut.Flip.window_prepare":0.007,"VideoOut.Flip.window_title":0.178,"VideoOut.Readiness":0.013,"VideoOut.Readiness.locks_validate":0.006,"Vulkan.Acquire":0.164,"Vulkan.Acquire.acquire_fence_wait":0.028,"Vulkan.Acquire.acquire_image":0.110,"Vulkan.Acquire.fence_reset":0.023,"Vulkan.Acquire.retired_swapchains":0.001,"Vulkan.Dispatch":50.802,"Vulkan.Dispatch.command_record":4.853,"Vulkan.Dispatch.shader_resources":45.477,"Vulkan.DispatchRecipe":3.806,"Vulkan.DispatchRecipe.command_record":3.772,"Vulkan.DrawFromRecipe":408.776,"Vulkan.GraphicsPipeline":3834.149,"Vulkan.GraphicsPipeline.create":3796.681,"Vulkan.GraphicsPipeline.modules_and_state":37.342,"Vulkan.GraphicsPipelineLibrary":3781.070,"Vulkan.GraphicsPipelineLink":3.365,"Vulkan.Present":0.801,"Vulkan.Present.command_record_scale":0.247,"Vulkan.Present.pixel_upload":0.008,"Vulkan.Present.queue_submit":0.543,"Vulkan.QueuePresent":0.051,"Vulkan.QueuePresent.queue_present":0.049,"Vulkan.Retire":135.541,"Vulkan.Retire.dump":98.966,"Vulkan.Retire.wait":36.462},"top_phases_ms_per_frame":{"Driver.Packet":63184.431,"Driver.Packet.memory_wait":36494.265,"Graphics.Draw":25753.352,"Driver.Packet.draw":23763.761,"Driver.Draw":23758.554,"Resources.Complete":23079.244,"Driver.Draw.draw_enqueued":22965.118,"Graphics.Draw.draw_and_resource_release":19447.701},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":96,"Graphics.Barrier.dcc-clear":36,"Graphics.Barrier.dcc-keys":36,"Graphics.Barrier.dispatch-lead":297,"Graphics.Barrier.dispatch-trail":589,"Graphics.Barrier.draw":5866,"Graphics.Barrier.fill":117,"Graphics.Barrier.fill-clear":46,"Graphics.Barrier.indirect-args":27,"Graphics.Barrier.label-run":16833,"Graphics.Barrier.present-blit":6,"Graphics.Barrier.shadow-publish":37,"Graphics.Barrier.staging-in":464,"Graphics.Barrier.staging-out":202,"Graphics.Barrier.storage-upload":606,"Graphics.Barrier.storage-writeback":604,"Graphics.BarrierMerged.dispatch-lead":346,"Graphics.BarrierMerged.fill":27,"Graphics.BarrierMerged.label-run":12,"Graphics.BarrierMerged.shadow-publish":25,"Graphics.BarrierMerged.staging-in":123,"Graphics.BarrierMerged.staging-out":202,"Graphics.BarrierMerged.storage-writeback":92,"Graphics.Copy":9573,"Graphics.Copy.bytes":41311410792,"Graphics.RenderPass":2802,"Graphics.RenderPass.Close.command":1915,"Graphics.RenderPass.Close.image":10,"Graphics.RenderPass.Close.key":7,"Graphics.RenderPass.Close.label":12,"Graphics.RenderPass.Close.new-batch":858,"Graphics.RenderPass.Continued":19278},"trace_dropped":false,"trace":"aps5-trace-291a878fd221-707833.json.gz"}B1 {"commit":"8214ef9c8483","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":657,"ms":60836.422},"presents":13,"frame_ms":{"p50":3258.992,"p90":6625.673,"p99":12071.185,"max":12071.185},"gpu_busy_ms_per_present":422.305,"worker_busy_pct":{"queue worker 0x0":99.737,"queue worker 0x48":95.083,"queue worker 0x40":94.476,"queue worker 0x46":0.027},"phase_totals_ms":{"Driver.Completion":0.786,"Driver.Dispatch":1048.211,"Driver.Dispatch.capture_resources":33.180,"Driver.Dispatch.decode_key_device_setup":688.591,"Driver.Dispatch.lookup_cache":8.017,"Driver.Dispatch.materialize":3.630,"Driver.Dispatch.prepared_invocation":3.099,"Driver.Draw":55794.492,"Driver.Draw.device_setup":204.263,"Driver.Draw.draw_enqueued":51936.979,"Driver.Draw.post_compile_prepare":37.965,"Driver.Draw.prepare":565.543,"Driver.Draw.shader_compile_and_link":2503.983,"Driver.EndSubmission":23.489,"Driver.Packet":175989.254,"Driver.Packet.device_lock":18.504,"Driver.Packet.dispatch":1052.110,"Driver.Packet.draw":55864.989,"Driver.Packet.execute":180.945,"Driver.Packet.flip_flush":1.958,"Driver.Packet.flush_between_packets":106.406,"Driver.Packet.memory_wait":114379.767,"Driver.Packet.pipeline_drain":109.540,"Driver.Packet.pipeline_prepare":35.115,"Driver.Packet.prepare_memory":808.356,"Driver.Packet.rendering_wait":0.065,"Driver.Present":96.014,"Driver.Present.acquire_image":0.582,"Driver.Present.device_setup":0.010,"Driver.Present.gpu_mutex_wait":2.566,"Driver.Present.inflight_wait":0.031,"Driver.Present.present_display_buffer":4.205,"Driver.Present.queue_present":0.208,"Driver.Present.release_and_callback":0.020,"Driver.Present.render_fence_wait":88.302,"Driver.Present.resize":0.021,"Driver.Present.validate":0.004,"Driver.Suspend":0.004,"GpuMutex.wait.dispatch":136.980,"GpuMutex.wait.draw":111.373,"GpuMutex.wait.end":13.846,"GpuMutex.wait.fill":0.158,"GpuMutex.wait.flush":28.144,"GpuMutex.wait.hook":23.837,"GpuMutex.wait.indirect":5.322,"GpuMutex.wait.label":141.920,"GpuMutex.wait.other":2.054,"GpuMutex.wait.present":2.511,"GpuMutex.wait.wait":2.972,"Graphics.Draw":50806.907,"Graphics.Draw.draw_and_resource_release":39375.167,"Graphics.Draw.index_upload":379.327,"Graphics.Draw.validate":837.941,"Graphics.Draw.vertex_upload":260.738,"Graphics.DrawWithRecipe":2342.134,"Graphics.DrawWithRecipe.draw_and_resource_release":2161.797,"Graphics.DrawWithRecipe.index_upload":9.222,"Graphics.DrawWithRecipe.validate":76.419,"Graphics.DrawWithRecipe.vertex_upload":38.805,"Recorder.Reap":638.937,"Recorder.Submit":3348.084,"Recorder.WaitSerial":625.338,"Resources.Complete":33824.884,"Resources.Prepare":445.262,"Shader.DrawStage":1973.708,"Shader.DrawStage.capture_resources":855.008,"Shader.DrawStage.materialize":980.862,"Shader.DrawStage.prepared_invocation":127.892,"Shader.ResolveAbi":2.843,"Shader.ResolveGraphicsAbi":0.921,"Shader.ResolveGraphicsStagesAbi":23.375,"VideoOut.Flip":91.802,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.010,"VideoOut.Flip.notify_game":0.517,"VideoOut.Flip.present":90.600,"VideoOut.Flip.validate":0.025,"VideoOut.Flip.vblank_wait":0.010,"VideoOut.Flip.window_prepare":0.024,"VideoOut.Flip.window_title":0.597,"VideoOut.Readiness":0.029,"VideoOut.Readiness.locks_validate":0.019,"Vulkan.Acquire":0.538,"Vulkan.Acquire.acquire_fence_wait":0.022,"Vulkan.Acquire.acquire_image":0.421,"Vulkan.Acquire.fence_reset":0.087,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.Dispatch":79.687,"Vulkan.Dispatch.command_record":15.682,"Vulkan.Dispatch.shader_resources":62.970,"Vulkan.DispatchRecipe":8.251,"Vulkan.DispatchRecipe.command_record":7.760,"Vulkan.DrawFromRecipe":2407.880,"Vulkan.GraphicsPipeline":8743.895,"Vulkan.GraphicsPipeline.create":8710.622,"Vulkan.GraphicsPipeline.modules_and_state":33.040,"Vulkan.GraphicsPipelineLibrary":8691.497,"Vulkan.GraphicsPipelineLink":4.284,"Vulkan.Present":3.588,"Vulkan.Present.command_record_scale":0.491,"Vulkan.Present.pixel_upload":0.186,"Vulkan.Present.queue_submit":2.895,"Vulkan.QueuePresent":0.189,"Vulkan.QueuePresent.queue_present":0.177,"Vulkan.Retire":88.293,"Vulkan.Retire.dump":10.820,"Vulkan.Retire.wait":77.135},"top_phases_ms_per_frame":{"Driver.Packet":13537.635,"Driver.Packet.memory_wait":8798.444,"Driver.Packet.draw":4297.307,"Driver.Draw":4291.884,"Driver.Draw.draw_enqueued":3995.152,"Graphics.Draw":3908.224,"Graphics.Draw.draw_and_resource_release":3028.859,"Resources.Complete":2601.914},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":201,"Graphics.Barrier.dcc-clear":156,"Graphics.Barrier.dcc-keys":156,"Graphics.Barrier.dispatch-lead":1222,"Graphics.Barrier.dispatch-trail":2561,"Graphics.Barrier.draw":19539,"Graphics.Barrier.fill":527,"Graphics.Barrier.fill-clear":252,"Graphics.Barrier.indirect-args":117,"Graphics.Barrier.label-run":134193,"Graphics.Barrier.present-blit":26,"Graphics.Barrier.shadow-publish":119,"Graphics.Barrier.staging-in":1010,"Graphics.Barrier.staging-out":787,"Graphics.Barrier.storage-upload":911,"Graphics.Barrier.storage-writeback":2324,"Graphics.BarrierMerged.dispatch-lead":1573,"Graphics.BarrierMerged.fill":105,"Graphics.BarrierMerged.label-run":103,"Graphics.BarrierMerged.shadow-publish":67,"Graphics.BarrierMerged.staging-in":564,"Graphics.BarrierMerged.staging-out":787,"Graphics.BarrierMerged.storage-writeback":363,"Graphics.Copy":10158,"Graphics.Copy.bytes":26480696300,"Graphics.RenderPass":8957,"Graphics.RenderPass.Close.command":2414,"Graphics.RenderPass.Close.image":82,"Graphics.RenderPass.Close.key":48,"Graphics.RenderPass.Close.label":103,"Graphics.RenderPass.Close.new-batch":4976,"Graphics.RenderPass.Close.raw":1334,"Graphics.RenderPass.Continued":157363},"trace_dropped":false,"trace":"aps5-trace-8214ef9c8483-748529.json.gz"}A2 {"commit":"291a878fd221","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"0","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":616,"ms":74651.794},"presents":3,"frame_ms":{"p50":24333.323,"p90":28293.892,"p99":28293.892,"max":28293.892},"gpu_busy_ms_per_present":1625.556,"worker_busy_pct":{"queue worker 0x0":99.963,"queue worker 0x40":68.932,"queue worker 0x48":62.110,"queue worker 0x46":0.006},"phase_totals_ms":{"Driver.Completion":0.296,"Driver.Dispatch":2854.073,"Driver.Dispatch.capture_resources":13.525,"Driver.Dispatch.decode_key_device_setup":2757.774,"Driver.Dispatch.lookup_cache":7.132,"Driver.Dispatch.materialize":1.216,"Driver.Dispatch.prepared_invocation":0.712,"Driver.Draw":71032.891,"Driver.Draw.device_setup":38.603,"Driver.Draw.draw_enqueued":70223.704,"Driver.Draw.post_compile_prepare":6.527,"Driver.Draw.prepare":111.598,"Driver.Draw.shader_compile_and_link":520.854,"Driver.EndSubmission":10.771,"Driver.Packet":172443.015,"Driver.Packet.device_lock":2.523,"Driver.Packet.dispatch":2855.348,"Driver.Packet.draw":71046.760,"Driver.Packet.execute":128.660,"Driver.Packet.flip_flush":0.481,"Driver.Packet.flush_between_packets":21.514,"Driver.Packet.memory_wait":97647.690,"Driver.Packet.pipeline_drain":19.364,"Driver.Packet.pipeline_prepare":6.866,"Driver.Packet.prepare_memory":125.324,"Driver.Packet.rendering_wait":0.023,"Driver.Present":70.288,"Driver.Present.acquire_image":0.159,"Driver.Present.device_setup":0.002,"Driver.Present.gpu_mutex_wait":0.205,"Driver.Present.inflight_wait":0.008,"Driver.Present.present_display_buffer":1.181,"Driver.Present.queue_present":0.091,"Driver.Present.release_and_callback":0.025,"Driver.Present.render_fence_wait":68.564,"Driver.Present.resize":0.006,"Driver.Present.validate":0.001,"Driver.Suspend":0.000,"GpuMutex.wait.dispatch":26.767,"GpuMutex.wait.draw":25.619,"GpuMutex.wait.end":5.579,"GpuMutex.wait.fill":0.007,"GpuMutex.wait.flush":13.660,"GpuMutex.wait.hook":5.356,"GpuMutex.wait.indirect":2.273,"GpuMutex.wait.label":20.251,"GpuMutex.wait.other":5.085,"GpuMutex.wait.present":0.168,"GpuMutex.wait.wait":0.191,"Graphics.Draw":73438.866,"Graphics.Draw.draw_and_resource_release":65096.712,"Graphics.Draw.index_upload":93.100,"Graphics.Draw.validate":179.329,"Graphics.Draw.vertex_upload":63.192,"Graphics.DrawWithRecipe":147.075,"Graphics.DrawWithRecipe.draw_and_resource_release":134.264,"Graphics.DrawWithRecipe.index_upload":0.502,"Graphics.DrawWithRecipe.validate":5.376,"Graphics.DrawWithRecipe.vertex_upload":3.118,"Recorder.Reap":74.775,"Recorder.Submit":471.970,"Recorder.WaitSerial":111.671,"Resources.Complete":68988.076,"Resources.Prepare":350.725,"Shader.DrawStage":414.320,"Shader.DrawStage.capture_resources":204.312,"Shader.DrawStage.materialize":169.806,"Shader.DrawStage.prepared_invocation":37.825,"Shader.ResolveAbi":0.736,"Shader.ResolveGraphicsAbi":0.240,"Shader.ResolveGraphicsStagesAbi":7.315,"VideoOut.Flip":57.390,"VideoOut.Flip.completion_mutex_wait":0.002,"VideoOut.Flip.config_mutex_wait":0.000,"VideoOut.Flip.frame_limit":0.002,"VideoOut.Flip.notify_game":0.020,"VideoOut.Flip.present":57.278,"VideoOut.Flip.validate":0.004,"VideoOut.Flip.vblank_wait":0.003,"VideoOut.Flip.window_prepare":0.006,"VideoOut.Flip.window_title":0.079,"VideoOut.Readiness":0.006,"VideoOut.Readiness.locks_validate":0.004,"Vulkan.Acquire":0.151,"Vulkan.Acquire.acquire_fence_wait":0.006,"Vulkan.Acquire.acquire_image":0.114,"Vulkan.Acquire.fence_reset":0.029,"Vulkan.Acquire.retired_swapchains":0.001,"Vulkan.Dispatch":17.883,"Vulkan.Dispatch.command_record":3.573,"Vulkan.Dispatch.shader_resources":14.073,"Vulkan.DispatchRecipe":4.993,"Vulkan.DispatchRecipe.command_record":4.951,"Vulkan.DrawFromRecipe":152.308,"Vulkan.GraphicsPipeline":994.373,"Vulkan.GraphicsPipeline.create":970.542,"Vulkan.GraphicsPipeline.modules_and_state":23.801,"Vulkan.GraphicsPipelineLibrary":963.779,"Vulkan.GraphicsPipelineLink":1.483,"Vulkan.Present":0.980,"Vulkan.Present.command_record_scale":0.261,"Vulkan.Present.pixel_upload":0.296,"Vulkan.Present.queue_submit":0.422,"Vulkan.QueuePresent":0.056,"Vulkan.QueuePresent.queue_present":0.045,"Vulkan.Retire":68.558,"Vulkan.Retire.dump":10.321,"Vulkan.Retire.wait":58.161},"top_phases_ms_per_frame":{"Driver.Packet":57481.005,"Driver.Packet.memory_wait":32549.230,"Graphics.Draw":24479.622,"Driver.Packet.draw":23682.253,"Driver.Draw":23677.630,"Driver.Draw.draw_enqueued":23407.901,"Resources.Complete":22996.025,"Graphics.Draw.draw_and_resource_release":21698.904},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":138,"Graphics.Barrier.dcc-clear":36,"Graphics.Barrier.dcc-keys":36,"Graphics.Barrier.dispatch-lead":269,"Graphics.Barrier.dispatch-trail":576,"Graphics.Barrier.draw":6737,"Graphics.Barrier.fill":108,"Graphics.Barrier.fill-clear":60,"Graphics.Barrier.indirect-args":27,"Graphics.Barrier.label-run":11159,"Graphics.Barrier.present-blit":6,"Graphics.Barrier.shadow-publish":27,"Graphics.Barrier.staging-in":1310,"Graphics.Barrier.staging-out":423,"Graphics.Barrier.storage-upload":168,"Graphics.Barrier.storage-writeback":537,"Graphics.BarrierMerged.dispatch-lead":361,"Graphics.BarrierMerged.fill":24,"Graphics.BarrierMerged.label-run":5,"Graphics.BarrierMerged.shadow-publish":15,"Graphics.BarrierMerged.staging-in":196,"Graphics.BarrierMerged.staging-out":423,"Graphics.BarrierMerged.storage-writeback":86,"Graphics.Copy":13412,"Graphics.Copy.bytes":54079801020,"Graphics.RenderPass":3222,"Graphics.RenderPass.Close.command":2718,"Graphics.RenderPass.Close.image":15,"Graphics.RenderPass.Close.key":10,"Graphics.RenderPass.Close.label":5,"Graphics.RenderPass.Close.new-batch":462,"Graphics.RenderPass.Close.raw":12,"Graphics.RenderPass.Continued":15823},"trace_dropped":false,"trace":"aps5-trace-291a878fd221-786458.json.gz"}AI-assisted: yes. |
|
Four Ghost of Tsushima (PPSA02225) runs with the switch off and on, on a 12 GiB card, which the Tested section says is untested. Setup:
What this shows:
AI-assisted: yes (Claude Code). The runs are from this machine. Fixed scene, as asked (11-18). Same build (
|
|
@milescoviello yes, a fixed scene without input would be useful, and the allocation lines are the part I most want. The open question on this switch is the thinner headroom: on an 8 GiB card it placed device-local allocations in host memory, and your 12 GiB card with a budget at 10.3 of about 11 GiB is where that would show next. What I would read from each arm:
Two runs per arm in the same off, on, off, on order is enough. If the switch arm shows host placements and the off arm does not, I will add a floor on the free headroom before anyone considers it as a default. |
|
@oneandonlydean thanks, that's clear. The fixed-scene runs are queued on the same build (
I'll add them to my results comment above when the four runs finish. AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed change is an opt-in texture cache budget experiment; no verified blocking defect was found, but the claimed runtime benefit remains unverified on a card where the switch changes the budget.
What I ran
No build or tests were run. I inspected the prepared diff and targeted source at head 34bcf276a78204cd9bb4fe51a92b0c9a1326aacc using repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Budget formulas and call sites inspected |
| Build and tests | not run | No execution environment used |
| Changed-file coverage | not run | Two changed files were only partially read |
Findings
Blocking
None.
Non-blocking
- The demand-mode formula is covered by explicit fixture assertions, but the description says the actual switch was not tested on hardware where it changes the outcome. A run on a 16 GiB card, or another setup where the default budget is too small and demand mode allows the level to fit, would confirm the intended effect.
Not verified
- I read the prepared diff,
ShaderResources.hpp, targeted ranges ofShaderResources.cpp,Graphics.cpp,SampledCacheBudget.cpp, the CMake test registration, and the environment documentation.ShaderResources.cppandGraphics.cppwere not read in full; other source outside the targeted ranges was not inspected. - The prepared review bundle did not provide
files.json; the changed-file list was checked with the review-folder listing. The manifest lists five changed files as included and two excluded as too large; I read targeted ranges of both excluded files through the reader. - No build, automated tests, Windows checks, or physical-console/hardware run was performed. The performance measurements and Linux test results in the PR description are author-reported, not independently verified.
To get this to a good state
Nothing is required. Optional: report the described demand-mode comparison on hardware where the setting changes the budget, including allocation failures and the sampled budget/cache metrics.
|
@oneandonlydean the fixed-scene runs are in my results comment. In short:
The scene didn't settle the same way each run, so the presents don't compare between arms. AI-assisted: yes (Claude Code) |
|
@milescoviello that answers what I asked. My reading of the placement column:
What the table cannot tell me yet is whether the cache gave back less with the switch on. Before a texture goes to host memory the driver asks the texture caches to release, and prints one stderr line each time:
Could you paste those lines from runs 3 and 4, next to the |
|
@oneandonlydean here are the release lines, in log order, from the same two runs. Run 4 (switch on): every 3265 MiB texture request first released only 194 to 808 MiB. There was no Run 3 (switch off):
So with the switch off, the busy-skip case shows up in this title, and with it on, the releases fall short without it. The linesRun 3 (switch off): Run 4 (switch on): AI-assisted: yes (Claude Code). The runs are from this machine. |
|
@milescoviello these lines settle the first half. The release was not skipped in run 4: it ran, freed what only the cache still held (138 to 300 entries, 194 to 808 MiB), and the 3265 MiB texture still did not fit in a heap at 8.0 to 8.6 GiB. Both runs also show the first 3265 MiB request fitting after a release of about 1.1 GiB, so the two arms behave alike until the later requests, which run 3 never reached. What they do not show is how much the sampled cache held when the release fell short. The release only frees entries nothing else references. If the cache held several GiB at that moment and gave back 200 MiB, the larger budget is keeping referenced textures around and the switch needs a rule for that. If it held about what it released, the scene itself has 8 GiB live and the switch is not the cause. One switch-on run with
and the lines I need are the ones just before each |
|
@oneandonlydean the run your Not tested section asks for, on a 12 GiB card. Setup
Results
Radeon 780M (RADV, Mesa 26.0.8, shared memory, Linux 7.0) The same head and scene, one warm-up, then A B A B, about 300 s after the level starts. Here the switch makes no lasting difference, and one B run lost the device.
One limitation on the 3080 Ti: each arm's second run wrote over the first run's log folder, so the budget, eviction and snapshot lines are from the second run of each arm. The present rates come from both runs' summaries. AI-assisted. |
|
@mrfelek that is the pair this PR was missing. On the 3080 Ti the default budget of about 3.2 GiB sits under the 5.8 GiB the level holds, and the switch moves frame p50 from about 9 s to about 410 ms with no failed allocation, the same level you reached with a forced 6144 MiB. On the 780M I read your lines the same way you do: the heap fills with 9.5 to 9.9 GiB of which under 1 GiB is sampled textures, so both arms end on the 2048 MiB floor and the switch has nothing to give. One device loss in two B runs, at a point where both arms had the same budget, does not tie it to the switch, but it is why I am not proposing a default change from this PR. Where this leaves it: the switch stays off by default here. Two things are open before I would propose it as the default: the large single allocations milescoviello saw on a 12 GiB card with a fuller heap (his profiled run above), and a rule for shared-memory heaps like the 780M's, where the higher starting budget only delays the same slide. |
|
@oneandonlydean understood. The profiled run is queued: switch on, AI-assisted: yes (Claude Code) |
|
A data point from a 6 GiB card, where the switch changes the storage image side rather than the sampled side, and one stop that I only see with the switch on. Setup
So by default the storage image budget sits on its 512 MiB floor while the dialogs need about 0.9 GiB of storage images, and the cache evicts and uploads again about 8.5 GiB per 10 s. With the switch the budget is about 1 GiB, the evictions are gone and the heap stays under its budget. The frame rate gain is small (17 to 21 presents per 10 s) because about 200 ms of GPU time per present remain either way; in the run without evictions the The stop. Two of four runs with the switch on ended with after 274 s and after 233 s (the second with program Not covered: other titles, other GPUs, Linux. The table is one run per column. AI-assisted (Claude Code). |
|
@DerKarussellbremser your 29 Nov result here is now the open question on #28766, which makes Could you repeat it on current If the stop shows again only with the switch, the default does not go in as it is. |
What
An experiment for the texture thrash reported in #17533 and #12575, behind
APS5_TEXTURE_BUDGET_DEMAND=1. Without the variable nothing changes.Background: the automatic sampled texture budget is the heap budget minus the other device memory in use, minus a reservation for the storage image cache, minus an eighth of the heap budget. The reservation is the larger of a quarter of the heap and what the storage image cache holds. On a 12 GiB card in the pirate island level of PPSA21564 that is 10105 - 2769 - 3072 - 1263 = 3001 MiB for a level that holds about 5.9 GiB of sampled textures, while the storage image cache holds 1282 MiB of its 3072 MiB reservation. The storage image budget in turn subtracts everything the sampled cache holds, so it shrinks under what it holds once the sampled cache is allowed to grow.
With the switch:
On the numbers above the sampled budget becomes about 5170 MiB instead of 3001 MiB.
APS5_TEXTURE_CACHE_MIBstill overrides both.Tested
Linux, built on
b9e3cbbc0c.agc_driver_graphicspasses with new assertions insampledTextureBudgetTestsfor a 12 GiB heap: the default and the switch arm of both formulas, the sampled budget staying put when the cache fills it, the sampled budget yielding to storage images that grow, and both floors. The sampled and storage cache budget tests pass.What the budget is worth, measured on
mainb9e3cbbc0cwith forced budgets (RTX 4090, PPSA21564 pirate island, one perf window, profiled 300 s arms, medians of the last twelve 10 s windows, one arm each):APS5_TEXTURE_CACHE_MIB=3072APS5_TEXTURE_CACHE_MIB=4608APS5_TEXTURE_CACHE_MIB=5632So the cost falls steeply as the budget approaches what the level holds and is gone once it fits.
Not tested: the switch itself on a card where it changes the outcome. On my 24 GiB card the default budget already holds the level. On 12 GiB the switch still leaves the budget under what the level holds, so I expect less thrash there, not none; a 16 GiB card should move from the edge to a clear fit. The run that would settle it is the same scene with
APS5_PROFILE_DRAW=1, default againstAPS5_TEXTURE_BUDGET_DEMAND=1, reading the[gpu] sampled texture cache budgetline, the[textures] sampled createdline and the frame time, and watching for failed allocations.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository