d3d12-gpu: fix parallel unit test races in watch, descriptor, and pool #2854
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2854"
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 ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T09:35:14Z.
Claim:
D3D12-GPU-TEST-PARALLEL-FLAKES(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7306755357)Fixes three process-global parallel test issues in
leonida-gpureported in #2570 (wherecargo test -p leonida-gpu --libflaked under default parallel test threads while passing under--test-threads=1).Root causes & fixes
watch::tests(d3d12/crates/leonida-gpu/src/watch.rs)drop_viewscalledtitle_memory_remappedinstead oftitle_memory_unmapping, deterministically leakingclean,PUBLISHED, andVIEWSstate for an unmapped view address. Switcheddrop_viewstotitle_memory_unmapping.nothing_is_guarded_between_our_forgetting_it_and_its_unmappingandwrites_to_views_are_not_lostcalledUnmapViewOfFilebefore droppingRemapping, returning the virtual address to Windows whileg.changingstill marked its block asleft_alone. Ended the remapping window beforeUnmapViewOfFile(note: this race-window tightening is not directly covered by a unit test; reverting it leaves the suite green).descriptor::tests(d3d12/crates/leonida-gpu/src/descriptor.rs)records_copied_as_bytes_are_made_at_the_next_syncraced with the 4 ms background"leonida-heap-sync"thread and concurrent test submissions callingsync_heaps()over process-globalSHADER_HEAPS: a competing sync round could consume the write-watch reset for slot 5 before publishing its host descriptor, causing the test's post-syncassert!(host.made(5))to observefalse. Added a#[cfg(test)]TEST_SYNC_LOCKaroundsync_heaps()and held it across the raw copy, pre-sync check, and sync call.pool::Reclaim/texture::alias_cast_tests(d3d12/crates/leonida-gpu/src/pool.rs)Reclaim::releasereturned a pooled piece without removing the releasedID3D12Resourceraw pointer fromRECENTorUNSEEN. When a subsequent committed texture reused that COM pointer within 1 second,pool::freshfalsely reportedtrue, failingassert_eq!(pool::fresh(©.texture), false)incommitted_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers. Storedraw: usizeinReclaimand calledforget_released(gone.raw)before returninggone.piecetoTEXTURESon final release.released_texture_pointer_is_not_kept_in_recent_or_unseen(testsforget_releaseddirectly, inserting(raw, u64::MAX)intoUNSEENwithout callingnote_unseen's eviction sweep) and COM last-reference drop regression testdropping_last_pooled_texture_reference_forgets_recent_and_unseen(allocates a 32x32 RGBA8 placed texture viapool::texture, holds two COM references, confirms entries remain after dropping the first reference, and confirmsRECENTandUNSEENare cleared after dropping the final reference triggersReclaim::release).Verification
mainad7c62edb, 8 parallel runs):watch::tests::other_memory_at_a_guarded_address_keeps_its_protectionandwatch::tests::what_is_put_in_beside_the_guards_is_told_at_every_viewpanicked on parallel run 2/8.dropping_last_pooled_texture_reference_forgets_recent_and_unseen:forget_released(gone.raw)inReclaim::release:0 passed; 1 failed(panicked on post-dropRECENTassertion; independently reproduced by@Neutron-0and@KelboLive).forget_released(gone.raw)beforelock(&TEXTURES).give(...)(81a6e94a9):cargo test --locked -p leonida-gpu --lib pool::: 10/10 consecutive parallel runs passed (19 passed, 0 failed each).leonida-gpu --libparallel runs (atbce4a898b): 17/18 passed here (601/0/55; run 18 hit the separate standing-ask flake tracked in #2896); 0/40 failures and 635/0/59 merged onmainon@KelboLive's machine.depth_bounds_pipeline_loads_and_filters_drawsfails deterministically on Windows 10 inbox D3D12 without Agility SDK; tracked in #2855.)GPUs tested: NVIDIA GeForce RTX 5070 12 GB (driver 621.40, Windows 10 Pro 22H2 build 19045, Ryzen 9 5950X 16C/32T)
AI-assisted: Antigravity (plus separate read-only reviewer subagent)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T10:04:45Z.
Your claim is there (
D3D12-GPU-TEST-PARALLEL-FLAKES, https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7306755357), but the description does not name it. Could you add the ID and that link, so the merge checklist finds it?One small thing while reading the diff:
TEST_SYNC_LOCKsits between the doc comment ofsync_heapsand the function, so those lines now document the static.This one changes
pool.rsoutside the tests, so it is in the in-game run I have queued on an RTX 4060.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-01T10:45:06Z.
Independent Windows check, A/B over repeated runs:
99ed48337merged onto currentmain653f60d37(no conflict,1b2be1bfc) againstmainitself. Native Windows 11, MSVC x64, Rust 1.98.1. I built theleonida-gpulib test binary once per side (debug, default parallel test threads) and ran each whole suite 40 times back to back, alternating nothing else.main653f60d37watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view,watch::tests::kernel_reads_into_guarded_blocks_after_opening,watch::tests::a_write_is_reported_at_every_checked_view(one per run; one run's name wasn't captured)main+ this PRSo the
watchcross-test interference reproduces onmainhere (about 1 run in 10), and with this PR it doesn't show in 40 runs. On another day I also sawdescriptor::tests::records_copied_as_bytes_are_made_at_the_next_syncfail once in 9 runs on a branch, which is the second race this PR addresses. It didn't come up in these 40mainruns, so I can't add a count for it.GPUs tested: n/a (unit tests). AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T11:16:16Z.
@MoonEyes Thanks for catching both!
D3D12-GPU-TEST-PARALLEL-FLAKES) and link to the PR description.TEST_SYNC_LOCKabovesync_heaps's doc comment so those doc lines stay attached topub(crate) fn sync_heaps(), and re-verifiedrecords_copied_as_bytes_are_made_at_the_next_sync.@Kal0s-design Thanks for the independent 40-run Windows 11 A/B verification (4/40 -> 0/40)!
AI-assisted: Antigravity
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-01T11:18:10Z.
RUN (independent run on Windows, #2854 head
99ed48337, merged locally into main3393ceec9withgit merge --no-ff, no conflicts. The head still merges cleanly into mainbf30e2585. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with--locked, at low priority.cargo test -p leonida-gpu --lib --no-runof main and of the merge; then the two test binaries were run alternately, each with the default thread count (32 here, no--test-threads), ascargo test -p leonida-gpu --libruns them:watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view,watch.rs:6010, leftSome([..]), rightSome([])); merge 32 clean (602 passed / 0 failed / 55 ignored, the extra test being the new one). So no new failure, and the one parallel failure seen on main is a watch test. The flake rate here is low (1 in 32 on main), so these runs alone cannot prove the fix; the two tests named in the body did not fail on main in 32 runs here.--features diagnosticsbuild, 10 runs each side: main 2 clean, merge 2 clean.timeline::record::tests::global_stall_routing_retains_spans_waits_wakes_and_sent_fences_without_stacksfails in parallel on both sides (main 7 of 10, merge 8 of 10,record.rs:2325, no "synthetic stall span"): a parallel race this pull request does not touch.descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync, which this pull request fixes, failed once on main and never on the merge.forget_releasedemptied (fn forget_released(_raw: usize) {}), the new test kept:released_texture_pointer_is_not_kept_in_recent_or_unseenfails on its first assertion (!RECENT...any(|r| r.0 == raw),pool.rs:1295). Green after restoring: 1 passed.forget_releaseddirectly. With the call taken out ofrelease(let _ = gone.raw;), the whole suite still passes (602 / 0 / 55, one run). So no test checks that the last release of a pooled texture really forgets it; a test that makes a pooled texture, drops it and then asksfreshfor its pointer would.pool.rs(RECENT,UNSEEN,TEXTURES):RECENTandUNSEENare private topool.rs. They are taken infresh,made_now,begun_before,forget_releasedand the new test, and each guard covers only work on its own list of numbers (underUNSEEN,made_nowalso callshost::submissions(), which reads two atomics). No other lock is taken and no COM object is released while either is held, and the two are never held together (made_nowdropsRECENTbefore it takesUNSEEN;forget_releasedtakes one, then the other). Inrelease, theTEXTURESguard is a temporary dropped at the end of its statement, beforeforget_released. So both stay leaf locks: no reversed order and no re-entry is possible. A caller that holds some other lock when it drops the last reference to a pooled texture only adds an edge into these two leaf locks, which cannot close a cycle.descriptor.rs:TEST_SYNC_LOCKand its use insync_heapsare#[cfg(test)], so a normal build does not change. But the new static sits between the doc comment ofsync_heapsand the function: that whole doc block (including theLEONIDA_HEAP_SYNC=0line) now documentsTEST_SYNC_LOCK, andsync_heapshas no doc comment in a normal build. Moving the static above that block would fix it.python -I tools/d3d12_switches.py --check d3d12/docs/switches.mdis still clean on the merge.cargo clippy -p leonida-gpu --all-targets, default and--features diagnostics, on main and on the merge: the same warnings on both sides (69 and 68 locations, counting those the command reports inleonida-shaderandleonida-lua), none new.forget_releasednow runs at every last release of a pooled texture (a scan ofRECENT, the textures made in the last second, under its lock).Since this run the head moved to
eab9e2abf, which only movesTEST_SYNC_LOCKabove the doc comment ofsync_heaps(5 lines indescriptor.rs): that fixes the doc point above and changes nothing else tested here.Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Rust 1.98.1.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T14:25:09Z.
One thing before a merge, from enlight3d's check and confirmed by reading: taking the call of
forget_releasedout ofreleaseleaves the whole suite green, since the new test calls the function directly. Could you add a test that drops the last reference of a pooled texture (or aReclaim) and fails without that call? The rest reads fine: the locks are leaves and the entry goes before the address can be reused.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T14:28:47Z.
I tested the requested last-reference regression at
eab9e2ab+ #2884 onb3910e5e. The fixture makes a real 32×32 RGBA8 placed texture throughpool::texture, requires that pooled allocation to succeed, and holds two COM references. It checks that both tracking entries exist initially and after the firstdrop. After dropping the last reference, it checks thatHELDhas returned to its original count and bothRECENTandUNSEENno longer contain the key.forget_released(gone.raw)removed fromreleaseThat gives a red/green test through COM destruction without relying on pointer reuse. The separate full diagnostics runs with #2884 kept the same eight non-target Wine failures seen with #2884 alone. All three combined runs passed the new stock bookkeeping test and the timeline-record tests. Win64 MSVC target, Rust 1.98.1, synthetic inputs. MEASURED, AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T15:02:32Z.
@MoonEyes Added
pool::tests::dropping_last_pooled_texture_reference_forgets_recent_and_unseeninbce4a898b:pool::texture, holds two COM references, verifiesRECENTandUNSEENstay populated after dropping the first reference, and verifies both entries are cleared when dropping the final reference triggersReclaim::release.forget_released(gone.raw)fromReclaim::releasefails the test (0 passed; 1 failed); restoring it passes (1 passedunder both default features and--features diagnostics, and20/20parallel runs ofpool::).@merzleckeier Thanks for testing the last-reference drop path independently as well!
Imported from ubiquitarianism/leonida. Originally posted by DIGITALWORLD-PL on 2026-12-01T17:59:15Z.
For comparison with the test-only lock in this PR, we tested an alternative for
records_copied_as_bytes_are_made_at_the_next_syncon Windows with a GeForce RTX 5090 (driver 621.01).We paused a competing synchronization round after it had taken the dirty page for slot 5 and before it published the host descriptor. Under that forced interleaving, the original test failed 6/6 runs at
assert!(host.made(5))after its ownsync_heaps()returned. With our patch, the test passed 6/6 runs under the same schedule: three with the helper thread and three with inline synchronization.Our one-file patch checks the fresh slot before the raw copy, submits a closed command list through
Host::execute_sync_internal, and checks publication after it returns. The experiment exercised CPU-side descriptor publication on the RTX-backed D3D12 device. We tested the original code and our patch; we have not run this experiment against #2854'sTEST_SYNC_LOCKimplementation.AI-assisted testing and independent review with OpenAI Codex (GPT-6.2 Astra).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T18:14:15Z.
Review: COMMENTED
The strongest hunk is
drop_views→title_memory_unmapping—open/remappednever clearedclean,PUBLISHEDorVIEWS, so a freed address kept stale state; that is a deterministic leak, not a race. The descriptor lock is real too: my parent-commit A/B caughtassert!(host.made(5))failing 1/60 full-suite runs, and the head is 0/40. One correction: the body describes that race backwards — the observed failure was the post-sync assert seeingfalsebecause another sync had consumed the write-watch reset, not!madeseeing an early mirror. Same root cause, opposite direction.Two nits in
pool.rs:forget_released(gone.raw)beforelock(&TEXTURES).give(...)(:713-714). As written, a texture created at the same COM address in that gap can have its freshRECENT/UNSEENentry wiped by the release. The mechanism is right (wrapper reuse is independent of the 2.5 s pieceREST), just the order.dropping_last_...asserts on process-globalRECENT/UNSEENafter freeing a COM object (a parallel pool test landing on the same wrapper address re-addsraw), andreleased_texture_pointer_...callsnote_unseen(..., 10, 5)(:1295), whoseretainevicts every otherUNSEENentry withbegun <= 5. Low probability, but this is a flake PR.The watch reorder (
:5190) is not covered: reverting it leaves the whole 602-test suite green. That is acceptable for a race, but please don't count it as tested — it removes the specific window where the address is back with Windows whileguards().changingstill makesleft_alone()skip guarding; the residual window betweendrop(changing)andUnmapViewOfFileis argued, not closed.Mutation coverage otherwise holds: dropping
forget_releasedfromreleasefails the new test atpool.rs:1345, and dropping justUNSEEN.removefails both. Merge is clean against current main; a local merge builds and passes 635/0/59 despite the 384-commit gap. #2896 is complementary (different hunks), but note #2908'srequire_host()sweep would leave the newpool.rs:1313test on the old silent form.Imported from ubiquitarianism/leonida. Originally posted by Neutron-0 on 2026-12-01T18:21:03Z.
Verified on Windows 11, Rust 1.98.1, no GPU and no game files.
The fix is shown to be needed, by reverting only the source the change touches. The pull request's own new test
pool::tests::dropping_last_pooled_texture_reference_forgets_recent_and_unseenpasses on the headbce4a898b, and fails when the one line the fix adds toReclaim::releaseis taken out of the head'sd3d12/crates/leonida-gpu/src/pool.rs(forget_released(gone.raw);), with the rest of the head untouched:bce4a898btest result: ok. 1 passed; 0 failedtest result: FAILED. 0 passed; 1 failedThat test builds a real 32x32 RGBA8 texture, keeps a second COM reference so the first drop does not release it, drops the last reference, and then checks that the raw pointer is gone from both
RECENTandUNSEEN- so it does cover the wiring, not only the helper.The other new test covers less than its comment says.
pool::tests::released_texture_pointer_is_not_kept_in_recent_or_unseenpasses on the head, and it still passes with that same line removed: it callsforget_released(raw)itself rather than releasing anything, so it tests the helper and not the path that calls it. Its doc comment ("Releasing a pooled texture clears its raw pointer fromRECENTandUNSEEN") describes the other test. Not blocking - the second test covers the wiring - but the comment overstates what is checked.What the parallel runs showed. The whole
leonida-gputest binary was run in parallel, with the shape the report uses (cargo test -p leonida-gpu --lib --features diagnostics -- --skip depth_bounds_pipeline_loads_and_filters_draws), so that the other test threads are there to contend. This was done three times, twenty runs on the head and forty on the base:bce4a898b7fbcd456eThe seven failures on the base were in four different tests, and only one of them is named in the report:
The two watch failures are in the file this pull request changes, under names the report does not list. The report names
watch::tests::nothing_is_guarded_between_our_forgetting_it_and_its_unmappingandwatch::tests::writes_to_views_are_not_lost; the ones that actually fired here arewhat_the_kernel_writes_through_is_not_guarded_for_another_viewanda_block_guarded_before_we_were_told_of_its_view_can_be_written. The first is the same shape the report describes - a view's address reused by another thread while this thread's guard state still listed the block, so the secondguard()query found the block still guarded by somebody else - and the pull request'swatch.rschange (ending the remapping window beforeUnmapViewOfFilereturns the address to Windows, andtitle_memory_unmappingwheretitle_memory_remappedwas called) is aimed at exactly that window. Both of these tests should be named in the report, because they are the ones that failed here.The timeline failure is a different race, in a file this pull request does not touch, and its cause is known.
crates/leonida-gpu/src/timeline/report.rs:1459is not covered by this pull request, and neither by #2884 (which fixes theROLLING.dropped_contentioncounter intimeline/record.rs). The assertion readsleft: None, so there was no wait of 10 ms or more to attribute at all: the test spawns the thread that is to wait on the mutex, sleeps a fixed 20 ms and then releases the lock, and under the load of the whole binary running in parallel the new thread sometimes has not reached the lock by then. It is filed as a separatefinding:in #2570, becausecargo test --workspaceonmainis red at random when it fires. Note the shape of the four pull requests: #2854 fixes the pool and watch races, #2884 fixes thetimeline/record.rsrace, and thetimeline/report.rsrace is a fourth one that nobody has taken.A note on the rates. A race that fires in one run out of ten does not fire in every set of ten, so the difference between the head and the base here is seven failures in forty against none, not a clean per-test verdict for each of the races. The deterministic control above is what shows the change is needed; the parallel runs show the suite is not yet clean.
Not checked: the
descriptorrace in this pull request (it needs the same contention and did not fire in these sixty runs); the GPU crates under a real adapter (no GPU device here).Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T20:54:46Z.
@KelboLive @Neutron-0 Thanks for the thorough verification and mutation checks! Addressed the feedback in
81a6e94a9and updated the PR description:pool.rs): movedforget_released(gone.raw)beforelock(&TEXTURES).give(gone.piece, now())so a texture reusing the COM address aftergivecannot have its freshRECENT/UNSEENentry wiped.UNSEENtest (pool.rs):released_texture_pointer_is_not_kept_in_recent_or_unseennow inserts(raw, u64::MAX)directly intoUNSEENinstead of callingnote_unseen(..., 10, 5)(which ranretainacross other tests' entries), and its doc comment now accurately states it testsforget_releaseddirectly whiledropping_last_pooled_texture_reference_forgets_recent_and_unseencovers the COM release path.descriptor.rsrace direction (assert!(host.made(5))seeingfalseafter a competing sync consumed the write-watch reset) and explicitly noted that thewatch.rsremapping-drop reorder is not directly covered by a unit test.Re-verified
cargo test --locked -p leonida-gpu --lib pool::(10/10 parallel runs, 19 passed, 0 failed) andscripts/check_no_game_data.py.@DIGITALWORLD-PL Thanks for sharing the forced-interleaving confirmation on RTX 5090 -- that cleanly reproduces the exact
assert!(host.made(5))race direction!Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T21:12:55Z.
Real final-reference check at the pool return boundary on
81a6e94amerged into1fff69129. The stock 32×32 real pooled texture test passed 3/3 on each of RTX 4070 SUPER (620.73.4) and Radeon RADV (26.3.1), Win64 Wine 11.22 / VKD3D-Proton 3.1.0.I added the same observer immediately before
TEXTURES.give, restricted to the test texture’s actual COM pointer. BothRECENTandUNSEENwere already empty for that pointer in all six runs with the updated order. Moving onlyforget_releasedback belowgiveleft both entries present at that point in all six comparison runs. Both arms still passed the assertions before final release and after cleanup. This distinguishes the ordering change from eventual cleanup. The probe did not force concurrent COM-pointer reuse.Separately, the selected descriptor sync, alias cast and kernel-write watch tests passed 3/3 in all 24 starts across both trees, both GPUs, and one/eight test threads. The full serial Wine-builtin no-device suite reproduced the same three watch assertions on both trees in every repeat (
holes_are_known_until_the_runtime_tells,no_mapping_is_lost_between_askers,what_is_left_alone_is_no_known_hole). Main reported 640 passes and the PR 642, both with three failures and 59 ignored.MEASURED with synthetic inputs, OpenAI Codex and a separate read-only review.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T23:45:16Z.
VERIFY-2854 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), Wine 11.21, no GPU device, no game files
Verdict: PASS. The pooled-texture fix is a real bug fix and the ordering fix in the watch tests closes a window where an address could be handed back to Windows while a guard still held it. Nothing that passed before fails now.
Head
bce4a898, base the currentmain, merge base7fbcd456, 3 files, +92/−5:d3d12/crates/leonida-gpu/src/pool.rs,d3d12/crates/leonida-gpu/src/descriptor.rs,d3d12/crates/leonida-gpu/src/watch.rs.1. What it changes
A pooled texture's address could be mistaken for a new one.
pool.rskeeps two tables of raw pointers:RECENT(textures made in the last second) andUNSEEN(ones the GPU has not touched). When the last COM reference to a pooled texture went,Reclaim::releasegave the piece back to the pool but left the raw pointer in both tables — and a new resource allocated at the same address would then be treated as one that was "made in the last second", which is what the commit and write-back heuristics read. The change removes it:called from
Reclaim::release, with the raw pointer carried in theReclaimbox.An address could be handed back to Windows while a guard still held it. In
watch.rs's tests the view was unmapped before the remapping guard was dropped, so another thread could take the address whileg.changingstill left its block alone. The change drops the guard first:and the same order is used in
many_askers_tests.A test that raced the background sync thread.
descriptor.rsgains a test-only mutex so a test that inspects a descriptor slot between two syncs cannot race the sync that writes it.2. Red and green, run under Wine
leonida-gpudoes not build on Linux (upstream: "The crates are Windows-only today … Linux follows #2577"), so I cross-compiled it forx86_64-pc-windows-gnuand ran the tests under Wine 11.21.The red side (the merge base with only this pull request's test changes) does not compile: the new test calls
forget_released, which the change introduces (error[E0425]: cannot find function 'forget_released' in this scope). So the usual "the test fails on the base" cannot be shown, and I compared the base with the pull request's head instead:pool::tests::released_texture_pointer_is_not_kept_in_recent_or_unseenandpool::tests::dropping_last_pooled_texture_reference_forgets_recent_and_unseen, both passThe three that fail on both sides are
watch::many_askers_tests::holes_are_known_until_the_runtime_tells,watch::many_askers_tests::no_mapping_is_lost_between_askersandwatch::tests::what_is_left_alone_is_no_known_hole— they are about which pages the runtime reports as known holes, and they fail identically with and without this change, so they are not this change's doing. They are the tests this pull request is about (it fixes races in them), and they need Microsoft'sVirtualAlloc/VirtualQuerybehaviour, which Wine does not have.3. What I did not check
watchtests fail here on both sides, so I could not see them turn green; the pull request's own claim (that they are flaky under parallel runs) is not something I could confirm or refute here.pool::tests::dropping_last_pooled_texture_reference_forgets_recent_and_unseenneeds a host device (crate::host::host()) and returns early without one; under Wine a device exists, but I did not check that the texture really came back through the pool rather than through another path.RECENTandUNSEEN. I checked that the stale pointer is gone; I did not trace what the heuristics now decide differently.AI-assisted: MiniMax M3.1 Flash.
Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:19:12Z.
Native Windows verification with separate leonida-gpu library test executables at merge base
7fbcd456eand PR head81a6e94a9. Each invocation started a fresh process with --test-threads 16.No failures in either group. The full-suite runs exercised concurrent tests from other modules as well. The baseline flake did not reproduce here, so these results verify repeated passes on Windows without establishing a change in failure rate. Codex-assisted.
Imported from ubiquitarianism/leonida. Originally posted by DIGITALWORLD-PL on 2026-12-02T07:43:36Z.
Follow-up: I tested your
TEST_SYNC_LOCKfix at81a6e94a9on Windows with a GeForce RTX 5090 (driver 621.01). Inrecords_copied_as_bytes_are_made_at_the_next_sync, I paused a competing synchronization round after it took the dirty page for slot 5 and before it published the host descriptor.7fbcd456e81a6e94a9TEST_SYNC_LOCKacquisition insidesync_heaps()removedEach group of six used three fresh processes with the helper thread and three with inline synchronization. All 12 failures hit the original positive assertion
assert!(host.made(5)). The mutation kept the copy-side guard in place, isolating the contribution of the round-side lock. Three additional forced runs with the default helper and early-polling settings also passed on your head.This confirms the descriptor fix for this controlled schedule. The selector verified the RTX 5090 D3D12 device by DXGI name and LUID. AI-assisted testing and review with OpenAI Codex (GPT-6.2 Astra).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T13:15:57Z.
RUN (in game, grouped): this head
81a6e94a9was merged withgit merge --no-ff, together with nine other rendering pull requests, ontomainf6dd2242e(no conflicts), and the d3d12 layer was rebuilt from that tree (diag profile, with DLSS). RTX 4060 8 GB, driver 610.88, Windows 11;scripts/play-d3d12.ps1 -SeriesS -Resolution 1080 -FrameGen 2, low-memory profile, keyboard-driven entry into the world and a walking route.Heads in this run: #2854
81a6e94a9, #293668215ad0b, #2939561bbc19c, #2997ef429f923, #3043915d4d5aa, #3045cb30a595a, #30460f19a0819, #3047c33e5b48e, #30482ab0b4b9d, #3051856615ce7.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T13:19:33Z.
Merging. Head
81a6e94a9merges cleanly withmainbf7886746and does not force a rebase of #2566. Checked on head81a6e94a9: all 6 CI checks green; third-party red/green by DIGITALWORLD-PL (RTX 5090) on this head; an in-game run of at least 381 s with this head merged onto mainf6dd2242e(grouped with nine other rendering pull requests, comment above) showed no device loss, no unhandled exception and no hang; item claimed in the coordination issue; author has earlier merged pull requests; conflict-free merge against main. Merged by MoonEyes.AI-assisted (Claude Code).