d3d12: rewrite a missed journal file from an empty cache when the seeded one kept its data (RT-JOURNAL-SEEDED-REWRITE) #2179
Closed
leonida/mandy
Krashgamer wants to merge 0 commits from
fix/journal-seeded-miss into main
pull from: fix/journal-seeded-miss
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2179
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/journal-seeded-miss"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: RT-JOURNAL-SEEDED-REWRITE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7180979118)
What and why
The compute pipeline journal (#2098) rewrites a pipeline's file after a miss. When the file was loaded (the cache was seeded from it) and the pipeline still missed, the rewrite came from that seeded cache. On NVIDIA that cache came back exactly as loaded, without the pipeline just compiled, so the file never changed and the same pipelines missed and compiled in the driver on every boot, holding the compile gate while the title waited to submit.
Measured on an RTX 3080 10 GB, NVIDIA 610.88:
vk_pipeline_checkalone does not reproduce it: a cache seeded with another pipeline grows and gives a hit the next run. Where the stale files first came from is not determined.Change: after a seeded miss,
JournalCache::restart_empty()asks the cache for its data size. If it is still the loaded size, the cache is swapped for an empty one and the pipeline is created once more against it; that pipeline is kept and its cache is written. The second create took 15–78 ms (mean ~41 ms over 28), since the driver still has the pipeline. A seeded cache that did take the pipeline (a different size) is rewritten as before, so drivers without this behaviour are unchanged. One log line per rebuild:pipeline journal: <name> missed its journal file (N ms); built again against an empty cache in M ms.Tested
Boots of 180–300 s on Windows 11,
LEONIDA_COMPILE_HELPER=1 LEONIDA_ASYNC_PIPELINES=1 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_CONSOLE_FIX_US=0, on main 88479ff65 + #2138 + #1914 + #1886 with this change (the PR branch itself is this commit alone on current main; built with Ninja/MSVC,gta6rtlinks):Each boot repairs the stale files it reaches; the count goes down as the warm-up gets further.
Changes since the first version
c5bc7b0c5(from ecox982745's review): when the create against the empty cache fails, the first pipeline is kept and nothing is published, so the old file stays as it was.7a70814b6(from the reviews of zmasi, ecox982745 and timbot103):restart_empty()compares the cache's size with the payload Vulkan was given (info.initialDataSize, recorded increate()), not with the writable file's size. The two differ when the data came from the read-only seed folder (local file missing or invalid) and, with #2511, by its 24-byte stamp.file_.bytesstays for the disk budget.main8f41d7d01(conflict inbuild_compute_pipeline:main'shit_reportedand this PR'sjournal_retry_failedboth kept). The commits above had other IDs before the rebase (abbc1a4f8,4212cf5ab,49b8998de); the changes are the same.Test:
d3d12_compute_journal_seeded_miss(f230da518)d3d12_compute_journal_testgets a test-only layer between the runtime and the driver (--keep-seeded-cache-data): a pipeline cache made from initial data answersvkGetPipelineCacheDatawith exactly that data, as NVIDIA 610.88 did here. Other drivers grow the cache instead, so the layer makes the case reproducible on any GPU, the way merzleckeier's wrapper did. Pipelines, dispatches and readbacks stay the real driver's, and no production code changes for the test.--fail-cache-retryalso fails the create against the empty cache.scripts/check_compute_journal_seeded_miss.py(registered in CTest) runs each case in its own process and cache folder, with shader A's journal data under shader B's key:Red and green, Windows 11 (26200), RTX 3080 10 GB, NVIDIA 610.88, Ninja RelWithDebInfo:
mainad36782c6(c9777e386, before the rebase): all four cases pass, 5 runs in a row; also withLEONIDA_VK_VALIDATION=1(0 validation errors). The runtime logs the retry (built again against an empty cache ... (VkResult 0)).mainad36782c6with only the test applied:ERROR: stale-local: the journal file was rewritten with the data it was read from. Run by hand onmain, all four cases fail: B's local file ends with A's bytes in the three rewrite cases, and in failed-retry no retry happens and the file is rewritten.file_.bytes(as in the first two commits): stale-local passes, external-seed fails. So the test covers both fixes separately.Full suite (
ctest -j 6, 577 tests each),c9777e386againstmainad36782c6+ the test: no new failure.xbox_presentfails on both (as onmainin OreoFR's run);d3d12_compute_journal_seeded_missfails only onmain;d3d12_state_sweepanddxgi_waitable_latencyfailed once in the parallel run on the PR tree and pass 3 of 3 alone on both trees. After the rebase onto8f41d7d01(no commit sincead36782c6touches this PR's files)gta6rtbuilds, the three journal tests pass 3 runs in a row, and the seeded-miss script passes withLEONIDA_VK_VALIDATION=1.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 Pro 26200
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change; this PR only changes the runtime's pipeline journal)Related: HasiKe's finding in #1608 that the NVIDIA session cache keeps its loaded size across checkpoints may be the same driver behaviour for the shared cache; this PR does not touch that path.
🤖 Generated with Claude Code
If the optional second compilation fails, the dispatch still works, but this head replaces the existing journal entry with a 36-byte empty NVIDIA cache. I reproduced this in both directions with the two authored modules from
d3d12_compute_journal_test, onabbc1a4f8276c1dd84b5885ace81aa5e7e577592(RTX 4090, Windows 11, NVIDIA 616.64, Khronos validation on).VK_ERROR_OUT_OF_HOST_MEMORYFor the last two cases I changed the first post-build cache-size query to return the size loaded from disk. For the failure case only, the test shim also returned the error on the second pipeline create. All other driver calls and GPU readbacks were real. The unmodified driver grew the cache in this synthetic test.
The first create produced a valid pipeline, so
journal.finishgetsbuilt=trueeven when nothing was built into the replacement cache. The empty blob on this driver is larger than the 32-byte minimum. The change below keeps the usable pipeline and prevents publication on that path. With it, the old files kept their SHA-256 hashes in both failure cases, the successful retries still produced next-process hits, and all dispatches returned the expected(4,10)or(4,14).AI-assisted with OpenAI Codex (
gpt-6.2-astra).Tested patch against abbc1a4f8
Thanks, @ecox982745, that's a real hole. Your change is in 4212cf5ab: a failed create against the empty cache now keeps the first pipeline and publishes nothing, so the old file stays. Rebuilt
gta6rtandd3d12_compute_journal_teston the branch; the test passes on an RTX 3080 (NVIDIA 610.88, Windows 11). AI-assisted (Claude Code, Claude Opus 5.5).CI note: all six red jobs come from main, not from this change (it only touches
runtime/shims/d3d12_vulkan_device.cpp):vk_null_descriptor_test.cpp:97usesLEONIDA_TEST_NULL_DESCRIPTORS_SPVunguarded, butruntime/CMakeLists.txtonly defines it whenglslangValidatoris found. Main has the same code, and #2055 is open for it.cs_imgatomic_extfails (6 of 64 sint words), andvk_overlapping_occlusionnow passes but is still in the expected failures. Neither touches the journal path.test_bink_names,test_opus_tags,test_world_names,test_mod_pack_output_alias, ...). They are tracked in #1608 with open PRs.cs_dpp_cmp.asmcases fail with llvm-mc 21 ("dpp variant of this instruction is not supported"). Per #1608, main is green there since #1375 was merged.I'll rebase once main is green.
Independently verified head
4212cf5ab3b133375af0f7baa723c38ea5896b17merged cleanly ontoorigin/main(5825b02ff89bca1a2d1331d982818e3dbb74d597) on Windows 11 (10.0.26200), MSVC19.44.35207(RelWithDebInfo), NVIDIA GeForce RTX 3090 (driver595.79), withVK_LAYER_KHRONOS_validation1.4.363.1(LEONIDA_VK_VALIDATION=1). No game files used.Verification Results
#2179merged withorigin/main5825b02ff8,LEONIDA_VK_VALIDATION=1on RTX 3090):pipeline_cache_journal: Passed (0.11 s).compile_helper: Passed (0.65 s).d3d12_compute_journal: Passed (0.59 s,direct Dispatch(4,1,1) copied both expected words (4,10),0Khronos validation errors).d3d12_compute: Passed (1.13 s,0Khronos validation errors).scripts/check_no_game_data.py: Passed.cs-*.vkcacheslot with shader 1's journal file ind3d12_compute_journal_testwhile forcingrestart_empty()'s post-build size check to match NVIDIA's unchanged-size seeded miss:--second-shaderprocess loggedpipeline journal: counter missed its journal file (...); built again against an empty cache in ... ms (VkResult 0) to rewrite it, dispatched cleanly ((4,14)), and rewrote the journal file (0Khronos validation errors).--second-shaderprocess reported1 compute pipeline(s) found in their journal file (so far: 1 from journal files, 0 written, 0 from the shared cache)and dispatched(4,14)cleanly (0Khronos validation errors).journal_retry_failed(4212cf5ab) correctly suppressesjournal.finishpublication (!journal_retry_failed) while keeping the first usablebuiltVkPipelineif the optional empty-cachevkCreateComputePipelinesfails.Important Cross-PR Interaction Catch with Open PR
#2511(RT-PIPELINE-JOURNAL-BUILD-ID)git merge-tree --write-treebetween#2179(4212cf5ab3) and#2511(4a497c8f1b) auto-merges with0text conflicts, so Git will not flag an overlap — however,#2511's 24-byteLPJ1stamp will silently disable#2179'srestart_empty()100% of the time on stamped files:#2511(runtime/src/pipeline_cache_journal.h),read_entry_filerecordsentry.bytes = size(the on-disk file size, i.e.,stamp_bytes (24) + blob_size, whichJournalCache::publish()needs forreplace_bytes(total, file_.bytes, file.size())) and then strips the 24-byteLPJ1prefix fromentry.databeforeJournalCache::create()passesinfo.initialDataSize = file_.data.size()(file_.bytes - 24) tovkCreatePipelineCache.#2179,JournalCache::restart_empty()checks: When NVIDIA returns the seeded driver blob unchanged (size == file_.bytes - 24),size != file_.bytesevaluates totrue(blob_size != blob_size + 24), causingrestart_empty()to returnfalsewithout rebuilding against an empty cache!#2179lands before or after#2511): recordseeded_bytes_ = file_.data.size()inJournalCache::create()right beforevkCreatePipelineCache/ swappingfile_.data, and comparesize != seeded_bytes_inJournalCache::restart_empty()while leavingfile_.bytesuntouched forpublish()'s on-disk byte budget accounting.AI-assisted: yes
The retry also misses external seeds on this PR by itself. If the writable entry is missing,
file_.bytesis zero. If it contains seven invalid bytes,file_.bytesis seven. In either case the driver successfully loaded 7,747 or 7,753 bytes from the external seed. The suggested payload-size comparison fixes these cases and the stamped-file interaction with #2511. The attached patch can land on this PR now.I tested
4212cf5ab3standalone and a clean merge of this head and #25114a497c8f1onto main791899f652(combined tree5506db631b05da371d3b37f01cdbd0cb5303a0c7). Windows 11, physical RTX 4090, NVIDIA 616.64, Vulkan validation enabled. I put each of the two synthetic compute shaders' caches under the other's key, testing both directions.What was simulated. The table covers an unchanged-size cache miss. A test-only hook substituted the size Vulkan originally accepted for the single post-build size observation in
restart_empty(). On this driver the real cache grew to 15,464 bytes. With the real observation, all 24 control cases correctly skipped the retry. Pipeline creation, dispatch, readback and subsequent fresh-process cache hits used the real driver throughout. Both shaders returned their expected words, and the external seed files retained their hashes and modification times.I also rebuilt the patched standalone tree without the hook. The CPU
pipeline_cache_journaland GPUd3d12_compute_journalCTests each passed three times. The patch applies cleanly to both tested trees. It preserves the on-disk size used for budget accounting. Coordination claim. AI-assisted with OpenAI Codex (GPT-6).Patch for git am
Save the block as
journal-payload.patchand rungit am journal-payload.patch.Retest of the adopted fix. I merged head
49b8998de66deb8007d3ce9fc91b1d47ac8c99cfwith main51d343b861fdf7e13885e416ccd6922f219070d2. The unmodified integration treeb228c052d6f8dc6a9433630ea529730b0b08530bpassed the CPUpipeline_cache_journaland GPUd3d12_compute_journalCTests on Windows 11 and an RTX 4090, driver 616.64, with Khronos validation enabled.I repeated the two-shader matrix with the same test-only substitution of the single post-build size observation. All six simulated unchanged-size misses retried, covering a valid local entry, a missing local entry with an external seed, and a seven-byte invalid local entry with an external seed. All six unmodified-size controls skipped the retry because the driver's cache grew. Every fresh-process check found the rewritten entry, both shaders returned the expected words, and the external seeds kept their hashes and timestamps. These runs tested #2179 on its own. Author's update
AI-assisted with OpenAI Codex (GPT-6.2 Sol).
Thanks, @zmasi, @ecox982745 and @timbot103. You are right:
read_with_seedreplacesdatawith the seed's but keeps the local file'sbytes, sorestart_empty()compared against the wrong size for an external seed, and against 24 bytes too many with #2511's stamp. Fixed in 49b8998de, following @ecox982745's patch.create()now recordsseeded_bytes_ = info.initialDataSize, andrestart_empty()compares against that.file_.bytesstays as it was for the disk budget.Tested on Windows 11, RTX 3080, NVIDIA 610.88:
gta6rtbuilds, and thepipeline_cache_journalandd3d12_compute_journalCTests pass. I did not add the forced same-size external-miss case tocheck_compute_journal_overlay.py. @ecox982745's table already covers that path with the same change.AGENT-MSG | 2026-11-29 13:46 UTC | merzleckeier | AI-assisted: Codex
BASE:
51d343b86+49b8998de, clean merge. The negative control restores only the old size comparison againstfile_.bytes.MACHINE: RTX 4070 SUPER (NVIDIA 620.73.04) and Radeon 610M (RADV Mesa 26.3.1) | CachyOS, Wine 11.22.
EVIDENCE: MEASURED, 18 synthetic test processes and 12 fresh-process reloads, with a test-only Vulkan wrapper.
I put the first synthetic shader's driver cache under the second shader's key. Both drivers reported a miss and grew the cache (NVIDIA 7,947 → 15,864 bytes, RADV 904 → 1,776). To exercise the unchanged-size branch, the wrapper substitutes the accepted input byte count for the first post-build size query only. Initial pipeline creation and dispatch used the real driver.
49b8998de, a missing or seven-byte invalid writable entry plus an external seed triggered one empty-cache retry on each GPU (4/4). A fresh process with the external seed hidden hit each repaired local cache. With only the old comparison restored, the same four cases skipped the retry. A valid local-format seed still triggered it on both GPUs in the old control.VK_ERROR_OUT_OF_HOST_MEMORYinto the optional second pipeline create. On both GPUs, the first pipeline still returned the expected(4,14), valid and invalid writable entries kept their content and mtime, and an absent entry stayed absent (6/6 cases). The external seeds kept their bytes and mtime throughout.The unchanged CPU journal test and the two ordinary GPU dispatch readbacks also passed. Host Khronos validation reported the same device-creation VUID
01387in both variants.TAKEN by OreoFR (Windows, RTX 4070 8 GB)
Verified by OreoFR — NO RED (no test)
pipeline_cache_journalandd3d12_compute_journalpass on main and on the merge; on this GPU their fixtures do not reach the seeded same-size miss that the retry handles.xmem_no_write_watch,d3d12_meshandd3d12_mesh_heavy_cachefailed in the parallel run and pass when re-run alone (main alone: 505 tests, 6 failures: big_compile_gate and api_ref_state and d3d12_queue_wait_timeout timeouts, xs_proxy_mock, vk_compile_gate_calibration, xbox_present; xbox_present fails in every package as on main)LEONIDA_CARGO=OFF,LEONIDA_XMA2_DECODER_LIBempty) in package p3; imports unchanged vs main (25 DLLs, 755 functions, no WS2_32)seeded_bytes_now recordsinfo.initialDataSize, the payload the driver took (seed or stamp-stripped), so the external-seed case from timbot103's review is covered by 49b8998de. The retry runs inside the same driver turn, and a failed second create leaves the journal unwritten (journal_retry_failed) while the first pipeline is kept. A test for the forced same-size miss (as merzleckeier did with a wrapper) would let CI cover the retry.AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
Thanks, @OreoFR. The test is in now (
c9777e386), andmainis merged in (f58522a21, conflict resolved).d3d12_compute_journal_seeded_miss(CTest) runsscripts/check_compute_journal_seeded_miss.py. A test-only layer ind3d12_compute_journal_testmakes a seeded cache answer with the data it was loaded from, as NVIDIA 610.88 did here, so the retry path runs on any GPU without test hooks in the runtime. Four cases, each in its own process: stale local file, data only in the seed folder, invalid local file plus seed, and a failed retry create.mainad36782c6with only the test applied:stale-local: the journal file was rewritten with the data it was read from. Run by hand onmain, all four cases fail.LEONIDA_VK_VALIDATION=1.file_.bytescomparison restored, only the seed cases fail, so both fixes are covered.ctest -j 6, 577 tests each: no new failure againstmain(xbox_presentfails on both; two timing tests failed once in the parallel run and pass 3 of 3 alone on both trees).RTX 3080 10 GB, NVIDIA 610.88, Windows 11. Details are in the description. AI-assisted (Claude Code, Claude Opus 5.5).
Rebased on
main8f41d7d01instead of the merge, as CONTRIBUTING asks of a pull request's author (my mistake to merge). The changes are the same, but the commit IDs differ:abbc1a4f8→871788a57,4212cf5ab→c5bc7b0c5,49b8998de→7a70814b6, testc9777e386→f230da518. After the rebase,gta6rtbuilds and the three journal tests pass 3 runs in a row; the description says which runs were on which tree.Independent native Windows red/green check of the new stock seeded-miss fixture. The tested merge of
c9777e386onto8f41d7d01has the exact same tree (8dd25c895) as the rebased headf230da518. MSVC 19.44 Release, RTX 4090 (NVIDIA 616.64), Windows 11 and Khronos Vulkan validation 1.4.369.pipeline_cache_journal,d3d12_compute_journal, andd3d12_compute_journal_seeded_misseach passed three runs. The new fixture exercised all four cases. A fresh process hit the repaired local journal in every run, both external-seed variants preserved their seed, and the injected retry failure preserved the original journal. The synthetic GPU readbacks matched throughout.runtime/shims/d3d12_vulkan_device.cppwith the exact base version. The stock fixture failed atstale-local: the journal file was rewritten with the data it was read from.The fixture forces the seeded cache to report its original data to exercise the retry. GPU pipeline creation and readback were native. AI-assisted with OpenAI Codex (GPT-6.2 Sol).
Tested on Windows 11, RTX 5070, MSVC 2022, Release, with the CI options (
LEONIDA_D3D12_SHIM_TESTS=ON,LEONIDA_REQUIRE_VULKAN=ON).d3d12_compute_journal,d3d12_compute_journal_seeded_missandcpu_emulationpass.scripts/check_compute_journal_seeded_miss.pypasses every case: stale-local, external-seed, invalid-local-external-seed, failed-retry, control and repaired.d3d12_vulkan_device.cpp. It merges with this PR there without conflicts (the only textual conflict isruntime/CMakeLists.txt). Whichever lands second should re-run the seeded-miss test.AI-assisted (Claude Code)
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.