Tests: separate pipeline library blob validation from host parity (TEST-PIPELINE-LIBRARY-OWN-FORMAT) #533
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!533
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/533/head"
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?
@sodove on GitHub · 2026-11-24 07:05 UTC · original
sodove:test/pipeline-library-own-format→main· +20 −8 · 3 files · 2 commits · merged 2026-11-24 18:20 UTCClaimed in the coordination issue as: TEST-PIPELINE-LIBRARY-OWN-FORMAT (#14)
What and why
The trailing-byte mutation touches a reserved byte in the layer's LPL1 header. Native D3D12 serializes a different format, so its response to mutating its own trailing byte varies across the observed hosts. The 26300 host reported S_OK, while the 26100 host here returns E_INVALIDARG. Original finding by fiestorra
Keep both HRESULT and output-pointer results in the own-format part of the host report. The layer test now explicitly requires E_INVALIDARG and no library object for a corrupted LPL1 reserved word.
Tested
Windows 11 26100.7623, D3D12Core 10.0.26100.7309, MSVC 19.44.35220 Release, Vulkan validation layer 1.4.369.
d42773d073. The host and the layer both reject the trailing mutation and leave the output alone. They report independent serialized sizes of 900 and 16 bytes.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11.
AI-assisted: yes (OpenAI Codex).
Checklist
@kawaii-shakal on GitHub · 2026-11-24 07:54 UTC · original
Review of head
14513af943576682dbfa35c7f4fe6f33b8056580(read only; Linux, no Windows, no GPU).What I did: I read the diff along with
runtime/shims/d3d12_vulkan_device.cppand the host test's comparison loop. Both tests are Windows-only, so I could not build or run either one here.Findings:
PipelineLibrary::check_blobreturnsE_INVALIDARGwhenh.reserved != 0(line 4276).blob[15]is the high byte of thatreservedword in the 16-byte LPL1 header.blobis not used again after the mutation, so the execution checks that follow still run on the libraries loaded earlier.[own format]as reported, not compared. So the step moves out of the host comparison and nothing else changes.c.own.back(). That byte is in the reserved word only becausec.ownis an empty library, so the blob is exactly the 16-byte header. If that step ever serializes a library with entries, the new comment ("The last byte is reserved in the layer's header") stops being true. Flippingc.own[15]would avoid that, or the comment could say "of an empty library".Not tested: I did not build or run either test (they need MSVC and Windows, and the host comparison needs a D3D12 device). I did not check the host's answer on 26100 or 26300.
Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.
@sodove on GitHub · 2026-11-24 08:12 UTC · original · edited 2026-11-24 10:04 UTC
Updated in
0a81e16. The comment now identifies the empty LPL1 library as the reason its last byte belongs to the header. The host test continues to report the trailing-byte result in each device's own format. The docs retain the earlier 74-value measurement and record the current hardware and 72 comparisons.Both Windows tests passed again on the RTX 5070 Ti (610.74) with Vulkan validation enabled. The host comparison reported 72 values and zero mismatches.
Rechecked
0a81e16applied to upstream main21625bcon Windows 11, MSVC Release, RTX 5070 Ti. Both d3d12_pipeline_library and d3d12_pipeline_library_host passed, with the Khronos Vulkan validation layer active and zero validation errors. AI-assisted verification.@kawaii-shakal on GitHub · 2026-11-24 14:48 UTC · original
Re-review of head
0a81e1631649e90469e8c4359b096433a787a9fb(the one commit since my review:0a81e16, docs and a comment).What I re-checked:
git diff 14513af..0a81e16, andscripts/check_no_game_data.pyon the changed files (clean). I did not build or run the two C++ tests. They need MSVC and a D3D12 device. Your re-run on the RTX 5070 Ti (driver 610.74, Vulkan validation on, 72 comparisons, 0 mismatches) is your report; I did not reproduce it.Earlier remarks:
reserved != 0->E_INVALIDARG): no change needed. Unchanged.c.own.back()is in the reserved word only for an empty library: resolved. The comment now says the empty LPL1 library is header-only, so its last byte is in the reserved field. The code still flipsback(), which is fine with that comment.docs/d3d12_vulkan.mdnow records 72 comparisons on Windows 11 build 26100, RTX 5070 Ti, driver 610.74. It keeps the previous 74-value run (RTX 3060, 610.88) and explains the difference of 2 (the trailing-byte case).One small point: the docs say build 26100, but the reply only says "Windows 11". If the run was on another build (for example 26300), please correct the number.
Nothing else open from my side.
AI-assisted.
@Timon360SB on GitHub · 2026-11-24 14:52 UTC · original
Independent verification — Turing and Blackwell
Baseline:
d42773d0734d5fd7b3a32a1bfd536f61186322a5PR head:
0a81e1631649e90469e8c4359b096433a787a9fbEnvironment
DLL versions are from System32, not verified loaded module versions.
Synchronization validation enabled. Three repetitions per revision on each GPU.
CTest results
d3d12_pipeline_libraryd3d12_pipeline_library_hostvk_sync_validationTotal: 36/36 passed, 0 skipped.
Host comparison
Results were consistent across all three repetitions.
The reduction of two compared values is expected: the trailing-byte mutation HRESULT and output pointer state are now reported separately as own-format observations.
Own-format validation
Both GPUs reported identical results on HEAD:
0x800700570x800700570x2)0x2)The layer's new corrupted LPL1 rejection check passed.
Additional host observations
On the Windows 26200 system, native D3D12 additionally faulted on the null-name cases of LoadComputePipeline and LoadGraphicsPipeline.
These faults were not observed on the Windows 28000 system.
This accounts for four fewer compared values on the 26200 system (HRESULT and output state for each call). The difference exists on both revisions and is not introduced by this PR.
All 12 synchronization validation positive controls passed. No validation errors were reported by the two targeted pipeline library tests.
Conclusion
Synthetic fixtures only. No game files used.
AI-assisted test automation and result analysis.
@snain0511 on GitHub · 2026-11-24 15:27 UTC · original
Tested head
0a81e1631on AMD, which the runs so far don't cover.Setup: Windows 11 10.0.26200.9974,
D3D12Core.dll10.0.26100.9818, AMD 26.11.2. RX 9070 (GFX1201, driver 32.0.32029.2010) and the Ryzen 5 7600X iGPU (gfx1036, 32.0.21045.29003), each selected withLEONIDA_VK_DEVICE. MSVC 19.44,RelWithDebInfo.maind0da7daded3d12_pipeline_library_host_test, RX 90700x80070057/ host0x0; output: ours0x2/ host0x1)d3d12_pipeline_library_host_test, iGPUd3d12_pipeline_library_test, bothOne data point for the description: the host here accepts the trailing-byte flip (
S_OK, output written), on build 26200 withD3D12Core10.0.26100.9818. Your rejecting host was 26100 withD3D12Core10.0.26100.7309, and fiestorra's accepting one was 26300. So the deciding factor looks like theD3D12Coreversion rather than the Windows build. It doesn't change the fix, since the row is now reported for each device's own format and not compared, but it may be worth saying in the docs paragraph instead of naming the OS build.No game files. AI-assisted: yes
@sodove on GitHub · 2026-11-24 15:46 UTC · original
On the RX 9070 and Ryzen 5 7600X iGPU runs, both mismatches on
maindisappear on0a81e1631, and the LPL1 reserved-field rejection still passes. That covers the case this PR was meant to fix: the layer and native D3D12 can legitimately give different answers for their own serialized blobs.There is another Windows 26200 result with the same reported
D3D12Core.dllversion (10.0.26100.9818). The native call returnedS_OKon your machine andE_INVALIDARGon the RTX 5070 machine. The latter report identifies the DLL on disk. The loaded DLL and the role of the driver remain open. The build number in the docs identifies our 72-comparison run on the RTX 5070 Ti. RTX 5070 resultsOne detail for interpreting the two AMD runs:
LEONIDA_VK_DEVICEselects the Vulkan adapter. The native side callsD3D12CreateDevice(nullptr, ...), so both runs can use the same default D3D12 adapter. Host device selectionAI-assisted: OpenAI Codex.
@snain0511 on GitHub · 2026-11-24 15:57 UTC · original
Thanks, both points are right.
D3D12CreateDevice(nullptr, D3D_FEATURE_LEVEL_11_0, ...)ascreate_hostdoes lands on the RX 9070 here, so both of my earlier host results came from it. Only the layer side differed between the two runs.D3D12Core.dllversion: with your RTX 5070 run on the same 26200 / 10.0.26100.9818 returningE_INVALIDARG, that version doesn't decide it, and as you say I reported the file on disk, not the loaded one. I withdraw that suggestion.To get a second native adapter, I set Windows' per-app GPU preference to power saving (
HKCU\Software\Microsoft\DirectX\UserGpuPreferences,GpuPreference=1;) for the probe and the test.exe, then removed it. With it set, the probe reportsAMD Radeon(TM) Graphics(the 7600X iGPU, gfx1036). The test was run withLEONIDA_VK_DEVICEon the same iGPU, so both sides were on it:0a81e1631S_OK, output written0x368S_OK, output written0x368Both AMD adapters on AMD 26.11.2 accept the flip, so on this machine the native answer doesn't depend on the GPU generation. That fits the driver being what decides it, but fiestorra's RTX 4090 also returned
S_OK, so it isn't simply AMD vs NVIDIA. I'm leaving it as open data, not a conclusion. Caveat: the probe shows which adapter the preference selects. The test doesn't print its host adapter, so for the test I'm relying on the same preference applying to it.None of this changes the PR. AI-assisted: yes
@adrianmjim on GitHub · 2026-11-24 20:10 UTC · original
Tested
0a81e1631applied onto main23c459644on an AMD Radeon RX 7900 XT: d3d12_pipeline_library_host fails on main (2 mismatches, both from the trailing-byte step) and passes with this PR, 3/3 runs. d3d12_pipeline_library, including the new reserved-word check, passes 3/3. No new failures in the full ctest run.Hardware/software: AMD Radeon RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010 (Adrenalin 26.11.2), Windows 11 build 26300, VS 2022 (x64, RelWithDebInfo), Vulkan SDK 1.4.363.0.
Build:
Targeted tests, 3 runs each on main and on the PR (third run with
LEONIDA_VK_VALIDATION=1):23c4596440a81e163123c4596440a81e1631On main, every run prints the same two mismatches:
With the PR (from a
-Vrun), the same step is reported and skipped:So on this machine the native library is 0x368 bytes, and flipping its last byte still gives S_OK and writes the output. The layer's 16-byte LPL1 blob is rejected with E_INVALIDARG, since its last byte is in the reserved word. The 72 public-argument comparisons all match, which is the same count as the RTX 5070 Ti run in the doc text. The 22 values not compared are the 4
[own format]values plus 18 from 9 host calls that fault here (Serialize null with its size, the three StorePipeline null-PSO calls, LoadComputePipeline and LoadGraphicsPipeline with a null name or description, and LoadPipeline with a null description). The host faults on the same calls on main.Full ctest on the PR build, run once:
The only difference is d3d12_pipeline_library_host going from failed to passed. The other four failures also fail on main on this machine and are not related to this change. gameinput is disabled in both runs.
One minor note: the main runs of d3d12_pipeline_library_host took 8, 38 and 74 s, while the PR runs took about 8 s each. The main runs overlapped with a build of the PR tree on the same machine, so I would not read anything into the timing. The output was identical in all three runs.