Repository navigation
D3D12.X: do not borrow title memory in texture workers - #2849
guinpereira wants to merge 1 commit into
Conversation
|
Independent Wine verification of production head Environment: Linux, Wine 11.0, Rust 1.98.1, Windows MSVC target, 16 GiB host RAM; 9 GiB memory / 512 MiB swap cgroup limits, 180 s timeout, one test thread. RTX 4060 Laptop host, but these are CPU/Win32 memory tests, not GPU rendering. The installed vkd3d stack is diagnostic-relaxed; no native-Windows or stock-driver certification is implied. Production code unchanged. Two local test-only strengthenings:
The API adaptation is simply: let bytes = title_bytes(base, PAGES * PAGE);
std::hint::black_box(content_hash(&bytes));
assert!(bytes.chunks(4096).enumerate().all(|(k, c)| {
let n = c.iter().position(|&x| x != tag(k)).unwrap_or(c.len());
c[n..].iter().all(|&x| x == 0)
}));The local fixture additionally uses a scoped thread and a stop-on-drop guard to stop the mutator on assertion failure. It requires a nonzero concurrent-decommit count and successful decommit/recommit calls. No production hooks or mocked memory calls. Suggested changes before merge: rename the existing test/doc comment (it now requires copying outside UMA, not in-place use whenever readable), and retain a source-release/concurrent-decommit regression. The existing static byte-equality test alone does not exercise the lifetime defect from #2841. Performance/RAM limitation: No matched-parent race run: deliberately reproducing the known worker access violation is not needed for this verification. No title launch, Game Init watchdog fix claim, or gameplay/OOM claim. Local evidence: |
|
Independent test report under Wine/Proton (not native Windows) for head Tested
(Counts are from the last
The test change only switches the existing assertion from Not tested
AI use
|
|
Two contributors checked independently and found that #2877 solves the same problem (for #2841) in a different way: #1607, group D142. 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. |
|
For D142, I compared the exact read helpers from Across three processes with nine alternating samples each, the #2877 UMA helper’s per-process medians were 0.27–0.29 us (16 KiB), 4.75–6.60 us (256 KiB), and 476–485 us (4 MiB). In that same fixture #2849 did no copy for those ranges. This measures obtaining and dropping the slice or copy, before detile or upload. No GPU work, title run, or frame-rate claim. The choice also affects scope: #2849 changes the shared helper used by submit-time hashing for non-UMA memory; #2877 keeps that caller on the old path. OpenAI Codex (6.2sol) assisted with verification. |
Relates to #2841.
Copies title bytes page by page instead of borrowing the range, so a worker cannot fault if the title decommits pages between the readability check and the detile copy.
What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs: page-by-page copy instead of borrowing the title range.Tested
cargo test -p xcl --lib -- --test-threads=4: 1315 passed, 4 failed (GPU OOM in dxil fuzz tests, environment), 27 ignored.cargo build -p xcl: clean.Regression run
Reference run on the author's local main (05adb5a). A run on ivall/xcl main and on this PR's head commit is still pending (cold shader cache crashes the title's startup precompile on this machine).
Not tested
AI use
OpenCode, Beam Free - drafted the change; smoke run and review by the author.