d3d12: look up cached shaders without scanning the cache directory #165
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!165
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/165/head"
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?
@Jerkin42 on GitHub · 2026-11-25 11:42 UTC · original
Jerkin42:fix/cache-lookups→main· +71 −11 · 1 files · 1 commits · merged 2026-11-25 11:44 UTCSummary
Under Wine, opening a file that is not there reads the whole directory, because names match without regard to case. Each program request asked for several absent names: its session reply (twice), the cache's
.sha256or.unsupportedfile, and the destination of the rename that published a copy of a cached program to the session directory.With 39,463 files in the ProjectScarlett cache and 13,812 copies in the session directory, the loader threads were up to 80% busy, three quarters of it in the kernel, with almost no disk reads.
perfshowedutf8_mbstowcs,hash_short_file_nameandreaddir64in Wine.This lists both directories once and opens only names they hold. It reads the cache's own file instead of a session copy. A translation the host adds after the listing still works: it is requested, and the host answers from its cache.
Measured on ProjectScarlett (RX 9060 XT, RADV, Proton Experimental), one run each: from leaving the first screen to the start of streaming, 3 min 45 s became 1 min 16 s. Kernel time over the busy part fell from about 360% to 170% of a core. Those runs used our tree, an older main with the same change, not this branch. The second run also had a larger Mesa shader cache limit (12 GB) and the first run's driver cache, so not all of the difference need be this change.
Checks
The
verifysuites d3d12-exports, heaps, draw, mesh, tables, indirect and stream pass on this branch (on529c52d); 283 Python tests run, 13 skipped, no failures;cargo checkfor the Windows target. In game, on our tree, 16 translations deleted from the cache just after launch were requested again and came back. The new unit test is compiled but not run here, since it needs the Windows target.🤖 Generated with Claude Code