D3D12.X: under Wine the driver blob cache answers a missing name from a listing #3507
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3507"
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?
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-30T04:36:32Z.
Edited 2026-12-02: head
2dd74d1aafter bmjask's and Foniass's reviews (see Tested).Under Wine a retail title's process spent most of its file-system time listing the driver blob cache's folder. Wine lists the whole folder for an open of a name that is not there, the title asks the cache for each pipeline's file before it builds it, and the folder holds the blobs of every earlier run. Under Wine,
driver_cache::loadnow answers a missing name from a listing kept in memory. Part of #3067; the same cause as #3506, in the title this time.What is in it
crates/xcl/src/hle/d3d12x/real.rs(driver_cache):Nameskeeps each folder's file names from one listing, adds whatwritestores, and lists again at most every 10 s when a name is missing (a preparation worker may have written it since).loadasks it first, underunder_wine()only: Windows opens the file as before. Six new tests ofNames,reloadand the listing.shaders.rs: the re-checks after a claim and after the permit wait callreload.Tested
master71cae091, RTX 4060 Ti 16 GB (driver 615.71.09), rustc 1.98.0, release build forx86_64-pc-windows-gnu, head8244a3baonmainf97120dc.2dd74d1a(2026-12-02), after reviews by bmjask and Foniass, rebased ontomain078358a0: a folder that cannot be listed is not trusted (its files are opened); a name whose open finds no file leaves the listing, unless this process wrote a file in that folder since that open; names are compared in lower case, listed and asked alike.cargo test --lib --release -- warm_blobs driver_cache shaders::under Wine on the CPU only (lavapipe, no card): 124 passed, 1 failed (an_older_process_cannot_remove_a_replacement_blob, as onmain), 14 SKIPPED (no device), in 3 of 3 runs. The four new tests fail without their change.716036be(2026-12-01): the re-checks after a claim and after the permit wait open the file (driver_cache::reload) and no longer ask the listing, so a blob the last claim holder wrote is found; the relist runs outside theNAMESlock and adds to the set; noPathBufa lookup. New testa_reload_finds_a_blob_written_since_the_listing.cargo test --lib -- warm_blobs driver_cache shaders::: 110 passed, 1 failed (an_older_process_cannot_remove_a_replacement_blob, which fails onmainunder Wine too), 2 SKIPPED. The measurements below are from the head before it and were not repeated.cargo test -p xcl --lib --release -- driver_cache: 20 passed, 1 failed (an_older_process_cannot_remove_a_replacement_blob, which fails the same way onmain9335bc0dunder Wine: 19 passed, 1 failed).mainf97120dcwith other PRs merged, #3067), with and without this commit, 1 launch each, back to back from the same caches, 79,155 files in the folder.strace -con the title's process for 20 s once it had presented 200 frames:getdents64callsperfon the title had about a quarter of its CPU samples inreaddir64and its callers, most on thexcl-psothreads.Regression run
RTX 5070 Ti 16 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 Pro 26300, release builds by
scripts/smoke.ps1, the same retail title for 60 s each.main:this PR's head:
Not tested
AI use
perf,strace), wrote the change and the test, made the runs and wrote this description. Claude Opus 5.5 wrotereload, the relist outside the lock and the new test. Claude Opus 5.5 made the changes after bmjask's and Foniass's reviews of 2026-12-02 and their tests.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:03:10Z.
Review (head
8244a3ba, diff read, not a merge-check; draft withPR descriptionred, so not built or run):shaders.rs~2690, and ~2702 after the permit wait) precisely to see a blob the previous claim holder just wrote.Names::missing(real.rs~6584) answers "missing" until its listing is 10 s old, so the worker repeats a full driver compile and overwrites a blob already on disk, which the claim exists to prevent. SkippingNameson those re-checks, or dropping the folder's listing when a claim is acquired, would fix it.NAMESmutex (~6608), and while pipelines keep missing it can repeat every 10 s, blocking everyloadcaller; its cost isn't measured.PathBuf, and a blob removed byinvalidate()stays in the set (one extra open later).Fine: Windows is gated off with
under_wine()(only an empty lock is added inwrite), theNamestest, and the strace measurements.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-01T08:25:58Z.
Thanks, both points are right. Head
716036be:driver_cache::reload).a_reload_finds_a_blob_written_since_the_listingfails under Wine withloadin its place.NAMESand adds its names to the set, so other threads answer from the previous listing meanwhile and names written during a relist are kept. Its cost was never timed here; the strace in the description only bounds its system calls.PathBufa lookup is gone.invalidate()is left:LoadedBlobholds no path, and the cost is one open of a missing name, as onmain.cargo test --lib -- warm_blobs driver_cache shaders::, RTX 4060 Ti under Wine: 110 passed, 1 failed (an_older_process_cannot_remove_a_replacement_blob, as onmainunder Wine), 2 SKIPPED. Not run in a title on this head; the Windows suite and the smoke pair are still owed.AI use: Claude Code. Claude Opus 5.5 checked the points and wrote the changes; Claude Fable 5.2 ran the tests on the card and wrote this reply.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:36:40Z.
Re-review (head
716036be, diff read, not a merge-check; draft,PR descriptionred). Follow-up to my review of8244a3ba.shaders.rs(~2690 / ~2702) now calldriver_cache::reload, which opens the file and skips the listing; the otherloadcallers in real.rs are first lookups.NAMESwith the timestamp reset first, so one thread relists. A folder's first listing (~79k files) still runs inside the lock (real.rs~6592).invalidate()removed stays in the set, so the next lookup opens a missing file (one Wine folder listing untilwriteadds it back); time only.reloadreads a fresh file, but nothing checks that the re-checks use it.Fine: relisting adds to the set and never removes from it, and Windows behaves as on main.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:05:28Z.
Triage (#1607) – head
716036bNo open or merged PR makes the same change. #3506 does the same kind of thing for the v1 receipt import in
warm_blobs.rs, and #3556 changes blob reuse inbuild_with_blob; both are separate changes for #3067.A small point in
driver_cache::Names::missing: a folder's first listing runs while theNAMESlock is held, so otherxcl-psothreads wait on it once per folder. Only the relist runs outside the lock. Windows behaviour is unchanged (loadchecks the listing only underunder_wine()).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T09:14:37Z.
Review: COMMENTED
Review of
716036be: 4 finding(s). 4 are inline.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T09:14:38Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6620The title's runtime call sites (
compute_containerat ~6253, and ~8130, ~9417, ~9525, ~10947) callloadwithout thereloadre-check. Under Wine, a blob another process wrote after the last listing is reported missing for up to NAMES_AGE, and the title compiles the pipeline in the driver. Say a preparation worker writes<hash>.pso2 s after the title listed driver/, and the title then binds that compute pipeline.loadreturns None from the listing,compute_containerdoes an uncached driver compile (5-27 s on NVIDIA for large programs), andkeep_driver_blob_atthen overwrites the worker's file. Before, the open found it. Falling back to an open (or a reload) on a listing miss before compiling would keep that.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T09:14:38Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6584names_inturns a failedread_dir, or any per-entry error dropped by the second.flatten(), into an empty or partial set, andmissingthen trusts it for 10 s as a complete listing. A transient error (sharing violation, handle exhaustion, an entry error partway through under Wine) means every blob outside the partial set getsSome(true)for the next 10 s, so each of those pipelines is compiled from scratch and rewritten even though its blob is on disk. On a listing error it should fall back to opening files, not trust the set.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T09:14:38Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6605Names are only ever added (
relistedusesextend,wroteinserts). Nothing removes a name when a blob is deleted byLoadedBlob::invalidate,note(false, ..)or another process. If the driver refuses a blob,invalidatedeletes it, and the rebuild is under KEEP so no new file is written, every laterloadof that name passes the listing.reloadthen opens a missing file, and Wine scans the whole folder on each lookup, the cost this PR removes, now on every lookup of that name. Removing the name ininvalidate/note(false, ..)would close it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T09:14:38Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6598Not certain about this one:
missingsets*listed = nowbefore the relist has run. Until it finishes andrelistedmerges it, other threads asking about other missing names getSome(true)from the old set. Thread A starts a relist that takes seconds on 79k files, and thread B asks abouty.pso, written by another process 15 s ago. The timestamp looks fresh, so B is told it's missing, compiles in the driver, and doesn't re-check for another 10 s, although A's listing contains it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:12:34Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T20:39:21Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6620True, and on purpose. The description gives it under Not tested: a blob another process writes is found up to 10 s late. Opening the file after a listing miss would bring back what this removes, because under Wine every miss is one listing of the folder (79,155 files in the measured run, 408,089
getdents64calls in 20 s without the change). The re-checks that exist to see another process's write open the file: after a claim and after the permit wait (shaders.rs:2800,:2812). A late find costs one driver build and a rewrite of the same pipeline's blob, not a wrong blob. Left as is.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T20:39:24Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6584Right.
names_innow returnsNonewhenread_dirfails or any entry does. A folder whose first listing fails is not kept, and its files are opened as before. A relist that fails leaves the previous set as it was, and the file asked about is opened. New testa_folder_that_cannot_be_listed_has_its_files_opened, red without it. Headab684f03.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T20:39:27Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6605Right.
reloadnow takes a name out of the listing when its open finds no file (ErrorKind::NotFound,real.rs:6814), whoever deleted it:invalidate,note(false, ..)or another process. Such a name costs one open, and after that the listing answers for it again. New testa_blob_deleted_since_the_listing_is_missing_after_one_open, red without it. Headab684f03.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T20:39:29Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6598True, and on purpose. Setting the time first is what stops every other thread from listing the folder at once, which takes seconds each under Wine at that size. While one relist runs, the others answer from the previous listing, so the 10 s can stretch by as long as that listing takes. It is the same trade as the first point, and the commit message says so ("the other threads answer from the previous one meanwhile"). Left as is.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T20:54:44Z.
Review: COMMENTED
Review of
ab684f03: 3 finding(s) (3 medium), most severe first.crates/xcl/src/shaders.rs:2768: see below.crates/xcl/src/hle/d3d12x/real.rs:6405: see below.crates/xcl/src/hle/d3d12x/real.rs:6815:reload's NotFound path callsgone()after the open fails without any ordering check, so it can erase a name a concurrentwritein the same process just added, and the file then reads as missing until the next relist. (inline)On lines outside the diff:
Medium
crates/xcl/src/shaders.rs:2768: The pre-claimover_capearly return (and the warm_blobsverifiedshortcut above it) now depends on the listing-backedload, so an over-cap pipeline whose blob another process wrote since the listing is rejected with the size-limit error before the claim path's newreloadre-check is reached. Under Wine with XCL_PIPELINE_MAX_KB set, process B writes the blob for over-cap pipeline P. Within 10 s, process A'sPipelinesreaches P,loadanswers None from the old listing,cached.is_none() && over_capis true, and A returns Err("Compute DXIL exceeds the native pipeline size limit") and counts it as capped, where before it would have loaded B's blob. Doing thereloadcheck before the over-cap rejection would fix it.Medium
crates/xcl/src/hle/d3d12x/real.rs:6405: Runtime cache lookups (compute 6405; graphics 8325, 9614, 9723, 11164) now trust a folder listing up to 10 s old with noreloadfallback, so a blob that a preparation worker wrote since the last listing is reported missing and the pipeline is compiled from scratch. Under Wine, with the listing from t=0, a worker writes compute blob X at t=3 and the title asks for X at t=8:missing()returns Some(true),loadreturns None, and the title does a full driver compile (5–30 s by the module's own notes) instead of using the blob, then writes the same file again. Falling back to a real open when the listing says missing, at least on the runtime path, would keep the speed-up without the misses.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T20:54:44Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6815Medium:
reload's NotFound path callsgone()after the open fails without any ordering check, so it can erase a name a concurrentwritein the same process just added, and the file then reads as missing until the next relist. Thread A's open of P fails with NotFound, thread B renames tmp to P and callswrote(P), then A takes NAMES and callsgone(P). For up to 10 s,load(P)returns Some(true) frommissingand rebuilds the pipeline whenever the in-memory blob cache misses. A per-name generation (or rechecking existence under the lock) would prevent it.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T20:57:06Z.
Follow-up review of
ab684f03, since716036b(code reading only, not a merge-check;PR descriptionred) · 2 medium, 1 nitIn short: Since
716036bethe commit has two additions. A folder whose listing fails is no longer cached, and its files are opened as before. A name whose open returnsNotFound, such as a refused blob that was deleted, is removed from the listing. Both come with tests, and the earlier point aboutinvalidate()is fixed. The first listing still runs under the global lock, and the claim re-checks are still untested. Thexcl-smokepair is for716036be(PR descriptionis red), and Tested has only filtered--libruns under Wine, no whole-suite run on Windows.Medium
The first listing of a folder still holds the
NAMESlock (still open).Names::missingcallsnames_in(dir)(real.rs~6747) whileloadholds the globalNAMESmutex (~6783). With about 79k files under Wine, everyxcl-psothread and the title's ownloadcalls wait on that listing once per folder, and the cost is unmeasured. Fix: do it the way the relist already does: release the lock, list, then insert.Nothing checks that the claim re-checks use
reload(still open).loadtoreloadatshaders.rs~2800 and ~2812.a_reload_finds_a_blob_written_since_the_listingonly shows thatreloadreads a fresh file. If either call site went back toload, no test would fail.Fix: add a test at the
Pipelineslevel that writes the blob between the first lookup and the claim re-check.Nit
Names", but there are four. Tested says nothing about this head's changes or their two tests.Checked and fine
invalidate()removed stayed in the set. ANotFoundopen now removes the name throughNames::gone(real.rs~6812-6816), so it costs one open, not one per lookup. Covered bya_blob_deleted_since_the_listing_is_missing_after_one_open.reload, the relist runs outsideNAMESand only adds names, and noPathBufis built per lookup.read_diror any entry fails,names_inreturnsNone.missingthen answersSome(false)without caching, so the file is opened. Covered bya_folder_that_cannot_be_listed_has_its_files_opened.goneruns only onNotFound. A delete-pending file or a sharing error leaves the set alone.loadusesNAMESonly under Wine.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T21:22:37Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6815Right, that order can happen.
writenow counts the files this process wrote (WRITES, bumped after the rename and beforewrote).reloadreads the count before its open, and onNotFoundtakes the name out only when no write came in between (not_found). New testa_blob_written_while_another_thread_opened_it_stays_listed, red without the check. Head6a1d82eb.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T21:22:54Z.
On the two points outside the diff, at head
6a1d82eb:shaders.rs:2768, the over-cap return before the claim: true, and it costs nothing. The cap is there so that the pass skips a pipeline it should not build. If another process has written that blob in the last 10 s, the blob is on disk for the title either way, and the pass has nothing to build. Left as is.real.rs:6405and the graphics lookups on the runtime path: this is the same point as the first review's, answered in its thread. A blob written in the last 10 s is missed on purpose. An open after every listing miss is the cost this PR removes. Left as is.The inline point is answered in its thread.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:24:13Z.
Follow-up review of
6a1d82eb, sinceab684f03(code reading only, not a merge-check;PR descriptionred) · 2 medium, 1 nitIn short: This push closes a race in the driver blob cache's listing. An open that finds no file now removes the name only if this process wrote no file since that open (
WRITES,not_foundinreal.rs), so a blob written by another thread meanwhile stays listed. A test covers it. The three earlier points are unchanged. The smoke pair names716036be.Medium
NAMESlock (still open).Names::missingcallsnames_in(dir)whileloadholds the globalNAMESmutex. With about 79k files under Wine, everyxcl-psothread and the title's ownloadcalls wait on that listing once per folder, and the cost is unmeasured. Fix: list the way the relist already does: release the lock, list, then insert.reload(still open). If eitherreloadcall inshaders.rs(~2800, ~2812) went back toload, no test would fail. Add a test at thePipelineslevel that writes the blob between the first lookup and the claim re-check.Nit
Names", and there are five now. Tested says nothing about the changes since716036be.Checked and fine
not_foundreadsWRITESwhile holdingNAMES, andwritebumpsWRITESbefore it takesNAMESto add the name. A write that lands after the check re-adds the name throughwrote, so it is never lost. A write to an unrelated file only skips one removal, which costs one more open later.a_blob_written_while_another_thread_opened_it_stays_listedreplays that order and checks the name stays listed.NotFoundremoves the name, a folder that cannot be listed is not cached, Windows unchanged) still hold.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T21:25:34Z.
@Foniass thanks. At
6a1d82eb:NAMESlock: kept on purpose. It happens once per folder. While it runs, a thread that waits loses at most that one listing. Without the wait it would open its file, and under Wine every open of a missing name is a listing of its own, which is what each thread pays onmain. The relist runs outside the lock because it comes back every 10 s. Its trade is that the other threads answer from the old set meanwhile, and here that old set does not exist yet. Not changed.reload: this would be a test ofPipelineswith a device and a second writer between its two lookups. It is coverage, not a defect, and I have not added it. The two calls are inshaders.rs(~2800, ~2812) and the commit message names them.716036be, and the smoke pair once it has run.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T21:40:12Z.
Review: COMMENTED
Review of
6a1d82eb: 1 finding(s) (1 medium), most severe first.Re-review at
6a1d82eb. The over-cap early return and thereload/gonerace from theab684f03review weren't flagged again; theWRITEScounter covers the race. Still open: title-sideloadcallers in real.rs have noreloadre-check, so a blob another process wrote within the last 10 s is treated as missing and rebuilt. One new item below.crates/xcl/src/hle/d3d12x/real.rs:6753: The listing set compares exactOsStrings, but the Wine open it stands in for matches names case-insensitively (sibling #3506 now lowercases its listing for this reason). (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T21:40:12Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6753Medium: The listing set compares exact
OsStrings, but the Wine open it stands in for matches names case-insensitively (sibling #3506 now lowercases its listing for this reason). A cache file stored on the Linux file system as0123ABCD...-1f-0.pso(copied or renamed by another tool, or written by an older build) is opened today because Wine folds case. With this PR,names.contains("0123abcd...-1f-0.pso")is false, so the blob is never used and the pipeline is compiled from scratch on every run. Lowercasing both the listing and the lookup, as #3506 does, would keep the old behaviour.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T21:58:24Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6753Changed, as in #3506:
names_innow lower-cases each name it lists. The names it is compared with are lower-case already, becausedriver_cache::nameand the graphics name are made with lower-case hex. New testa_blob_stored_in_upper_case_is_listed, red without it. Head644ed3e7.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T21:59:15Z.
Follow-up review of
644ed3e7, since6a1d82eb(code reading only, not a merge-check;PR descriptionred) · 2 medium, 1 nitIn short: This push compares the listed blob names in lower case, as Wine's open matched them, so a blob stored in another case is still found. A test covers it. The three earlier points are unchanged. The smoke pair names
716036be(PR descriptionis red).Medium
NAMESlock (still open).Names::missingcallsnames_in(dir)(real.rs,driver_cache~278) whileloadholds the globalNAMESmutex. With about 79k files under Wine, everyxcl-psothread and the title's ownloadcalls wait on it once per folder. Fix: list the way the relist already does.reload(still open). If eitherreloadcall inshaders.rs(~2800, ~2812) went back toload, no test would fail.Nit
Names", and there are six now. Tested says nothing about the changes since716036be.Checked and fine
names_inlowercases each listed name. Every name the cache makes is already lower case: hex inname_for_root_node_with_ext, thepso/chain.psoextensions, thegfx-prefix. Somissing,wroteandgonecompare like with like.a_blob_stored_in_upper_case_is_listedwrites0123ABCD-1F-0.PSOand finds0123abcd-1f-0.psolisted.WRITESrace fix from the last push is unchanged.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T22:21:35Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6754Medium: Letter case is now handled inconsistently:
names_inlowercases the listed names, butmissing,wroteandgoneuse the rawp.file_name(). Any cache path with an upper-case character (apath_override, or a future name format) is never found in the lowercased set, so under Wineloadalways returns None, the blob on disk is never used, and the pipeline is recompiled every run.wrotethen adds the mixed-case name, so the set holds both spellings. Lowercasing inmissing/wrote/goneas well would make it consistent.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T22:21:35Z.
Review: COMMENTED
Review of
644ed3e7: 1 finding(s) (1 medium), most severe first.Re-review at
644ed3e7. Still open: title-sideloadcallers have noreloadfallback, so blobs another process wrote within the last 10 s are rebuilt. And contrary to my6a1d82ebnote, the pre-claim over-cap rejection in shaders.rs:2768 is still reachable from a stale listing. Listed names are now lowercased, but that's only half of the fix (below).crates/xcl/src/hle/d3d12x/real.rs:6754: Letter case is now handled inconsistently:names_inlowercases the listed names, butmissing,wroteandgoneuse the rawp.file_name(). (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T22:39:01Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6754Right.
missing,relisted,wroteandgonenow lower-case the name they are given, asnames_indoes, so the set holds one spelling. The case test also asks with an upper-case name now, and it fails without this. Head2dd74d1a, rebased ontomain078358a0.Also in this head: the check that keeps a just-written name in the listing now counts writes per folder, not per process. With one count for the process, a write to any other folder could skip a removal; a test that ran beside others showed it once.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T22:39:03Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 6620Still left as is, for the reason above. An open after every listing miss is one listing of the folder per miss under Wine, which is the cost this PR removes (408,089
getdents64calls in 20 s against 4,156 with it). A blob up to 10 s old being built once more is the price, and the description says so under Not tested. The over-cap return inshaders.rsis reachable from a stale listing, yes. It skips a pipeline whose blob another process has already written, so the pass has nothing left to build for it.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T22:40:16Z.
Follow-up review of
2dd74d1a, since644ed3e7(code reading only, not a merge-check;PR descriptionred) · 2 medium, 1 nitIn short: This push narrows the race check to the folder: an open that finds no file now removes the name only if no file was written in that folder since the open (a per-folder count in
Names), instead of a process-wide count. Lookups, writes and removals now lowercase the name as the listing does. The two medium points and the description nit are unchanged. The smoke pair names716036be.Medium
NAMESlock (still open).Names::missingcallsnames_in(dir)whileloadholds the globalNAMESmutex. With about 79k files under Wine, everyxcl-psothread and the title's ownloadcalls wait on it once per folder.reload(still open). If eitherreloadcall inshaders.rs(~2800, ~2812) went back toload, no test would fail.Nit
Names", and Tested says nothing about the changes since716036be.Checked and fine
NAMES, andwrotebumps it under the same lock. A write in the folder between the open andnot_foundkeeps the name. A folder listed only after the open givesNonethenSome(0)and skips the removal, which costs one more open later.missing,relisted,wroteandgoneall lowercasep.file_name(), matchingnames_in. The upper-case lookup is now in the test as well.Names::writes.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-02T22:55:12Z.
@Foniass the two medium points are as answered above, unchanged at
2dd74d1a. The description was brought up to date with this head: What is in it lists the six tests, and Tested has a line for this head. The Windows suite and smoke pair for2dd74d1aare queued, and they go in when done.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.