Skip to content

D3D12.X: console pipeline-state flags reach the PC as PC flags - #3137

Draft
KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-console-pso-flags
Draft

KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-console-pso-flags

Conversation

@KOLESNiii

@KOLESNiii KOLESNiii commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Status: a guess that needs evidence before it can be merged. The console's pipeline-state flag values (TOOL_DEBUG 0x8000_0000, no 0x4 / 0x8, console-only 0x8000 / 0x10_0000 / 0x20_0000 / 0x40_0000) 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: this head logs the first pipeline-state flag bit it does not know; the flag words titles pass in their pipeline descs and streams settle it. Related: #2693 (forwards a console compute stream's FLAGS subobject) and #3001 (records the flags the driver accepted). The three fit together in code, and none of them has title evidence: on a 60 s run of the retail game, no graphics stream had a FLAGS subobject and every compute desc had flags 0, so all three are no-ops there. Note that the PC itself defines 0x1, 0x4 and 0x8, so dropping 0x4 / 0x8 rests only on this guess.

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

The console's pipeline-state flag enum is not the PC's: its TOOL_DEBUG is

0x8000_0000, it has 0x8000 / 0x10_0000 / 0x20_0000 / 0x40_0000 of its own,

and no 0x4 (dynamic depth bias) or 0x8 (dynamic strip cut). XCL forwarded

a title's Flags unmasked, so console bits reached the PC runtime and the

driver-cache keys (which hash the flags), and a title's 0x4 was taken for

a request XCL makes itself.

pc_pso_flags keeps only 0x1 and logs the first occurrence of any other

unknown bit. It is applied where a title's desc or stream becomes a PC

one, before the cache keys are formed:

  • device_x.rs create_graphics_pso_tracked (CreateGraphicsPipelineState,

    ...X, CreateDerivedPipelineStateX), before XCL adds its own 0x4;

  • real.rs dev_create_compute_pso (also the compute stream projection);

  • real.rs dev_create_pipeline_state: the FLAGS subobject of the stream.

