Skip to content

Diagnostics: label translated pipelines in PIX captures - #2566

Open
mokkamokacaffe wants to merge 2 commits into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/pix-pipeline-markers
Open

mokkamokacaffe wants to merge 2 commits into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/pix-pipeline-markers

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1269.

XCL already inserts a D3D12 marker after each translated pipeline bind for DRED attribution, but the GPU-visible text is only xcl pipeline. This exposes the existing console shader label in that marker and adds an independent XCL_PIX=1 switch for captures.

What is in it

  • crates/xcl/src/hle/d3d12x/dred.rs: enable pipeline-label tracking for either XCL_DRED or XCL_PIX and write the existing stage/hash label as terminated UTF-16 marker text.
  • Preserve the marker ordering used by DRED and the title-marker accounting that keeps its breadcrumb indices aligned.
  • Add focused coverage for the exact marker encoding and label text.
  • README.md: document XCL_PIX=1 and that it uses the D3D12 command-list marker API directly, with no WinPixEventRuntime dependency.

Example marker text:

xcl vs 0123456789abcdef ps fedcba9876543210

Tested

  • On 7f108b8d, the Windows workspace passed 2,741 tests (49 ignored), the focused UTF-16 marker test passed, and the paired retail smoke completed. On an earlier Wine/Proton integration (merge SHA unreported), SlopTart also verified marker encoding on an RX 7900 XT; the cold GPU suite reported 165 passed and three reported baseline failures. AMD report

  • Windows 11 with an NVIDIA GeForce RTX 3060 Ti, branch merged with the contributor's current main:

    • cargo test -p xcl --lib: all tests that ran passed, 0 failed, 26 ignored.
  • Linux x86-64, Rust 1.100.0, compile-only Windows MSVC target at clean head 72e94879f2680935608975a993e1663889c66838:

    • cargo check -p xcl --tests --target x86_64-pc-windows-msvc: passed, including the new marker-encoding test.
  • git diff --check: passed.

The Windows test report establishes that the library suite passes on an NVIDIA machine after integration with main; it does not by itself verify marker presentation in a PIX capture.

Regression run

Conflict repair on pinned main 0fe06eb, PR head 7f108b8. Workspace: 2741 passed, 0 failed, 49 ignored, 27 explicit SKIPPED lines. The focused marker encoding test passed. An interactive PIX capture was not exercised in this repair. Both release smokes used separate empty XCL caches and XCL_PREPARE=0 on the same RTX 4080 SUPER. OpenAI Codex reconciled the changes, ran validation, and prepared this update.

Main

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16004 MB

PR

xcl-smoke v1
commit: 7f108b8d0378be39cfa6b546d87c5fe465743056
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 61 58 61
device removals: 0
crashes: 0
peak commit: 16493 MB

Earlier regression evidence (historical):

Pending paired xcl-smoke blocks from current main and this PR's clean head, with the same title and duration.

Not tested

  • A Windows PIX capture confirming that PIX displays the D3D12 marker text and associates it with the expected command list.
  • A forced device removal confirming that DRED attribution remains aligned after the marker text change.
  • AMD and Intel runtime behavior on the repaired head.

AI use

OpenAI Codex inspected the existing DRED marker and pipeline-label flow, implemented the opt-in PIX path and UTF-16 regression coverage, ran the Windows-target compile check, reviewed the external Windows/NVIDIA test report, and drafted this description.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

@KOLESNiii KOLESNiii mentioned this pull request Nov 25, 2026

@luckyteagirl luckyteagirl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source-derived dependency between PIX marker recording and console-list reset handling. No local PIX capture.

pub fn on() -> bool {
static ON: OnceLock<bool> = OnceLock::new();
*ON.get_or_init(|| std::env::var_os("XCL_DRED").is_some())
*ON.get_or_init(|| std::env::var_os("XCL_DRED").is_some() || std::env::var_os("XCL_PIX").is_some())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XCL_PIX=1 now activates DRED's MARKS recording even when XCL_DRED is unset, but the console-list Reset and KickoffX paths still do not start a new recording. On multi-frame captures, marker history can therefore carry across resets and grow. Open PR #2510 already adds the missing recording restart and initial-pipeline marking in those paths. Could #2510 be merged first and this PR refreshed on it, or could the reset wiring be coordinated with its author? A multi-frame marker-history check would cover the combined behavior. This is a source-derived dependency; I did not run a PIX capture.

AI-assisted review: OpenAI Codex (GPT-6; exact serving variant unavailable) and a Luna subagent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — I confirmed the dependency at 72e9487.

XCL_PIX=1 enables the shared MARKS recorder, while list_x::reset_pc and kickoff_x call the native Reset directly and therefore bypass real::cl_reset. Without #2510, those paths keep appending markers to the previous recording, so the per-list history can span frames and the RECORDINGS cap is not applied.

#2510 already provides the appropriate post-successful-Reset wiring, records the initial pipeline, and includes a ten-frame test verifying that only four recordings are retained. I will avoid duplicating that work: this PR will be refreshed on #2510 after it lands, preserving its ON_FOR_TEST hook while extending on() to enable recording for either XCL_DRED or XCL_PIX.

After refreshing, I’ll rerun the combined multi-frame recording test and the PIX marker-text test. I’ll leave this thread open until that integration is present. Thank you for catching the interaction.

AI-assisted review: OpenAI Codex (GPT-6.2 Astra, Ultra reasoning).

@SlopTart

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of pix_marker_contains_the_pipeline_label_as_terminated_utf16: passed. PIX itself is Windows tooling; this lane only checks the marker encoding, which is all the test claims.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

@Prime1997 Prime1997 mentioned this pull request Nov 26, 2026
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@mokkamokacaffe
mokkamokacaffe marked this pull request as ready for review November 29, 2026 19:52
@mokkamokacaffe

Copy link
Copy Markdown
Contributor Author

Now see the DXC information in window title, from DXC 0 to 3.

image

@github-actions github-actions Bot added needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Nov 29, 2026
@github-actions github-actions Bot removed needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 7f108b8

No open or merged PR makes the same change. Note that the marker text now carries the pipeline label for XCL_DRED=1 too, not only XCL_PIX=1, and XCL_PIX=1 turns on all of dred::on() (label bookkeeping and the watchdog's label lookup), not only the marker text. Both look intended and only apply under the switches. No 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.

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 area:docs-ci Documentation, scripts, workflows, repo governance 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.

5 participants