Repository navigation
GPU: ask for an empty pipeline library with a null blob - #347
AugustoZFJ wants to merge 1 commit into
Conversation
e479df5 to
c2a98e8
Compare
An empty slice still has an address, and vkd3d-proton answers E_INVALIDARG to a non-null blob of length 0, so under Wine no pipeline library was ever created and host pipelines were not kept.
c2a98e8 to
197c7ac
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested PR #347 at head
Behavior covered: Runs GPU library unit tests against the null-blob pipeline-library initialization change. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 197c7ac on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed). Not tested under vkd3d-proton.
- The root cause is right.
&[]has a dangling non-null pointer, and the D3D12 contract (and vkd3d-proton's check) treats non-null with length 0 as invalid, while null with 0 means "empty library". Native D3D12 accepts both, which is why this only showed up under vkd3d-proton. - The raw vtable call is sound.
CreatePipelineLibrary(null, 0, &IID_ID3D12PipelineLibrary, &mut raw)matches the signature, a nullrawafter success becomesE_POINTER, andfrom_raw+casttoID3D12PipelineLibrary1releases the base reference when it drops. - The non-empty-blob path is untouched.
No issues found.
AI-assisted (Claude Code).
…y with a null blob Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested under vkd3d-proton, which fills the gap in @mercuryVM's review. Thanks @AugustoZFJ, the null-blob fix works there too. Setup: Radeon 8060S (Strix Halo, RADV GFX1151, Mesa 25.2.8), Ubuntu 24.04, Wine 11.22 + vkd3d-proton 3.1 (
The test reaches the device here (main fails on it rather than returning early), so the pass means vkd3d-proton now hands back an empty library for the null blob. Everything else in the crate behaves the same on both. The only other failure is AI-assisted test. The runs were done on this machine. |
|
Independent NVIDIA/vkd3d-proton validation on Environment: Linux x86_64, Rust 1.98.1, Windows MSVC cross-build (
Not checked here: native Windows, persistent-cache round trips, or gameplay with this patch. This is synthetic GPU-test validation, not an end-to-end gameplay result. AI-assisted testing with Codex. |
…Marvisak#358 Marvisak#89 Marvisak#331 Marvisak#86 Marvisak#83 Marvisak#211 Marvisak#260 Marvisak#275) Conflict in crates/victory-gpu/src/descriptor/host.rs: gpu-state (Marvisak#251) moved the dynamic-slot search into free_table(); gpu-draw (Marvisak#86) bounds the search by the heap's spare slots instead of DYNAMIC. free_table() works over taken.len(), which is the spare count, so the helper is kept with gpu-draw's spare-based cursor wrap. Both sides' tests kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested this PR ( Unit Tests (Windows
|
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
…so caching works on Wine/vkd3d-proton (gmankab, based on Marvisak/VIctory#347) An empty slice still has an address, and vkd3d-proton answers E_INVALIDARG to a non-null blob of length 0, so under Wine no pipeline library was ever created and host pipelines were not kept. Co-authored-by: AugustoZFJ <14866271+AugustoZFJ@users.noreply.github.com>
…so caching works on Wine/vkd3d-proton (gmankab, based on Marvisak/VIctory#347) An empty slice still has an address, and vkd3d-proton answers E_INVALIDARG to a non-null blob of length 0, so under Wine no pipeline library was ever created and host pipelines were not kept. Co-authored-by: AugustoZFJ <14866271+AugustoZFJ@users.noreply.github.com>
|
Confirmed the empty-library fix on a real 8 GB RTX 3060 Ti under CachyOS Proton (NVIDIA 615.78.08, vkd3d-proton 3.2.0). Tested a
This verifies persistence across runs, not faster steady-state execution. Related implementation: #1722. |
|
@AugustoZFJ I resolved the conflict with current main On native Windows with app-local Agility 1.620.2 and WARP 1.0.22, the rejected-blob fallback and the pipeline-library serialize/reopen test both passed. Full GPU diagnostics had 247 passes, 0 failures and 1 ignored. Strict all-feature GPU Clippy passed. The Proton and title results are those reported by the other testers in this thread. You can fast-forward your branch to the tested merge. AI-assisted with Codex. |
…900 XTX benchmark Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Under vkd3d-proton,
pipeline::library::open()never gets a pipeline library, solibrary()logs "no host pipeline library: pipelines are not kept" and nothing is cached between runs.When there is no saved blob, or the saved one is rejected,
open()asks for an empty library with an empty slice. An empty Rust slice still has a non-null address (0x1here). vkd3d-proton rejects a non-null blob of length 0 and accepts null.In outline, not the literal diff:
Only the empty request changes. It goes through the raw vtable, because the
windowswrapper takes a slice and a slice can't be null. Loading a saved blob still uses the wrapper. If the host refuses even the empty library, the error is now logged instead of dropped. Onlycrates/victory-gpu/src/pipeline/library.rschanges.Evidence
Everything below ran on GE-Proton11-14 (its vkd3d-proton is v3.1-83) with an RX 6900 XT on RADV 26.2.6, built with
cargo xwinforx86_64-pc-windows-msvc. No game files were used.What
CreatePipelineLibraryreturns there, from a throwaway test that isn't in this PR:S_OK0x1, 0E_INVALIDARG(0x80070057)D3D12_ERROR_DRIVER_VERSION_MISMATCH(0x887E0002)pipeline::library::tests::a_rejected_blob_gives_an_empty_librarypanics at.expect("an empty library").victory-gpu: 40 passed, 3 failed.After: with this change it passes.
victory-gpu: 41 passed, 2 failed. The two that remain,argument_clamp_builds(Wine/vkd3d: indirect execution is dropped because the argument clamp cannot be compiled there; rewriting its HLSL does not help #170) andbuffer_data_reaches_the_host_texture(Wine/vkd3d: deferred uploads are skipped because VirtualQuery() reports mapped memory as MEM_FREE #128), fail the same way before the change.The same throwaway test also ran one round trip with a trivial compute pipeline.
StorePipelineandSerializesucceed (200 bytes), a second library opens from those bytes,LoadComputePipelinereturns the stored pipeline, and an unknown name givesE_INVALIDARG. So the cache works for one pipeline. I haven't run the title with it.Not checked: Windows, because I have no Windows machine. Only the empty request differs there, null instead of
0x1. Microsoft's page forCreatePipelineLibrarysays an empty blob gives an empty library and doesn't say what the pointer should be, so this needs one run of that test on Windows.Merge Danger
Door: two-way
For the code, a revert is enough. A
host-pipelines.binwritten under vkd3d-proton in the meantime stays in thepipelinescache folder and the reverted code would still load it, so undoing it fully also means deleting that folder.Blast Radius: pipeline-cache
On Windows the empty-library request passes null instead of a dangling pointer. That is untested.
Under vkd3d-proton the whole cache switches on for the first time.
LoadGraphicsPipeline,LoadComputePipelineandLoadPipelineare tried before every pipeline is made, and new ones are stored.save()serialises under the library lock, at most every 20 seconds, and writeshost-pipelines.binandearly-pipelines.txt. On the next run the saved blob is reopened and the pipelines listed inearly-pipelines.txtare started early. Of all that, only the one-pipeline round trip above has been exercised.