D3D12.X: per-queue worker dispatch and atomic 64-bit immediate writes (#1488) #1643
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!1643
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1643"
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?
@slopgobblercobbler on GitHub · 2026-11-24 18:35 UTC · original
slopgobblercobbler:fix/cpu-writes-queue-independence→main· +188 −40 · 2 files · 1 commits · openSummary
Implements dedicated per-queue worker dispatch and atomic 64-bit immediate writes in
crates/xcl/src/hle/d3d12x/cpu_writes.rsandlist_x.rs(Issue #1488, findingXCL-BT-003):xcl-cpu-writesworker thread handled writes across all command queues.spawn_queue_worker), ensuring independent command queues make forward progress without blocking each other while preserving strict in-queue FIFO ordering.Write::ImmediateU64(usize, u64)and updatedwrite_nowto commit 8-byte aligned word pairs as a single atomicu64viaAtomicU64::store(..., Ordering::Release).list_x.rs, recordsWrite::ImmediateU64directly for 64-bit bottom-of-pipe writes to title memory, preventing 64-bit tearing under concurrent title polling.atomic_64bit_write_ordering: Validates atomicu64store without tearing under high-frequency concurrent polling reader.independent_queues_do_not_head_of_line_block: Validates that an unblocked command queue executes immediately (< 3s) without being head-of-line blocked behind a stalled command queue waiting on an unsignalled fence.Changes
crates/xcl/src/hle/d3d12x/cpu_writes.rs: per-queue worker dispatch channels, atomic 64-bit stores, and regression tests.crates/xcl/src/hle/d3d12x/list_x.rs: emitWrite::ImmediateU64for 64-bit immediate writes.Tested
cargo test -p xcl -- cpu_writes: 5 passed, 0 failed.cargo test -p xcl -- list_x: 27 passed, 0 failed.upstream/main(c160d86), GPL-2.0-only compliant, zero retail game data or keys.Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
github-bot referenced this pull request2026-11-26 05:30:56 +00:00
@Anon64 on GitHub · 2026-11-24 19:33 UTC · original
Regression run for this PR: head
7711f4c, based onmainc160d86. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
c160d86:this PR:
No device removals or crashes; 99 % of main's frames, 98 % of its peak commit.
Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies from run to run, so it says little about this PR.
Not tested: the whole suite; whether the title reaches the changed code in these 60 s.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@DavidM1911 on GitHub · 2026-11-24 21:06 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!
@throny on GitHub · 2026-11-24 23:07 UTC · original
Two contributors checked independently and found that #562 solves the same problem in a different way: #1607, group D63. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@throny on GitHub · 2026-11-25 17:00 UTC · original
Two contributors checked independently and found that #562 #1819 solves the same problem (for #1488) in a different way: #1607, group D89. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@ -159,3 +178,3 @@static FIRST: std::sync::Once = std::sync::Once::new();FIRST.call_once(|| crate::xlog_info!("D3D12.X: bottom-of-pipe writes outside unified memory are done by the CPU after the GPU ({} in the first submission)", job.writes.len()));let _ = worker().lock().unwrap().send(job);let _ = tx.send(job);@gut0to on GitHub · 2026-11-24 18:37 UTC · original
The fence value and
Signalare serialized underQUEUES, but the job is sent after that lock is released. Two concurrentafter()calls can therefore signal values 1 then 2 yet enqueue job 2 before job 1. Once the fence reaches 2, the worker can apply the newer payload and then overwrite it with the stale value-1 payload, violating the per-queue FIFO guarantee. Please keep enqueue order serialized with fence-value assignment (or use another ordering mechanism). AI-assisted review; I verified the race from this call sequence.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.