Skip to content

D3D12.X: console pipeline-state streams are parsed with the console's subobject numbers - #3151

Draft
KOLESNiii wants to merge 2 commits into
xcl-dev:mainfrom
KOLESNiii:d3d12x-pso-stream-console-table
Draft

KOLESNiii wants to merge 2 commits into
xcl-dev:mainfrom
KOLESNiii:d3d12x-pso-stream-console-table

Conversation

@KOLESNiii

@KOLESNiii KOLESNiii commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #3138; only the top commit belongs here. This fix assumes #3138's reading of the console's subobject numbering is right. #3138 only logs the type sequences of titles' streams and checks their sizes under both tables; until its log from a title shows the console table matches, this PR is a guess built on it, and it changes with whatever #3138 finds.

Status: a guess that needs evidence before it can be merged. The console's subobject numbering above type 22 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: #3138's log lines from a title (pipeline stream uses subobject types above 22), where the sizes add up under the console table and not under the PC's. 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).

Above type 22 a console stream numbers its subobjects differently from the

PC (23 AS, 25-29 options and limits, 100-102 the PC's DEPTH_STENCIL2 /

RASTERIZER1 / RASTERIZER2). Read with the PC table, a 25 desyncs the offsets,

a 26/27/28 overwrites the depth-stencil and rasterizer state with option and

limit words, and a 23 or 29 ends the parse, so every subobject after it

(blend, RT and DSV formats) was lost.

A stream that holds a console shader (types 1-6, 23, 24, before the first

type >= 25) and a type >= 23 is rewritten once, at the entry points

(stream_pipeline, translated_graphics_stream_once, translated_mesh_stream_once,

stream_has_unreadable_shader, fallback_stream, capture_stream_desc), into the

PC's numbering that the existing code reads:

