D3D12.X: reject PAGE_GUARD/overflow in cpu_writes and handle stale fence wakeups #1379
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!1379
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1379"
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?
@b3IKK on GitHub · 2026-11-24 15:24 UTC · original
b3IKK:d3d12x/cpu-writes-guard-and-event→main· +112 −25 · 1 files · 1 commits · openFixes two bugs in
crates/xcl/src/hle/d3d12x/cpu_writes.rs:writable()andwrite_now()omitted thePAGE_GUARDcheck and overflow-checked arithmetic thatwrite_u64_now()already performed, so aPAGE_GUARDpage reported writable and could fault the worker thread on store, and largeva + lenvalues overflowedusize.WaitForSingleObjectcall: if an earlier job timed out and its fence completed later while waiting on a subsequent job, the stale signal woke the worker prematurely and applied bottom-of-pipe writes before the GPU finished.This shares one
is_writable_committed()helper acrosswritable(),write_now(), andwrite_u64_now(), and extractswait_for_fence()which resets the event before arming and loops untilGetCompletedValue() >= valueor the wait deadline expires.What is in it
crates/xcl/src/hle/d3d12x/cpu_writes.rs: unifyPAGE_GUARD+ checked bounds inis_writable_committed(); addwait_for_fence()deadline loop withResetEvent; add unit testswritable_and_write_now_reject_guard_page_and_overflow(verified failing before the fix) andwait_for_fence_ignores_stale_wakeup_from_timed_out_fence.Since the last push: rebased onto
main06c9f55.mainalready hasu64_writable_nowwith thePAGE_GUARDand alignment checks, so only the dword path andwritable()share the newis_writable_committed; the u64 path staysmain's. Thewait_for_fencechange merged unchanged.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 1267 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib cpu_writes: 5 passed, 0 failed (writable_and_write_now_reject_guard_page_and_overflowfailed before the fix)Regression run
main (
426a5a7, clean tree, no local changes):PR (
aaf89e0, clean tree, no local changes):(The main block is
426a5a7, an ancestor of the currentmain, from the same machine and data folder.)Not tested
AI use
main06c9f55, resolved the conflicts, ran the suite and thescripts/smoke.ps1pair at the head above.@futurepro62 on GitHub · 2026-11-24 15:32 UTC · original · edited 2026-11-24 15:35 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
7b3fc47(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.writable_and_write_now_reject_guard_page_and_overflow,wait_for_fence_ignores_stale_wakeup_from_timed_out_fence.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 16:49 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@DavidM1911 on GitHub · 2026-11-26 05:03 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.