GPU: reject mismatched command list allocators #2965

Open
github-bot wants to merge 1 commit from github-bot/gh-2965 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:44 UTC · original
andrewpozdnakov7-jpg:codex2/command-list-allocator-type → main · +95 −8 · 3 files · 1 commits · open

Command list creation and Reset now require an allocator of the same command list type. The shared list paths check the allocator before creating host state, marking a pipeline used, or restarting a list. The cross-queue regression now supplies a matching allocator for each of its graphics and compute lists.

Native inbox and app-local D3D12 WARP returned E_INVALIDARG for real list creation and for Reset with a mismatched DIRECT/COPY allocator, in both directions. A matching reset after the rejection returned S_OK. CreateCommandList, Reset.

The same synthetic guest-vtable fixture on main at 63bcca43 created a list and returned S_OK in every mismatch case. The patch matches the native results for both list types, including the matching creation and reset controls.

Five default list tests and the app-local WARP diagnostics suite passed (247 passed, one ignored), including the cross-queue fixture. Strict GPU Clippy in both feature configurations and asset policy passed.

AI-assisted. The paired comparison used software WARP and synthetic lists.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 01:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2965) `andrewpozdnakov7-jpg:codex2/command-list-allocator-type` → `main` · +95 −8 · 3 files · 1 commits · open Command list creation and Reset now require an allocator of the same command list type. The shared list paths check the allocator before creating host state, marking a pipeline used, or restarting a list. The cross-queue regression now supplies a matching allocator for each of its graphics and compute lists. Native inbox and app-local D3D12 WARP returned E_INVALIDARG for real list creation and for Reset with a mismatched DIRECT/COPY allocator, in both directions. A matching reset after the rejection returned S_OK. [CreateCommandList](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-createcommandlist), [Reset](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-reset). The same synthetic guest-vtable fixture on main at 63bcca43 created a list and returned S_OK in every mismatch case. The patch matches the native results for both list types, including the matching creation and reset controls. Five default list tests and the app-local WARP diagnostics suite passed (247 passed, one ignored), including the cross-queue fixture. Strict GPU Clippy in both feature configurations and asset policy passed. AI-assisted. The paired comparison used software WARP and synthetic lists.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:18:48 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:59 UTC · original

Thanks for the RTX 5090 and WARP checks. On both inbox WARP and Agility WARP, CreateCommandList with a null output returned E_UNEXPECTED with either allocator in both DIRECT/COPY directions. Real creates and Reset returned E_INVALIDARG for the mismatched type, and a subsequent matching Reset returned S_OK.

I kept VIctory's established S_FALSE probe behavior in 6f8a7e4. Removing the output guard would make the mismatched probe return E_INVALIDARG and the matching probe return S_FALSE, where both native runtimes reported the same status. The real-create and Reset paths are the ones covered by this fix.

Review note

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 01:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2965#issuecomment-7180351004) Thanks for the RTX 5090 and WARP checks. On both inbox WARP and Agility WARP, CreateCommandList with a null output returned E_UNEXPECTED with either allocator in both DIRECT/COPY directions. Real creates and Reset returned E_INVALIDARG for the mismatched type, and a subsequent matching Reset returned S_OK. I kept VIctory's established S_FALSE probe behavior in 6f8a7e4. Removing the output guard would make the mismatched probe return E_INVALIDARG and the matching probe return S_FALSE, where both native runtimes reported the same status. The real-create and Reset paths are the ones covered by this fix. [Review note](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2965)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:22 UTC · original

Automated triage for the maintainers.

Proposed close. This makes new_list and reset in crates/victory-gpu/src/list.rs return E_INVALIDARG when the allocator's type differs from the list's (or the allocator isn't one of ours, via the new Object::uses_table). That is input validation on the title's calls: a correct title never passes a mismatched allocator, so it adds no capability, and the evidence is desktop D3D12 / WARP behaviour, not the console runtime, which this layer emulates. If the console runtime accepts a pairing desktop D3D12 rejects, this turns a working call into a failure; the cross-queue test in resource.rs that had to change (a compute list on a direct allocator) is the kind of pattern that would break. What would change the verdict: evidence that the title passes a mismatched allocator and that the console rejects it, or a title-visible bug this fixes.

CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2965#issuecomment-7183427170) <!-- victory-triage v1 head=6f8a7e437c6b32982a2f79ad01ed08e118f80f0f verdict=proposed-close at=2026-11-26T05:22:30Z --> Automated triage for the maintainers. **Proposed close.** This makes `new_list` and `reset` in `crates/victory-gpu/src/list.rs` return `E_INVALIDARG` when the allocator's type differs from the list's (or the allocator isn't one of ours, via the new `Object::uses_table`). That is input validation on the title's calls: a correct title never passes a mismatched allocator, so it adds no capability, and the evidence is desktop D3D12 / WARP behaviour, not the console runtime, which this layer emulates. If the console runtime accepts a pairing desktop D3D12 rejects, this turns a working call into a failure; the cross-queue test in `resource.rs` that had to change (a compute list on a direct allocator) is the kind of pattern that would break. What would change the verdict: evidence that the title passes a mismatched allocator and that the console rejects it, or a title-visible bug this fixes. CI: passing. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
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/2965/head:github-bot/gh-2965'
git switch 'github-bot/gh-2965'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2965'
git switch 'github-bot/gh-2965'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2965'
git switch 'github-bot/gh-2965'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2965'
git switch 'main'
git merge --squash 'github-bot/gh-2965'
git switch 'main'
git merge --ff-only 'github-bot/gh-2965'
git switch 'main'
git merge 'github-bot/gh-2965'
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!2965
No description provided.