gpu(metal): build pipelines off the title's thread, with standins resolved at bind (XCL pso_async) #647

Open
opened 2026-11-28 21:37:02 +00:00 by github-bot · 0 comments
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 21:34 UTC · original

What

Pipeline creation goes through the MetalIRConverter synchronously on the title's thread: 23k calls at d3d12 slot 0x1c8 before the 18 s int3 (docs/native-host.md), and MacBox measured presentation stopping ~132 s into a GTA VI loading run while native pipelines kept compiling — their title only survived compile storms once pipelines were built off the title's thread (xcl crates/xcl/src/hle/d3d12x/pso_async.rs): stand-in PSO handles handed back to the title at creation, the real build queued as a background job, and the standin resolved to the real object at bind, holding the title thread only there (title_held, which their sleep hold then excludes from title Sleep accounting — see the sleep-hold issue).

What this changes (measure first)

  1. A diagnostic measuring how long each pipeline build holds the title thread (sum, max, count, by pipeline kind), off by default.
  2. If the numbers are large: standin handles + a background compile queue; bind resolves the standin and holds; Sleep accounting excludes held time (depends on the sleep-hold issue).

How it was tested

  • the diagnostic's numbers from a game run once the data finishes downloading;
  • existing pipeline tests stay green; a standin-resolution unit test.

Sources: MacBox crates/xcl/src/hle/d3d12x/pso_async.rs (title_held, submit, resolve_for_bind), README "Tests and current status" loading runs.

**@⁠AnastasisKon** on GitHub · 2026-11-28 21:34 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/643) ## What Pipeline creation goes through the MetalIRConverter synchronously on the title's thread: 23k calls at d3d12 slot 0x1c8 before the 18 s int3 (docs/native-host.md), and MacBox measured presentation stopping ~132 s into a GTA VI loading run while native pipelines kept compiling — their title only survived compile storms once pipelines were built off the title's thread (xcl crates/xcl/src/hle/d3d12x/pso_async.rs): stand-in PSO handles handed back to the title at creation, the real build queued as a background job, and the standin resolved to the real object at bind, holding the title thread only there (`title_held`, which their sleep hold then excludes from title Sleep accounting — see the sleep-hold issue). ## What this changes (measure first) 1. A diagnostic measuring how long each pipeline build holds the title thread (sum, max, count, by pipeline kind), off by default. 2. If the numbers are large: standin handles + a background compile queue; bind resolves the standin and holds; `Sleep` accounting excludes held time (depends on the sleep-hold issue). ## How it was tested - the diagnostic's numbers from a game run once the data finishes downloading; - existing pipeline tests stay green; a standin-resolution unit test. Sources: MacBox crates/xcl/src/hle/d3d12x/pso_async.rs (title_held, submit, resolve_for_bind), README "Tests and current status" loading runs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:37:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.