Repository navigation
GPU: the host pipeline library works under Wine (null blob for an empty library) - #1722
Impre-visible wants to merge 3 commits into
Conversation
…ty library, loads outside the lock) An empty library was asked for with an empty Rust slice, whose pointer is dangling and non-null. Windows only looks at the length; vkd3d-proton refuses a non-null blob of length 0 with E_INVALIDARG, so under Wine every run logged 'no host pipeline library: pipelines are not kept' and the early-start list was never written. The empty library is now created with a null blob. Loading a pipeline held the library's mutex for the whole LoadPipeline call. Where the host's library keeps no compiled code (vkd3d-proton with its internal cache on), a load is a whole pipeline creation, so the workers made 'loaded' pipelines one at a time. The load now runs on a reference of the library's own, outside the lock (as creation already did). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas Signed-off-by: Impre-visible <69050895+Impre-visible@users.noreply.github.com>
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-gpu— 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok
Clean Wine compatibility fix passing a null blob for an empty pipeline library and performing loads outside the lock. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
Empty pipeline library under Wine: an empty Rust slice has a dangling non-null pointer, and vkd3d-proton rejects a non-null blob of length 0 with E_INVALIDARG. The fix asks for a truly null blob via the vtable directly (CreatePipelineLibrary(null, 0)) and falls back to the normal path otherwise. Minimal and correct-looking; the vtable call is unsafe but matches the COM signature. Windows/Wine-only.
main now loads from the library outside the lock itself, so that half of this branch is dropped in favour of main's. What remains is the empty library created with a null blob. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas Signed-off-by: Impre-visible <69050895+Impre-visible@users.noreply.github.com>
|
Merged today's Re-measured on the merged branch (Linux, Wine + vkd3d-proton, GTX 1660), two 75 s runs in a row: run 1 🤖 Generated with Claude Code |
|
Automated triage for the maintainers. Merge candidate. The head is unchanged since the last triage ( On your reply: thanks. There is now an independent run on a second vendor (RX 9070 XT, RADV under Wine): the library is saved and reloaded across runs, and Generated by Claude Code |
…ty-wave * GPU: copy shader writes into write-watched pages under Wine Port upstream #1831: when WriteProcessMemory/NtWriteVirtualMemory refuses an untouched MEM_WRITE_WATCH page under Wine, use the kernel read path into that destination so copy-back still lands. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * GPU: load cached pipelines outside the library lock Port the Wine part of upstream #1722. vkd3d-proton treats a library load as a full compile, so holding the global library lock serialised all workers. Loads of different names can now overlap; same-name loads remain serialised as D3D12 requires. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * GPU: drop unready indirect calls before the argument clamp Port upstream #1635: a call whose host pipeline is not ready cannot run, so do not refresh and clamp records that nothing will read. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * GPU: run indirect mesh dispatches as one-record ExecuteIndirect Port upstream #1749: DispatchMeshX with group counts in GPU memory now uses the host indirect mesh path instead of being dropped. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * Shaders: leave runaway translated loops after 2^14 iterations Port upstream #1819. The previous 2^20 limit could outlast a driver reset; 2^14 bounds runaway loops to milliseconds per wave while VICTORY_SHADER_LOOP_LIMIT remains an override. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * Input: keep the keyboard stand-in while XInput pads are idle Port upstream #1430: virtual or untouched controllers no longer disable keyboard controls; real input outside the XInput deadzones takes over, and fallback keys regain control once host pads are idle. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * GPU: keep pipeline workers competitive and configurable Port upstream #1505 and #1728: workers no longer run below the title's priority, where busy world threads starved them, and VICTORY_PIPELINE_WORKERS can raise the worker count on many-core Linux/Windows hosts. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: stoltembergg <stoltembergg@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas Signed-off-by: Impre-visible <69050895+Impre-visible@users.noreply.github.com>
|
Merged the current 🤖 Generated with Claude Code |
…(null blob for an empty library)
|
RX 9070 XT (RADV) under Wine 11.22: pipelines are kept and loaded (menus only) Setup: Arch Linux, RX 9070 XT (RDNA4), RADV / Mesa 26.3.1. System Wine 11.22. vkd3d-proton
Not tested: the world (the menus make only 6 pipelines), Windows. AI-assisted (Claude Code); numbers from my own runs. |
|
@ntgata1-dotcom thank you, that is the independent run this needed, and on a different vendor (RADV) than mine. To cover the part you list as not tested: a world-scale number from my side (NVIDIA GTX 1660, Wine + vkd3d-proton 🤖 Generated with Claude Code |
Adapt PR Marvisak#1722 from source 08b526d. Preserve the recovered per-name locks, metadata snapshots, and save retry/backoff. Add an isolated WARP regression that serializes an empty library and reopens the saved blob. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested on Linux (Wine-staging 11.21 + vkd3d-proton, RADV): without this the library is never kept (E_INVALIDARG from CreatePipelineLibrary with an empty blob); with it a 4.5 MB library loads in 9-17 ms and ~2.4k pipelines are reused on the next run. |
|
I independently verified the host pipeline library save and reload on RTX 2070 SUPER, NVIDIA 620.73.04, Linux and GE-Proton 11-14. I used upstream The cold PR run reached the heavy transition and saved 27,128 bytes in
Both full replays read all 1,279 early-start entries. The guard recorded no GPU fault. The library-only replay reached heavy demand with the same saved library, so in this test the early exit reproduced with the full early-start list. The logs didn’t establish why the process exited. The full replays ended before I could compare mission readiness. In the library-only versus main pair, all 1,165 matched keys were pending at first request. Of the 356 keys with at least one second of common follow-up, 37 were ready within one second on the library-only replay and 222 on main. This was one pair, with the early-start list omitted on both sides, so it leaves the performance impact of the normal warm path open. Codex assisted with the local instrumentation and analysis. These are aggregate timings and counts. |
|
I traced the early exit from the full-cache replays and posted the results in the existing compiler-crash issue. Both detailed startup traces faulted while creating compute shader Upstream main also hit the same NVIDIA compiler offset later during graphics pipeline creation with both host pipeline files omitted. On this route the full early-start list moved the failure to startup. The library save and reload results above still hold. |
…(null blob for an empty library)
pipelines_load_on_many_threads_at_once returned at "no shader compiler
here" under Wine: Wine's d3dcompiler_47 (vkd3d-shader) refuses
RWByteAddressBuffer.Load ("Method 'Load' is not defined") and stores to
structured buffers ("not yet implemented"), and does not keep a
[RootSignature] attribute in the code. The test never dispatches, so its
96 programs now differ by group size alone, with no resources, and the
empty root signature is serialised apart.
Under vkd3d-proton the test then reaches the library, and needs Marvisak#1722
there (an empty library from a null blob).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of @arogan178 Verified on RDNA 4 under Proton: Setup: RX 9070 XT, RADV (Mesa 27.0-devel), Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 from Proton Experimental, Windows SDK |
|
I tested the empty-library change from Each build got one warmup into the opening sequence. For each of three timed launches per build I restored its warmed caches and the same starting profile at 1280×720. Main logged that it could not create a host pipeline library. The PR saved 313,400 bytes and 1,765 early-start entries. On the next launch it reported 1,360 pipelines loaded and zero created before the world marker.
One main run exited early. All three PR runs exited early, one before the marker and the others about 23 and 62 seconds afterward. Two compute pipelines from the failing runs also failed independently on main and compiled with #2723. The library fix restores reuse on this machine. The surviving frame-time samples are too few to establish an FPS improvement. AI-assisted with Codex. |
GPU: the host pipeline library works under Wine (null blob for an empty library) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous renderer (old upstream base 940d32f) is the first parent and is also kept as the branch renderer-2026-11-25-oldbase; the second parent is the rebuild: fork main (upstream main 63bcca4 + our pull requests) with the renderer stack merged on it: Marvisak#439 (on main: update/439-main's resolution), Marvisak#2309, Marvisak#2167, Marvisak#2118, Marvisak#2311, Marvisak#1722, Marvisak#1751, Marvisak#688, Marvisak#1872, Marvisak#2292, Marvisak#2310, Marvisak#2112 (opt-in), Marvisak#2230 (latch on by default), Marvisak#2389, Marvisak#2088 (small windows opt-in), Marvisak#2099's new head, and tonight's Marvisak#491 journal fixes. Merged upstream since: Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906, Marvisak#1152; superseded by main: Marvisak#1769, Marvisak#1763, Marvisak#2366. The picture on this base still shows the overlay that plain upstream main shows too; that is being looked into. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(null blob for an empty library)
|
Tested at head Setup: RX 9070 XT, Mesa RADV, CachyOS, Proton Experimental bleeding-edge 11.0-20261125 (vkd3d-proton
Only |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified ee84a448 against origin/main (63bcca43; clean git merge-tree):
- Passing a null pointer and zero length directly to
CreatePipelineLibrary(crates/victory-gpu/src/pipeline/library.rs:170-198) resolves the dangling-pointer rejection on empty libraries cleanly, checks the HRESULT before taking ownership ofout, and safely releases the temporaryID3D12PipelineLibraryif theID3D12PipelineLibrary1cast fails.
Local checks on ee84a448 passed: xtask policy (182 files ok), cargo clippy -p victory-gpu --all-targets -- -D warnings (default & --all-features), and victory-gpu --lib pipeline::library::tests (8 passed, 0 failed on RTX 5090, RTX 5090 + VICTORY_D3D12_DEBUG=1, and WARP + VICTORY_D3D12_DEBUG=1). Approve.
What
Two changes in
crates/victory-gpu/src/pipeline/library.rs, both about hosts where D3D12 is vkd3d-proton (Wine/Proton).1. An empty library is created with a null blob.
make(&[])passes an empty Rust slice, whose pointer is dangling and non-null. Windows only looks at the length. vkd3d-proton refuses a non-null blob of length 0 withE_INVALIDARG, so under Wine every run logsand neither
host-pipelines.binnorearly-pipelines.txtis ever written: no pipeline is started early on the next run. The empty library is now asked for through the vtable with a null pointer and length 0. A refusal is logged with its error.2. A pipeline is loaded outside the library's lock.
pipeline()held the mutex for the wholeLoadPipelinecall. Creation was already done outside the lock ("compiles take up to seconds"); with vkd3d-proton's internal cache on, its library stores no compiled code, so a load is a whole pipeline creation too, and the workers then made loaded pipelines one at a time. The load now uses a clone of the library interface taken under the lock.StorePipelineandSerializestill run under it.Measured
Linux, Wine (GE-Proton11-6) + vkd3d-proton, GTX 1660, NVIDIA 620.73.04.
On this branch (main + this commit), two 75 s runs in a row:
saved bytes=2552 early=12 made=13 loaded=0host pipeline library loaded bytes=2552,title pipelines to start early pipelines=12On a larger test tree, at world entry (about 1,400 pipelines first bound in one frame):
Mutex::lock_contendedinsidelibrary::pipeline, the eighth is in the host's create callhost pipelines all made made=0 loaded=500 started_early=499)Before change 1:
madeequals everything on every run, nothing loaded, nothing started early.Not tested
cargo build --release -p victorywith and without--features diagnosticsbuilds forx86_64-pc-windows-msvc. A null blob with length 0 is the documented way to create an empty library, so I expect no change there, but that is unverified.cargo clippy: not run here.VKD3D_SHADER_CACHE_PATH=0, where it would store SPIR-V and driver blobs): not measured.🤖 Generated with Claude Code