Diagnostics: label translated pipelines in PIX captures #2566

Open
github-bot wants to merge 1 commit from github-bot/gh-2566 into main AGit
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-25 23:03 UTC · original
mokkamokacaffe:diagnostics/pix-pipeline-markers → main · +22 −6 · 3 files · 1 commits · draft

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.

**@⁠mokkamokacaffe** on GitHub · 2026-11-25 23:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566) `mokkamokacaffe:diagnostics/pix-pipeline-markers` → `main` · +22 −6 · 3 files · 1 commits · draft 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: ```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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:55 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 23:19 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-25 23:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566#issuecomment-7177405240) 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
@ -35,3 +37,3 @@
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())
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 03:27 UTC · original

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.

**@⁠luckyteagirl** on GitHub · 2026-11-26 03:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566#discussion_r4703560316) `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.
@ -35,3 +37,3 @@
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())
Author
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-26 03:32 UTC · original

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

**@⁠mokkamokacaffe** on GitHub · 2026-11-26 03:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566#discussion_r4703585842) 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).
Author
Owner

@⁠SlopTart on GitHub · 2026-11-26 05:13 UTC · original

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.

**@⁠SlopTart** on GitHub · 2026-11-26 05:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566#issuecomment-7183292931) **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.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 03:27 UTC · original · reviewed

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

**@⁠luckyteagirl** on GitHub · 2026-11-26 03:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2566#pullrequestreview-6068161250) · **reviewed** Source-derived dependency between PIX marker recording and console-list reset handling. No local PIX capture.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2566/head:github-bot/gh-2566'
git switch 'github-bot/gh-2566'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2566'
git switch 'github-bot/gh-2566'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2566'
git switch 'github-bot/gh-2566'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2566'
git switch 'main'
git merge --squash 'github-bot/gh-2566'
git switch 'main'
git merge --ff-only 'github-bot/gh-2566'
git switch 'main'
git merge 'github-bot/gh-2566'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.