Diagnostics: add opt-in Tracy timelines for shader and driver stalls #2560

Closed
opened 2026-11-26 05:33:49 +00:00 by github-bot · 1 comment
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-25 23:01 UTC · original

Diagnostics: add opt-in Tracy timelines for shader and driver stalls

Summary

Add an optional Tracy build mode that records the CPU-side paths most relevant to shader translation, driver pipeline compilation, worker-queue stalls and GPU wait diagnosis.

The initial implementation should remain disabled in ordinary builds. A diagnostic build connects only to a Tracy profiler on the same machine and records on demand.

Part of #1269.

Motivation

XCL already reports aggregate timings and periodic activity in xcl.log, and its DRED support identifies pipelines near a device removal. Those reports do not show overlapping work across threads or reveal whether a long delay was spent translating a shader, waiting for a DXC worker, running DXC, waiting for a PSO worker, compiling inside the driver or waiting on a fence.

A CPU timeline can answer those questions while preserving XCL's existing logs and hashes as the durable bug-report format.

Proposed stages

  1. Add an optional Cargo feature using the Tracy client with local-only, on-demand collection.
  2. Instrument direct DXIL translation, the DXC queue and compiler, and the common D3D12 driver PSO call.
  3. Add zones for PSO workers, shader-cache access, memory-budget waits, buffer mirrors, texture refresh and GPU fence waits in separate PRs.
  4. Attach existing record, shader and pipeline hashes to selected spans or messages where the extra data is measurable and useful.
  5. Document a reproducible capture procedure and disclose the profiler overhead in benchmark reports.

Build and use

cargo build --release -p xcl --features tracy

Run that build, connect the Tracy profiler from the same machine, reproduce the stall, and save the capture with the corresponding xcl.log and report.json.

Constraints

  • Ordinary builds must not compile or initialize the Tracy client.
  • Diagnostic builds must accept profiler connections only from the local machine.
  • Capture should be on demand to limit memory and timing overhead before a profiler connects.
  • Performance reports must state whether Tracy was enabled and provide normal-build timings separately.
  • Shader contents and title-derived data should not be sent over the network by default.
  • Each instrumentation PR should stay focused enough that its overhead and coverage can be reviewed.

Initial success criteria

  • A Tracy-enabled Windows build completes and runs.
  • A capture distinguishes direct DXIL translation, DXC queue wait, DXC compilation and driver PSO creation.
  • The same source tree builds without Tracy in the default configuration.
  • A retail-title smoke comparison shows no correctness regression.
  • The capture procedure and its expected overhead are documented.

AI use

OpenAI Codex reviewed XCL's existing activity, DRED, translation and pipeline-creation paths and drafted this proposal.

**@⁠mokkamokacaffe** on GitHub · 2026-11-25 23:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/2560) # Diagnostics: add opt-in Tracy timelines for shader and driver stalls ## Summary Add an optional Tracy build mode that records the CPU-side paths most relevant to shader translation, driver pipeline compilation, worker-queue stalls and GPU wait diagnosis. The initial implementation should remain disabled in ordinary builds. A diagnostic build connects only to a Tracy profiler on the same machine and records on demand. Part of #1269. ## Motivation XCL already reports aggregate timings and periodic activity in `xcl.log`, and its DRED support identifies pipelines near a device removal. Those reports do not show overlapping work across threads or reveal whether a long delay was spent translating a shader, waiting for a DXC worker, running DXC, waiting for a PSO worker, compiling inside the driver or waiting on a fence. A CPU timeline can answer those questions while preserving XCL's existing logs and hashes as the durable bug-report format. ## Proposed stages 1. Add an optional Cargo feature using the Tracy client with local-only, on-demand collection. 2. Instrument direct DXIL translation, the DXC queue and compiler, and the common D3D12 driver PSO call. 3. Add zones for PSO workers, shader-cache access, memory-budget waits, buffer mirrors, texture refresh and GPU fence waits in separate PRs. 4. Attach existing record, shader and pipeline hashes to selected spans or messages where the extra data is measurable and useful. 5. Document a reproducible capture procedure and disclose the profiler overhead in benchmark reports. ## Build and use ```powershell cargo build --release -p xcl --features tracy ``` Run that build, connect the Tracy profiler from the same machine, reproduce the stall, and save the capture with the corresponding `xcl.log` and `report.json`. ## Constraints - Ordinary builds must not compile or initialize the Tracy client. - Diagnostic builds must accept profiler connections only from the local machine. - Capture should be on demand to limit memory and timing overhead before a profiler connects. - Performance reports must state whether Tracy was enabled and provide normal-build timings separately. - Shader contents and title-derived data should not be sent over the network by default. - Each instrumentation PR should stay focused enough that its overhead and coverage can be reviewed. ## Initial success criteria - A Tracy-enabled Windows build completes and runs. - A capture distinguishes direct DXIL translation, DXC queue wait, DXC compilation and driver PSO creation. - The same source tree builds without Tracy in the default configuration. - A retail-title smoke comparison shows no correctness regression. - The capture procedure and its expected overhead are documented. ## AI use OpenAI Codex reviewed XCL's existing activity, DRED, translation and pipeline-creation paths and drafted this proposal.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:49 +00:00
Author
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-25 23:07 UTC · original

Closing in favor of PR #2500, which already provides the Tracy infrastructure and substantially broader runtime instrumentation, with Windows execution, retail-title captures and paired smoke coverage.

This PR's direct-DXIL translation zone is not present in #2500. That small addition can be proposed as a focused follow-up after #2500 lands.

**@⁠mokkamokacaffe** on GitHub · 2026-11-25 23:07 UTC · [original](https://github.com/xcl-dev/xcl/issues/2560#issuecomment-7177172147) Closing in favor of PR #2500, which already provides the Tracy infrastructure and substantially broader runtime instrumentation, with Windows execution, retail-title captures and paired smoke coverage. This PR's direct-DXIL translation zone is not present in #2500. That small addition can be proposed as a focused follow-up after #2500 lands.
This discussion has been locked. Commenting is limited to contributors.
No description provided.