What is in it

  • crates/xcl/src/hle/d3d12x/device_x.rs: +18 / -0

  • crates/xcl/src/hle/d3d12x/real.rs: +142 / -0

  • new tests: console_only_bits_do_not_reach_the_pc, stream_flags_subobject_is_mapped, compute_desc_flags_are_mapped, console_compute_flags_create_a_pso_on_d3d12

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

  • cargo test --workspace --no-fail-fast -- --test-threads=4 on f7f8fc27 (built on main 336fddda; it merges into the current main e429936c without conflict): 2126 passed, 9 failed, 48 ignored, 25 SKIPPED lines (21 no wave64, 3 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426, 1 no heap windows).

  • The 9 failures are the ones main has (3 e2e title tests and 6 split-wave64 GPU tests, main e429936 on NVIDIA: 3 e2e title tests and 6 split-wave64 GPU tests fail since #2959 #3093: main 336fddda gives 2122 passed, 9 failed, 48 ignored); the set of failing tests is identical to it.

  • console_only_bits_do_not_reach_the_pc: ok in that run

  • stream_flags_subobject_is_mapped: ok in that run

  • compute_desc_flags_are_mapped: ok in that run

  • console_compute_flags_create_a_pso_on_d3d12: ok in that run

Regression run

Both 60-second runs used the same warm DXIL cache directory.


xcl-smoke v1

commit: 336fdddafbcb3c3db753629f5f79a9f44b6c4b9d

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1228 (PresentX 1228)

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

device removals: 0

crashes: 0

peak commit: 15234 MB


xcl-smoke v1

commit: f7f8fc274f9b81947fe69f9b7ddd7ee73764b49d

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1460 (PresentX 1460)

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

device removals: 0

crashes: 0

peak commit: 15065 MB

Not tested

  • Full preparation. The smoke runs used XCL_PREPARE=0.

  • A title creating a PSO with console flags: none logged. The console flag 0x1 passes through unchanged (an open point); a FLAGS subobject after an unknown subobject type is not mapped.

  • AMD and Intel GPUs; wave64 hardware (the RTX 2070 SUPER is wave32).

AI use

  • Codex (exact model name unavailable) verified the queued smoke results and drafted this description update.

  • patch-worker on Claude Sonnet 5.5 (self-reported); reviewed by Claude Opus 5.5: the code and tests. The description and the test / suite runs: Claude Code, Claude Sonnet 5.5 and Claude Opus 5.5.

🤖 Generated with Claude Code

@KOLESNiii
KOLESNiii marked this pull request as ready for review November 28, 2026 14:41
@JJAutoCompare

Copy link
Copy Markdown

Tested

Independently reran the pinned standalone CPU executable for f7f8fc274f9b81947fe69f9b7ddd7ee73764b49d on Windows 11 x64 build 26200.9974 with a Ryzen 7 3800X. The executable was built with Rust 1.100.1 (x86_64 MSVC). The harness used byte-identical copies of pc_pso_flags and the stock test, a minimal flag stand-in verified against Windows SDK 10.0.26100.0 (TOOL_DEBUG = 0x1), and a diagnostic macro that captured warning text.

pso-flags-tests.exe --exact fixture::unknown_bits_warn_only_on_first_appearance --test-threads=1 --nocapture
pso-flags-tests.exe --exact pso_flags_tests::console_only_bits_do_not_reach_the_pc --test-threads=1 --nocapture

Both native processes exited 0. Total was 2 passed, 0 failed, 0 ignored, 0 skipped. Across 16 sequential calls, only bit 0x1 survived mapping. Recognized console-only masks were silent. The four warnings reported newly seen unknown subsets in order: 0x20000, 0x100, 0x2000000, and 0x40000010. The final repeated composite 0xc272811d mapped to 0x1 with no warning.

Not tested

Runtime call sites, production logging, concurrency, pointer validity, PSO creation, D3D12 or GPU behavior, cache behavior, retail smoke, and the workspace suite.

AI use

T3 Code through Codex (gpt-6.2-sol, high) prepared the standalone fixture, verified the source and executable pins, independently reran both tests, and drafted this report.

The console's pipeline-state flag enum is not the PC's: its TOOL_DEBUG is
0x8000_0000, it has 0x8000 / 0x10_0000 / 0x20_0000 / 0x40_0000 of its own,
and no 0x4 (dynamic depth bias) or 0x8 (dynamic strip cut). XCL forwarded
a title's Flags unmasked, so console bits reached the PC runtime and the
driver-cache keys (which hash the flags), and a title's 0x4 was taken for
a request XCL makes itself.

pc_pso_flags keeps only 0x1 and logs the first occurrence of any other
unknown bit. It is applied where a title's desc or stream becomes a PC
one, before the cache keys are formed:
- device_x.rs create_graphics_pso_tracked (CreateGraphicsPipelineState,
  ...X, CreateDerivedPipelineStateX), before XCL adds its own 0x4;
- real.rs dev_create_compute_pso (also the compute stream projection);
- real.rs dev_create_pipeline_state: the FLAGS subobject of the stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Codex (exact model unavailable)
@KOLESNiii
KOLESNiii force-pushed the d3d12x-console-pso-flags branch from a311e4e to 1e924c7 Compare November 29, 2026 20:56
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 1e924c7

No open or merged PR masks a title's pipeline-state flags. #3001 records nonzero compute flags and #3151 changes subobject numbering above 22; both touch nearby code but make a different change. FLAGS is type 20 in both numberings.
No problems found in the diff. Dropping a title's 0x4/0x8 rests only on the unconfirmed console enum, as the description says.
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 1e924c7, diff read, not a merge-check; draft, PR description red: the smoke block names f7f8fc2):

  • The console flag values aren't observed. In the retail title every flag word was 0. In practice only "keep 0x1" changes behaviour: the CONSOLE_ONLY list (real.rs ~8739) only decides which bits get logged. Dropping the list and logging every bit other than 0x1 would keep the same behaviour without the console values nothing backs.
  • 0x4 / 0x8 are dropped. If the console does define them, dynamic strip cut (0x8) is lost. XCL adds 0x4 back only on the graphics-desc path (device_x.rs ~211), not on streams or compute (unverified).
  • Shaders: record and precompile nonzero compute PSO flags (#2995) #3001 (open) records non-zero compute flags the driver accepted. After this PR only 0x1 reaches the driver, so Shaders: record and precompile nonzero compute PSO flags (#2995) #3001 becomes nearly a no-op; the two should be reconciled.
  • Three of the tests cover new helpers, so they can't fail on main. Only console_compute_flags_create_a_pso_on_d3d12 tests behaviour, and whether it fails on main is unverified. JJAutoCompare's comment re-ran a standalone copy of the code, not the crate.

Fine: the desc copies live until each call returns, and XCL's own pipeline streams use orig_fn, so the mask doesn't touch them. 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

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants