Skip to content

d3d12_pipeline_library_host_test: an own blob with its last byte changed is own format (AMD accepts it) - #5873

Open
mrp1no wants to merge 1 commit into
ItsNotRexed:mainfrom
mrp1no:d3d-plib-host-last-byte
Open

mrp1no wants to merge 1 commit into
ItsNotRexed:mainfrom
mrp1no:d3d-plib-host-last-byte

Conversation

@mrp1no

@mrp1no mrp1no commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #5781 (comment) (point 3 of @PeterGrieffindor's finding, #5781 (comment))

What and why

d3d12_pipeline_library_host (#3089, mine) fails on AMD's Windows D3D12 (26.11.2, RX 9070 XT): pipeline library create: its own blob, last byte flipped: ours 0x80070057 host 0x0, and the same step's output ours 0x2 host 0x1.

That step flips the last byte of each device's own serialized empty library. Whether CreatePipelineLibrary notices depends on what that driver's blob format covers:

  • the layer, NVIDIA's D3D12 and Intel's D3D12 refuse it with E_INVALIDARG;
  • AMD's accepts it.

That is a property of each driver's format, like the serialized size the test already records without comparing.

The step now carries [own format]. It is still recorded and printed, but not compared. The first-byte flip (the header) is refused by every host measured, so it stays compared. The docs/d3d12_vulkan.md paragraph on this test says so. The layer itself is unchanged.

Tested

Windows 11, MSVC RelWithDebInfo, at the branch head. On both an Intel UHD Graphics 750 and an NVIDIA RTX 3060, the host is that adapter's own D3D12: 72 steps compared with the host (22 more not compared), 0 mismatches, OK. The flipped step prints ours 0x80070057 host 0x80070057 (each device's own format; not compared).

I have no AMD card. @PeterGrieffindor offered to run a candidate on the RX 9070 XT. tests/test_docs_*.py pass (33).

No game files. AI-assisted (Claude Code).

🤖 Generated with Claude Code

…ged is own format

