GPU: add synthetic unit tests for query.rs and signature.rs #897
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 geiyiliyabumo on 2026-11-24T13:44:28Z.
Summary
Adds 8 deterministic synthetic unit tests for
crates/victory-gpu/src/query.rs(previously 0 tests) andcrates/victory-gpu/src/signature.rs(previously 0 tests). Production code is unchanged after auditing null/bounds/descriptor validation in both files.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/gpu-query-and-signaturegeiyiliyabumo/VIctory@0be58e6(based onmainffe310e)Tests Added (Synthetic Only)
crates/victory-gpu/src/query.rs(+3 tests): null-desc rejection & probe ordering,S_FALSEprobe + null-IID tolerance, interface answering across all 4 IIDs with full COM refcount lifecycle.crates/victory-gpu/src/signature.rs(+5 tests): invalid/null descriptions, empty signatures (count 0 never dereferences pointer),layoutnull check & copy-out-of-title-memory semantics, interface/refcount lifecycle, and probe path.Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --locked -- query::(3/3 PASS) &-- signature::(5/5 PASS)AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by DaniiL35 on 2026-11-24T13:48:55Z.
Verified branch
0be58e6(on top offfe310e):Code & Specification Audit
Audited
crates/victory-gpu/src/signature.rsandcrates/victory-gpu/src/query.rsagainst the added tests:arguments_are_copied_out_of_title_memoryconfirms thatdesc.argumentsare immediately cloned into owned storage (arguments: Vec<[u32; 4]>), preventing use-after-free or data corruption when the guest application mutates or unmaps the descriptor buffer.signatures_without_arguments_stay_emptyconfirms thatdesc.count == 0does not dereferencedesc.argumentseven if non-null, correctly creating an empty signature without segfaulting.creation_without_an_out_pointer_only_probesexercises theout.is_null()probe path returningS_FALSE, and confirms null IID returnsE_NOINTERFACEwithout null-dereferencing.signatures_answer_their_interfaces_and_count_referencesvalidates interface dispatch acrossSIGNATURE_IIDS(ID3D12CommandSignatureandPAGEABLE_IIDS),E_NOINTERFACEfor unknown/null IIDs,E_POINTERon null out pointers, and monotonic reference counting viaobject::release_boxed.query.rs.Verification & Policy Compliance
cargo xtask policy.main(ffe310e) with zero changes to production code.Reviewed and verified. AI-assisted with Antigravity.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T14:00:28Z.
Independent result for
0be58e6on Wine 11.22, cross-compiled with the Win64 GNU LLVM toolchain. All three query tests and all five command-signature tests passed. That includes the creation probes, interface queries and reference counts, and the check that the signature retains its copied arguments after the caller changes the source memory. This used the exact test-only commit.