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

Open
opened 2026-11-26 01:33:39 +00:00 by KOLESNiii · 1 comment
KOLESNiii commented 2026-11-26 01:33:39 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T01:33:39Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6617480742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2609). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T01:33:39Z. --- 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.
oni-swr commented 2026-11-26 03:06:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T02:09:30Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7180517874 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2609#issuecomment-7180517874). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T02:09:30Z. --- 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).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2599
No description provided.