Skip to content

D3D12.X: keep the FLAGS subobject of a console compute stream (#2607) - #2693

Open
kotekompotek wants to merge 1 commit into
xcl-dev:mainfrom
kotekompotek:fix/compute-stream-flags
Open

kotekompotek wants to merge 1 commit into
xcl-dev:mainfrom
kotekompotek:fix/compute-stream-flags

Conversation

@kotekompotek

Copy link
Copy Markdown

Fixes #2607 (part of #2508).

stream_pipeline's console-CS branch projects a PIPELINE_STATE_STREAM onto a zeroed D3D12_COMPUTE_PIPELINE_STATE_DESC, mapping only the root signature (type 0), the shader (6) and the node mask (18). A FLAGS subobject (type 20) in the stream was dropped, so a compute PSO built through a stream desc always reached dev_create_compute_pso with Flags 0 - while the same title's legacy D3D12_COMPUTE_PIPELINE_STATE_DESC keeps its flags. Since Flags feeds the driver's PSO cache key (compute_blob_key / driver_cache::path_for), a stream-created PSO could also alias a legacy-created one with different flags.

The graphics branch of the same function already forwards type 20, and no console-to-PC flag normalisation exists anywhere in the code, so the fix passes the subobject through verbatim the same way.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: 20 => put(&mut c.Flags, p) in the compute branch of stream_pipeline, matching the graphics branch; a unit test that feeds a synthetic stream (console CS + FLAGS=1) through it and asserts the projected descriptor keeps Flags.

Tested

  • NVIDIA GeForce GTX 1050 (SM 6.5 max), Windows 11, Rust stable MSVC.
  • cargo test -p xcl --lib a_compute_stream_keeps_its_flags_subobject: fails without the fix (Flags stays 0), passes with it.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on ab87bf62 (parent b49be183, which merges cleanly): 1433 passed / 3 failed / 47 ignored, 357 GPU tests SKIPPED. The 3 failures are the known environment-bound ones (SM 6.5 / driver HRESULT / DXC barrier diff), same set as upstream b49be183 - details under Not tested.

Regression run

Run under load-matched conditions on D:\GTA6.Xbox.v1.0.2.1, -Seconds 0 (the only window that reliably precedes the title's entry-point int3 on this hardware), both binaries release-built.

Main b49be183:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce GTX 1050
title: 9cc6a39e
seconds: 0
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 901 MB

PR head ab87bf62:

xcl-smoke v1
commit: ab87bf620d811915898eabfaa185164070d11dd0
gpu: NVIDIA GeForce GTX 1050
title: 9cc6a39e
seconds: 0
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0
device removals: 0
crashes: 0
peak commit: 896 MB

Not tested

  • A real title that passes FLAGS via a compute pipeline stream (no sample at hand); verified on the synthetic stream only. Per the issue, title usage remains unmeasured.
  • The 3 environment-bound GPU tests listed above (this GPU caps at SM 6.5); community members verify them on SM 6.6 cards.

AI use

Devin (SWE-2 High) implemented the fix and test, ran the suite and smoke runs, and wrote this PR.

…v#2607)

stream_pipeline's console-CS branch mapped only the root signature, the
shader and the node mask; a FLAGS subobject (type 20) in a
PIPELINE_STATE_STREAM was dropped, so a title that builds its compute PSO
through a stream desc always reached dev_create_compute_pso with Flags 0.
The graphics branch already forwards type 20, and the legacy compute path
feeds desc.Flags into the driver cache key verbatim, so no normalisation
is needed - put() it the same way.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@SlopTart

SlopTart commented Nov 26, 2026 •

Copy link
Copy Markdown

Tested on the Linux/Wine lane, full standard env (AMD rig: Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB, Arch kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0; d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b overrides, official DXC kit, VKD3D_CONFIG=ignore_shared_fence, threads=2), head ab87bf62, mergeable against main b49be183:
non-gpu suite (--skip gpu::): 598 passed, 2 failed, 4 ignored, 733 filtered.
The failure set is identical to bare main b49be183 measured on the same rig the same day (596 passed, 3 failed): gpu_promoted_uav_clear (our #2490), xma2_source_voice (#2481, vendored-FAudio gate). The third red, the sparse tile video-memory test, is a known batch flake (green solo; it did not reproduce in this run).
Zero delta from this PR; every test it adds passes inside the suite.
Not tested: gpu suite, Windows native.
Correction: an earlier version of this row reported three extra reds; those runs lacked the d3d12,d3d12core=n,b DLL overrides and hit stub-DLL NOTIMPL artifacts. Re-ran with the standard env, artifacts gone.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.

@luckyteagirl

Copy link
Copy Markdown
Contributor

RX 6800M verification at PR head ab87bf620d811915898eabfaa185164070d11dd0 against current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 (Windows 11, AMD driver 30.0.13002.13003, Rust 1.99.0 MSVC):

  • cargo test --locked -p xcl --lib a_compute_stream_keeps_its_flags_subobject -j 1 -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored, 1,336 filtered. This exercises the synthetic compute stream with FLAGS.
  • cargo build --locked --release -p xcl -j 1: passed; head executable SHA-256 1F41990B09FCE382DCD9180E5FC7CEB1F27B8DBAAB72C86EBE5E3C3D8ABF3FE5.
  • Paired release smoke with scripts/smoke.ps1 -Seconds 12, pinned XCL_ADAPTER=6800M and separate data/DXIL cache directories, on the same locally owned title build (hash 2ef5fd64):
Main b49be183 PR ab87bf62
Exit 0x0 0x0
Frames shown / PresentX 147 / 147 144 / 144
Last three 2-second present windows 27, 60, 60 24, 60, 60
Device removals / crashes 0 / 0 0 / 0
Peak commit 7,512 MB 7,491 MB

The title launched and presented frames on this AMD card. This short startup smoke does not establish that the title submitted a compute stream with nonzero FLAGS, and it does not cover world load or a performance comparison. I did not run the full workspace suite on this head. AI-assisted test report with Codex.

@oni-swr

oni-swr commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tested (independent run, synthetic only): PR head ab87bf620d811915898eabfaa185164070d11dd0 vs its parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

  • AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Windows 11 10.0.26200, Rust stable MSVC, debug build, no retail title.
  • cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4:
    • parent b49be183: 1434 passed, 1 failed, 47 ignored
    • head ab87bf62: 1435 passed, 1 failed, 47 ignored
  • The one failure is the same on both: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, seed 722: res[30] = 0x1, CPU 0x7fffffff.
  • SKIPPED output is identical on both, 7 entries: 4x f16_programs_on_the_gpu and 2x f32_programs_on_the_gpu (refused, gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics), and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). These are not counted as coverage.
  • cargo test -p xcl --lib a_compute_stream_keeps_its_flags_subobject: passes on the head. Control: on the parent with only that test applied (the one-line 20 => put(&mut c.Flags, p) absent) it fails with the FLAGS subobject must reach the projected compute desc (left 0, right 1).

Not tested

  • No smoke / regression run and no retail title; only the synthetic stream path was exercised.
  • No source review is given here.

AI use
Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report, coordinated by Codex (gpt-6.2-sol).

@sage-sage

Copy link
Copy Markdown

Test report: passes on NVIDIA. Exact head ab87bf62 (its base is current main b49be18, so head = merged).

Tested

  • RTX 4080 SUPER (driver 621.40), Ryzen 5 7600X, Windows 11 26H2 build 26300.10075, rustc 1.100.0 MSVC, DXC 1.9.2602.17 (Windows SDK 10.0.26100), debug build
  • cargo test --workspace -- --test-threads=4: 1436 passed, 0 failed, 47 ignored; a_compute_stream_keeps_its_flags_subobject passes
  • SKIPPED (29 lines, the same as on main on this machine): 21 wave64 tests (NVIDIA is wave32 only), 3 per-lane wave32 f16/f32 forms (refused), 3 D3D12 debug layer (d3d12SDKLayers.dll not installed), 1 no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off)
  • With the 20 => put(&mut c.Flags, p) line taken out (local only): the new test fails (the FLAGS subobject must reach the projected compute desc), so it covers the fix.

Not tested

  • No game, so not a title's compute stream with a FLAGS subobject.

Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@relativespace2K

Copy link
Copy Markdown

Tested - retail title on native Windows AMD RDNA2, PR head ab87bf620d811915898eabfaa185164070d11dd0 on main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7

Tool: OpenCode with DeepSeek V4.1 Flash 1017

  • AMD Radeon RX 6800 XT (16338 MiB), driver 32.0.21045.29003; Ryzen 5 5600, 31.9 GB;
    Windows 11 IoT Enterprise LTSC 26100; release build; DXC 1.9.2602.17.
  • cargo test --release -p xcl --lib -- a_compute_stream_keeps_its_flags_subobject --nocapture:
    1 passed, 0 failed, 0 ignored, 0 skipped, 1336 filtered out.
  • Game: retail title 1.0.2.1, three 240 s runs, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=1 XCL_RUN_SECONDS=240, no other XCL_* variables; warm shader/pipeline
    caches.
run presents peak commit local VRAM first frame driver compiles
main (warm) 1,849 31,819 MB 16,465 MB 20.13 s 33 / 183 s
PR run 1 1,644 35,156 MB 16,403 MB 17.35 s 39 / 658 s
PR run 2 (new cache) 1,651 31,673 MB 16,470 MB 16.19 s 58 / 210 s

The first PR run rebuilt the compute PSO cache now that FLAGS is in the key: 658 s of
driver compiles and a 35.2 GB peak. The warm repeat normalized to 31.7 GB peak and 210 s
of compiles, against 183 s on main - within run-to-run variance. No crash, no error,
0 failed pipelines, 0 DXIL failures; 40 mesh refusals on both trees. The title still
stalls on its loading screen (last present around 100 s), so there is no world or FPS
comparison in this window.

Not tested: full workspace, NVIDIA, debug build, world/FPS runs.

AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests, read the logs and wrote this comment; the figures and crash lines were checked against the run logs.

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.

D3D12.X: preserve pipeline flags from translated compute streams

6 participants