Diagnostics: add opt-in Tracy critical-path zones #2564

Closed
github-bot wants to merge 1 commit from gh-pr/2564/head into gh-pr/2564/base
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-25 23:03 UTC · original
mokkamokacaffe:diagnostics/tracy-critical-paths → main · +297 −15 · 7 files · 1 commits · closed without merging

Part of #1269.

This adds the first opt-in Tracy CPU timeline for separating XCL translation time from DXC queue/compile time and D3D12 driver pipeline creation.

What is in it

  • crates/xcl/Cargo.toml: add an optional tracy feature using tracy-client 0.19 with on-demand collection and local-machine connections only. Default builds do not enable or compile the client.
  • crates/xcl/src/lib.rs: add one feature-gated zone macro so call sites disappear from ordinary builds.
  • crates/xcl/src/gpu/dxil/coverage.rs: time one direct DXIL translation.
  • crates/xcl/src/gpu/recomp/dxc.rs: distinguish time waiting for the DXC worker result from time spent inside DXC compilation.
  • crates/xcl/src/hle/d3d12x/real.rs: time the common call into D3D12 driver PSO creation, including the retry with the PC pipeline-state IID when required.
  • README.md: document the diagnostic build command and the initial zones.

Build the instrumented executable with:

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

Tested

  • Linux x86-64 host, Rust 1.100.0, compile-only Windows MSVC target at clean head 76b674ec6662c484e90d3988e3da04dd4deb157e:
    • cargo check -p xcl --tests --target x86_64-pc-windows-msvc: passed.
    • cargo check -p xcl --tests --features tracy --target x86_64-pc-windows-msvc: passed, including tracy-client-sys and every instrumented call site.
  • cargo tree -p xcl --no-default-features: contains no Tracy package.
  • cargo tree -p xcl --features tracy: selects tracy-client 0.19.0 and tracy-client-sys 0.30.1.
  • git diff --check: passed.

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 linked or executed Tracy-enabled Windows binary. This Linux environment has the Rust Windows target and an archive wrapper, but no Visual Studio link.exe or Windows SDK import libraries.
  • Connection from the Tracy profiler, captured zone boundaries, capture memory use or timing overhead.
  • AMD, NVIDIA or Intel runtime behavior.
  • Retail-title smoke and workspace tests on Windows.

AI use

OpenAI Codex identified the existing common translation and pipeline-creation paths, implemented the optional feature and initial zones, ran both Windows-target compile configurations, checked dependency selection, reviewed the diff and drafted this description.

**@⁠mokkamokacaffe** on GitHub · 2026-11-25 23:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2564) `mokkamokacaffe:diagnostics/tracy-critical-paths` → `main` · +297 −15 · 7 files · 1 commits · closed without merging Part of #1269. This adds the first opt-in Tracy CPU timeline for separating XCL translation time from DXC queue/compile time and D3D12 driver pipeline creation. **What is in it** - `crates/xcl/Cargo.toml`: add an optional `tracy` feature using `tracy-client` 0.19 with on-demand collection and local-machine connections only. Default builds do not enable or compile the client. - `crates/xcl/src/lib.rs`: add one feature-gated zone macro so call sites disappear from ordinary builds. - `crates/xcl/src/gpu/dxil/coverage.rs`: time one direct DXIL translation. - `crates/xcl/src/gpu/recomp/dxc.rs`: distinguish time waiting for the DXC worker result from time spent inside DXC compilation. - `crates/xcl/src/hle/d3d12x/real.rs`: time the common call into D3D12 driver PSO creation, including the retry with the PC pipeline-state IID when required. - `README.md`: document the diagnostic build command and the initial zones. Build the instrumented executable with: ```powershell cargo build --release -p xcl --features tracy ``` **Tested** - Linux x86-64 host, Rust 1.100.0, compile-only Windows MSVC target at clean head `76b674ec6662c484e90d3988e3da04dd4deb157e`: - `cargo check -p xcl --tests --target x86_64-pc-windows-msvc`: passed. - `cargo check -p xcl --tests --features tracy --target x86_64-pc-windows-msvc`: passed, including `tracy-client-sys` and every instrumented call site. - `cargo tree -p xcl --no-default-features`: contains no Tracy package. - `cargo tree -p xcl --features tracy`: selects `tracy-client` 0.19.0 and `tracy-client-sys` 0.30.1. - `git diff --check`: passed. **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 linked or executed Tracy-enabled Windows binary. This Linux environment has the Rust Windows target and an archive wrapper, but no Visual Studio `link.exe` or Windows SDK import libraries. - Connection from the Tracy profiler, captured zone boundaries, capture memory use or timing overhead. - AMD, NVIDIA or Intel runtime behavior. - Retail-title smoke and workspace tests on Windows. **AI use** OpenAI Codex identified the existing common translation and pipeline-creation paths, implemented the optional feature and initial zones, ran both Windows-target compile configurations, checked dependency selection, reviewed the diff and drafted this description.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:51 +00:00
github-bot closed this pull request 2026-11-26 05:33:51 +00:00
Author
Owner

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

Closing in favor of #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:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2564#issuecomment-7177157697) Closing in favor of #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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.