GPU: reject mismatched command list allocators #2963
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2965"
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?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T01:44:23Z.
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
63bcca43created 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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:54:54Z.
Review: COMMENTED
Reviewed and verified against
main(63bcca43) on Windows 11 (RTX 5090 + WARP,VICTORY_D3D12_DEBUG=1) — clean fix and ready to merge:Object::uses_table(crates/victory-gpu/src/object.rs:61-63) +allocator_kind(list.rs:319-327) safely verify the COM vtable before readingkind, and bothnew_list(list.rs:376) andreset(list.rs:468-473) reject mismatched allocator types withE_INVALIDARG(also fixing the mismatched direct allocator inresource.rs:3067-3131).list.rs:376,(!out.is_null() && allocator_kind(allocator) != Some(kind))skips the allocator-type check when a caller passesout == nullto probe creation (S_FALSEpath inobject.rs:136), whereas the adjacentallocator.is_null()check still runs forout == null. Dropping!out.is_null() &&would make probe calls consistent.Local verification:
cargo test --locked -p victory-gpu --lib list:: resource::tests::: 23/23 passed on both RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1), includinglist_creation_and_reset_reject_the_wrong_allocator_typecargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warningscargo xtask policy: 191 files okImported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T01:59:34Z.
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
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:25:22Z.
Review: COMMENTED
Verified: D3D12 requires the allocator type to match the list type on both CreateCommandList and Reset — previously a mismatched (or foreign COM) allocator was accepted and blindly cast to our Allocator layout. uses_table is the right guard for the foreign-object case. Test asserts E_INVALIDARG on create+reset for both kinds, and the resource.rs test now correctly gives each list its own kind-matched allocator.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:22:25Z.
Automated triage for the maintainers.
Proposed close. This makes
new_listandresetincrates/victory-gpu/src/list.rsreturnE_INVALIDARGwhen the allocator's type differs from the list's (or the allocator isn't one of ours, via the newObject::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 inresource.rsthat 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 closelabel.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T07:50:49Z.
Independent CPU-only verification of PR #2965 (
GPU: reject mismatched command list allocators).CARGO_TARGET_DIR(D:\Victory-Contrib\target-2965-verify),CARGO_BUILD_JOBS=2.6f8a7e437c6b32982a2f79ad01ed08e118f80f0f, base63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-gpu --lib -- list::tests::list_creation_and_reset_reject_the_wrong_allocator_type --exact --test-threads=1 --quiet->1 passed; 0 failed; 232 filtered.git grep -Ffor the new test name on63bcca4returned no hits (test absent on base).git diff --check 63bcca4 HEADexit 0 (clean).device::DEVICEwas replayed; real D3D12 allocators and the full suite were not exercised.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.