Repository navigation
Conversation
|
Your claim is there ( One small thing while reading the diff: This one changes AI-assisted (Claude Code). |
|
Independent Windows check, A/B over repeated runs:
So the GPUs tested: n/a (unit tests). AI-assisted: yes. |
|
@MoonEyes Thanks for catching both!
@Kal0s-design Thanks for the independent 40-run Windows 11 A/B verification (4/40 -> 0/40)! AI-assisted: Antigravity |
|
RUN (independent run on Windows, #2854 head 99ed483, merged locally into main 3393cee with Commands, in
Since this run the head moved to eab9e2a, which only moves Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Rust 1.98.1. |
|
One thing before a merge, from enlight3d's check and confirmed by reading: taking the call of AI-assisted (Claude Code). |
|
I tested the requested last-reference regression at
That 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). |
|
@MoonEyes Added
@merzleckeier Thanks for testing the last-reference drop path independently as well! |
|
For comparison with the test-only lock in this PR, we tested an alternative for 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 Our one-file patch checks the fresh slot before the raw copy, submits a closed command list through AI-assisted testing and independent review with OpenAI Codex (GPT-6.2 Astra). |
KelboLive
left a comment
There was a problem hiding this comment.
The strongest hunk is drop_views → title_memory_unmapping — open/remapped never cleared clean, PUBLISHED or VIEWS, 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 caught assert!(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 seeing false because another sync had consumed the write-watch reset, not !made seeing an early mirror. Same root cause, opposite direction.
Two nits in pool.rs:
- Call
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. - The new tests are not hermetic:
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 while guards().changing still makes left_alone() skip guarding; the residual window between drop(changing) and UnmapViewOfFile is argued, not closed.
Mutation coverage otherwise holds: dropping forget_released from release fails the new test at pool.rs:1345, and dropping just UNSEEN.remove fails 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's require_host() sweep would leave the new pool.rs:1313 test on the old silent form.
|
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
That 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 The other new test covers less than its comment says. What the parallel runs showed. The whole
The 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 The timeline failure is a different race, in a file this pull request does not touch, and its cause is known. 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 |
Claim:
D3D12-GPU-TEST-PARALLEL-FLAKES(#2570 (comment))Fixes the three process-global parallel test races 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)nothing_is_guarded_between_our_forgetting_it_and_its_unmappingandwrites_to_views_are_not_lostcalledUnmapViewOfFilebefore droppingRemapping, returning the virtual address to Windows whileg.changingstill listed its block asleft_alone. Any concurrent test whoseMapViewOfFile/VirtualAlloc2reused that address skipped guarding or lostpublished(...). Ended the remapping window beforeUnmapViewOfFile.drop_viewscalledtitle_memory_remappedinstead oftitle_memory_unmapping, leaving staleVIEWSbitmap bits behind after unmapping. Switcheddrop_viewstotitle_memory_unmapping.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, causingassert!(!host.made(5))to observe an early mirror. Added a#[cfg(test)]TEST_SYNC_LOCKaroundsync_heaps()and held it across the raw copy + pre-sync assertion.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 clearedRECENTandUNSEENviaforget_released(raw)on final release.released_texture_pointer_is_not_kept_in_recent_or_unseenand 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(atbce4a898b):forget_released(gone.raw)inReclaim::release:0 passed; 1 failed(panicked on post-dropRECENTassertion).forget_released(gone.raw)restored:cargo test --locked -p leonida-gpu --lib dropping_last_pooled_texture_reference_forgets_recent_and_unseen -- --nocapture: 1 passed, 0 failed.cargo test --locked -p leonida-gpu --features diagnostics --lib dropping_last_pooled_texture_reference_forgets_recent_and_unseen -- --nocapture: 1 passed, 0 failed.cargo test --locked -p leonida-gpu --lib pool::: 20/20 consecutive parallel runs passed.cargo test --locked -p leonida-gpu --lib -- --skip depth_bounds_pipeline_loads_and_filters_draws(default thread count): 17/18 parallel runs passed (601 passed, 0 failed, 55 ignored each); run 18/20 hit an unrelatedwatch::port7_tests::no_write_is_lost_with_port_7+watch::tests::what_is_put_in_beside_the_guards_is_told_at_every_viewparallel flake.depth_bounds_pipeline_loads_and_filters_drawsfails deterministically on Windows 10 inbox D3D12 without Agility SDK; tracked in d3d12-gpu: drop unused SM 6.6 root signature flags in depth_bounds test #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)