GPU: route indirect dispatch_mesh_x through State::execute_indirect #1546

Open
github-bot wants to merge 2 commits from github-bot/gh-1546 into main AGit
Owner

@⁠n-romanovich on GitHub · 2026-11-24 19:01 UTC · original
n-romanovich:fix/indirect-mesh-dispatch → main · +58 −7 · 1 files · 2 commits · open

Summary

Fixes Issue #756.

Routes indirect DispatchMeshX calls (indirect != 0) through State::execute_indirect as a single MESH (kind = 10, stride = 12) command instead of silently dropping them, reusing the existing GPU argument clamp (indirect::bound) and command signature cache.

  • crates/victory-gpu/src/list.rs:
    • Route dispatch_mesh_x with indirect != 0 to s.execute_indirect(list, (10, 12, 1), indirect, None).
    • Increment INDIRECT and log once (with indirect address) if execute_indirect returns false.
    • Warn once if non-zero flags or payload are passed.
  • Added unit test indirect_dispatch_mesh_x_routes_through_execute_indirect.

Testing

Tested on Windows 11, NVIDIA GeForce RTX 5060 Ti:

  • cargo clippy --workspace --all-targets --locked -- -D warnings (pass)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (pass)
  • cargo test -p victory-gpu --locked (51 passed, 0 failed, 1 ignored)

AI-assisted: implemented and reviewed with AI assistance.

**@⁠n-romanovich** on GitHub · 2026-11-24 19:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/1546) `n-romanovich:fix/indirect-mesh-dispatch` → `main` · +58 −7 · 1 files · 2 commits · open ## Summary Fixes Issue #756. Routes indirect `DispatchMeshX` calls (`indirect != 0`) through `State::execute_indirect` as a single `MESH` (`kind = 10`, `stride = 12`) command instead of silently dropping them, reusing the existing GPU argument clamp (`indirect::bound`) and command signature cache. - `crates/victory-gpu/src/list.rs`: - Route `dispatch_mesh_x` with `indirect != 0` to `s.execute_indirect(list, (10, 12, 1), indirect, None)`. - Increment `INDIRECT` and log once (with `indirect` address) if `execute_indirect` returns `false`. - Warn once if non-zero `flags` or `payload` are passed. - Added unit test `indirect_dispatch_mesh_x_routes_through_execute_indirect`. ## Testing Tested on Windows 11, NVIDIA GeForce RTX 5060 Ti: - `cargo clippy --workspace --all-targets --locked -- -D warnings` (pass) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (pass) - `cargo test -p victory-gpu --locked` (51 passed, 0 failed, 1 ignored) AI-assisted: implemented and reviewed with AI assistance.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:52 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 22:27 UTC · original

Heads-up: #24 (opened yesterday) also routes indirect DispatchMeshX through execute_indirect instead of dropping it. The two conflict in list.rs.

Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current main (70564ae):

cargo test -p victory-gpu passed failed ignored
main 76 2 1
main + this PR 77 2 1
main, --all-features 79 2 -
main + this PR, --all-features 80 2 -
  • The new test passes.
  • No GPU test skipped for lack of a device.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.
  • Minor: cargo fmt --check would rewrap one block this PR adds (list.rs). main isn't rustfmt-clean either, so take it or leave it.
  • Two victory-gpu tests fail on current main on this NVIDIA card: dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1546#issuecomment-7146248319) Heads-up: #24 (opened yesterday) also routes indirect `DispatchMeshX` through `execute_indirect` instead of dropping it. The two conflict in `list.rs`. Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current `main` (70564ae): | `cargo test -p victory-gpu` | passed | failed | ignored | |---|---|---|---| | `main` | 76 | 2 | 1 | | `main` + this PR | 77 | 2 | 1 | | `main`, `--all-features` | 79 | 2 | - | | `main` + this PR, `--all-features` | 80 | 2 | - | - The new test passes. - No GPU test skipped for lack of a device. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. - Minor: `cargo fmt --check` would rewrap one block this PR adds (`list.rs`). `main` isn't rustfmt-clean either, so take it or leave it. - Two `victory-gpu` tests fail on current `main` on this NVIDIA card: `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:30 UTC · original · edited 2026-11-25 20:22 UTC

Automated triage for the maintainers.

Needs work. The new commit d1892690 addresses the wording points from the previous review in crates/victory-gpu/src/list.rs:

  • The doc comment on dispatch_mesh_x now says the 12-byte (x, y, z) record is inferred. That makes it honest, but an inference isn't evidence yet.
  • The test comment now matches what happens: execute_indirect returns false because no pipeline is bound. A new assertion checks that indirect == 0 takes the direct path and doesn't count a drop. On main an indirect call was dropped without counting, so the test now does tell the two versions apart.
  • dispatch_mesh's warning check now uses checked_mul.

What still decides the verdict is the same as for #24: evidence for the argument layout at this call. That means the title's code that fills the buffer, or buffer contents seen at a real DispatchMeshX with an indirect address. A tester on #24 reported that the sampled scene never makes such a call. Without the evidence, this routes GPU memory of unknown shape into a mesh dispatch.

Overlap. #24 and #1749 still make the same change in list.rs, and #2014 changes dispatch_mesh right next to it. Of the three, this one is the most complete (rebased, with a test), so it is a reasonable one to keep. Please agree with the other authors, and once the layout evidence is here this can move forward.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1546#issuecomment-7149625456) · edited 2026-11-25 20:22 UTC <!-- victory-triage v1 head=d1892690c821128f770cfc4aaaeed29a4f21d14b verdict=needs-work at=2026-11-25T20:22:45Z --> Automated triage for the maintainers. **Needs work.** The new commit `d1892690` addresses the wording points from the previous review in `crates/victory-gpu/src/list.rs`: - The doc comment on `dispatch_mesh_x` now says the 12-byte `(x, y, z)` record is inferred. That makes it honest, but an inference isn't evidence yet. - The test comment now matches what happens: `execute_indirect` returns false because no pipeline is bound. A new assertion checks that `indirect == 0` takes the direct path and doesn't count a drop. On `main` an indirect call was dropped without counting, so the test now does tell the two versions apart. - `dispatch_mesh`'s warning check now uses `checked_mul`. What still decides the verdict is the same as for #24: **evidence for the argument layout at this call.** That means the title's code that fills the buffer, or buffer contents seen at a real `DispatchMeshX` with an indirect address. A tester on #24 reported that the sampled scene never makes such a call. Without the evidence, this routes GPU memory of unknown shape into a mesh dispatch. **Overlap.** #24 and #1749 still make the same change in `list.rs`, and #2014 changes `dispatch_mesh` right next to it. Of the three, this one is the most complete (rebased, with a test), so it is a reasonable one to keep. Please agree with the other authors, and once the layout evidence is here this can move forward. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1546/head:github-bot/gh-1546'
git switch 'github-bot/gh-1546'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1546'
git switch 'github-bot/gh-1546'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1546'
git switch 'github-bot/gh-1546'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1546'
git switch 'main'
git merge --squash 'github-bot/gh-1546'
git switch 'main'
git merge --ff-only 'github-bot/gh-1546'
git switch 'main'
git merge 'github-bot/gh-1546'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1546
No description provided.