GPU: the empty host pipeline library is made from a null blob (vkd3d-proton refused it: no pipeline kept under Wine) #124

Open
github-bot wants to merge 1 commit from github-bot/gh-124 into main AGit
Owner

@⁠sil-kong on GitHub · 2026-11-25 14:57 UTC · original
sil-kong:wine-pipeline-library → main · +16 −0 · 1 files · 1 commits · open

What

library::open asks for an empty pipeline library with CreatePipelineLibrary(&[]). An empty Rust slice's pointer is not null (it is dangling, 0x1), so the call passes a non-null blob with a length of 0. Windows' runtime accepts it; vkd3d-proton does not:

CreatePipelineLibrary(NULL, 0)        -> S_OK
CreatePipelineLibrary(non-null, 0)    -> E_INVALIDARG (0x80070057)

(checked with a 20-line C program against vkd3d-proton from Proton Experimental, GE-Proton10-34's Wine, RADV.)

So under Wine/Proton the first run ever, and every run after it, logs

no host pipeline library yet; starting an empty one
no host pipeline library: pipelines are not kept

and since save returns when there is no library, early-pipelines.txt is never written either: no host pipeline is kept and no title pipeline is started early, on any run.

The fix passes a null blob through the vtable when the bytes are empty. Non-empty blobs go through the same call as before, so Windows is unchanged.

Measured

Arch Linux, RX 7900 XT (RADV), Ryzen 9 5900X, same save and spot. With the fix, run 1 starts the library and saves it; run 2:

before (every run) run 2 with the fix
host pipeline library not kept loaded, 344 KB
title pipelines started early 0 1736
host pipelines made / loaded ~1800 / ~100 114 / 1821
pipelines still being made at the first world frames ~700 1

Steady world frame times are unchanged (~620 ms/frame here); what changes is the backlog of compiles at world entry. One side effect I hit before the fix: with every pipeline compiled cold during the world load, a slow compile tripped the endless watchdog and its draws were left out for the run (characters' skin, in my case).

**@⁠sil-kong** on GitHub · 2026-11-25 14:57 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/124) `sil-kong:wine-pipeline-library` → `main` · +16 −0 · 1 files · 1 commits · open ## What `library::open` asks for an empty pipeline library with `CreatePipelineLibrary(&[])`. An empty Rust slice's pointer is not null (it is dangling, `0x1`), so the call passes a non-null blob with a length of 0. Windows' runtime accepts it; vkd3d-proton does not: ``` CreatePipelineLibrary(NULL, 0) -> S_OK CreatePipelineLibrary(non-null, 0) -> E_INVALIDARG (0x80070057) ``` (checked with a 20-line C program against vkd3d-proton from Proton Experimental, GE-Proton10-34's Wine, RADV.) So under Wine/Proton the first run ever, and every run after it, logs ``` no host pipeline library yet; starting an empty one no host pipeline library: pipelines are not kept ``` and since `save` returns when there is no library, `early-pipelines.txt` is never written either: no host pipeline is kept and no title pipeline is started early, on any run. The fix passes a null blob through the vtable when the bytes are empty. Non-empty blobs go through the same call as before, so Windows is unchanged. ## Measured Arch Linux, RX 7900 XT (RADV), Ryzen 9 5900X, same save and spot. With the fix, run 1 starts the library and saves it; run 2: | | before (every run) | run 2 with the fix | |---|---|---| | `host pipeline library` | not kept | loaded, 344 KB | | title pipelines started early | 0 | 1736 | | host pipelines made / loaded | ~1800 / ~100 | 114 / 1821 | | pipelines still being made at the first world frames | ~700 | 1 | Steady world frame times are unchanged (~620 ms/frame here); what changes is the backlog of compiles at world entry. One side effect I hit before the fix: with every pipeline compiled cold during the world load, a slow compile tripped the `endless` watchdog and its draws were left out for the run (characters' skin, in my case).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:14 +00:00
Author
Owner

@⁠TobiasFornell on GitHub · 2026-11-25 21:40 UTC · original

Confirming on another GPU/OS: CachyOS, RX 9070 XT (RDNA4, RADV), Proton Experimental, GTA VI 1.0.2.1 (offline).

With the null-blob change in place, early-pipelines.txt is written and read back on the next run under vkd3d-proton. In one of my second-run logs the early-pipeline step ends with host pipelines all made made=0 loaded=1153, i.e. everything came from the saved list and nothing had to be compiled at that point.

I did not re-measure frame times or compare against a build without the fix; this is only a confirmation that the library persists and loads on RDNA4 as well.

**@⁠TobiasFornell** on GitHub · 2026-11-25 21:40 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/124#issuecomment-7175392686) Confirming on another GPU/OS: CachyOS, RX 9070 XT (RDNA4, RADV), Proton Experimental, GTA VI 1.0.2.1 (offline). With the null-blob change in place, `early-pipelines.txt` is written and read back on the next run under vkd3d-proton. In one of my second-run logs the early-pipeline step ends with `host pipelines all made made=0 loaded=1153`, i.e. everything came from the saved list and nothing had to be compiled at that point. I did not re-measure frame times or compare against a build without the fix; this is only a confirmation that the library persists and loads on RDNA4 as well.
Author
Owner

@⁠DecayingEagle on GitHub · 2026-11-27 10:44 UTC · original

Independent confirmation on a-publier 4eb6cfdf9e61cb112f1f811344ec0dd309eddd6c, using an equivalent local null-blob fix.

Setup: RX 7900 XT, Mesa/RADV 26.3.1, CachyOS, Wine 11.22 with the mapped-view tree change, official vkd3d-proton 71cae091b06571e51446cf2a937f0b04c237c04d.

A standalone D3D12 probe on this machine returned:

CreatePipelineLibrary(nullptr, 0)       -> 0x00000000
CreatePipelineLibrary((void*)1, 0)      -> 0x80070057

The same probe verified a 65,536-byte GPU upload/copy/readback, fence completion and a healthy device.

With the equivalent fix applied locally, the game saved and subsequently loaded the host library (bytes=387512 mapped=true), and the next launch listed 2,212 title pipelines to start early. warm --used also completed 2,212 pipelines, with no missing host pipelines or failed worker processes. Both the release and diagnostic MSVC-target builds passed their version checks under Wine.

This confirms cache persistence and prewarming on the current default branch. Steady-state frame-time effects were not isolated.

AI-assisted investigation and comment: OpenAI Codex. Measurements are from runs on this machine.

**@⁠DecayingEagle** on GitHub · 2026-11-27 10:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/124#issuecomment-7216243221) Independent confirmation on `a-publier` `4eb6cfdf9e61cb112f1f811344ec0dd309eddd6c`, using an equivalent local null-blob fix. **Setup:** RX 7900 XT, Mesa/RADV 26.3.1, CachyOS, Wine 11.22 with the mapped-view tree change, official vkd3d-proton `71cae091b06571e51446cf2a937f0b04c237c04d`. A standalone D3D12 probe on this machine returned: ``` CreatePipelineLibrary(nullptr, 0) -> 0x00000000 CreatePipelineLibrary((void*)1, 0) -> 0x80070057 ``` The same probe verified a 65,536-byte GPU upload/copy/readback, fence completion and a healthy device. With the equivalent fix applied locally, the game saved and subsequently loaded the host library (`bytes=387512 mapped=true`), and the next launch listed **2,212 title pipelines to start early**. `warm --used` also completed **2,212 pipelines**, with no missing host pipelines or failed worker processes. Both the release and diagnostic MSVC-target builds passed their version checks under Wine. This confirms cache persistence and prewarming on the current default branch. Steady-state frame-time effects were not isolated. AI-assisted investigation and comment: OpenAI Codex. Measurements are from runs on this machine.
Author
Owner

@⁠BlueCatsz on GitHub · 2026-11-27 11:56 UTC · original

Confirmed working on a CachyOS / RDNA4 setup:

  • Hardware / OS: CachyOS (Arch Linux), Ryzen 7 5800X3D, RX 9070 XT 16 GB, Mesa RADV 26.3.1, 32 GB DDR4
  • Runner / Translation: proton-cachyos-slr (wine 11.0) + RB-tree wineserver (CachyOS/wine-cachyos#50), official vkd3d-proton (71cae09), native Microsoft d3dcompiler_47.dll, VKD3D_CONFIG=descriptor_heap
  • Build: diag build of a-publier (4eb6cfd) with #124 (d6acf71) + #247 + #541's moving-faces hunk, Series X profile (VICTORY_LAND_ECHO=0), retail 1.0.2.1

Observed across three consecutive runs:

  • Run 1 (clean cache): no host pipeline library yet; starting an empty one → saved 328,568 bytes (early=1856 made=1713 loaded=144 started_early=0)
  • Run 2: loaded 328,568 bytes (mapped=true) → saved 345,272 bytes (early=1929 made=87 loaded=1878 started_early=1875)
  • Run 3: loaded 345,272 bytes (mapped=true) → saved 346,040 bytes (early=1933 made=4 loaded=1930 started_early=1931)

AI assistance disclosure: log extraction and test notes were compiled with AI assistance; all builds and hardware runs were executed and verified locally.

**@⁠BlueCatsz** on GitHub · 2026-11-27 11:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/124#issuecomment-7217645095) Confirmed working on a CachyOS / RDNA4 setup: - **Hardware / OS:** CachyOS (Arch Linux), Ryzen 7 5800X3D, RX 9070 XT 16 GB, Mesa RADV `26.3.1`, 32 GB DDR4 - **Runner / Translation:** `proton-cachyos-slr` (`wine 11.0`) + RB-tree `wineserver` (`CachyOS/wine-cachyos#50`), official `vkd3d-proton` (`71cae09`), native Microsoft `d3dcompiler_47.dll`, `VKD3D_CONFIG=descriptor_heap` - **Build:** `diag` build of `a-publier` (`4eb6cfd`) with `#124` (`d6acf71`) + `#247` + `#541`'s moving-faces hunk, Series X profile (`VICTORY_LAND_ECHO=0`), retail 1.0.2.1 Observed across three consecutive runs: - **Run 1 (clean cache):** `no host pipeline library yet; starting an empty one` → saved `328,568 bytes` (`early=1856 made=1713 loaded=144 started_early=0`) - **Run 2:** loaded `328,568 bytes` (`mapped=true`) → saved `345,272 bytes` (`early=1929 made=87 loaded=1878 started_early=1875`) - **Run 3:** loaded `345,272 bytes` (`mapped=true`) → saved `346,040 bytes` (`early=1933 made=4 loaded=1930 started_early=1931`) --- *AI assistance disclosure: log extraction and test notes were compiled with AI assistance; all builds and hardware runs were executed and verified locally.*
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/124/head:github-bot/gh-124'
git switch 'github-bot/gh-124'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-124'
git switch 'github-bot/gh-124'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-124'
git switch 'github-bot/gh-124'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-124'
git switch 'main'
git merge --squash 'github-bot/gh-124'
git switch 'main'
git merge --ff-only 'github-bot/gh-124'
git switch 'main'
git merge 'github-bot/gh-124'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.