Recompiler: share translated DXIL across repeated compute PSO builds #2609

Open
opened 2026-11-26 05:34:45 +00:00 by github-bot · 1 comment
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 01:33 UTC · original

Part of #2508 (Pipeline Rebuild). Verified on main at b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Related to #2454, #2600 and #2608.

The translated shader cache returns Arc<Compiled>, but console_to_dxil_in clones the inner object for every caller, including a RAM hit. Compiled stores the whole DXIL and samplers as owned vectors, so they are copied. Chain pieces already share an Arc. Runtime compute creation uses the whole bytes as slices for driver lookup/create, and creating a chain makes another owned copy of the whole bytes for fallback. Repeated creates can therefore allocate and copy a large whole shader even when all translation entries hit. Compiled and cache boundary · Runtime caller · Chain fallback ownership

Carry immutable shared DXIL into the ordinary compute builder and its chain fallback. Keep ownership of the bytecode through the native call or delayed build. An allocation or storage-identity test on repeated RAM hits can show what changed while preserving the emitted bytes, static samplers and chain. Windows allocation counts and loading-time impact remain unmeasured.

AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review and drafting.

**@⁠KOLESNiii** on GitHub · 2026-11-26 01:33 UTC · [original](https://github.com/xcl-dev/xcl/issues/2609) Part of #2508 (Pipeline Rebuild). Verified on `main` at `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Related to #2454, #2600 and #2608. The translated shader cache returns `Arc<Compiled>`, but `console_to_dxil_in` clones the inner object for every caller, including a RAM hit. `Compiled` stores the whole DXIL and samplers as owned vectors, so they are copied. Chain pieces already share an `Arc`. Runtime compute creation uses the whole bytes as slices for driver lookup/create, and creating a chain makes another owned copy of the whole bytes for fallback. Repeated creates can therefore allocate and copy a large whole shader even when all translation entries hit. [Compiled and cache boundary](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/gpu/recomp/pso.rs#L124-L171) · [Runtime caller](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/hle/d3d12x/real.rs#L4329-L4353) · [Chain fallback ownership](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs#L50-L94) Carry immutable shared DXIL into the ordinary compute builder and its chain fallback. Keep ownership of the bytecode through the native call or delayed build. An allocation or storage-identity test on repeated RAM hits can show what changed while preserving the emitted bytes, static samplers and chain. Windows allocation counts and loading-time impact remain unmeasured. AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review and drafting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:45 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 02:09 UTC · original

Claiming #2609: preserve shared translated compute bytecode through ordinary pipeline creation and chain fallback, with synthetic storage-identity and ownership checks.
AI use: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol).

**@⁠oni-swr** on GitHub · 2026-11-26 02:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/2609#issuecomment-7180517874) Claiming #2609: preserve shared translated compute bytecode through ordinary pipeline creation and chain fallback, with synthetic storage-identity and ownership checks. AI use: Claude Code (Claude Opus 5.5), coordinated by Codex (gpt-6.2-sol).
This discussion has been locked. Commenting is limited to contributors.
No description provided.