ExecuteIndirect only runs single-argument command signatures #757
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#757
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Conrage on GitHub · 2026-11-24 09:37 UTC · original
crates/victory-gpu/src/list.rs:1169matches([[kind, ..]], Some(address)), which is exactly one argument. A signature with more than one argument (for example root constants or a root view per record, then a draw or dispatch) is counted and dropped. It logs "indirect execution dropped (first time for this signature)".Suggestion: build host command signatures for the root-constant and root-view arguments as well, mapped onto our root signature's parameters.
Testers: the
argsfield of those log lines shows which signatures the world uses.AI use: found and written with Claude from reading the code at
8e79c80; not run on hardware.@MartinIndra02 on GitHub · 2026-11-24 10:12 UTC · original
Branch ready on fork (since PR creation is currently collaborators-only): https://github.com/MartinIndra02/VIctory/tree/feat/gpu-multi-arg-execute-indirect (commit
71967c1, based onmainffe310e).What it implements
crates/victory-gpu/src/indirect.rs:cbuffer Record(arg_offset) so the GPU argument clamp bounds the trailing Draw / DrawIndexed / Dispatch / DispatchMesh arguments atid.x * stride + arg_offsetwithout disturbing preceding root constants.plan_indirect()to map single-argument signatures and multi-argument signatures whose prefix arguments areD3D12_INDIRECT_ARGUMENT_TYPE_CONSTANTonto the boundHostPipeline'suser_dataroot-constant parameters (checking contiguity, bounds, collisions with otherUserDataentries, and cross-stage sharing; unused constants land in an unoccupied contiguoususer_datarange when available, otherwise the signature is cleanly dropped).crates/victory-gpu/src/pipeline/host.rs&draw.rs&list.rs:argsfromlist.rsintoState::execute_indirect, creates and caches multi-argument hostID3D12CommandSignatures againstp.rootonHostPipeline, and keeps the signature alive on the host list until reset.Verification
Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver
621.24), Ryzen 7 5800X3D, Rust 1.98.1 (x86_64-pc-windows-msvc):indirect::tests::plan_indirect_maps_root_constants_and_rejects_unsupportedindirect::tests::multi_argument_indirect_dispatch_sets_root_constants_and_clamps(3-record indirect dispatch with 2 root constants +Dispatchatarg_offset = 8: verifies record 0 and 2 pass their root constants to the shader and record 1's over-limit dispatch is clamped to 0)cargo test -p victory-gpu --lib -- --test-threads=1(RTX 3080): 52 passed, 0 failed, 1 ignoredVICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib indirect -- --test-threads=1(WARP): 3 passed, 0 failedcargo clippy -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics): 0 warningscargo xtask policy: 154 files okNo game data used. AI-assisted; all builds and GPU tests executed on my machine.
@geiyiliyabumo on GitHub · 2026-11-24 10:18 UTC · original
Ready-to-merge implementation on a fork branch (since external PR creation is currently paused):
9782f64onmainffe310e; 3 files:crates/victory-gpu/src/{list,draw,indirect}.rs)Summary
ExecuteIndirectsupport for root-constant prefixes:list.rsforwards the full guest argument slice toState::execute_indirect.draw.rsaddsmap_indirect_argsto map precedingD3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT(type5) entries onto the host pipeline'suser_dataroot constants while preserving packed record layout (splitting non-contiguous destinations in record order; rejecting unsupported types like VBV/IBV/root-views, unmapped/aliased dwords, overlapping or out-of-order destinations, and invalid strides).ID3D12CommandSignatures (bounded 64-entryVecDequeholdingID3D12RootSignaturerefs to prevent ABA reuse, andlist.keep(&signature)for in-flight lifetime safety) and mirrorsExecuteIndirect's root-constant invalidation inState::roots.indirect.rs):offset(byte offset of the trailing draw/indexed/dispatch/mesh action within eachstride-byte record) so the constant prefix is left untouched while the draw/dispatch counts are clamped.Verification
Windows 11 Pro (
26100), Rust1.98.1(x86_64-pc-windows-msvc), AMD Radeon RX 9060 XT (driver32.0.32029.2010):cargo test --workspace --locked→ 349 passed, 0 failed, 6 ignored (23 test suites)cargo test -p victory-gpu --locked indirecton RX 9060 XT and WARP → 8 passed, 0 failed (including live D3D12CreateCommandSignaturefor single/split root constants and GPU clamp readback preserving padded constant prefixes)cargo clippy --workspace --all-targets --locked -- -D warnings→ pass (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings→ pass (0 warnings)rustfmt --edition 2024 --checkon all 3 modified files &cargo xtask policy(154 files ok) → passAI-assisted; synthetic tests only, no game files.
@DrDarkDK on GitHub · 2026-11-24 10:18 UTC · original
Tested
71967c1on native Windows 11 with the RTX 4070 Ti (driver 621.01) and software WARP. All three indirect tests passed on each adapter, including root-constant readback and clamping. I used--features diagnosticsfor WARP and made the GPU test fail locally if it couldn't create a D3D12 device.cargo test --locked -p victory-gpu --features diagnostics --lib indirect -- --test-threads=1Separately, I confirmed setup and ran the title on
8e79c80with WARP. Both runs logged the same five dropped signatures during world loading. Each had one argument: kinds2,105,10,1, and0, with strides12,12,12,20, and16bytes respectively. Signature-creation logging in the second run showed the same five single-argument layouts. Both runs ended at WARP device removal (0x887A0005), so coverage ends at early world loading.AI-assisted test execution and reporting.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 10:26 UTC · original
Compared the two branches on WARP with a synthetic guest command list. I seeded guest root slot 7 with
[10, 20, 30], recorded an indirect compute dispatch whoseCONSTANTargument covers only DWORD 1, and checked the cached guest values after recording.ExecuteIndirect71967c1[10, 20, 30]71967c1with a local reset of the written range[10, 0, 30]9782f64with its existing reset[10, 0, 30]A separate native D3D12 readback confirmed that a direct dispatch after
ExecuteIndirectsees zero for the constant changed by the indirect signature. The guest cache needs the same reset so a later bind does not restore the old value. The range reset in9782f64passes this check and preserves both neighboring DWORDs.AI-assisted test, executed on Windows with WARP using synthetic data.
@fuzeofficlal on GitHub · 2026-11-24 10:27 UTC · original
I compared the root-constant state after
ExecuteIndirecton RTX 5090 and WARP with synthetic command lists.In native D3D12, a subsequent direct dispatch read
[17, 0, 0, 68, 85]from five initially nonzero words. Only the two words named in the command signature were cleared. Both adapters did the same with a zero count-buffer value and withMaxCommandCount = 0. All five native cases had zero debug-layer errors. D3D12 state rulesFor a separate VIctory probe, I recorded the indirect dispatch and checked the guest values that the next translated bind consumes:
71967c1[11, 22, 33, 44]71967c1+ small reset follow-up[11, 0, 0, 44]9782f64[11, 0, 0, 44]The follow-up zeros the guest words referenced by the accepted signature after recording the command, so the next bind does not restore stale values. Both diagnostic suites passed 55 tests with one benchmark ignored.
9782f64already handles this and passes the same probe.@MartinIndra02 on GitHub · 2026-11-24 10:37 UTC · original
In-game signature check from two RTX 3080 world runs (~1.5 min into the world, diag build): every
indirect execution dropped (first time for this signature)line logged was a single-argument signature (stride=12kind105/2/10,stride=16kind0,stride=20kind1) — dropped only because the bound pipeline wasn't translated, not because of multi-argument records. No multi-argument command signatures appeared in the opening world load.Counts/types only; no game data. AI-assisted.
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 10:39 UTC · original
Integrated, verified, and merged constant-prefixed multi-argument ExecuteIndirect signatures onto latest main with root-constant address pair lowering (#710) and mesh indirect routing (commit
github.com/LAKSHYA-cmd-tech/VIctory@4c559868f0). All 75 tests in victory-gpu and 346 workspace tests pass cleanly.@MartinIndra02 on GitHub · 2026-11-24 11:04 UTC · original
Thanks @andrewpozdnakov7-jpg and @fuzeofficlal for the native D3D12 state-leakage check! Updated \eat/gpu-multi-arg-execute-indirect\ with $sha: \State::clear_indirect_constants\ now zeroes only the overwritten guest root-constant dwords after \ExecuteIndirect\ (preserving neighboring dwords and the other pipeline's roots), with regression test \draw::tests::indirect_constants_clear_only_overwritten_guest_range.\n\nRe-verified on Windows 11 / RTX 3080 (\621.24): \ictory-gpu\ 53 passed, 0 failed (1 ignored), \clippy -- -D warnings\ (default and \diagnostics) clean, \cargo xtask policy\ 154 files ok. No game data; AI-assisted.
@Proudnoob4 on GitHub · 2026-11-24 12:11 UTC · original
This extends @MartinIndra02's opening-load check to a longer window in the world.
I went through 18 of my runs on an RTX 4080 / Windows 10: several diag builds based on
d2a4bae, Series S and X. Everyindirect execution dropped (first time for this signature)line is one of the same five single-argument signatures:args[[2, …]][[105, …]][[10, …]][[1, …]][[0, …]]No line has a second argument. That includes one run that stayed 15 minutes in the world (to frame 3600) and one of 7 minutes.
Those two long runs had
VICTORY_SKIP_WAVE64=mesh,compute(#579) set, but the skip can't hide a multi-argument signature. Inlist.rs, a signature that isn't a single argument goes straight to that drop log and never reachesState::execute_indirect, where the pipeline checks and the skip happen. The five single-argument drops come fromexecute_indirectreturning false, not from having several arguments.So on this title, multi-argument command signatures are not what drops world work, at least in the first 15 minutes.
Also for #756:
indirect mesh dispatches droppeddoes not appear in any of these runs.Counts and log fields only; no game data attached. AI-assisted (Claude Code); the runs are from my machine.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 13:45 UTC · original
Thanks @MartinIndra02 for incorporating the guest root-constant reset and its regression test. Commit
94ecc4eCould you retain this Git trailer when carrying that contribution forward?
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>@MartinIndra02 on GitHub · 2026-11-24 13:55 UTC · original
@andrewpozdnakov7-jpg Sure thing — amended the commit on
feat/gpu-multi-arg-execute-indirect(db86e1e) to include theCo-authored-by: andrewpozdnakov7-jpg <[email protected]>trailer.@Marvisak on GitHub · 2026-11-25 03:50 UTC · original
Automated triage for the maintainers.
Confirmed on current
main.execute_indirectincrates/victory-gpu/src/list.rspasses only single-argument signatures ([[kind, ..]]) toState::execute_indirect. Any other signature is counted and dropped, as its ownshortcut:comment says. The thread also measured the title: across several world runs of up to 15 minutes, every logged dropped signature had a single argument. Those calls were dropped because their pipeline was missing, so multi-argument signatures don't drop any world work so far.Open PR #956 (MartinIndra02) carries the root-constant-prefix version, linked to this issue. The other implementations (geiyiliyabumo, LAKSHYA-cmd-tech) are only on forks. Pull requests are open to everyone, so please compare with #956 and comment there, or open a PR if yours differs. The root-constant reset after
ExecuteIndirectthat testers found should be part of whichever lands.Generated by Claude Code