Skip to content

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

Closed
mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/tracy-critical-paths
Closed

mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:diagnostics/tracy-critical-paths

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 25, 2026 •

Copy link
Copy Markdown

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
mokkamokacaffe deleted the diagnostics/tracy-critical-paths branch November 25, 2026 23:06
@mokkamokacaffe

Copy link
Copy Markdown
Author

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.

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.

1 participant