Skip to content

Diagnostics: label translated pipelines in PIX captures - #2566

Draft
mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/pix-pipeline-markers
Draft

mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/pix-pipeline-markers

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 25, 2026 •

Copy link
Copy Markdown

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

  • 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

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 or Intel runtime behavior.
  • Retail-title smoke.

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
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.

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.

4 participants