XGameRuntime: XTaskQueueIsEmpty counts delayed callbacks not yet due #1681
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!1681
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1681"
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?
@emirduran707 on GitHub · 2026-11-24 19:14 UTC · original
emirduran707:taskqueue-is-empty-delayed→main· +23 −1 · 1 files · 1 commits · openXTaskQueueIsEmptylooked only at a port's queued items and the callbacks in flight. A callback submitted with a delay (XTaskQueueSubmitDelayedCallback, orXAsyncSchedulewith a delay) waits in the task queue's timer heap until it is due, so while it waited the port read as empty. libHttpClient's task queue, which XTaskQueue is, counts those entries.TaskQueuePortImpl::IsEmptyis(m_queueList->empty()) && (m_pendingList->empty()) && (m_processingCallback == 0), and a delayed entry goes tom_pendingList(TaskQueue.cpp).A title that dispatches until the port is empty before it terminates a queue, or that uses
XTaskQueueIsEmptyto tell whether its timers are done, stopped too early. The delayed callback then ran canceled at termination.XTaskQueueIsEmptynow also looks for the queue's entries on that port in the timer heap. The locks are taken in the ordersubmit_delayedalready uses: the timer heap, then the port's items, then the queue state. No path takes the timer lock while it holds the other two.What is in it
crates/xcl/src/hle/xgameruntime/taskqueue.rs:XTaskQueueIsEmptycounts delayed callbacks not yet due. Testis_empty_counts_delayed_callbacks_not_yet_due: a 60 s delayed callback keeps the work port non-empty and leaves the completion port empty, and termination cancels it.Tested
cargo test --workspace -- --test-threads=4onc53eed3: 859 passed, 0 failed, 42 ignored; SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)XTaskQueueIsEmpty: it fails atassert!(!XTaskQueueIsEmpty(h, PORT_WORK), "a delayed callback not yet due is still queued")Regression run
main:
this PR:
Not tested
XTaskQueueIsEmptywith delayed callbacks pending; the smoke title's run is a regression check only.AI use
🤖 Generated with Claude Code
@mantavisual on GitHub · 2026-11-24 20:46 UTC · original
Test report for
c53eed33ef16on NVIDIA, which the PR lists as not tested.Tested
cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 859 passed, 0 failed, 42 ignored. The new test ran.4178e88: 892 passed, 0 failed, 42 ignored.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Does the test notice a broken fix?
Arc::ptr_eq(&t.queue, &q)removed, so that delayed callbacks of any queue count, all 11taskqueuetests still pass. The timer heap is shared by all queues and the test makes one. Creating a second queue while the callback is pending and assertingXTaskQueueIsEmpty(other, PORT_WORK)passes normally and fails with that break.Not tested: AMD, retail title, concurrent use.
AI use: Claude Code (Claude Opus 5.5) ran this on my machine, wrote the report and posted it for me.
@DavidM1911 on GitHub · 2026-11-24 21:37 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@MiharaxD on GitHub · 2026-11-24 21:44 UTC · original
Test report on an NVIDIA card, head
c53eed3(onmainc160d86), which covers the "NVIDIA" line.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) onc53eed3: 859 passed, 0 failed, 42 ignored (lib tests 810 / 0 / 22).gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).is_empty_counts_delayed_callbacks_not_yet_duepasses.Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60(release builds, start screen, no input).mainisc160d86:main:
this PR's head:
Not tested
XTaskQueueIsEmptywith delayed callbacks pending: the smoke run is a regression check only.AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting.
@JJAutoCompare on GitHub · 2026-11-25 03:55 UTC · original
XCL PR #1681 compatibility verification
Commit
c53eed33ef1625568c739ca854e4eb34db8d1775on STOR-WINLAB. Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB with driver 32.0.101.9175. The adapter reportsDoublePrecisionFloatShaderOps=0and a wave range of 8–32.d3d12SDKLayers.dllis absent. DXC/DXIL 1.9.2609.5 and rustc 1.100.0 (0ef1bc386 2026-11-09), unoptimized builds with debug info disabled.Tested
cargo build --workspaceandcargo test --workspace --no-runsucceeded. Both emitted two deprecation warnings forAtomic::fetch_update(duplicated in the test build).cargo test -p xcl xgameruntime -- --nocaptureunder the Arc lock reported 75 passed, 0 failed, 0 ignored, 0 SKIPPED lines. All 74 unit tests ran. The libHttpClient integration test returned early becauseXCL_SAMPLE_DLLSwas unset. The new regression passed here and in the workspace run. In a manual queue it verified that a not-yet-due callback makes the work port nonempty, leaves the completion port empty, and clears on termination.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the Arc lock and exited 101. Across 20 harness summaries,pr1681-suite.logrecorded 841 passed, 18 failed, 42 ignored and 3 SKIPPED lines. The harness totals include early returns. Two explicit skips cited no wave64 and one cited no heap windows. These skips provide no test coverage.Of the 18 failures, 13 GPU tests reported
CreateComputePipelineStatereturning0x80070057. Four other GPU tests reported mismatches in fused multiply-add, implicit texture LOD, f16 lane preservation, and wave64 pixel reduction. The test-title e2e failed the D3D12.X dynamic depth-bias check (RSSetDepthBiasX), which produced a blue pixel where green was expected.Not tested
Main-branch baseline, retail-title smoke runs, optional
XCL_SAMPLE_*fixtures, and other GPU adapters.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1681-suite.logand published.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.