The step flips the last byte of each device's own serialized empty library, so
whether CreatePipelineLibrary catches the change depends on that driver's blob
format. The layer and NVIDIA's and Intel's D3D12 refuse it with E_INVALIDARG.
AMD's D3D12 (26.11.2, RX 9070 XT) accepts it, which made the test fail there
with 2 mismatches in 74 (@PeterGrieffindor, ItsNotRexed#5781). The step now carries
[own format]: recorded and printed, not compared, like the serialized size.
The first-byte flip, which every host measured refuses, stays compared. The
d3d12_vulkan.md paragraph says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DenRakEiw

Copy link
Copy Markdown

Independent review on Windows 11 x64 / NVIDIA GeForce RTX 5090 (driver 32.0.16.1088), MSVC 2022 (RelWithDebInfo), Ninja, Vulkan SDK 1.4.363.0, testing commit 98d6cbb740f6a1f0d48e50dcf988010b657a8571 trial-merged onto origin/main (561b65a83):

  • Diff & scope: Clean (git diff --cached --check passed). Tagging "create: its own blob, last byte flipped [own format]" marks both the HRESULT and (output) records as [own format], so they remain recorded and printed without cross-driver comparison while the first-byte header-flip step stays compared. docs/d3d12_vulkan.md matches the change.
  • GPU test (LEONIDA_VK_VALIDATION=1): Built and ran d3d12_pipeline_library_host_test.exe on NVIDIA GeForce RTX 5090 (validation on):
    • pipeline library create: its own blob, last byte flipped [own format]: ours 0x80070057 host 0x80070057 (each device's own format; not compared)
    • pipeline library create: its own blob, last byte flipped [own format] (output): ours 0x2 host 0x2 (each device's own format; not compared)
    • pipeline library: 72 steps compared with the host (22 more not compared), 0 mismatches
    • d3d12_pipeline_library_host_test: OK (0 Vulkan validation errors).
  • Docs tests: python -m pytest tests/test_docs_*.py — 33 passed.

Looks good to merge from the NVIDIA/Vulkan side (AMD RX 9070 XT behavior not directly re-measured here).

AI-assisted (Gemini 4 Neon).

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 98d6cbb on NVIDIA GeForce RTX 4080, driver 617.42: d3d12_pipeline_library_host_test exits 0 and prints "pipeline library: 72 steps compared with the host (22 more not compared), 0 mismatches" and "d3d12_pipeline_library_host_test: OK". The step "its own blob, last byte flipped [own format]" prints "ours 0x80070057 host 0x80070057 (each device's own format; not compared)", so this host also refuses the flipped blob. The steps with a null argument print host 0xfa017ed and are marked "the host faults; not compared". The AMD claim in the description was not run here.

AI-assisted.

@Etr0p

Etr0p commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 98d6cbb7 with an AMD host, the case this PR is for (the two checks above are NVIDIA hosts): pass. On this laptop the test's native D3D12 is the default adapter, a Radeon 610M (AMD 26.11.2 / 32.0.21045.29003). Windows 11 26200, MSVC 14.44 RelWithDebInfo, Vulkan SDK 1.4.363.0.

  • ctest -R ^d3d12_pipeline_library_host$ with the layer on the RTX 5070 Ti Laptop (NVIDIA 621.24) and on the 610M, each with LEONIDA_VK_VALIDATION=0 and 1: 4/4 pass, 72 steps compared with the host (22 more not compared), 0 mismatches.
  • The flipped-last-byte step is now recorded and not compared: its own blob, last byte flipped [own format]: ours 0x80070057 host 0x0, and the output ours 0x2 host 0x1. AMD's D3D12 accepts its own blob with the last byte changed.
  • Baseline: on main 561b65a8 the same host fails with 2 mismatches, from that step, as in @PeterGrieffindor's finding.

AI-assisted (Claude Code). Synthetic test only, no game files.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting. Head 98d6cbb74.

Built with MSVC 19.44 + Ninja RelWithDebInfo and ran on the RTX 5070 Ti (NVIDIA host D3D12): d3d12_pipeline_library_host_test.exe → 72 steps compared with the host (22 more not compared), 0 mismatches, d3d12_pipeline_library_host_test: OK, rc 0.

The changed step is recorded and skipped as intended: create: its own blob, last byte flipped [own format]: ours 0x80070057 host 0x80070057 (each device's own format; not compared). On NVIDIA both still refuse it, so this run does not exercise AMD's accept case, but the [own format] suffix is what the comparison loop keys on (d3d12_pipeline_library_host_test.cpp:387-389), so the AMD record can no longer fail the test. The header-flip step remains compared.

Docs paragraph matches the code. No sibling PR touches this test.

@emirduran707

Copy link
Copy Markdown
Contributor

Ran 98d6cbb7 on AMD, as asked in the coordination issue: Radeon RX 9060 XT (RDNA4), driver 26.10.44, Windows 11, MSVC (VS 2022), LEONIDA_VK_DEVICE=9060. Passes, two runs.

main 561b65a8 this PR 98d6cbb7
d3d12_pipeline_library_host fails: 74 steps compared, 2 mismatches (its own blob, last byte flipped: ours 0x80070057 host 0x0 and its output, ours 0x2 host 0x1; line 401: mismatches == 0) passes: 72 steps compared (22 more not compared), 0 mismatches

The two steps are still printed with this PR, now as [own format] ... (each device's own format; not compared), with the same values as above, so AMD's D3D12 on this card does accept its own blob with the last byte changed, as on the 610M.

Only this test was built and run for this check, not the whole suite.

AI-assisted (Claude Code). Synthetic test only, no game files.

@trick-ye

Copy link
Copy Markdown

Tested 98d6cbb7 on AMD Radeon RX 7800 XT (RDNA3), AMD 26.11.2 (Windows driver 32.0.32029.2010), Windows 11 26200: pass; it fixes a failure this card has on main.

  • main 561b65a8: d3d12_pipeline_library_host fails with create: its own blob, last byte flipped: ours 0x80070057 host 0x0 MISMATCH and its output ours 0x2 host 0x1 MISMATCH (line 401: mismatches == 0). So AMD's D3D12 accepts the changed blob on RDNA3 too.
  • This head: 3 runs alone with LEONIDA_VK_DEVICE=7800, exit 0 each: pipeline library: 72 steps compared with the host (22 more not compared), 0 mismatches; the step now reads [own format] ... ours 0x80070057 host 0x0 (each device's own format; not compared).
  • Only this test was built and run. MSVC 14.42 (VS 2022), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo. Synthetic test only, no game files.

AI-assisted (Claude Code).

@Witredd

Witredd commented Nov 23, 2026

Copy link
Copy Markdown

Tested 98d6cbb7 on AMD RDNA1: Radeon RX 5600 XT (Navi 10), AMD 26.10.1 (32.0.21045.16010), Windows 11 Pro 26200, MSVC 17.14 RelWithDebInfo, LEONIDA_VK_DEVICE=5600. Pass; it fixes the failure this card has on main.

main 1cc6e3c this PR 98d6cbb7
d3d12_pipeline_library_host fails: its own blob, last byte flipped: ours 0x80070057 host 0x0 and its output ours 0x2 host 0x1 passes 3/3: 72 steps compared with the host (22 more not compared), 0 mismatches, OK

The flipped step now prints ours 0x80070057 host 0x0 (each device's own format; not compared), so AMD's D3D12 accepts the changed blob on RDNA1 as well, the same as on the RDNA2, RDNA3 and RDNA4 results above. Not run with LEONIDA_VK_VALIDATION=1 (no validation layer installed here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants