Repository navigation
Conversation
…PIPELINE-LIBRARY) The empty host pipeline library was made with CreatePipelineLibrary(&[]), which the windows crate passes as an empty slice's dangling, non-null pointer with a length of 0. Microsoft's D3D12 takes that; VKD3D-Proton answers E_INVALIDARG (0x80070057), and make(&[]).ok()? dropped the error, so under Wine and Proton the run kept no library and every start made every pipeline again. The blob now goes through blob_pointer(), null when it is empty, and a refused empty library is logged instead of dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Independent synthetic A/B of
This resolves the local Wine library assertion I reported in #2648. The hosted native Windows pixel failure there remains open. Small build note: the Synthetic fixtures only. AI-assisted with OpenAI Codex. |
An empty slice's pointer is never null, so the assertion could not fail (useless_ptr_null_checks); the converted pointer is checked just above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the A/B on both GPUs, and for checking it together with #2569.
AI-assisted (Claude Code). |
|
We independently landed exactly this on our tree and can confirm it end-to-end under Wine. Before the null-pointer fix, with |
KelboLive
left a comment
There was a problem hiding this comment.
Not superseded, and the fix is correct: main still has device.CreatePipelineLibrary::<ID3D12PipelineLibrary>(bytes)?.cast() (library.rs:522) with make(&[]).ok()? (:551), and windows-rs 0.62.2 does transmute(plibraryblob.as_ptr()) on an empty slice (Windows/Win32/Graphics/Direct3D12/mod.rs:9959) — a dangling non-null pointer. The manual vtable call with null + 0 is the right fix, and the rejected-blob test exercises that path against native D3D12 here (7/7 pass, clippy clean in library.rs).
One test gap: replacing blob_pointer(bytes) at the call site with bytes.as_ptr().cast() leaves all 7 tests green — only the helper is asserted, not that open uses it. A small seam (or the replay vtable) that checks the pointer open passes would close it, since the bug is only observable under VKD3D.
Also d3d12/crates/leonida-gpu/tests/replay.rs:193 still calls CreatePipelineLibrary(&[]) through windows-rs, so the replay test keeps the same dangling pointer under Wine — worth switching too.
Branch is 1068 commits behind main; merge-tree is clean (0b142434a), but the head predates #2648's d3d12 cargo-test CI, so no checks have run. A rebase is needed for CI; otherwise this is good to merge.
Item:
D3D12-VKD3D-EMPTY-PIPELINE-LIBRARY(claim: #2570 (comment))What is wrong
pipeline/library.rs(open) makes the empty host pipeline library withCreatePipelineLibrary(&[]). Thewindowscrate passes an empty slice's pointer, which is dangling, not null, with a length of 0. Microsoft's D3D12 takes that. VKD3D-Proton answersE_INVALIDARG(0x80070057), andmake(&[]).ok()?dropped the error, so under Wine and Proton the run keeps no library:Nothing is stored or saved (
cache/pipelines/host-pipelines.binnever appears), and every start makes every pipeline again.The change
CreatePipelineLibrarythroughblob_pointer(), which gives a null pointer for an empty blob.the host refused an empty pipeline library, with the error) instead of dropped.an_empty_blob_is_given_as_a_null_pointer.One file,
d3d12/crates/leonida-gpu/src/pipeline/library.rs.Tested
cargo xwin test --target x86_64-pc-windows-msvc -p leonida-gpu --features diagnostics -- pipeline::library, run under Wine 11.23: 7 passed, 0 failed (the new test and the six that were there).play-linux.shof Linux: build leonida.exe and run it under Proton or Wine #2577.919c0a9e2, with a log line added at that call):CreatePipelineLibrary refused error=Invalid parameter. (0x80070057), thenpipelines are not kept.cache/pipelines):host pipeline library saved bytes=248 ... made=1. With the same fix on Linux: build leonida.exe and run it under Proton or Wine #2577's tree, the next start loggedhost pipeline library loaded bytes=6584andhost pipelines all made made=0 loaded=34.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline/library.rs: clean.The new unit test checks the pointer, not the host: it passes on
maintoo as far as the D3D12 call is concerned, since Microsoft's runtime accepts the dangling pointer. The failure only shows under VKD3D-Proton, which is what the hardware runs above are for.Related
AI-assisted (Claude Code).
🤖 Generated with Claude Code