Repository navigation
Conversation
…IPELINE-CACHE) A driver keys its pipeline cache on the device's enabled extensions and features. vk_pipeline_check enables a different set from the runtime (17 device extensions the runtime has and it doesn't), so the pipelines stage's pipeline_cache.bin, though accepted by its header, misses for the runtime's pipelines. Measured on an RTX 3070 (driver 32.0.16.1692) with the retail 1.0.2.1 BVH builder: the checker's own re-run of its largest program hits in 0.01 s, while the runtime with that seed loaded still compiles it cold in about 28 s. The title compiles it on its graphics-init thread, and its own watchdog ends the process after about 26 s. - DeviceState::save_pipeline_cache writes the device's vkGetPipelineCacheData through a temporary file; rt::d3d12::save_pipeline_cache exposes it for a device from create_vulkan_device*. - pso_warmup (runtime/test/pso_warmup.cpp) builds a folder of compute programs through create_vulkan_device_standalone and writes that device's cache. For the BVH builder's 52 programs: 63 s cold, 5.7 s with the result seeded. - LEONIDA_PIPELINE_CACHE_OUT=<file> saves after every compute compile of 250 ms or more, so a run that ends without a teardown keeps what it compiled. - A compute compile of 1 s or more is logged with the shader's name. - docs/d3d12_vulkan.md: the checker's device differs, with the measurement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Read the whole diff and tested The cause in the docs doesn't reproduce here.
So on this driver the checker's device gives the runtime the same key, at least for that empty shader with no bindings, and the exe name isn't part of it. That is after the changes
The same section measured that on an RX 9070 XT the executable's file name is part of the key. There a cache from In the code:
What works here: AI-assisted (Claude Code, Claude Opus 5.5). |
|
Independent retail check of Every run below got its own empty NVIDIA shader disk cache ( Q2, the 52 programs' layout: all 52 The checker's cold compile ( The runtime's device (
So on this driver the checker's cache does hit for the runtime's pipelines: Q1: The 2.5 s left in B, C and D is not a miss. In every seeded run
It is the first file It also matters for the boot, a little: in the title, the first pipeline creation is on the graphics-init thread the watchdog watches, so those ~2.5 s are paid inside the same ~26 s budget as the BVH compiles. Loading the library when the device is created would move them out of it. Not measured in the title itself. What this means for the PR: the "the checker's device does not match" cause does not reproduce on this driver with the current checker, which already enables Measured with Claude Code. |
|
OreoFR's first-use index measurement led PortBridge to try retaining one top-level JSON entry at a time. This changes the main shader-catalog load and keeps the existing optional-index paths. Work is recorded in #14. On a 29,187-entry source-generated catalog (57.4 MB), median The standalone patch, generator, test and raw timings use only public source and synthetic metadata. This measures the loader you identified inside the first pipeline, without making a title-startup timing claim. The two touched source files also matched the latest main at verification. AI assistance: OpenAI Codex (GPT-6 family) assisted with the implementation, verification and measurements. |
|
One substantial follow-up to the main index result above. PortBridge kept the one-entry parser and replaced its complete input string with a 16 KiB cursor. It reuses the same JSON grammar, keeps optional indexing on the existing path, and incorporates the late read-error check motivated by sodove's #1218. On a generated 57,357,214-byte index of 29,187 rows, the exact stock / bounded reads / bounded plus an optional short-decimal conversion measured 802.8 / 470.4 / 442.5 ms. Peak process commit was 459.2 / 34.6 / 34.7 MB. We used all six process orders and checked every row. The independent reproduction was in the same range. Rollback after malformed input and a Windows-locked byte passed, and all 111,211 numeric controls agreed. The three source headers used by the probe are unchanged on main Separate patches, source-only reproduction and raw data. These are loader measurements for synthetic inputs on Windows. The bounded input patch can be reviewed on its own; the decimal conversion is a separate follow-on. |
Item: RT-RUNTIME-PIPELINE-CACHE (claimed in #14). Complements #218, which persists the cache at device teardown.
Why
The
pipelinesstage'spipeline_cache.binpasses the runtime's header check, but it misses for the runtime'spipelines. A driver keys its cache on the device's enabled extensions and features, and
vk_pipeline_checkcreates a different device. The runtime enables 17 extensions the checker doesn't (mesh shader,
maintenance5/8, shader FMA and clock, fragment barycentrics and interlock among them), and the two build their
feature lists differently: the checker sets every core feature through
Features2and the 1.1/1.2/1.3 structs,the runtime a subset through per-extension structs. I diffed both
VkDeviceCreateInfos with a local dump.Measured on an RTX 3070, driver 32.0.16.1692, with the retail 1.0.2.1 BVH builder's 52 compute programs:
LoadInstances)vk_pipeline_check, coldvk_pipeline_check, re-run on its own cachepso_warmup(runtime device), coldpso_warmup, re-run on its own cacheThis matters for booting. The title creates the BVH builder's pipelines on its graphics-init thread, and its own
watchdog ends the process after about 26 s, so the cold 28 s compile kills every launch the same way, with nothing
in the log. With a
pso_warmupcache besidegta6rt.exe, the #432 stack on native Windows gets past graphics initand into its frame loop (details in #14).
Change
DeviceState::save_pipeline_cache(path):vkGetPipelineCacheDatawritten through a temporary file and renamed.rt::d3d12::save_pipeline_cache(ID3D12Device*, path)exposes it for a device fromcreate_vulkan_device*.vkGetPipelineCacheDatais added to the backend's function table.pso_warmup <dir of .dxbc compute programs> <out file>(runtime/test/pso_warmup.cpp, built with the otherWindows tools): builds every program through
CreateComputePipelineStateoncreate_vulkan_device_standalone,then writes that device's cache. It needs
LEONIDA_SHADERSand the user's carved programs; nothing of the game isin the source.
LEONIDA_PIPELINE_CACHE_OUT=<file>: the runtime saves after every compute compile of 250 ms or more, so a runthat ends without a teardown (a watchdog, a crash) keeps what it compiled.
docs/d3d12_vulkan.mdsection 4: replaces the sentence implying the checker's cache serves the runtime with themeasurement and both new paths.
Not in this PR: wiring
pso_warmupintomake_game.py'spipelinesstage, and the graphics PSO path. Both arefollow-ups once this shape is agreed.
Tested
gta6rtandpso_warmupbuild without new warnings.tests/test_docs_env_vars.pyandtests/test_text_write_line_endings.pypass.check_no_game_data.pyon every changed file passes.AI-assisted (Claude Code).
🤖 Generated with Claude Code