Other streams, and subobject_payload (#2006), are unchanged. The detection is a

heuristic: a console stream whose shaders all come after a type >= 25 is not

rewritten. own_stream and record_mesh_stream still use the PC table.

Stacked on #3138; only the top commit belongs here.

What is in it

  • crates/xcl/src/hle/d3d12x/null.rs: +2 / -0

  • crates/xcl/src/hle/d3d12x/real.rs: +137 / -7

  • new tests: console_type_23_is_dropped_only_when_empty, console_stream_types_above_22_do_not_desync_the_parse, console_type_27_leaves_the_rasterizer_alone_and_101_sets_it

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 8462a9d4 (built on main 336fddda; it merges into the current main e429936c without conflict): 2126 passed, 10 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 suite shows one more failure than the others, hle::d3d12x::alloc_pool::tests::submit_marking_calls_out_unlocked_and_revalidates_the_queue_marker ("fence creation must run outside STATE"). It passes 3 of 3 alone and the whole alloc_pool module passes (23 of 23); this change touches only null.rs and real.rs, so I take it for a flaky test (a race on a shared lock), not this change.

  • console_type_23_is_dropped_only_when_empty: ok in that run

  • console_stream_types_above_22_do_not_desync_the_parse: ok in that run

  • console_type_27_leaves_the_rasterizer_alone_and_101_sets_it: 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: 8462a9d41040c24899417483ce1f00b89804e6db

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1440 (PresentX 1440)

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

device removals: 0

crashes: 0

peak commit: 16277 MB

Not tested

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

  • A title whose stream carries console subobject types 23-29 / 100-102: none logged. Type 26 has no known layout here: it is skipped and its raw bytes are logged.

  • 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 and others added 2 commits November 28, 2026 03:47
A console stream numbers its subobjects differently above type 22 (23 AS,
25-29 options and limits, 100-102 the PC's DEPTH_STENCIL2 / RASTERIZER1 / 2),
and XCL parses with the PC table. Log (at most 16 lines) each stream that
has a type above 22: the type sequence, SizeInBytes and whether the sum of
the 8-aligned subobject sizes matches it under the PC and the console table.
This is to confirm the numbering on a title's real streams. Parsing results
are unchanged and streams with only types up to 22 do not allocate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… subobject numbers

Above type 22 a console stream numbers its subobjects differently from the
PC (23 AS, 25-29 options and limits, 100-102 the PC's DEPTH_STENCIL2 /
RASTERIZER1 / RASTERIZER2). Read with the PC table, a 25 desyncs the offsets,
a 26/27/28 overwrites the depth-stencil and rasterizer state with option and
limit words, and a 23 or 29 ends the parse, so every subobject after it
(blend, RT and DSV formats) was lost.

A stream that holds a console shader (types 1-6, 23, 24, before the first
type >= 25) and a type >= 23 is rewritten once, at the entry points
(stream_pipeline, translated_graphics_stream_once, translated_mesh_stream_once,
stream_has_unreadable_shader, fallback_stream, capture_stream_desc), into the
PC's numbering that the existing code reads:
- dropped: 23 with empty bytecode, 25, 27, 28, 29;
- 100 / 101 / 102 become 26 / 27 / 28;
- 26 is dropped too: its layout is not known yet, so its depth-stencil
  semantics are not applied; its bytes are logged once;
- 24 is left as it was (xcl-dev#541 / xcl-dev#630 own the AS / MS numbers);
- a stream with a non-empty 23 is not rewritten (renumbering it would
  collide with 24) and is parsed as before; logged once.
Other streams, and subobject_payload (xcl-dev#2006), are unchanged. The detection is a
heuristic: a console stream whose shaders all come after a type >= 25 is not
rewritten. own_stream and record_mesh_stream still use the PC table.

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

Aniseto commented Nov 28, 2026

Copy link
Copy Markdown

Ran the console stream subobject tests at 8462a9d4 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib -- console_stream_types_above_22_do_not_desync_the_parse console_type_23_is_dropped_only_when_empty console_type_27_leaves_the_rasterizer_alone_and_101_sets_it --test-threads=1
3 passed; 0 failed; 0 ignored; 0 measured; 2027 filtered out      (exit 0)

All three new tests pass, covering console subobject numbering above type 22. They are CPU-side stream-parsing tests. The author ran the full workspace suite on an RTX 2070 SUPER; this adds a Blackwell desktop datapoint for the focused tests. The PR has no comments yet.

Not tested: the full workspace suite here, a paired smoke run, a retail title, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 8462a9d

Stacked on #3138, which is its first commit (71a9023, the console subobject table and logging); only the top commit 8462a9d belongs here. #3137 changes the pipeline-state flags, a different change. No other open PR renumbers console subobjects.
real.rs console_stream_to_pc: as the commit says, telling a console stream apart is a heuristic. A stream whose console shaders all come after a type >= 25 is not rewritten, and own_stream / record_mesh_stream still parse with the PC table. No other problems found in the diff.
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 8462a9d, diff read, not a merge-check; draft, stacked on #3138):

  • Where do the numbers and sizes come from? Only 23 (AS) and 24 (MS) have backing: a retail title's MS container sits in slot 24 (HANDOFF ~1763). Nothing backs the rest: 25 PS options, 26 DS options, 27 shader limits, 28 tessellation parameters, 29 CS limits, 100-102, and the payload sizes 32 / 24 / 60 / 12 / 24 (null.rs ~363). D3D12.X: log pipeline-state streams that use console subobject types #3138 exists to find them out. These can't be worked out from PC D3D12, and one wrong size desynchronises the rest of the stream. Please say how they were obtained.
  • A default-path change. Every stream with a type of 23 or above and a console shader is rewritten (real.rs ~7919), and the rewrite drops 25 (~7952). Main reads 25 as MS (own_stream ~7336, record_mesh_stream, capture), so a title that puts its MS at 25 would lose it.
  • Two tables at once. The background path (own_stream, ~7313) still parses with the PC table, so its blob fix-ups go wrong after a console 25-28.
  • Cost. pc_numbered runs on every CreatePipelineState, from capture (no gate) and up to four more entry points, and copies the stream each time.

Fine: 100-102 -> 26-28 keep the PC sizes (60 / 44 / 40) and 8-byte alignment, and an unknown type falls back to main's parse. console_stream_types_above_22_do_not_desync_the_parse should fail on main, which stops at 23 (not run here). It overlaps #630 on slot 24.

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.

3 participants