Tests: wait for the last deferred CPU write #1337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1347"
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 ebarr24 on 2026-11-24T15:04:31Z.
The deferred CPU-write test can observe the first dword before the worker stores the second. This is the intermittent failure reported in #546. The test now waits for the final store before reading both results.
What is in it
cpu_writes.rs's test module, wait for the last immediate dword with an acquire load, then check the first. Keep the atomic destination alive if the test times out while the worker is still queued.Tested
scripts/test.ps1withXCL_ADAPTER=3080andXCL_REQUIRE_GPU=meshon both base930e8b4and head5ec0cf4. Each run reported 751 passed, 0 failed, and 41 ignored. Two native-wave64 tests returned early and are included in the reported passes.5ec0cf4, 32 fresh libtest processes each passed bothcpu_writes::testscases with--test-threads=2.cb868b2held the second store briefly. The original polling order observed a zero second word in all three runs. Waiting for the final store passed all three runs with the same delay. The test in this PR uses the regular worker.Regression run
The diff is confined to one unit test in a runtime file and qualifies for maintainer review under the
test-onlylabel.Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:17:36Z.
Full-suite run, since this PR has no test report yet. Tested exact head
5ec0cf4(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.#[test]functions in the diff.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T15:33:32Z.
Under Wine on Linux, with an
x86_64-pc-windows-gnubuild, the changed test fails every time at its newwritablecheck, wheremainpasses.Tested
x86_64-pc-windows-gnu(mingw-w64 GCC 16.2.0).5ec0cf4as it is andmain930e8b4, no uncommitted changes. The lib test binary runs under Wine.cpu_writestests (readback_u64_lands_after_the_queue,writes_land_after_the_queue, andtitle_textures::…gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes, which the filter also matches), 20 runs each,--test-threads=1:main930e8b4: 20 of 20 ok.cpu_writes.rs:185,assertion failed: writable(va, std::mem::size_of_val(&WORDS)).VirtualQueryforWORDS, reverted afterwards:state 0x1000(MEM_COMMIT),protect 0x8(PAGE_WRITECOPY),alloc_protect 0x80,type 0x1000000(MEM_IMAGE). The static lands in the image's.bss(0x140a6d000), a page nothing has written yet, andwritable()accepts onlyPAGE_READWRITE/PAGE_EXECUTE_READWRITE.PAGE_WRITECOPYuntil they are first written. So this may not be Wine-specific. Whether it shows up there probably depends on whether something else has already written that page (the MSVC and GNU layouts differ). I have not run it on Windows.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:17:55Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (One run showed a single flaky failure / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
title_memory_budget_mbis 13,824 MB regardless of the adapter's memory #1327Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:25:14Z.
Regression run of
5ec0cf4aon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by sage-sage on 2026-11-26T17:53:36Z.
Test report: the race this PR fixes is real on current
main, but the new test fails when it runs alone. Merged onto currentmainb49be18(clean merge,083a1b54locally).Tested
cargo test --workspace -- --test-threads=4: 1435 passed, 0 failed, 47 ignored, 29 SKIPPED lines (the same asmainhere)main's version of the test failed once in about 900 whole-lib runs at--test-threads=12(left: [7, 9],right: [7, 9]: the second dword landed between the compare and the print). With a 20 ms sleep put between the worker's two stores (local only),main's test fails every time (left: [7, 0]), as the description says.cargo test -p xcl --lib writes_land_after_the_queue(the test alone, orcpu_writesalone): fails 4 of 4 runs atassert!(writable(va, std::mem::size_of_val(&WORDS))).WORDSis a static in the image's.data, and until something writes to its page,VirtualQueryreportsPAGE_WRITECOPY(0x8), whichwritabledoes not accept. In a local probe the page read0x8before a store toWORDS[0]and0x4after, and with that store the test passed. In the whole suite it passes because another static on that page has been written first.A destination that stays alive without being in
.data(for exampleBox::leak(Box::new([const { AtomicU32::new(0) }; 2]))) or a store toWORDSbefore the check would avoid it; I have not tried either beyond the probe above.Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:30:05Z.
Triage (#1607) – head
5ec0cf4The race in
cpu_writes::tests::writes_land_after_the_queue(waiting for word 0 then checking word 1) is gone on main: commit342ba2d("D3D12.X: order waits after deferred CPU writes") changed the test toafter_with_completion(...)andcompletion.wait()before comparing both words.Recommendation: close (superseded by main commit
342ba2d).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 throny on 2026-12-01T12:44:31Z.
Closing as superseded: this change is already on
main(342ba2dd). main cpu_writes.rs writes_land_after_the_queue waits on after_with_completion(...).wait() so the polling race is gone; commit342ba2dexistsTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed