D3D12.X: a stream-out pipeline names the PC's target and depth formats #1716

Closed
github-bot wants to merge 1 commit from gh-pr/1716/head into gh-pr/1716/base
Owner

@⁠b3IKK on GitHub · 2026-11-24 19:41 UTC · original
b3IKK:d3d12x/stream-out-formats-translated → main · +45 −8 · 1 files · 1 commits · closed without merging

Addresses XCL-BT-036 from #1488.

translated_gs_pso (the two-pass mesh emulation of a console VS+GS pair) builds a pipeline stream for the driver and copied the console desc's RTVFormats and DSVFormat into it verbatim — unlike pc_topology_type, which translates them on the plain-desc path. The console's 116–120 are its depth formats and the PC reads those codes as video formats (116 = P208, …), and its B5G5R5A1 / B4G4R4A4 targets (86 / 115) are made R8G8B8A8 by XCL's resource creation — so a stream-out pipeline that named them would be refused by CreatePipelineState, or disagree with the target XCL made.

This moves the translation into one place, pc_pipeline_formats, used by pc_topology_type and by the stream-out subobjects (stream_out_formats).

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: add pc_pipeline_formats() and stream_out_formats(); pc_topology_type uses the first, translated_gs_pso the second; add test a_stream_out_pipeline_names_pc_formats (fails with the translation removed: left: (116, 115, 86, 28), right: (10, 28, 28, 28)).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib a_stream_out_pipeline_names_pc_formats: 1 passed, 0 failed

Regression run

main (1d027e5, clean tree, no local changes):

xcl-smoke v1
commit: 1d027e5c76c9a86a7ee2ca1cc677edf0be95d331
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1645 (PresentX 1645)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14611 MB

PR (c1c7ab0, clean tree, no local changes):

xcl-smoke v1
commit: c1c7ab0028ac579ef8d885c268a46940a2fb1384
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14615 MB

(A first run of this head, with the machine still compiling the suite, showed 1229 frames and 13 10 33; the quoted run is the one after it.)

Not tested

  • a console VS+GS pair on the GPU (the translation is covered by the unit test; no game here builds a stream-out PSO with a console-only target format)
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: checked XCL-BT-036 against the code, wrote the fix and unit test (and confirmed the test fails without the translation), rebased onto 1d027e5, ran the test suite and scripts/smoke.ps1 regression runs with #677's title hashing, and drafted this PR description.
**@⁠b3IKK** on GitHub · 2026-11-24 19:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716) `b3IKK:d3d12x/stream-out-formats-translated` → `main` · +45 −8 · 1 files · 1 commits · closed without merging Addresses `XCL-BT-036` from #1488. `translated_gs_pso` (the two-pass mesh emulation of a console VS+GS pair) builds a pipeline stream for the driver and copied the console desc's `RTVFormats` and `DSVFormat` into it verbatim — unlike `pc_topology_type`, which translates them on the plain-desc path. The console's `116`–`120` are its depth formats and the PC reads those codes as video formats (`116` = `P208`, …), and its `B5G5R5A1` / `B4G4R4A4` targets (`86` / `115`) are made `R8G8B8A8` by XCL's resource creation — so a stream-out pipeline that named them would be refused by `CreatePipelineState`, or disagree with the target XCL made. This moves the translation into one place, `pc_pipeline_formats`, used by `pc_topology_type` and by the stream-out subobjects (`stream_out_formats`). **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: add `pc_pipeline_formats()` and `stream_out_formats()`; `pc_topology_type` uses the first, `translated_gs_pso` the second; add test `a_stream_out_pipeline_names_pc_formats` (fails with the translation removed: `left: (116, 115, 86, 28), right: (10, 28, 28, 28)`). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib a_stream_out_pipeline_names_pc_formats`: 1 passed, 0 failed **Regression run** main (`1d027e5`, clean tree, no local changes): ``` xcl-smoke v1 commit: 1d027e5c76c9a86a7ee2ca1cc677edf0be95d331 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1645 (PresentX 1645) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14611 MB ``` PR (`c1c7ab0`, clean tree, no local changes): ``` xcl-smoke v1 commit: c1c7ab0028ac579ef8d885c268a46940a2fb1384 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14615 MB ``` (A first run of this head, with the machine still compiling the suite, showed 1229 frames and `13 10 33`; the quoted run is the one after it.) **Not tested** - a console VS+GS pair on the GPU (the translation is covered by the unit test; no game here builds a stream-out PSO with a console-only target format) - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: checked `XCL-BT-036` against the code, wrote the fix and unit test (and confirmed the test fails without the translation), rebased onto `1d027e5`, ran the test suite and `scripts/smoke.ps1` regression runs with #677's title hashing, and drafted this PR description.
translated_gs_pso copied the console desc's RTVFormats and DSVFormat into
the pipeline stream it builds for the two-pass mesh emulation of a VS+GS
pair, unlike pc_topology_type on the plain desc path. The console's
116-120 are its depth formats, which the PC reads as video formats, and
its B5G5R5A1 / B4G4R4A4 targets are made R8G8B8A8; a pipeline that names
them is refused by CreatePipelineState (or, for 86/115, disagrees with
the R8G8B8A8 target XCL made).

