Repository navigation
startup: leave a cache listing with no entries to the disk - #3436
Merged
JohnConnorNPC merged 1 commit intoNov 29, 2026
Merged
Conversation
FindFirstFileExW on "<directory>\*" returns "." and ".." for an empty directory, so ERROR_FILE_NOT_FOUND only comes from a directory with no entry at all, such as an empty volume root. No test reached the branch that treated it as an empty listing: with it removed, startup_cache_index_check (f) still passed under Wine. Drop it, so that every listing failure leaves the index unknown and lookups use the disk, as before the index. Fix the (a) lookup count in the check's header comment: 512 + 3 = 515.
Leyukaka
reviewed
Nov 29, 2026
Leyukaka
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed 628ff35 by reading the diff; nothing was built or run. The change reads correct.
- Before, a
FindFirstFileExWfailure withERROR_FILE_NOT_FOUNDwas turned into success (main, src/startup_stubs/cache_index.h:163):soif (error == ERROR_FILE_NOT_FOUND) error = ERROR_SUCCESS; // no entry at all: an empty listing
listed_.seal()ran on an empty set,ready_became true, and every lookup in that directory answeredabsent, which skips the open at native_mesh57.inl:256-257. At 628ff35 the error is kept (cache_index.h:163-166), so lines 183-189 clear the set, store it inlisting_error_and leaveready_false, and line 103 answersunknown:which goes on to the open.if (!ready_.load(std::memory_order_acquire) || !same_directory(directory)) return CacheLookup::unknown;
- Nothing else in the listing changes: the mask, the folding of the directory and
same_directoryare untouched, so separators, case and wide characters are handled as before. - Outside the test, the only reader of
listing_error()is the log line at d3d12_draw.inl:283. - (f) (tests/startup_cache_index_check.cpp:189-197) still asserts the same two outcomes: the empty directory is ready with 0 names and answers
absent, the missing directory isunknownwith a non-zero error. With the line removed, the first half passes only if listing an empty subdirectory succeeds, through.and... No test reaches theERROR_FILE_NOT_FOUNDcase. - The description reports a run under Wine only. The Windows check does not cover this: on pull requests the job runs
ctest --preset pr(windows.yml:489-493), and theprfilter (CMakePresets.json:51) does not matchstartup_cache_index*. A Windows run ofctest --preset dev -R '^startup_cache_index'at 628ff35 would confirm (f).
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.
Follow-up to #3433, which was merged before I could push this commit to its branch.
Change
src/startup_stubs/cache_index.h: drop the line that treated anERROR_FILE_NOT_FOUNDfromFindFirstFileExWas an empty listing.FindFirstFileExWon"<directory>\*"returns.and..for an empty directory, so that error only comes from a directory with no entry at all, such as an empty volume root. No test reached that branch: with the line removed,startup_cache_index_checkstill printed0 failed, (f) included, under Wine. Without the branch, every listing failure leaves the index unknown, and those lookups use the disk, as the stand-in did before startup: list the shader cache once and skip absent mesh57 profiles #3433.FindFirstFileExWfailure state that fallback: an empty directory lists empty through its.and..entries, and a directory with no entry at all uses the disk.tests/startup_cache_index_check.cpp: fix the (a) count in the header comment, 514 → 515 (512 + 3). The ctest regex and the check's own output already say 515.There is no behaviour change for a directory that lists, and no test changes beyond the comment.
Tests
I don't have MSVC or a Windows machine. I built with clang-cl 19.1.7 and lld-link against the xwin SDK, and ran the same executables and arguments that those ctest entries register, under Proton Experimental (wine-11.0) with vkd3d-proton 3.2.0. Commit 628ff35, on main 70813f0.
startup_cache_indexstartup_cache_index_check: 0 failed; (f) printsmissing directory: listing error 3, lookups unknownstartup_cache_index_per_call_controlFAIL: (a) 515 disk probes for 515 lookups of missing profiles, expected 0, noFAIL: (b)–(h)native_fixed_mesh57{,_mrt,_varying,_uint_heap,_pixel_heap,_waterfall,_waterfall_fine,_buffers,_constant,_mask}_hardwarenative fixed mesh profile lookups 66, opens 2 (2 profiles, 2000 other cache files)native_fixed_mesh57*_warpbidi_controls_check.pyChecked 2600 tracked source, script and build/CI files: no bidirectional controls.Hardware variants: NVIDIA GeForce RTX 4070 Ti SUPER, driver 550.163.01, Debian Linux 6.12 host (no Windows build). The fixture calls
EnableDebugLayer(), but vkd3d-proton does not provide the Windows debug layer's validation.Caveat: these are Wine results only. The
ERROR_FILE_NOT_FOUNDcase itself is not covered by a test, here or on Windows; this change only removes the code that handled it differently. The review on #3433 included a Windows run of these tests at adf532c (WARP, MSVC 14.44: 12/22 passed, the 10*_hardwarevariants skipped). Nobody has run them on Windows at this commit yet.Refs #3433
AI-assisted