d3d12/shadow: allocate cold buffer and window copies outside table write locks (D3D12-SHADOW-UNLOCK-ALLOC) #3139
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/3139:github-pr/3139" git switch "github-pr/3139"
Open
leonida/mandy
zmasi wants to merge 2 commits from
github-pr/3139 into main
pull from: github-pr/3139
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/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!3139
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/3139"
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?
This branch is out-of-date with the base branch
Reviewers 0 approvals
Details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as:
D3D12-SHADOW-UNLOCK-ALLOC(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7345440394)Addresses #3105 (does not close it: eliminates exclusive
BUFFERSandLOOSEtable write-lock contention across slow D3D12 host/card buffer creation onleonida-list-Nthreads; companion timeline attribution is in #3136).What and why
shadow::exact(d3d12/crates/leonida-gpu/src/shadow.rs:7700) already dropped its table lock before callingshared_buffer(CreateCommittedResource+MakeResident+Map) because holding the map lock across kernel/WDDM buffer creation serialized allleonida-list-Nthreads (WaitOnAddress). However, bothshadow::lookup(BUFFERS) andshadow::loose(LOOSE) still held exclusiveRwLockwrite guards across cold D3D12 allocations — matching #3105's stall trace pattern where oneleonida-list-Nthread hits an unhooked WDDM allocation/residency call insidelist::with_statewhile peerleonida-list-Mthreads block inWaitOnAddresslinked to it:shadow::lookup()(BUFFERS) cold allocation outsideBUFFERS.write():place_for,shared_buffer, andcard_forallocations outsideBUFFERS.write(), deduplicated per(start, resource, generation)viaBUFFERS_INFLIGHTwith an unwind-safe guard so panics orNonereturns always clean up the in-flight slot and wake waiters without poisoning.Entry.generation(NEXT_BUFFER_GEN) +entry.endto prevent ABA/resurrection ifunregisterorregisterraces mid-allocation, retries in-place opening across transientwatch::Remappingwindows (watch::change_over()) soLEONIDA_PORT_CONSTANTS=1/LEONIDA_INPLACEbuffers are not demoted to copies during streaming, and runsnote_carded+elide_note_boundsunderbuffers()strictly on winning publication (Shadow::newattachescard/mappedimmediately after allocation so unwinds never leak global byte counters).shadow::loose()(LOOSE) read-lock hits & unlocked cold window creation:tails()andany && fine()) underLOOSE.read()and coordinates cold(start, len)window creation (place_for,window_mapped_for,shared_buffer,window_card_for) outsideLOOSE.write()viaLOOSE_INFLIGHT, keepingArc::strong_count >= 2until followers clone and runnote_asksolet_go_idleremains race-free.Tested
python -I scripts/red_green.py HEAD --no-fetch --no-python:verdict: red then green(3/3new concurrency/race/unwind regression tests fail onmainand pass onHEAD;692tests pass on both).--release, 7 hot reader list threads + 1 thread in a simulated50 mscold allocation):BUFFERS(lookup/find): max reader stall48.241 ms->0.237 ms(203xlower stall latency;217,090->1,604,541reader ops).LOOSE(loose): max reader stall47.883 ms->0.026 ms(1,841xlower stall latency;194,799->2,368,813reader ops).x86_64-pc-windows-msvc):cargo test -p leonida-gpu [--features diagnostics] --lib --target x86_64-pc-windows-msvc shadow::—70 passed, 0 failedin both default anddiagnosticsbuilds (covering hot-read non-blocking during coldBUFFERS/LOOSEmisses, single-allocation deduplication on concurrent same-key misses,16 MiBcard-eligible unregister race + panic unwind with zerolive_span_bytes()leak, andLEONIDA_WINDOWS_BAR_MBindependence).cargo clippy -p leonida-gpu [--features diagnostics] --all-targets --no-deps --target x86_64-pc-windows-msvc—0warnings inshadow.rs.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/shadow.rsandpython -I tests/test_text_write_line_endings.py— exit0.GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Windows 11 Pro
10.0.26200(D3D12 host/card buffer unit tests and multi-thread contention benchmarks; no retail title run).AI-assisted: yes — authored with Gemini 4 Carbon (High) and independently audited across two read-only review cycles by Gemini 4 Neon (XHigh) (which caught and verified pre-logging
Shadowattachment for unwind byte-counter safety andwatch::change_over()in-place retry during concurrent page remaps).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Ran natively on Windows 11, head
2bc1f6f43merged into currentmain(69cd4106c, merges cleanly), on WARP and on one NVIDIA desktop card. I also wrote some throwaway stress tests (not pushed) and ran them on the merge and onmainalone.Suites on the merge
cargo test -p leonida-gpu --lib --features diagnostics, WARPcargo test -p leonida-gpu --lib(default features), WARPunlock_alloc_tests, WARP and NVIDIAcargo clippy -p leonida-gpu --all-targets --features diagnosticsshadow.rsThe new tests return early when there is no host. A host was present in both runs (the panic-unwind case in
unregister_race_...only passes when the allocation path actually runs).Races, leaks and duplicates (stress, 20 rounds each, WARP and NVIDIA, merge vs
main)mainfinds over 48 cold buffers, no churn: allocations / copies per bufferunregister+registerwith a new size: a second copy for a buffer that was never re-registeredpeekshowing an old-size copy after the roundLIVEcount and bytes,live_span_bytes()after unregistering, both casesfinds over 24 cold 4 MiB windows: allocations / copies per window /LIVEafterLIVEafter, a normal buffer right afterIn the churn rounds the merge makes more copies than it hands out (for example 1,591 made, 1,352 seen). Those are the
Stalecopies dropped afterregisterraced the allocation. All of them were freed:LIVEwent back to zero every round.One behaviour
maindoes not have:findcan returnNonefor a live bufferlookupnow gives up after 8Staleoutcomes in a row. One thread re-registers a single buffer in a loop while 8 threadsfindit, 24,000 asks per run:Noneon the mergeNoneonmainmainthe loop waits behind each allocation)When I raised the bound from 8 to 1,000 locally, the merge went to 0
Noneat the 20 us pacing. So these are theStaleretries running out. The setup is artificial, and I don't know whether a title ever re-registers one buffer this fast. If it does, the draw gets no copy at all, wheremaingives one. Falling through to theloosepath or retrying without a bound would avoid that.Opt-in finer windows (
LEONIDA_WINDOW_KB=256,find_any), WARPThread A asks for a 1 MiB range and is held inside its window allocation. Thread B then asks for 64 bytes inside that range:
mainholder/longest_tailnow pick the key under the read lock, and the in-flight table only joins asks with the exact same key. So overlapping asks that race make more than one window, whichmainavoided by holding the write lock. Only withLEONIDA_WINDOW_KBbelow 4096 orLEONIDA_WINDOW_TAILS=1, and it costs memory and copies, not correctness. I did not tryLEONIDA_WINDOW_TAILS=1on its own.Lock hold time with real allocations (no simulated sleep)
The bench in the PR compares a sleep under the lock against a sleep outside it, so it shows what the design allows but not what an allocation costs. Here, one thread makes 64 real cold copies of 16 MiB buffers in a row while 6 threads look up a buffer that already has its copy. 3 runs each, ranges across runs:
main, WARPmain, NVIDIAOn
mainthe slowest lookup matches the slowest allocation, so readers wait out the whole allocation. On the merge they don't. The allocations themselves take about as long as before.Overlap with #2981
Both PRs edit
shadow.rs, and they conflict when merged together (5 hunks). Three hunks are only the two new test modules colliding at the end of the file. The other two are real: #2981 adds anaccountfield toCard, and the twoCard { .. }literals this PR rewrites inbuild_buffer_shadowandbuild_loose_shadowdon't have it. Whichever lands second has to addaccount: CardAccount::Bufferandaccount: CardAccount::Windowthere. Otherwise it won't compile, andDrop for Shadowwould release from the wrong counter. I did not resolve or build the combination.Not checked: in-game run; the combination with #2981;
LEONIDA_WINDOW_TAILS=1on its own;LEONIDA_PORT_CONSTANTS=1and in-place (LEONIDA_INPLACE) paths under concurrency; the debug layer.GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
RUN (in game) -- unit tests + 300 s render-path verification for PR #3139:
2bc1f6f43mainSHA:acc350745(git merge --no-ff, clean merge)python -I scripts/check_no_game_data.pyPASScargo test -p leonida-gpu --features diagnostics --lib --locked shadow::-- 70 passed, 0 failed, 3 ignored (including all 4 newshadow::unlock_alloc_tests::*concurrency/coalescing/unwind tests)diagprofile (diagnostics,dlss,mimalloc), Series S profile, DLSS on, Frame Gen off, same restored save snapshot2bc1f6f43onacc350745)mainalone (acc350745)Loaded into the world cleanly, stayed up past 300 s in-world with 0 device lost / 0 crashes / 0
ERRORlines, and closed cleanly. Steady-state idle-camera FPS and preparing time matchmainwithin run-to-run variance (as expected, since lockless cold allocation targets cold-miss stalls on recording threads rather than hot-cache steady-state frames).Verdict: PASS.
AI-assisted: yes (Antigravity).
Verified here: it applies, and the whole
shadowgroup passes with it - 70 tests, 0 failed, including the four new ones that are the point of the change.Those four are the right four for "allocate outside the table write locks": a miss not blocking hot reads (the property the change exists for), two concurrent misses making one allocation (the failure mode of moving allocation out - a storm of duplicates), and an unregister racing an allocator panic cleaning up without a leak or a deadlock (the one that only shows up in a crash report months later). All pass, and nothing else in the module moved.
What that does not measure: the contention it is meant to reduce. A test can show that a miss no longer blocks a reader; it cannot show how much time that saves in the title, and I did not run one - the numbers for that would need a run, which this machine cannot do.
And one thing to keep an eye on:
unregister_race_and_allocator_panic_clean_up_without_leak_or_deadlockis a name that describes a real hazard - if it ever goes flaky, it is worth reading before skipping it.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Light code review only, not built (Windows-only
leonida-gpu). Ready, based on the runs already posted on this head.2bc1f6f43, merge base044339e4c, 63 behind currentmain45dc41f95. A trial merge is clean. CI on the head: all 6 checks pass.main. This satisfies the render-path gate.shadowgroup passes.Review notes on
d3d12/crates/leonida-gpu/src/shadow.rs(1,046 added, 178 removed):place_for,shared_bufferandcard_forallocation now happens outsideBUFFERS.write()andLOOSE. Work is de-duplicated through an in-flight table with an unwind guard. EachEntry.generationplusendcheck on publication guards against ABA whenunregisterorregisterraces the allocation. This is the right shape for #3105: blocking WDDM calls no longer serialize theleonida-list-Nthreads.Shadow::newright after allocation, so a loser does not leak them. I did not trace every unwind path in a diff this size. The in-game and unit runs above are the evidence for those paths, not this review.Verdict: ready.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
VERIFY-3139 — Windows nativo: 70 pruebas de
shadowpasan y el control muerde el coalescingad72eee3f—shadow.rs, +1046/−178 (the branch also mergesmain,2bc1f6f43)044339e4cRan at the head
Negative control (synthetic): I made the in-flight table never find its own entry (
map.get(&key).cloned().filter(|_| false)), so every concurrent miss allocates its own, rebuilt and ran:The test bites on the mechanism the commit adds — a per-key in-flight map with a
Condvar: one thread builds, the others wait and take the published value, and a hit never touches the table's write lock at all.Why the shape is right for what it is: this is a lock-hold-time change, so the tests are named after the property rather than the function — "a lookup miss does not block hot buffer reads", "…hot window reads", "concurrent misses coalesce a single allocation", "unregister race and allocator panic clean up without leak or deadlock". Those are the four ways this kind of change breaks, and each has one.
What I could not test
shadow), not the full suite on the merged tree.Written with an AI assistant.
For a follow-up to the cold allocation in
shadow::lookup, could we measure allocator time and the wait on unrelated hot lookups separately? A burst of misses for different keys would help show how far the stall spreads. Run the two versions in both orders from the same initial state.Synthetic test. Park the allocation for key A, queue a second cold miss for B, and look up the already-ready key C. With unlocked allocation, C should complete while A is still paused. Record the longest hot lookup wait in each run.
A follow-up to the unlocked allocation would be to install the ready buffer in a per-resource record. Validate the generation and range and install the handle while holding the same entry guard used to retire the resource. That would move final handle publication off the global index write lock.
Synthetic race test. Pause the builder for generation 1 of resource A after allocation. Unregister A, register it again as generation 2, and resume the old builder. Assert that the old candidate is discarded and generation 2 stays current. Publishing A should also allow lookups of an unrelated ready entry to finish.
Follow-up with four matched A/B pairs using this PR head (
2bc1f6f43399) merged locally into cleanmain(d9b618f10150). I used an RTX 5070 Ti Laptop GPU (12 GB) on Windows 11 with NVIDIA driver 621.47, native 2560×1440 DLAA, no frame generation, and Smooth Motion off. The order wasA B B A A B B Aafter two warm-ups. Each measured run started from the same prepared PSO cache snapshot.The paired change in median frame time was −0.43 ms for B versus A (95% CI −0.98 to +0.13 ms). The early window showed fewer long frames. The full-route result was inconclusive.
Run report in #2464.
I ran the requested two-cold-key control against the actual lookup paths on
maind9b618f1and this head2bc1f6f4. The same test-only hook parked cold lookup A for 150 ms immediately before its host allocation. Fresh threads then calledfindfor cold key B and for an unrelated ready key C. C had an empty thread-local cache, and the test checked that it returned the existingArc. The run order was A/B, B/A, A/B.mainThe timings are from the synthetic 150 ms pause in a Windows MSVC build under Wine 11.22. The four existing
shadow::unlock_alloc_testspassed, with the separate ignored benchmark left ignored. This isolates the spread of the table-lock wait. AI-assisted with OpenAI Codex.I checked the #2981 overlap with this exact head (
2bc1f6f43) onmaind9b618f10. The #2981 headb020637acstill conflicts here in five hunks ofshadow.rs. A local resolution kept this PR’s unlocked allocation and publication, setCardAccount::Bufferon the cold buffer constructor andCardAccount::Windowon the cold window constructor, and kept both test modules.The resolved diagnostics build passed the
shadow::suite on AMD Radeon (RADV 26.3.1, Wine 11.22, vkd3d-proton 3.1.0). 73 passed, 0 failed, 3 ignored. A separate synthetic test usedLEONIDA_CARD_ALL=1andLEONIDA_WINDOWS_OWN=1to exercise both actual constructors. Freeing the buffer returnedCARD_BYTES[0]to baseline while leaving the window’s reservation live. Freeing the window then returnedWINDOW_CARD_BYTESto baseline.BY_ADDRESS_USEDstayed at baseline throughout.git diff --checkpassed.AI-assisted verification with OpenAI Codex.