Translate them in one place, pc_pipeline_formats, used by both paths.

Assisted-by: OpenCode (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:30 +00:00
github-bot closed this pull request 2026-11-26 05:02:30 +00:00
Author
Owner

@⁠b3IKK on GitHub · 2026-11-24 21:53 UTC · original

Rebased onto 1d027e5 and re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 960 passed, 0 failed, 43 ignored. The first smoke run of the new head ran while the suite was still compiling (1229 frames); the quoted one is the run after it.

**@⁠b3IKK** on GitHub · 2026-11-24 21:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716#issuecomment-7145530686) Rebased onto 1d027e5 and re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 960 passed, 0 failed, 43 ignored. The first smoke run of the new head ran while the suite was still compiling (1229 frames); the quoted one is the run after it.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:19 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716#issuecomment-7146080014) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:20 UTC · original

XCL PR #1716 verification

Tested clean detached head c1c7ab0028ac579ef8d885c268a46940a2fb1384 on STOR-WINLAB. The diff changes crates/xcl/src/hle/d3d12x/real.rs.

AMD Ryzen 7 3800X, Intel Arc A770 (16 GiB, driver 32.0.101.9175), Windows 11 Enterprise Evaluation x64 build 26200. dxc.exe --version reported 1.9.2609.5. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), unoptimized profiles with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the Arc lock.
  • cargo test -p xcl --lib hle::d3d12x::real::console_format_query_tests::a_stream_out_pipeline_names_pc_formats -- --exact with XCL_ADAPTER=NONE_CPU_ONLY, outside the lock. 1 passed, 0 failed, 0 ignored, 0 skip markers. The test verified RTV codes 116/115/86/28 convert to 10/28/28/28, DSV code 118 (D16S8) maps to PC D24S8 (45), and the target count and unused UNKNOWN slot are preserved.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Cargo exited 101. All 20 test result: lines (19 test binaries and one doctest target) sum to 941 passed, 19 failed, 43 ignored. The PR test also passed in this run.

Workspace failures and skips

  • 18 library GPU tests failed. 14 reported CreateComputePipelineState error 0x80070057. Four hit assertions on FMA overflow, implicit-LOD sampling, f16 high-half preservation, and pixel-shader wave reductions.
  • e2e::test_title_runs_and_game_folder_is_untouched failed the RSSetDepthBiasX check: the top-right pixel was blue, expected green.
  • pr1716-suite.log contains 25 lines starting with SKIPPED across 15 tests. Reasons include unavailable wave64 (17 markers), three refused wave32 lowering cases, tiled tier below 2, inability to disable the driver cache, missing D3D12 debug layers, and unavailable heap windows. These cases provide no coverage.

Not tested

