Tests: separate pipeline library blob validation from host parity (TEST-PIPELINE-LIBRARY-OWN-FORMAT) #533

Manually merged
github merged 2 commits from gh-pr/533/head into gh-pr/533/base 2026-11-26 09:06:51 +00:00
Owner

@⁠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 UTC

Claimed 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.

  • Main 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.
  • This branch. d3d12_pipeline_library_host compares 72 values with 0 mismatches and reports the two trailing-mutation values separately. d3d12_pipeline_library passes the new rejection check and its existing execution checks.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11.

AI-assisted: yes (OpenAI Codex).

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption. Synthetic fixtures only.
  • New translator rule (not applicable).
**@⁠sodove** on GitHub · 2026-11-24 07:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533) `sodove:test/pipeline-library-own-format` → `main` · +20 −8 · 3 files · 2 commits · merged 2026-11-24 18:20 UTC Claimed in the coordination issue as: TEST-PIPELINE-LIBRARY-OWN-FORMAT ([#14](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/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](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) 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. - Main d42773d0734d5fd7b3a32a1bfd536f61186322a5. 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. - This branch. d3d12_pipeline_library_host compares 72 values with 0 mismatches and reports the two trailing-mutation values separately. d3d12_pipeline_library passes the new rejection check and its existing execution checks. GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11. AI-assisted: yes (OpenAI Codex). ### Checklist - [x] Based on current main. - [x] One topic. - [x] No game data, keys or decryption. Synthetic fixtures only. - [ ] New translator rule (not applicable).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:06:49 +00:00
github manually merged commit 0a81e16316 into gh-pr/533/base 2026-11-26 09:06:51 +00:00
Author
Owner

@⁠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.cpp and the host test's comparison loop. Both tests are Windows-only, so I could not build or run either one here.

Findings:

  • The new layer check matches the code. PipelineLibrary::check_blob returns E_INVALIDARG when h.reserved != 0 (line 4276). blob[15] is the high byte of that reserved word in the 16-byte LPL1 header. blob is not used again after the mutation, so the execution checks that follow still run on the libraries loaded earlier.
  • In the host test, the only code change is the step's new name. The comparison loop (around line 384) already treats any step whose name contains [own format] as reported, not compared. So the step moves out of the host comparison and nothing else changes.
  • One assumption to note: the host step flips c.own.back(). That byte is in the reserved word only because c.own is 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. Flipping c.own[15] would avoid that, or the comment could say "of an empty library".
  • The docs paragraph drops the value count and the hardware it was measured on (the old text said "74 values … RTX 3060, driver 610.88"; this PR's run reports 72). Consider keeping the count and the hardware for the new run, so that the next run on other hardware has a number to compare with.

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.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 07:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7125513772) 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.cpp` and the host test's comparison loop. Both tests are Windows-only, so I could not build or run either one here. **Findings:** - The new layer check matches the code. `PipelineLibrary::check_blob` returns `E_INVALIDARG` when `h.reserved != 0` (line 4276). `blob[15]` is the high byte of that `reserved` word in the 16-byte LPL1 header. `blob` is not used again after the mutation, so the execution checks that follow still run on the libraries loaded earlier. - In the host test, the only code change is the step's new name. The comparison loop (around line 384) already treats any step whose name contains `[own format]` as reported, not compared. So the step moves out of the host comparison and nothing else changes. - One assumption to note: the host step flips `c.own.back()`. That byte is in the reserved word only because `c.own` is 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. Flipping `c.own[15]` would avoid that, or the comment could say "of an empty library". - The docs paragraph drops the value count and the hardware it was measured on (the old text said "74 values … RTX 3060, driver 610.88"; this PR's run reports 72). Consider keeping the count and the hardware for the new run, so that the next run on other hardware has a number to compare with. **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._
Author
Owner

@⁠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 0a81e16 applied to upstream main 21625bc on 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.

**@⁠sodove** on GitHub · 2026-11-24 08:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7125863457) · 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 0a81e16 applied to upstream main 21625bc on 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.
Author
Owner

@⁠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, and scripts/check_no_game_data.py on 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:

  1. Layer check (reserved != 0 -> E_INVALIDARG): no change needed. Unchanged.
  2. Host test only renames the step: no change needed. Unchanged.
  3. 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 flips back(), which is fine with that comment.
  4. Value count and hardware in the docs: resolved. docs/d3d12_vulkan.md now 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.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 14:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7134974083) Re-review of head `0a81e1631649e90469e8c4359b096433a787a9fb` (the one commit since my review: `0a81e16`, docs and a comment). What I re-checked: `git diff 14513af..0a81e16`, and `scripts/check_no_game_data.py` on 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: 1. Layer check (`reserved != 0` -> `E_INVALIDARG`): no change needed. Unchanged. 2. Host test only renames the step: no change needed. Unchanged. 3. `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 flips `back()`, which is fine with that comment. 4. Value count and hardware in the docs: resolved. `docs/d3d12_vulkan.md` now 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.
Author
Owner

@⁠Timon360SB on GitHub · 2026-11-24 14:52 UTC · original

Independent verification — Turing and Blackwell

Baseline: d42773d0734d5fd7b3a32a1bfd536f61186322a5

PR head: 0a81e1631649e90469e8c4359b096433a787a9fb

Environment

Configuration RTX 2060 SUPER RTX 5070
Architecture Turing Blackwell
NVIDIA driver 621.14 621.14
Windows 11 build 28000 26200
D3D12Core.dll on disk 10.0.28000.3365 10.0.26100.9818
Vulkan SDK 1.4.363.0 1.4.363.0
MSVC 19.44.35230 19.44.35230
Configuration RelWithDebInfo RelWithDebInfo
Generator Ninja Multi-Config Ninja Multi-Config

DLL versions are from System32, not verified loaded module versions.

Synchronization validation enabled. Three repetitions per revision on each GPU.

CTest results

Test 2060S BASE 2060S HEAD 5070 BASE 5070 HEAD
d3d12_pipeline_library 3/3 3/3 3/3 3/3
d3d12_pipeline_library_host 3/3 3/3 3/3 3/3
vk_sync_validation 3/3 3/3 3/3 3/3

Total: 36/36 passed, 0 skipped.

Host comparison

GPU BASE compared HEAD compared BASE mismatches HEAD mismatches
RTX 2060 SUPER 78 76 0 0
RTX 5070 74 72 0 0

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:

Observation Layer Native D3D12
Empty serialized library size 16 bytes 896 bytes
Trailing-byte mutation HRESULT 0x80070057 0x80070057
Output pointer state Unchanged (0x2) Unchanged (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

  • The new own-format validation checks pass on Turing and Blackwell.
  • All compared host values match on both revisions.
  • Both tested native hosts reject the trailing-byte mutation.
  • No regressions observed in the selected tests.

Synthetic fixtures only. No game files used.

AI-assisted test automation and result analysis.

**@⁠Timon360SB** on GitHub · 2026-11-24 14:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7135099719) ## Independent verification — Turing and Blackwell **Baseline:** `d42773d0734d5fd7b3a32a1bfd536f61186322a5` **PR head:** `0a81e1631649e90469e8c4359b096433a787a9fb` ### Environment | Configuration | RTX 2060 SUPER | RTX 5070 | | --- | --- | --- | | Architecture | Turing | Blackwell | | NVIDIA driver | 621.14 | 621.14 | | Windows 11 build | 28000 | 26200 | | D3D12Core.dll on disk | 10.0.28000.3365 | 10.0.26100.9818 | | Vulkan SDK | 1.4.363.0 | 1.4.363.0 | | MSVC | 19.44.35230 | 19.44.35230 | | Configuration | RelWithDebInfo | RelWithDebInfo | | Generator | Ninja Multi-Config | Ninja Multi-Config | DLL versions are from System32, not verified loaded module versions. Synchronization validation enabled. Three repetitions per revision on each GPU. ### CTest results | Test | 2060S BASE | 2060S HEAD | 5070 BASE | 5070 HEAD | | --- | --- | --- | --- | --- | | `d3d12_pipeline_library` | 3/3 | 3/3 | 3/3 | 3/3 | | `d3d12_pipeline_library_host` | 3/3 | 3/3 | 3/3 | 3/3 | | `vk_sync_validation` | 3/3 | 3/3 | 3/3 | 3/3 | **Total: 36/36 passed, 0 skipped.** ### Host comparison | GPU | BASE compared | HEAD compared | BASE mismatches | HEAD mismatches | | --- | ---: | ---: | ---: | ---: | | RTX 2060 SUPER | 78 | 76 | 0 | 0 | | RTX 5070 | 74 | 72 | 0 | 0 | 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: | Observation | Layer | Native D3D12 | | --- | --- | --- | | Empty serialized library size | 16 bytes | 896 bytes | | Trailing-byte mutation HRESULT | `0x80070057` | `0x80070057` | | Output pointer state | Unchanged (`0x2`) | Unchanged (`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 - The new own-format validation checks pass on Turing and Blackwell. - All compared host values match on both revisions. - Both tested native hosts reject the trailing-byte mutation. - No regressions observed in the selected tests. Synthetic fixtures only. No game files used. AI-assisted test automation and result analysis.
Author
Owner

@⁠snain0511 on GitHub · 2026-11-24 15:27 UTC · original

Tested head 0a81e1631 on AMD, which the runs so far don't cover.

Setup: Windows 11 10.0.26200.9974, D3D12Core.dll 10.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 with LEONIDA_VK_DEVICE. MSVC 19.44, RelWithDebInfo.

main d0da7dade this PR
d3d12_pipeline_library_host_test, RX 9070 exit 1: 2 mismatches (last byte flipped: ours 0x80070057 / host 0x0; output: ours 0x2 / host 0x1) exit 0: 72 compared, 0 mismatches
d3d12_pipeline_library_host_test, iGPU exit 1: the same 2 mismatches exit 0: 72 compared, 0 mismatches
d3d12_pipeline_library_test, both exit 0 (the new LPL1 reserved-word rejection included)

One data point for the description: the host here accepts the trailing-byte flip (S_OK, output written), on build 26200 with D3D12Core 10.0.26100.9818. Your rejecting host was 26100 with D3D12Core 10.0.26100.7309, and fiestorra's accepting one was 26300. So the deciding factor looks like the D3D12Core version 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

**@⁠snain0511** on GitHub · 2026-11-24 15:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7136071496) Tested head `0a81e1631` on AMD, which the runs so far don't cover. **Setup:** Windows 11 10.0.26200.9974, `D3D12Core.dll` 10.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 with `LEONIDA_VK_DEVICE`. MSVC 19.44, `RelWithDebInfo`. | | `main` `d0da7dade` | this PR | |---|---|---| | `d3d12_pipeline_library_host_test`, RX 9070 | exit 1: 2 mismatches (last byte flipped: ours `0x80070057` / host `0x0`; output: ours `0x2` / host `0x1`) | exit 0: 72 compared, 0 mismatches | | `d3d12_pipeline_library_host_test`, iGPU | exit 1: the same 2 mismatches | exit 0: 72 compared, 0 mismatches | | `d3d12_pipeline_library_test`, both | | exit 0 (the new LPL1 reserved-word rejection included) | One data point for the description: the host here **accepts** the trailing-byte flip (`S_OK`, output written), on build **26200** with `D3D12Core` **10.0.26100.9818**. Your rejecting host was 26100 with `D3D12Core` 10.0.26100.7309, and fiestorra's accepting one was 26300. So the deciding factor looks like the `D3D12Core` version 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
Author
Owner

@⁠sodove on GitHub · 2026-11-24 15:46 UTC · original

On the RX 9070 and Ryzen 5 7600X iGPU runs, both mismatches on main disappear on 0a81e1631, 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.dll version (10.0.26100.9818). The native call returned S_OK on your machine and E_INVALIDARG on 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 results

One detail for interpreting the two AMD runs: LEONIDA_VK_DEVICE selects the Vulkan adapter. The native side calls D3D12CreateDevice(nullptr, ...), so both runs can use the same default D3D12 adapter. Host device selection

AI-assisted: OpenAI Codex.

**@⁠sodove** on GitHub · 2026-11-24 15:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7136577208) On the RX 9070 and Ryzen 5 7600X iGPU runs, both mismatches on `main` disappear on `0a81e1631`, 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.dll` version (`10.0.26100.9818`). The native call returned `S_OK` on your machine and `E_INVALIDARG` on 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 results](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/533) One detail for interpreting the two AMD runs: `LEONIDA_VK_DEVICE` selects the Vulkan adapter. The native side calls `D3D12CreateDevice(nullptr, ...)`, so both runs can use the same default D3D12 adapter. [Host device selection](https://github.com/ubiquitarianism/leonida/blob/0a81e1631649e90469e8c4359b096433a787a9fb/runtime/test/d3d12_pipeline_library_host_test.cpp#L263-L270) AI-assisted: OpenAI Codex.
Author
Owner

@⁠snain0511 on GitHub · 2026-11-24 15:57 UTC · original

Thanks, both points are right.

  • One host adapter, not two: confirmed. A small probe calling D3D12CreateDevice(nullptr, D3D_FEATURE_LEVEL_11_0, ...) as create_host does 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.dll version: with your RTX 5070 run on the same 26200 / 10.0.26100.9818 returning E_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 reports AMD Radeon(TM) Graphics (the 7600X iGPU, gfx1036). The test was run with LEONIDA_VK_DEVICE on the same iGPU, so both sides were on it:

Native adapter last byte flipped (host) empty library size (host) result at 0a81e1631
RX 9070 (RDNA4) S_OK, output written 0x368 72 compared, 0 mismatches
7600X iGPU (RDNA2, gfx1036) S_OK, output written 0x368 72 compared, 0 mismatches

Both 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

**@⁠snain0511** on GitHub · 2026-11-24 15:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7136883478) Thanks, both points are right. - **One host adapter, not two:** confirmed. A small probe calling `D3D12CreateDevice(nullptr, D3D_FEATURE_LEVEL_11_0, ...)` as `create_host` does 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.dll` version:** with your RTX 5070 run on the same 26200 / 10.0.26100.9818 returning `E_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 reports `AMD Radeon(TM) Graphics` (the 7600X iGPU, gfx1036). The test was run with `LEONIDA_VK_DEVICE` on the same iGPU, so both sides were on it: | Native adapter | last byte flipped (host) | empty library size (host) | result at `0a81e1631` | |---|---|---|---| | RX 9070 (RDNA4) | `S_OK`, output written | `0x368` | 72 compared, 0 mismatches | | 7600X iGPU (RDNA2, gfx1036) | `S_OK`, output written | `0x368` | 72 compared, 0 mismatches | Both 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
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-24 20:10 UTC · original

Tested 0a81e1631 applied onto main 23c459644 on 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:

cmake -S runtime -B runtime/build/d3d12 -G "Visual Studio 17 2022" -A x64 -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON
cmake --build runtime/build/d3d12 --config RelWithDebInfo --parallel 16

Targeted tests, 3 runs each on main and on the PR (third run with LEONIDA_VK_VALIDATION=1):

ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -R "^d3d12_pipeline_library_host$" --output-on-failure
ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -R "^d3d12_pipeline_library$" --output-on-failure
run 1 run 2 run 3 (validation on)
d3d12_pipeline_library_host, main 23c459644 Failed, 2 mismatches Failed, 2 mismatches Failed, 2 mismatches
d3d12_pipeline_library_host, PR 0a81e1631 Passed Passed Passed
d3d12_pipeline_library, main 23c459644 Passed Passed Passed
d3d12_pipeline_library, PR 0a81e1631 Passed Passed Passed

On main, every run prints the same two mismatches:

pipeline library create: its own blob, last byte flipped: ours 0x80070057 host 0x0  MISMATCH
pipeline library create: its own blob, last byte flipped (output): ours 0x2 host 0x1  MISMATCH
pipeline library: 74 steps compared with the host (20 more not compared), 2 mismatches

With the PR (from a -V run), the same step is reported and skipped:

pipeline library GetSerializedSize of an empty library [own format]: ours 0x10 host 0x368 (each device's own format; not compared)
pipeline library create: its own blob, last byte flipped [own format]: ours 0x80070057 host 0x0 (each device's own format; not compared)
pipeline library create: its own blob, last byte flipped [own format] (output): ours 0x2 host 0x1 (each device's own format; not compared)
pipeline library GetSerializedSize after the steps [own format]: ours 0x10 host 0x368 (each device's own format; not compared)
pipeline library: 72 steps compared with the host (22 more not compared), 0 mismatches

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:

ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -j 4 --timeout 600 --output-on-failure
  • main: 300/305 passed. Failed: vk_queue_query_sync, d3d12_texture_tiles, d3d12_execute_indirect_validation, d3d12_clear, d3d12_pipeline_library_host.
  • PR: 301/305 passed. Failed: vk_queue_query_sync, d3d12_texture_tiles, d3d12_execute_indirect_validation, d3d12_clear.

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.

**@⁠adrianmjim** on GitHub · 2026-11-24 20:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/533#issuecomment-7143152854) Tested 0a81e1631 applied onto main 23c459644 on 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: ``` cmake -S runtime -B runtime/build/d3d12 -G "Visual Studio 17 2022" -A x64 -DLEONIDA_BUILD_WINDOWS_RUNTIME=ON cmake --build runtime/build/d3d12 --config RelWithDebInfo --parallel 16 ``` Targeted tests, 3 runs each on main and on the PR (third run with `LEONIDA_VK_VALIDATION=1`): ``` ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -R "^d3d12_pipeline_library_host$" --output-on-failure ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -R "^d3d12_pipeline_library$" --output-on-failure ``` | | run 1 | run 2 | run 3 (validation on) | |---|---|---|---| | d3d12_pipeline_library_host, main 23c459644 | Failed, 2 mismatches | Failed, 2 mismatches | Failed, 2 mismatches | | d3d12_pipeline_library_host, PR 0a81e1631 | Passed | Passed | Passed | | d3d12_pipeline_library, main 23c459644 | Passed | Passed | Passed | | d3d12_pipeline_library, PR 0a81e1631 | Passed | Passed | Passed | On main, every run prints the same two mismatches: ``` pipeline library create: its own blob, last byte flipped: ours 0x80070057 host 0x0 MISMATCH pipeline library create: its own blob, last byte flipped (output): ours 0x2 host 0x1 MISMATCH pipeline library: 74 steps compared with the host (20 more not compared), 2 mismatches ``` With the PR (from a `-V` run), the same step is reported and skipped: ``` pipeline library GetSerializedSize of an empty library [own format]: ours 0x10 host 0x368 (each device's own format; not compared) pipeline library create: its own blob, last byte flipped [own format]: ours 0x80070057 host 0x0 (each device's own format; not compared) pipeline library create: its own blob, last byte flipped [own format] (output): ours 0x2 host 0x1 (each device's own format; not compared) pipeline library GetSerializedSize after the steps [own format]: ours 0x10 host 0x368 (each device's own format; not compared) pipeline library: 72 steps compared with the host (22 more not compared), 0 mismatches ``` 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: ``` ctest --test-dir runtime/build/d3d12 -C RelWithDebInfo -j 4 --timeout 600 --output-on-failure ``` - main: 300/305 passed. Failed: vk_queue_query_sync, d3d12_texture_tiles, d3d12_execute_indirect_validation, d3d12_clear, d3d12_pipeline_library_host. - PR: 301/305 passed. Failed: vk_queue_query_sync, d3d12_texture_tiles, d3d12_execute_indirect_validation, d3d12_clear. 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.