Repository navigation
Description
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
- Add an optional Cargo feature using the Tracy client with local-only, on-demand collection.
- Instrument direct DXIL translation, the DXC queue and compiler, and the common D3D12 driver PSO call.
- Add zones for PSO workers, shader-cache access, memory-budget waits, buffer mirrors, texture refresh and GPU fence waits in separate PRs.
- Attach existing record, shader and pipeline hashes to selected spans or messages where the extra data is measurable and useful.
- Document a reproducible capture procedure and disclose the profiler overhead in benchmark reports.
Build and use
cargo build --release -p xcl --features tracyRun 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.
Activity
mokkamokacaffe commentedon Nov 25, 2026
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.