Matched main baseline, retail-title smoke runs, and other GPUs. The focused test covers descriptor conversion on the CPU. Hardware creation and execution of the affected stream-out pipeline were unverified, and XCL_SAMPLE_* inputs were unset.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1716-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716#issuecomment-7152749818) # XCL PR #1716 verification Tested clean detached head `c1c7ab0028ac579ef8d885c268a46940a2fb1384` on STOR-WINLAB. The diff changes `crates/xcl/src/hle/d3d12x/real.rs`. AMD Ryzen 7 3800X, Intel Arc A770 (16 GiB, driver 32.0.101.9175), Windows 11 Enterprise Evaluation x64 build 26200. `dxc.exe --version` reported 1.9.2609.5. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), unoptimized profiles with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded outside the Arc lock. - `cargo test -p xcl --lib hle::d3d12x::real::console_format_query_tests::a_stream_out_pipeline_names_pc_formats -- --exact` with `XCL_ADAPTER=NONE_CPU_ONLY`, outside the lock. 1 passed, 0 failed, 0 ignored, 0 skip markers. The test verified RTV codes 116/115/86/28 convert to 10/28/28/28, DSV code 118 (D16S8) maps to PC D24S8 (45), and the target count and unused `UNKNOWN` slot are preserved. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. Cargo exited 101. All 20 `test result:` lines (19 test binaries and one doctest target) sum to **941 passed, 19 failed, 43 ignored**. The PR test also passed in this run. **Workspace failures and skips** - 18 library GPU tests failed. 14 reported `CreateComputePipelineState` error `0x80070057`. Four hit assertions on FMA overflow, implicit-LOD sampling, f16 high-half preservation, and pixel-shader wave reductions. - `e2e::test_title_runs_and_game_folder_is_untouched` failed the `RSSetDepthBiasX` check: the top-right pixel was blue, expected green. - `pr1716-suite.log` contains 25 lines starting with `SKIPPED ` across 15 tests. Reasons include unavailable wave64 (17 markers), three refused wave32 lowering cases, tiled tier below 2, inability to disable the driver cache, missing D3D12 debug layers, and unavailable heap windows. These cases provide no coverage. **Not tested** Matched `main` baseline, retail-title smoke runs, and other GPUs. The focused test covers descriptor conversion on the CPU. Hardware creation and execution of the affected stream-out pipeline were unverified, and `XCL_SAMPLE_*` inputs were unset. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1716-suite.log` and published.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 15:53 UTC · original

Closing as already done on main. Rebasing it onto 06c9f55 showed that the same translation now happens at every site this PR touched:

  • real.rs 6039/6041 (the two-pass / stream-out path): pc_target_format for each RTFormats entry and pc_view_format for DSVFormat - exactly what this PR's stream_out_formats added;
  • pc_topology_type 6264-6267 translates g.RTVFormats and g.DSVFormat the same way before it builds the stream.

So the console's format codes no longer reach CreatePipelineState from a stream-out pipeline, which is what this PR was for. It came in through the later pc_pipeline_formats / integer-RT-blend refactors rather than as this change, so there is nothing to salvage here.

AI use: OpenCode, Claude Fable 5.2 rebased it, read the current main code and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 15:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716#issuecomment-7167405999) Closing as already done on `main`. Rebasing it onto `06c9f55` showed that the same translation now happens at every site this PR touched: - `real.rs` 6039/6041 (the two-pass / stream-out path): `pc_target_format` for each `RTFormats` entry and `pc_view_format` for `DSVFormat` - exactly what this PR's `stream_out_formats` added; - `pc_topology_type` 6264-6267 translates `g.RTVFormats` and `g.DSVFormat` the same way before it builds the stream. So the console's format codes no longer reach `CreatePipelineState` from a stream-out pipeline, which is what this PR was for. It came in through the later `pc_pipeline_formats` / integer-RT-blend refactors rather than as this change, so there is nothing to salvage here. AI use: OpenCode, Claude Fable 5.2 rebased it, read the current `main` code and wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:17 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 06:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1716#issuecomment-7184280309) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.