GPU: skip empty command list submissions #1268

Closed
EatCodeSleep2 wants to merge 1 commit from upstream-pr/1268 into main
EatCodeSleep2 commented 2026-11-24 16:57:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EatCodeSleep2 on 2026-11-24T16:57:44Z.


Summary

  • Return immediately from the guest queue entry point for a zero-list call.
  • Skip the host queue submission when there are no host lists left after filtering. This avoids a zero-count Direct3D call and an unnecessary fence signal and wait.

Refs #1249, finding VIC-BT-035.

Verification

A synthetic D3D12 test reproduced the empty submission advancing the fence from 0 to 1 on main. With this change an empty batch leaves it at 0, and submitting one closed list advances it to 1.

  • cargo test --locked -p victory-gpu --lib (51 passed, 1 ignored)
  • cargo test --locked -p victory-gpu --lib --features diagnostics (54 passed, 1 ignored)
  • Focused regression with VICTORY_D3D12_WARP=1
  • cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings

AI-assisted. Only synthetic command lists were used.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6587054342 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1268). Originally posted by [EatCodeSleep2](https://github.com/EatCodeSleep2) on 2026-11-24T16:57:44Z. --- ## Summary - Return immediately from the guest queue entry point for a zero-list call. - Skip the host queue submission when there are no host lists left after filtering. This avoids a zero-count Direct3D call and an unnecessary fence signal and wait. Refs #1249, finding VIC-BT-035. ## Verification A synthetic D3D12 test reproduced the empty submission advancing the fence from 0 to 1 on main. With this change an empty batch leaves it at 0, and submitting one closed list advances it to 1. - `cargo test --locked -p victory-gpu --lib` (51 passed, 1 ignored) - `cargo test --locked -p victory-gpu --lib --features diagnostics` (54 passed, 1 ignored) - Focused regression with `VICTORY_D3D12_WARP=1` - `cargo clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings` AI-assisted. Only synthetic command lists were used.
mercuryVM commented 2026-11-24 18:04:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T17:17:30Z.

Review: APPROVED


Tested 00c6c961 on Windows 11, RTX 5070, MSVC:

  • cargo test -p victory-gpu passes on the head (51 passed, 1 ignored).
  • Merged into our fork: workspace tests, shader tests and clippy -D warnings (default and all features) are all clean.

The change is right. execute waits for every submission it makes while holding submitted, so the old empty call only signalled and waited on a fence with nothing behind it. Nothing ordered after it depended on that. The guest entry point's count == 0 return matches the existing lists.is_null() return. The new test pins both fence values.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6044017399 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1268#pullrequestreview-6044017399). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T17:17:30Z. **Review:** APPROVED --- Tested 00c6c961 on Windows 11, RTX 5070, MSVC: - `cargo test -p victory-gpu` passes on the head (51 passed, 1 ignored). - Merged into our fork: workspace tests, shader tests and `clippy -D warnings` (default and all features) are all clean. The change is right. `execute` waits for every submission it makes while holding `submitted`, so the old empty call only signalled and waited on a fence with nothing behind it. Nothing ordered after it depended on that. The guest entry point's `count == 0` return matches the existing `lists.is_null()` return. The new test pins both fence values. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:06:05 +00:00
Marvisak commented 2026-11-25 01:08:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:36:10Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1424. Same early return for an empty host submission as #1424, plus a count == 0 check in the queue entry that the host-side check already covers.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148683408 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1268#issuecomment-7148683408). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:36:10Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1424. Same early return for an empty host submission as #1424, plus a count == 0 check in the queue entry that the host-side check already covers. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1268
No description provided.