d3d12: bind inline ray scenes in queue order #569
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/569"
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?
Imported from brcly/TuxBox. Originally posted by smith-3 on 2026-11-30T04:02:57Z.
Problem
A list can record a reflected inline ray query while a later recording advertises replacement TLAS storage for the same guest address. Rejecting the older batch leaves its downstream texture signals unexecuted. This can happen after #514 when a later list has already published a successor and another build is being recorded.
Change
Resolve the native scene at the dispatch's position in queue order. For reflected direct dispatches and dispatch-only ExecuteIndirect, record the native dispatch at submission between its original prefix and suffix. Keep that work and its scene resources alive through the queue fence. Preserve validation on paths that cannot replay the dispatch.
This draft is open for review of the queue ordering and lifetime model.
Validation
The added native regression records three generations with the same guest scene address. It checks both Dispatch and ExecuteIndirect by reading back the ray hit. The regression rejected the later batch before the change. On
29d5c3d4, the 12 native D3D12 tests selected byscenepassed on an RTX 4080 SUPER using NVIDIA 570.211.01. All four tests selected byscene_publicationalso passed on an AMD iGPU using RADV 25.2.8.In a ProjectScarlett run on the RTX 4080 SUPER with the existing shader cache and #563 in the integration build, the direct queue accepted the batches and the first 3D scene rendered. The run later ended in the Xid 109 tracked by #232, before we could verify player control. The independent branch targets main.
python tuxbox.py check --no-gpuon29d5c3d4completed with 10 passed, 0 failed. Broader GPU checks are pending.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T04:12:02Z.
Heads-up: main just landed a large cleanup (up to
e5d2e913), so this PR needs a rebase.rustfmt.toml).unwrap(), lossyascasts and undocumentedunsafeoutside tests.cargo fmt --check, rustdoc with warnings denied, and Miri on the providers' unit tests.The least painful way is to format your branch first, so the rebase only shows real changes:
Then run
python tuxbox.py check --no-gpu, which now includes the format step.If clippy flags something new:
Fromfor widening,TryFromfor narrowing, and a mask for bit fields.unwrap(): use?, orexpectwith the reason it can't fail.unsafeblock: it needs a// SAFETY:comment.CONTRIBUTING's "Code checks" section lists the commands. Thanks!
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T04:20:59Z.
@smith-3 thanks for this. #566 (ours, opened an hour or so before) is for the same crash, so let's not both go in without thinking about it. What I have:
They look compatible to me (yours would take what #566 doesn't), but I haven't tried them together. I don't mind which goes in, or yours replacing mine; #566 is small and could be the first step. If you have a run where a scene outgrows 4 times its instances, that would be the case that decides it. I'm happy to run your draft on our RTX 5090 next to #566, in the same build, and say what both do; tell me if that would help. Both need main's reformat first.
Imported from brcly/TuxBox. Originally posted by akimfomin on 2026-11-30T06:09:08Z.
I ran a source-only Windows DXR check for this queue-ordering case from VIctory-NVIDIA-Lab. A direct producer and a compute consumer on RTX 4070 Ti SUPER gave 39 expected results across three fenced scene generations. Selecting the older scene changed two answers.
-LateBindingalso passed when I recordedExecuteIndirectfirst and filled the TLAS root SRV in a per-dispatch argument buffer before submission. This exercises the binding mechanism with generated geometry. The guest-address lookup and gameplay crash still need separate checks. Are there producer/consumer fence cases you would like covered in an independent Windows test?Pinned sources and commands.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.