D3D12.X: the count check's buffer stays INDIRECT_ARGUMENT between checks #3009
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3009"
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 ivall/xcl. Originally posted by voiceovarian1-max on 2026-11-27T12:09:24Z.
For nvidia-dev. The indirect count check (
indirect_guard) moved its buffer to INDIRECT_ARGUMENT before each checked ExecuteIndirect and back to COMMON after it. That is two transitions per check, each a barrier the GPU waits at. A retail title's world makes ~1,640 checked ExecuteIndirects a frame. The buffer now stays INDIRECT_ARGUMENT from one check to the next on a list (check_in,run_keeping,guard_out_ia). It goes back in the same call as the next check's UAV barrier, so a checked ExecuteIndirect takes 2 barriers instead of 3.What is in it
hle/d3d12x/indirect_guard.rs:check_in,run_keeping,guard_out_ia. New GPU testchecked_execute_indirects_in_one_list_keep_the_buffer_between_them: three checks on one list (in range, garbage, in range) each run their own checked counts (7 + 60 groups).hle/d3d12x/bind.rs: the ExecuteIndirect path uses them.Tested
x86_64-pc-windows-gnu, release. Headd6f30c18on nvidia-dev3f39671d.cargo test -p xcl --lib -- --test-threads=4):3f39671d: 1691 passed, 8 failed, 28 ignoredD3DCompileis Wine's own HLSL compiler and refuses its program (E5005 Load3 on RWByteAddressBuffer). The existingan_execute_indirect_with_garbage_counts_runs_no_groupsfails on nvidia-dev for the same reason. #3018 (DXC whenD3DCompilerefuses a program) fixes both.indirect_guardtests with Microsoft'sd3dcompiler_47.dll(WINEDLLOVERRIDES=d3dcompiler_47=n): 5 passed, 0 failed, including the new test and both garbage-count tests.Regression run
scripts/smoke.ps1needs Windows, and we only have Linux. A Windows smoke run on nvidia-dev and on this head would be welcome.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Lum7nt on 2026-11-27T14:50:37Z.
Native Windows 11 + NVIDIA RTX 3060 verification of PR #3009
Tested PR #3009 head \
d6f30c1809\ on native Windows 11 with native D3D12 hardware execution on Ampere (RTX 3060 12 GB, native wave32).Environment
ustc 1.100.0 (0ef1bc386 2026-11-09)\ x86_64-pc-windows-msvc, Windows SDK DXC \1.8.2502.11\ / dxil \1.8.2502.11\
Test Results (\hle::d3d12x::indirect_guard::tests)
Ran targeted \indirect_guard\ tests on the physical NVIDIA D3D12 device:
\\powershell
cargo test -p xcl --lib hle::d3d12x::indirect_guard::tests -- --nocapture
\\
Result: 5 passed; 0 failed; 0 ignored; 0 skipped (0.32s).
Observations
AI disclosure: Testing executed independently on physical hardware; report drafted with agent assistance.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T02:56:35Z.
I checked a two-command-list boundary on exact head
d6f30c1809b5350f09c492cc97ffb29088c56cc3using native Windows D3D12 WARP with the SDK debug layer. A test-only extension of the existing compute fixture records two independent adopted lists, each starting with its ownout_ia=false, and exercises the production guard's shared output buffer.ExecuteCommandListscall emitted debug-layer error 527: the second list declaredUNORDERED_ACCESS(0x8) while the previous tracked state wasINDIRECT_ARGUMENT(0x200).INDIRECT_ARGUMENT → UNORDERED_ACCESStransition at the second entry also produced no such error.All three runs signaled completion and produced the expected 67 groups. The output therefore does not demonstrate visible corruption; the debug-layer result identifies a state-tracking issue for a batched submission. XCL can submit multiple command lists in one driver call. I did not test a physical GPU, retail incidence, performance, or an author fix.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T03:11:03Z.
Follow-up to the cross-list state error: I tested a fixture-only mitigation on head
d6f30c18using Windows WARP and the D3D12 debug layer. Each physical command list transitions the shared guard output fromINDIRECT_ARGUMENTback toCOMMONimmediately before close, while keeping it inINDIRECT_ARGUMENTbetween checks inside that recording.The stock batch control emitted two state errors. The close-time transition emitted none for forward and reversed list submission, replay after fence completion, or lists discarded and reset before submission. Each run executed the expected 134 groups.
This is not a complete production fix. Deferred segments, mid-list splits, and
KickoffXhave paths that call the original PCClosedirectly and would need equivalent handling. Cross-queue concurrency, physical GPU behavior, and retail performance were not tested. The explicit transition is a useful control for the recorded-list ordering tested here, not proof that every close path is covered.AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:18:50Z.
Triage (#1607) – head
d6f30c1No open or merged PR makes this change. The 27 lines shared with #3099, #3111, #3112, #3335 and #3361 are the root-signature boilerplate of an
indirect_guardGPU test, not this change.Concern in
bind.rs::execute_indirect/indirect_guard::run_keeping: the guard'soutbuffer is one per device (guard_of), shared by every list. A list now ends with it in INDIRECT_ARGUMENT, andguard_out_iastarts false for the next recording. That relies on buffer state decay to COMMON. Decay happens when an ExecuteCommandLists completes, not between lists of the same call or across queues. A second list in the same ExecuteCommandLists call, or a list on another queue, then writes the buffer as a UAV with no transition out of INDIRECT_ARGUMENT. The new test records a single list, so it does not cover this. A Windows run with the debug layer would show whether this is a state mismatch there.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.