GPU: forward all direct mesh dispatch group counts #2624
No reviewers
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!2624
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2624"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:02 UTC · original
andrewpozdnakov7-jpg:codex1/mesh-dispatch-dimensions→main· +204 −13 · 3 files · 4 commits · draftDirect List6 DispatchMesh forwards only X and substitutes 1 for Y and Z. For example, a 2 × 3 × 4 dispatch launches two groups. Forward the three group counts. Direct DispatchMeshX still supplies a one-dimensional grid. D3D12 mesh dispatch
The regression records the calls through VIctory's list vtable. A native D3D12 pipeline-statistics query counts invocations of a synthetic one-thread mesh shader on WARP. The fixture locates the entry points in the active guest list layout.
63bcca422f5207The same test failed six times on main and passed each time with the patch. The full WARP GPU suite passed with 247 tests and one ignored under both D3D12 debug settings. Strict GPU Clippy in both configurations and repository policy passed. The project shader emitter generates the synthetic shader in-process. The test needs a host with mesh pipeline statistics. AI-assisted. Synthetic tests only.
The patch leaves indirect DispatchMeshX to #1546 and #1749. #24 also edits direct dispatch and would need a conflict resolution in list.rs.
Coordination claim
Please preserve the Git author when reapplying the change. If you fold the code or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@Bj0rnis on GitHub · 2026-11-25 17:32 UTC · original
Independent Windows 11 hardware + WARP verification of #2624 at
827fbf89(cleangit merge-treewithorigin/main13f91cae, Rust 1.98.1 MSVC):cargo test -p victory-gpu --features diagnostics --lib --locked -- --test-threads=1-> 197 passed, 2 failed, 1 ignored (2.89s; includes the new test, only the 2 pre-existing #1744 NVIDIA 1M view-heap baseline failures also present onmain13f91cae).VICTORY_D3D12_WARP=1): 199 passed, 0 failed, 1 ignored (1.76s).cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings-> 0 warnings.cargo xtask policy-> 184 files ok.Not tested: live game workload.
AI-assisted test run and summary.
@kotekompotek on GitHub · 2026-11-25 17:45 UTC · original
Reviewed: forwards the real (x, y, z) to
DispatchMeshinstead of forcing 1x1, indirect path keeps (x,1,1) as before. The old once-warn on y*z!=1 is correctly gone since it now works. CI green.@Marvisak on GitHub · 2026-11-25 22:15 UTC · original · edited 2026-11-26 03:23 UTC
Automated triage for the maintainers.
Verdict: merge candidate (changed from needs work). Re-reviewed at
22f5207, which merges cleanly intomain. The fix is unchanged:State::dispatch_meshincrates/victory-gpu/src/draw.rspasses the caller'sx, y, ztoDispatchMesh, the List6dispatch_meshinlist.rsforwards all three, and the directDispatchMeshXpath keeps(x, 1, 1).On your reply: confirmed.
direct_mesh_dispatch_uses_all_group_countsincrates/victory-gpu/src/pipeline/host.rsnow builds a one-thread synthetic mesh program (s_endpgmonly) through the crate's ownir/structure/emitpath. It no longer writes HLSL or spawnsdxc.exe, and reads no environment variable, which was the only reason for the previous verdict. It skips cleanly where mesh shaders or mesh pipeline statistics are unavailable. The expectedMSInvocations[2, 6, 8, 24, 0, 2]match the group grids it dispatches.CI: passing (
check).Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:39 UTC · original
I resolved the test-module conflict in 14c1fc2. The mesh-dispatch test and the new upstream test both pass.
The same six guest vtable calls on
f3578e3report[2, 2, 2, 2, 2, 2]mesh shader invocations. The updated branch reports[2, 6, 8, 24, 0, 2]. This covers the X-only and Xbox calls and the Y, Z and zero-axis controls. Six paired WARP runs, both serial GPU suites at 244 passed and one ignored, strict Clippy, and asset policy passed.Please retain the Git author on cherry-pick or rebase. If folding the fix or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:59 UTC · original
Updated this branch after #158 changed the command-list table tests. Commit
498b5c1df87242b38731cf1137574abe83dc0941retains the previous tested head and uses the table that belongs to the test list to locate the guest dispatch entry points.The same WARP statistics test on base
842b0cb76f8f5fa9289bd779783c51ec24d75302reports[2, 2, 2, 2, 2, 2]; with the patch it checks[2, 6, 8, 24, 0, 2]. Both upstream depth-bounds tests also pass. Full GPU suite: 247 passed, 1 ignored, with each D3D12 debug setting. Strict GPU Clippy in both configurations and asset policy passed.If you cherry-pick the fix or test, please preserve the Git author. If you fold the work into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 00:49 UTC · original
22f5207 addresses the test review. The fixture builds a one-thread synthetic mesh shader with VIctory's in-process shader emitter. It binds a guest view heap through the list vtable and uses the normal sampler fallback. The dispatch fix and statistics query are unchanged.
In six paired Windows/WARP runs with the same fixture and no external compiler,
63bcca43c6a00a758510398fa43096ce7e4f7df0reported[2, 2, 2, 2, 2, 2]and the updated head reported[2, 6, 8, 24, 0, 2]. Both depth-bounds tests pass. Full WARP GPU suite, 247 passed and one ignored under each D3D12 debug setting. Strict GPU Clippy in both configurations and asset policy passed.Please retain the Git author on cherry-pick. If folding the fix or test into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 03:59 UTC · original
I found a correctness problem in this head that the pipeline-statistics test cannot see. I am putting this PR back in draft.
I ran the same one-thread translated mesh program on
63bcca4and22f5207. It reads the guest mesh-group input and atomically increments that group's counter. The guest List6 command recorded DispatchMesh(3, 2, 4), and the submitted WARP work produced:63bcca422f5207Input::MeshGroupmultipliesSV_GroupID.xby the mesh stride. The extra Y/Z groups therefore revisit the first three indices and leave the other 21 counters untouched. This is the same lowering interaction caught in #2996's indirect path. The per-axis D3D12 bound also means a single X-only call cannot cover every valid direct grid. The D3D12 specification defines the host limit. We still need the direct guest mesh-group numbering for a multi-axis call or an implementation that carries the grid dimensions all the way to lowering and can be checked against that contract.AI-assisted with Codex. Synthetic Windows/WARP tests.
@fuzeofficlal on GitHub · 2026-11-26 14:39 UTC · original · reviewed
Tested
22f5207f2c50c81e02764929b1273701db81dd45merged ontomain(63bcca43c6a0) on Windows 11 x64 (NVIDIA GeForce RTX 5090 native mesh shaders + Microsoft WARP,VICTORY_D3D12_DEBUG=1, Rust1.98.1).Verification
cargo run --locked -p xtask -- policy:191 files ok;cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warnings.direct_mesh_dispatch_uses_all_group_counts+list::(VICTORY_D3D12_DEBUG=1): 5/5 passed on RTX 5090 (nativeD3D12_OPTIONS9mesh pipeline statistics) and 5/5 passed on WARP (--features diagnostics), confirmingMSInvocations == [2, 6, 8, 24, 0, 2].Note while in draft
crates/victory-gpu/src/draw.rs:1200,1209andcrates/victory-gpu/src/list.rs:1509-1511vscrates/victory-shader/src/emit/lower.rs:1498-1504):victory-shadercurrently lowersInput::MeshGroupstrictly asgroupId.i32(0) * mesh_stride(SV_GroupID.xonly), ignoringSV_GroupID.yandSV_GroupID.z. Forwarding(x, y, z)toDispatchMeshwhile removing the one-timey * z != 1warning would cause ally * zslices to alias onto indices0..xuntil multi-axis direct mesh group numbering/lowering is wired end-to-end (with a shader-readback check acrossx,y, andz). Happy to re-review once ready for review.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 15:37 UTC · original
I checked the translated indices on the exact draft plus current
main(8e516f1). Candidatef458a03passes the direct grid dimensions to the mesh shader in a spare root-constant dword. The translated input usesx + groups_x * (y + groups_y * z)before applying the existing mesh stride.The same synthetic shader increments one counter per translated group index through the guest List6 entry point. Agility 1.620.2 / WARP 1.0.22, three runs per revision:
(3, 2, 4)[8, 8, 8, 0, …](2, 3, 4)[12, 12, 0, …](3, 1, 1)(3, 0, 4)The existing mesh-invocation test also passed. Full GPU suite 249 passed, 1 ignored, including the app-local identity check. Strict shader/GPU Clippy with default and all features and the asset-policy check passed.
The candidate branch uses X-fastest ordering. The PR remains in draft while that order is checked against the Xbox mesh input. @fuzeofficlal, a run of
direct_mesh_visits_each_translated_group_indexon your RTX 5090 would provide the physical D3D12 check.Please retain the Git authors on pickup. If folding my fix or test into another commit, use
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 17:01 UTC · original
I checked the direct-grid candidate
f458a03together with the mesh index-export fix from #3299 at8f01cab. The exact combinationbd7a1bbmerged cleanly.On verified app-local Agility 1.620.2/WARP 1.0.22, three runs of each 3x2x4 and 2x3x4 grid still produced 24 counters equal to one. The one-axis, zero-axis and invocation-statistics controls passed. The edge-flag mesh draw also passed in three fresh processes. Full GPU diagnostics had 249 passed, 0 failed, 1 ignored, including the runtime identity check. Asset policy passed.
The draft still needs the physical rerun and evidence for X-fastest guest numbering requested above. The integration branch is available if you want to run both patches together. AI-assisted with Codex.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 19:22 UTC · original
I checked the latest draft head here with #3304’s stride fix. The combined result on #3304 uses six threads from multidimensional PSV0 metadata. Both 24-group grids reached every expected guest index, with exactly six increments at each index and zero at the others. The full GPU suite passed 249 with one ignored.
The current draft still needs the physical GPU repeat and confirmation of X-fastest guest group numbering. The combined follow-up is available in
0908871. Please preserve its Git author or addCo-authored-by: andrewpozdnakov7-jpg <[email protected]>if you fold the added test or grid follow-up into another commit.@evan-kolberg on GitHub · 2026-11-26 19:37 UTC · original
Physical D3DMetal repeat of the generated per-group readback. On Apple M4 Pro, CrossOver 26.3 and D3DMetal 4.0 beta 3, I held fuzeofficlal’s stride fix constant on Mac main
bf99e728. The comparison adapts andrewpozdnakov7-jpg’s List6 forwarding and grid linearization and UAV fixture.3×2×4and2×3×4reached three and two indices, with six increments each.0, 6, …, 138, with six increments each. The3×1×1control returned three indices with six increments each in all three builds.All nine 144-word vectors matched, including zeros elsewhere. This verifies unique index coverage on D3DMetal. Xbox coordinate ordering still needs console evidence.
Prepared and tested with Codex.
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.