Recompiler: preserve a split candidate when direct compact lowering selects a whole PSO #2745
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2745
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KOLESNiii on GitHub · 2026-11-26 09:47 UTC · original
Part of #2088 and #2508. Related to #2741, #2301 and #2080.
What happens on main
The direct translator selects a compact or ordinary lowering before it asks the dispatch splitter to plan pieces. The compact emitter keeps the current and next block indices in local
allocaslots, and uses the same scheme for loop budget and guest register state. XCL's optimizer leaves the live dispatch locals in the module.Shader::split_computerejectsAllocaand ordinary local loads/stores before it reaches the CFG planner. As a result, choosing compact emission can turn a shader with a valid ordinary chain into a whole-only build. Native wave64, group shape, barriers and other split restrictions still apply. Form selection · Dispatch-local state · Optimize then split · Split restrictionsThere is a second constraint even if the locals are promoted to SSA. Compact emission sends every class around the same dispatcher back edge. The resulting strongly connected component stays together in the partitioner, which refuses a component above four times its instruction target. In a standalone Linux probe using the extracted
mainoptimizer and partitioner, the optimizer kept two live dispatch-index allocas. Separately, an artificial acyclic graph with 40 bodies produced 14 pieces at a test limit of 32, and the same body sizes behind a shared dispatcher back edge produced no plan at that limit. This checks the two mechanisms on synthetic IR. Retail eligibility and latency remain to be measured. Loop emission · PartitionerProposed work
#2301's proposed size retry is a useful independent whole-form candidate. A comparison should track whether a smaller whole artifact replaces a useful chain, because the whole byte count alone omits the lost execution option. The end point is time to the first textured world frame with matching output and no increase in skipped work or device removals.
AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static analysis, standalone Linux probes and drafting.
@CryingLaughing on GitHub · 2026-11-26 11:30 UTC · original
I tested an opt-in implementation that keeps the compact whole fallback and retains compatible ordinary dispatch pieces. The branch is
fe87896d84ad581ac8a25b275d0889eaf938f2b0, based onb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. It requires matching ordered static samplers and gives the option its own cache identity.cargo build --workspace --locked -j 4andcargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputpassed. 1,437 passed, 0 failed, 47 ignored, including 29 capability skips in the pass count.RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11. The 24-piece case exercised CPU translation and DXIL validation. Retail smoke and native compile timings for large shaders remain untested.