d3d12: refuse section-backed imports that RADV silently substitutes #199
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!199
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-199"
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?
@smith-3 on GitHub · 2026-11-25 21:11 UTC · original
smith-3:codex/radv-section-import-probe→main· +141 −7 · 5 files · 2 commits · openOn RADV, every GPU import of XMem physical pages silently reads zeros. XMem pages are section views, which Wine maps as shared memory. RADV refuses shared memory as a host pointer, and vkd3d-proton then allocates unrelated memory while
OpenExistingHeapFromAddressstill succeeds. Strict mode (TUXBOX_REQUIRE_BUFFER_IMPORT=1) does not notice, because a CPUMapof the heap still returns the guest pointer. This matches thebuffer-remapfailure in #189.This PR probes once per device with a GPU copy from an imported section view. When the copy misses the canary, imports of section-backed ranges fail with
E_NOTIMPLand a log line, instead of aliasing nothing. If the probe itself cannot run, the previous behaviour is kept. The first commit only improves thebuffer-remapdiagnostic so it reports every wrong copy.This does not make AMD work. XMem-backed buffers still cannot be imported on RADV. They now fail visibly instead of reading zeros. A real fix needs private (non-shared) backing for guest pages or a different import path, and is out of scope here.
Evidence
Ryzen 7 9700X iGPU (
1002:13c0, RADV 25.2.8) and RTX 4080 SUPER (10de:2702, NVIDIA 570.211.01), same machine, Proton Experimental 11.0-20261014.buffer-remapcontrol:1002:13c010de:2702copy 0: 256/256 wrong, [0]=0 expected 0x12340000; copy 1: 256/256 wrong ...; copy 2: 256/256 wrong, [0]=0 expected 0x98760000PASS words=768/768 identical=1 replacement=1place remapped buffer failed: 0x80004001, plus the log line belowPASS words=768/768 identical=1 replacement=1Wine trace on AMD before the fix:
Native Vulkan probe (
VK_EXT_external_memory_host,vkAllocateMemoryresult).vkGetMemoryHostPointerPropertiesEXTsucceeds in every case, so it cannot predict the failure.Checks
tuxbox.py check.tuxbox.py check(Lanes, shader translator). Proton'ssteam.exeaborts inlsteamclientwhen the Steam client is not running on this machine. The change only affects imports of section-backed memory on drivers that fail the probe, and NVIDIA passes the probe.🤖 Generated with Claude Code
@tsunderejay on GitHub · 2026-11-25 21:23 UTC · original
Static review found a blocking lifetime issue: the fence is created after submission, so CreateFence/Signal/SetEventOnCompletion failure can return and unmap the section while the GPU copy is still running. Create the fence before submission and ensure every post-submit path waits (or retains the mapping/objects). Also add a bounded wait so a stuck probe cannot hang the title. The remap diagnostic counter has a separate bug:
actual != expected && !wrong++stops incrementing after the first mismatch, so it reports 1/256 instead of 256/256.buffer-remapregression control fails on RADV, with host memory imports refused #191@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 21:11 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.