Tests: a wait for a later signal on another queue gets past sparse uploads #603
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!603
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-603"
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?
@Kalmarv on GitHub · 2026-11-24 02:22 UTC · original
Kalmarv:test/sparse-1047-cross-queue→main· +70 −0 · 1 files · 1 commits · openA title's queue may GPU-wait for a fence that another of its queues signals only in a later submit; async compute does this.
sparse::before_executeuploads the CPU's writes into the sparse windows before each submit. A fix for the uploads' cross-queue writes (#262) that makes XCL's upload queue wait for the submitting queue's earlier work would make that wait for itself: A waits for B, B's submit waits for the upload, and the upload waits for A. This test guards against that. It changes no runtime code.Part of #262. The other test for #262, that an upload waits for the title queue's writes into the same window (debug layer message 1047), fails on
main. It follows in a later PR together with the fix.What is in it
crates/xcl/tests/sparse_queue_waits.rs:a_wait_for_a_later_signal_on_another_queue_does_not_hang, in its own process. Queue A waits for fence F; the CPU writes and A submits. The CPU writes again; compute queue B submits and only then signals F. A must finish within 5 s. If it doesn't, the test signals F from the CPU so that the process can end, then fails. A's two submits use two empty lists, so that no list is submitted again before its first run has finished.Tested
cargo test --workspace -- --test-threads=4on7a1794c, an earlier version of this commit (the skips printed instead of callingrunner::skip_test, and A submitted one list twice): 678 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.cargo test --workspace -- --test-threads=4on the headfc7336cmerged ontomain9e3831e(a clean merge,cb10791): 777 passed, 0 failed, 41 ignored (thexcllibrary: 727 passed, 21 ignored;sparse_queue_waits: 1 passed). SKIPPED:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).sparse_queue_waitson its own, on the head commitfc7336c, 3 runs: passes 3 of 3, in 0.2 to 0.4 s.0b33cf8submitted A's list twice and got 1 error in each of 2 runs:ExecuteCommandLists: Failed to execute a command list … because the command queue fence has not advanced past previous executions of the command list(message 553), as thehollowedone found in review.0b33cf8merged ontomaincb868b2(report):.\scripts\test.ps1686 passed, 0 failed, 41 ignored, no SKIPPED; the test on its own passes 3 of 3.XCL_ADAPTERdoes not reach this test (it takes the default adapter,create_device(None), astexture_states.rsdoes). So a local copy that opensEnumWarpAdapter("Microsoft Basic Render Driver") was run instead.sparse::initmakes no sparse windows there, and the test skips withSKIPPED a_wait_for_a_later_signal_on_another_queue_does_not_hang: no sparse windowsand exits 0. WithXCL_REQUIRE_GPU=wave64the same skip fails, throughrunner::skip_test.7a1794c: with the upload made to wait on the GPU for the submitting queue's earlier work (a fence that queue signals, waited on by XCL's upload queue; a local change only, not in this PR), it fails 3 of 3 with "queue A did not finish in 5 s".Not tested
0b33cf8(MesshM's run above), not on the head commit. On WARP the test only skips: it needs sparse windows, and WARP gets none.AI use
🤖 Generated with Claude Code
@MesshM on GitHub · 2026-11-24 02:33 UTC · original
Test run of
0b33cf8629be37562824ca4610246457bada580bon AMD RDNA4; the PR was tested on NVIDIA only. The branch is based on7ebf1b8, so I merged it onto currentmaincb868b2locally (clean merge, one new file) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debug.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) on the merge: 686 passed, 0 failed, 41 ignored, exit code 0SKIPPED, so the test got a device and sparse windows here and did not skip;a_wait_for_a_later_signal_on_another_queue_does_not_hangpassesReview: the test sets up the case the description gives: queue A waits for F before its second submit, the CPU writes into the sparse windows before each submit (
before_executewith the written addresses), and the compute queue B signals F only after its own upload. On a timeout it signals F from the CPU before failing, so a regression fails the test instead of hanging the run, and it is in its own process (crates/xcl/tests/), soXCL_UMA_MB/XCL_COHERENT_MBset at its start reachsparse::initand touch no other test. On currentmainit passes, as expected for a guard written ahead of the #262 fix. Small thing: the sparse block fromalloc_inis not freed at the end; harmless in a process of its own. I found nothing to change.Not tested: no retail title (not needed for a test-only change), release build, the second #262 test (the description says it follows with the fix).
Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@Kalmarv on GitHub · 2026-11-24 02:49 UTC · original
Thanks, confirmed and fixed in
fc7336c. Under the D3D12 debug layer (a local copy that turns it on and counts the InfoQueue's error and corruption messages),0b33cf8gives the same error in 2 of 2 runs, message 553:ExecuteCommandLists: Failed to execute a command list … because the command queue fence has not advanced past previous executions of the command list. So the debug layer dropped A's second submit. With A's second submit on its own empty DIRECT list and allocator, as you did, I got 0 errors in 2 runs. The fence order is unchanged. The test without the debug layer passes 3 of 3 on the head. RTX 5070 Ti (NVIDIA 610.74), Windows 11 26200, rustc 1.99.0, debug. The description is updated.Claude Code (Claude Opus 5.5) ran the check and wrote this reply.
🤖 Claude Opus 5.5
@thehollowedone on GitHub · 2026-11-24 02:35 UTC · original · edited 2026-11-24 07:19 UTC
The queue-A fixture submits
latwice without waiting for its first execution to finish. At 0b33cf8, the stock test passed, but a scratch run with the D3D12 debug layer enabled reported one InfoQueue error: the command list was submitted again before the queue fence advanced. That means the pass may not exercise both intended submissions under validation. Queue-A submissionsI gave the second submission its own empty DIRECT list and allocator in the scratch fixture. The test then passed with zero InfoQueue errors or corruption messages and no skips. The fence order stayed the same.
RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC, debug.
cargo test --offline --locked -p xcl --test sparse_queue_waits -- --test-threads=1 --nocapture. This checked the fixture and queue progress, with no retail or full-workspace run.AI use
Codex with GPT-6.2 Sol added the scratch diagnostics, ran the tests, and drafted this review.
Retest on the corrected fixture
The fixture from
fc7336cpassed 1/1 againstmainat1ec4c98. I then enabled the D3D12 debug layer in a scratch copy and added a VRAM readback after the fence. Both queues completed, and all 8,192 bytes across the two uploads matched. The scratch test passed 1/1. Both runs had zero skips, and the scratch run recorded zero InfoQueue errors or corruption messages.Same RTX 3080 Ti / 621.35, Windows 11 build 26300, Rust 1.99.1 MSVC, release. Both runs used
cargo test --locked --offline --release -p xcl --test sparse_queue_waits -- --nocapture --test-threads=1. This retest covers synthetic cross-queue ordering and uploaded bytes.AI use for this update: Codex (GPT-6, exact variant unavailable) extended the scratch fixture, ran the tests and drafted this update.
@JJAutoCompare on GitHub · 2026-11-25 06:43 UTC · original
Empirical test report (
fc7336c3)Hardware / environment
fc7336c3f8a6006ed1c7311394df8392b9489ac7(PR #603).0ef1bc386,x86_64-pc-windows-msvc), unoptimized test profile. DXC 1.9.2609.5 (01b62ad47).Commands and results
cargo test --workspace --no-runoutside the Arc lock exited 0 and built 16 test executables. The build command ran zero tests.Invoke-ArcTest.ps1 -Test { ... }withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1, ran the prebuilt executable:sparse_queue_waits-97916d7615bddbfd.exe a_wait_for_a_later_signal_on_another_queue_does_not_hang --exact --test-threads=1. Exit 0. 1 passed, 0 failed, 0 ignored, 0 skipped (case-sensitive^SKIPPEDcount). The diff adds no CPU-only tests.Observed behavior
The log reported three sparse windows backed by tiled buffers. The test wrote to two sparse pages and submitted work on a direct queue and a compute queue. The direct queue's completion fence reached its target within the five-second wait, after the compute queue signaled the fence the direct queue was waiting on. The focused test binary reported 1.41 s for the run.
Not tested
The full GPU workspace suite and game smoke runs were omitted. The prior runtime revision was not exercised.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr603-focused.log and published.
@DavidM1911 on GitHub · 2026-11-25 12:58 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
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.