DirectStorage: EnqueueSignal takes a fence in memory VirtualQuery does not know #1813
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!1813
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1813"
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?
@us3r40456 on GitHub · 2026-11-24 21:03 UTC · original
us3r40456:dstorage-native-host-fence→main· +60 −4 · 1 files · 1 commits · draftOn a Mac, a DirectStorage fence is never signalled, so a title that waits on one waits forever.
EnqueueSignalchecks the fence and its table withgpu::shader::readable, which asksVirtualQuery. D3DMetal (CrossOver) keeps its D3D12 objects in memory that Wine'sVirtualQuerydoes not know (the test title's fence is at0x7fcc2d0f7540), so every fence is refused and its signal dropped, with nothing in the log. This PR reads the fence pointer and its table withread_own(ReadProcessMemory), the helper this file already uses for the page lists. It still refuses memory that cannot be read. Part of #258, found while testing #1329 there (#1329).What is in it
crates/xcl/src/hle/dstorage.rs,queue_enqueue_signal: the fence's first word and the table's first 11 words are read withread_own. A null pointer, a null table or memory that cannot be read still enqueues nothing, as before. The Signal call itself is unchanged.a_fence_of_the_hosts_d3d12_is_signalled: a fence from the host's D3D12 (WARP if there is no adapter, as infence_x.rs) is taken byEnqueueSignal, andSubmitsignals it. A pointer to a reserved, uncommitted page is still not taken.Tested
hle::dstorage::one at a time (--test-threads=1), at this PR's head4d19aedonmaine9e94ce: 30 passed, 0 failed, the new test included (on the earlier base9e3831e: 18 of 18).queue_enqueue_signal(on9e3831e) fails on D3DMetal:the host's fence was not taken(0 entries instead of 1). With this PR it passes.tests/e2e.rsruns it, with a freshXCL_DATA_ROOT), with this change on the earlier base. Plainmainstops on a Mac before the DirectStorage check, so this is onmain9e3831e+ #750 + #1329 + Ahmet-Dedeler'spr/native-host-vtables(ddf3be7). With those, the title runs to its end:DirectStorage (xcrdapi): … the DirectStorage fence was not signalled;IsBadReadPtrversion). The other three are the window cloak (#1462), "no GPU timestamp" (#996) and XMA2GetState(#890).Regression run
This changes
crates/xcl/src/hle, so it needsxcl-smokepairs. I have no title. On Windows a D3D12 fence is in memoryVirtualQueryknows, and both checks take it, so I expect nothing to change there. A Windows pair would confirm that, and a Mac pair would show the effect on a title. Draft until the pairs are here.main:
PR:
Not tested
hle::dstorage::.AI use
@us3r40456 on GitHub · 2026-11-24 21:55 UTC · original
Overlap with
mac7. @Ahmet-Dedeler, yourmac7(dbd9d09) fixes the same thing more widely. In105498f("Mac host basics"),gpu::shader::readableprobes memory by reading it, withIsBadReadPtr, whenVirtualQueryreports it free and the host's D3D12 is native (NATIVE_HOST_MEMORY). That coversEnqueueSignaland every otherreadablecaller, where this PR only changesEnqueueSignal.On the test title, on this Mac (M5 Pro, CrossOver 26.3, D3DMetal), with
mac7+ #615 + #750: the DirectStorage check passes without this PR. The title gets 48 PASS / 2 FAIL, the same in 2 runs. The two failures are the window cloak andOpus GetState: ctx=0x0, queued=1. Without #750,mac7stops at the console-format shader check, the same D3DMetal crash #750 fixes.So which do you prefer: will you send the
readablechange as its own PR, so I close this one in its favour, or should this one go on as the narrow fix until then? Either is fine with me.AI use: Claude Code (Claude Opus 5.5) helped build, run and compare; the runs are on my Mac.
@DavidM1911 on GitHub · 2026-11-25 00:28 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@Toons29 on GitHub · 2026-11-25 03:37 UTC · original
Regression run of
4d19aed2on 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, 99 % 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.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.