d3d12 checks: free the memory under an imported buffer #220
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!220
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-220"
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?
@JeffreyBytes on GitHub · 2026-11-26 10:26 UTC · original
JeffreyBytes:test/buffer-unmap-control→main· +112 −1 · 3 files · 1 commits · merged 2026-11-26 11:19 UTCSummary
Two controls for a hazard
mainhas today on amdgpu (found in #191, used by #218): a host-pointer import whose pages go away while the import is still alive makes the kernel reject every later submit.Both are modes of the existing buffer import guest. They place a 64 KiB buffer on private
VirtualAllocmemory through slots 74 and 44, copy from it, free the pages, and then run unrelated upload-to-readback copies that are verified by readback (a lost device still completes the fence).buffer-unmap-releaseddestroys the buffer before freeing its pages. Later copies must arrive:mode=released later-submits=ok.buffer-unmap-alivefrees the pages while the buffer still exists. Whether later submits survive is the host driver's behavior, so the control reportslater-submits=okorlater-submits=lostand passes with either. Nothing in the provider can prevent it for memory the title frees itself, so this is a record of the host, not a gate.On the RX 6700 XT the alive mode prints
radv/amdgpu: The CS has been rejected, see dmesg for more information (-14), vkd3d-proton reportsVK_ERROR_DEVICE_LOST, and all three later copies read back 0 of 256 words, including the one made after the buffer is released. The released mode reads back 256 of 256. These are the same messages ProjectScarlett ends with after a page remap when imports are direct.Not included: a variant on XMem pages (remap or unmap with the import alive, later submits still work). As discussed on #218, that belongs with the XMem side that has to honor the hold.
Verified on Lanes
python tuxbox.py checkpassed on this branch — all stages but "Shader translator on the GPU", which also fails onmainhere (#219)This adds regression controls only; no provider code changes.
GPU, driver and backend: AMD Radeon RX 6700 XT (
1002:73df), Mesa RADV 26.3.1, Linux 7.3.6, Proton backend with GE-Proton11-14.buffer-unmap-aliveto reportlater-submits=okthere, but have no card to confirm.The translator stage fails the same way on
mainon this machine and this branch does not touch it: #219.Receipts for the new cases:
Checks
python -m unittest tests.test_d3d12_regressionscovers the two receipt rules. No evidence JSON changes.Two controls for the buffer import guest, with private VirtualAlloc memory placed through slots 74 and 44. buffer-unmap-released destroys the buffer, frees its pages, and then requires unrelated upload-to-readback copies to arrive. buffer-unmap-alive frees the pages while the buffer still exists. On amdgpu every later submit is then rejected ("The CS has been rejected (-14)") and the device is lost, which is how ProjectScarlett dies after a page remap when imports are direct. Whether this happens is the host driver's behaviour, so the control reports later-submits=ok or lost and passes with either.buffer-remapregression control fails on RADV, with host memory imports refused #191