Skip to content

D3D12.X: derived pipelines ignore hint patches; derived compute is the base - #3160

Draft
KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-derived-pso-hint-patches
Draft

KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-derived-pso-hint-patches

Conversation

@KOLESNiii

@KOLESNiii KOLESNiii commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Status: a guess that needs evidence before it can be merged. That derived-pipeline patch kinds 4, 6 and 7 are hints with no PC field, and that device #63 derives a compute pipeline is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then.

Evidence that would confirm it: a title that calls device #55 with patch kinds 4 / 6 / 7 (on main that call fails with E_FAIL and is logged) or calls #63 (a logged stub on main). The retail game used for the regression run does not get there.

If you run a title that gets there, please post those lines here (not the whole log, which names your paths).

CreateDerivedPipelineStateX (device #55) failed the whole call with E_FAIL on patch kinds 4 (pixel-shader options), 6 (graphics shader limits) and 7 (tessellation parameters). These are hints that a PC pipeline desc has no field for, like kind 5 (depth-stencil options), which XCL already ignores. A title that derives wave-limit variants of a pipeline therefore got no pipeline at all. The derived compute pipeline (device #63) was a logging stub: it returned S_OK and never wrote its out pointer.

What is in it

  • device_x.rs apply_patch: kinds 4–7 are ignored, with one log line per kind that includes the patch bytes. Kinds 8 and up still fail with E_FAIL.

  • device_x.rs create_derived_compute_pso_x, wired at device MicrosoftGame.config settings: comments skipped, UTF-16 BE read #63 in real.rs: its only patch kind is 0 (compute shader limits), so it returns the base pipeline (QueryInterface on the base for riid). A first patch of another kind, a null out pointer, or patches missing when the count is non-zero give E_INVALIDARG and a null out. The size of one compute patch is not known, so only the first patch's kind is checked.

  • tests/testtitle/src/gpu.rs: the test title's check that an unknown patch part is refused uses part 8, since part 4 is now accepted.

Kind 5 is still ignored rather than folded into the depth-stencil state, the same as stream type 26 in #3151.

#1921 (open) asserts E_FAIL for patch part 4. After this PR, part 4 succeeds, so that test needs an unknown part such as 8.

Tested

  • NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug

  • Rebased onto main bb9a6b4b on 2026-11-28. cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on b2445ec2: 2143 passed, 0 failed, 48 ignored; 25 SKIPPED (21 no wave64, 3 refused gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 forms, 1 no heap windows).

    • At the previous head, with main's e2e title tests passing again, the test title's check failed: it still sent part 4 and expected E_FAIL. It sends part 8 now.
  • New tests:

    • device_x::tests::derived_pipeline_patches_land_on_the_desc_parts (extended): ok. It fails without the change: part 4 returns Err(4).

    • device_x::tests::derived_compute_pipeline_is_the_base: ok. It tests the new function.

Regression run

RTX 2070 SUPER, the retail game, 60 s, XCL_PRESS_AT=25:A, XCL_PREPARE=0 (no startup shader preparation), release builds. main ran in an earlier queue job than this head; every run started from the same DXIL cache.

main:


xcl-smoke v1

commit: 309c3ec5a25ea231ddbe01f76748ab8ed3d9d953

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1297 (PresentX 1298)

presents per 2 s (last 3): 60 60 61

device removals: 0

crashes: 0

peak commit: 14701 MB

This PR's head:


xcl-smoke v1

commit: b2445ec2a4b4559f445502e1c9f1607daae94753

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1286 (PresentX 1286)

presents per 2 s (last 3): 60 60 60

device removals: 0

crashes: 0

peak commit: 15061 MB

Not tested

AI use

  • Claude Code, Claude Opus 5.5 (earlier steps of this session ran on Claude Sonnet 5.5): wrote the code, the tests and this description; ran the tests.

  • Claude Code (Claude Opus 5.5) rebased it, fixed the test title's check, ran the suite and the regression runs and updated this description.

🤖 Generated with Claude Code

@KOLESNiii
KOLESNiii force-pushed the d3d12x-derived-pso-hint-patches branch from 0816a9a to 31635e1 Compare November 28, 2026 15:30
…e base

CreateDerivedPipelineStateX (xcl-dev#55) failed the whole call (E_FAIL) on patch
kinds 4 (pixel-shader options), 6 (graphics shader limits) and 7
(tessellation parameters). Like kind 5 (depth-stencil options), they are
hints with no field in a PC pipeline desc, so a title that derives
wave-limit variants got no pipeline at all. They are now ignored with one
log line per kind; an unknown kind still fails.

The derived compute pipeline (xcl-dev#63) was a logging stub that returned S_OK
without writing its out pointer. Its only patch kind is compute shader
limits, again with no PC field, so it now returns the base pipeline
(QueryInterface on it for riid). An unknown first patch kind, a null out
pointer or missing patches are E_INVALIDARG with a null result.

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

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head b2445ec

No open or merged PR maps device slot #63 or treats patch parts 4-7 of CreateDerivedPipelineStateX as hints. #3137 (pipeline-state flags) and the merged #3292 (base pipelines own their shaders) touch nearby code but make a different change.
No problems found in the diff: apply_patch still rejects unknown parts (the test title now uses 8), and create_derived_compute_pso_x returns the base through QueryInterface, which takes its own reference. That parts 4-7 and the #63 patch kind 0 carry only hints is inferred, not confirmed by a title.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@Foniass

Foniass commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Review (head b2445ec, diff read, not a merge-check; draft):

Fine: the extended apply_patch test fails on main (Err(4)), the UNMODELLED[part - 4] index is bounded by the 4..=7 match, and CI is green.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

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.

2 participants