GPU: validate committed resource probes without allocating #2838
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2840"
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-25T21:49:19Z.
A supported CreateCommittedResource call with a null result pointer is a capability check. Today it still calls the title allocator, and its outcome depends on whether an allocation succeeds. Return the existing
S_FALSEafter shape and layout validation for this case. Ordinary creation still goes through the allocator. D3D12 referenceThe same 64-byte buffer fixture uses a synthetic allocator that always refuses. Before the change, ordinary creation correctly returns
E_OUTOFMEMORYand the probe makes a second allocator call and returns the same error. With the patch the probe returnsS_FALSEwith the call count still at one. A zero-size description still returnsE_INVALIDARG, and native D3D12 WARP returnsS_FALSEfor the valid probe.AI-assisted.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T22:28:39Z.
Independent Windows verification of exact head
4083b09d98865fb8d76fbf1aa8b52ac09b355232againstmainatf3578e3.cargo test -j 4 --locked -p victory-gpu --features diagnostics --lib -- --nocapturepassed 203 tests with one benchmark ignored. Main passed 243 with one benchmark ignored. DXGI confirmed the Microsoft software adapter (VendorId=0x1414,Flags=0x2). The native WARP probe returnedS_FALSEfor the valid synthetic buffer.The regression confirmed normal creation returned
E_OUTOFMEMORYwith one allocator call, a zero-sized probe returnedE_INVALIDARG, and a valid null-output probe returnedS_FALSEwith the call count still at one. Claude’s earlier negative control on the integration branch returnedE_OUTOFMEMORYand made a second allocator call when the early return was disabled.This head merges cleanly into current main and alongside #2837–#2839. Fresh verification and review by Codex (
gpt-6.2-sol), with synthetic inputs, both WARP switches set, and Windows SDKdxil.dll.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T22:40:31Z.
Verified
4083b09dmerged ontomain(f3578e3) on Windows 11 (RTX 5090 + WARP):Memory::layout(info)on theout.is_null() && object::is(iid, &RESOURCE_IIDS)probe path (covering bothcreate_committedandcreate_committed3), avoiding title allocator calls and shadow/texture registration.resource::tests: 18/18 passed on RTX 5090 (0.43s) and WARP (0.35s); with--features diagnostics,committed_resource_probe_does_not_call_the_allocatoralso confirmedNative WARP returned S_FALSE for the buffer probe.cargo clippy --locked -p victory-gpu --all-targets(default &--features diagnostics) 0 warnings;cargo xtask policy(190 files ok).committed_resource_probe_does_not_call_the_allocatoris gated behind#[cfg(all(windows, feature = "diagnostics"))], even thoughcrate::hostonly requires#[cfg(windows)]— droppingfeature = "diagnostics"lets defaultcargo test -p victory-gpurun it too.Looks ready to merge.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T22:50:11Z.
Updated in
a61debf. The test now opens a native WARP device directly. This lets it run with default features becausehost()only honors the software-adapter switch with diagnostics enabled.The native probe returned
S_FALSEin both default and diagnostics builds. The guest probe matched it and left the allocator count at one in both runs. All 18 resource tests passed in each build, along with strict GPU Clippy and the staged asset policy.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T03:21:38Z.
Automated triage for the maintainers.
Thanks for
4164a90. The test no longer spawns a process.TEST_ALLOCATORis a#[cfg(test)]thread-local, and theResetguard clears it on exit. Ordinary builds keep the same allocator path inMemory::for_resource. The change itself is unchanged. A null-outprobe of a resource IID increate_committednow returnsS_FALSE(orE_INVALIDARGfromMemory::layout) without calling the title allocator. The test checks this against native WARP and with an allocator-call count. That resolves the earlier maintainer-decision point.CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T06:32:32Z.
Commit 4164a90 runs the probe regression in-process on current
main. The refusing allocator is scoped to the test thread and its override is cleared on exit. The test leaves the runtime's allocator registration alone, and ordinary builds use the same allocator and fallback as before.The real allocation still returns E_OUTOFMEMORY and calls the allocator once. The malformed probe returns E_INVALIDARG. The valid null-output probe returns S_FALSE with the call count still 1. Disabling the probe's early return makes the same fixture return E_OUTOFMEMORY with two calls. The native WARP control returned S_FALSE in both builds, with and without diagnostics. The app-local WARP GPU suite passed 247 tests, 1 ignored. Strict GPU Clippy passed in both modes, and asset policy passed.
Please retain the Git author when moving the test. If folding it into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T09:28:16Z.
Review: APPROVED
Verified on RTX 5090 & WARP against
origin/main(63bcca4):cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 19/19 passed on RTX 5090 and WARP (includingcommitted_resource_probe_does_not_call_the_allocator).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly validates
CreateCommittedResourcenull-out probes without calling the allocator.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:05:01Z.
Review: APPROVED
Verified
4164a90dlocally on Windows 11 (RTX 5090 and WARP, withVICTORY_D3D12_DEBUG=1):cargo xtask policyandcargo clippy -p victory-gpu --tests -- -D warnings(default and--all-features): clean.resource::tests::committed_resource_probe_does_not_call_the_allocator --nocapture: passed and confirmedNative WARP returned S_FALSE for the buffer probealong with zero allocator invocations on both invalid (width = 0->E_INVALIDARG) and valid (width = 64->S_FALSE) null-outprobes.resource::suite: 19/19 passed on RTX 5090 (5/5 parallel rounds to verify thread-localTEST_ALLOCATORisolation), 19/19 on RTX 5090 +VICTORY_D3D12_DEBUG=1, and 19/19 on WARP +VICTORY_D3D12_DEBUG=1.Sharing
Memory::layout(info)across the probe path,Memory::for_resource, andMemory::newkeeps validation consistent across bothcreate_committedandcreate_committed3, and the thread-local refusing allocator with RAII cleanup is cleanly isolated. Ready to merge.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.