Recompiler: skip reload analysis for compact emission #2805

Open
github-bot wants to merge 1 commit from github-bot/gh-2805 into main AGit
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 14:04 UTC · original
CryingLaughing:perf/skip-compact-reload-analysis → main · +95 −3 · 2 files · 1 commits · open

Part of #2746.

The direct translator ran the scalar-load availability pass even when a compact emission plan had already been selected. The compact emitter never reads its result. Guard the analysis with the same ordinary-emission condition that governs its use.

What is in it

  • Skip scalar-load availability analysis when emitting an already selected compact plan. Ordinary emission still analyzes loads and uses the results.
  • Add a paired output comparison and an opt-in CPU benchmark for a generated program with 32,775 decoded instructions and 16,385 reachable blocks.

Tested

  • Base b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Patch 526f097fd99dad401955a05abe3a1ac17c2b7af3.

  • Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11.

  • Separate release test binaries passed 1/1 each. After one warmup, the median whole compact CPU translation across three samples moved from 968.219 ms to 44.335 ms. The ordinary kernel, forced compact kernel, and automatically compacted compute outputs matched the baseline byte for byte.

  • cargo build --workspace --locked -j 4 passed. cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 1,436 passed, 0 failed, 47 ignored across 37 harnesses, including 29 explicit capability skips in the pass total.

  • Independent Windows run by ettehn on a Ryzen 9 8945HX with Rust 1.97.1 MSVC. Six separate release test processes passed. The median across nine timed samples per revision fell from 1,017.296 ms to 41.299 ms, and all three generated shaders matched byte for byte. The comparison used the same synthetic 16,385-block input. Independent benchmark and commands

Regression run

Matched retail smoke runs are pending.

Not tested

  • Retail-title loading or smoke, frame rate, and NVIDIA driver PSO compilation time. The timing covers one generated CPU translation workload.
**@⁠CryingLaughing** on GitHub · 2026-11-26 14:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2805) `CryingLaughing:perf/skip-compact-reload-analysis` → `main` · +95 −3 · 2 files · 1 commits · open Part of #2746. The direct translator ran the scalar-load availability pass even when a compact emission plan had already been selected. The compact emitter never reads its result. Guard the analysis with the same ordinary-emission condition that governs its use. **What is in it** - Skip scalar-load availability analysis when emitting an already selected compact plan. Ordinary emission still analyzes loads and uses the results. - Add a paired output comparison and an opt-in CPU benchmark for a generated program with 32,775 decoded instructions and 16,385 reachable blocks. **Tested** - Base `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Patch `526f097fd99dad401955a05abe3a1ac17c2b7af3`. - Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. - Separate release test binaries passed 1/1 each. After one warmup, the median whole compact CPU translation across three samples moved from 968.219 ms to 44.335 ms. The ordinary kernel, forced compact kernel, and automatically compacted compute outputs matched the baseline byte for byte. - `cargo build --workspace --locked -j 4` passed. `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` reported 1,436 passed, 0 failed, 47 ignored across 37 harnesses, including 29 explicit capability skips in the pass total. - Independent Windows run by ettehn on a Ryzen 9 8945HX with Rust 1.97.1 MSVC. Six separate release test processes passed. The median across nine timed samples per revision fell from **1,017.296 ms to 41.299 ms**, and all three generated shaders matched byte for byte. The comparison used the same synthetic 16,385-block input. [Independent benchmark and commands](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2805) **Regression run** Matched retail smoke runs are pending. **Not tested** - Retail-title loading or smoke, frame rate, and NVIDIA driver PSO compilation time. The timing covers one generated CPU translation workload.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:05:13 +00:00
Author
Owner

@⁠ettehn on GitHub · 2026-11-26 14:18 UTC · original

Independent AMD CPU result for 526f097fd99dad401955a05abe3a1ac17c2b7af3 vs b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The PR checkout was clean. I copied only the benchmark test and its fixture into the base. Each had its own release target directory.

Ryzen 9 8945HX, Windows 11 build 26200, Rust 1.97.1 MSVC. Built each with cargo test --release --locked --offline -p xcl --lib -j 3 --no-run, then ran only gpu::dxil::compact_tests::scalar_load_compact_reload_comparison with XCL_2746_BENCH=1 in six separate processes in base/head/head/base/base/head order. Each process ran one warmup and three timed translations. All six test runs passed.

  • Median of nine samples per arm: 1,017.296 ms → 41.299 ms (24.6× as fast, 95.9% less time). Baseline range 967.805–1,090.684 ms, PR range 39.775–43.283 ms.
  • The ordinary kernel (8,200 B), forced compact kernel (4,616 B), and auto-compact compute shader (24,980 B) all matched the base byte for byte.

This measures CPU translation for the generated 16,385-block input. It does not measure GPU PSO compilation, retail load time, or frame rate.

OpenAI Codex assisted with the benchmark and verification. The exact model identifier was unavailable in this session.

**@⁠ettehn** on GitHub · 2026-11-26 14:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2805#issuecomment-7194608701) Independent AMD CPU result for `526f097fd99dad401955a05abe3a1ac17c2b7af3` vs `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. The PR checkout was clean. I copied only the benchmark test and its fixture into the base. Each had its own release target directory. Ryzen 9 8945HX, Windows 11 build 26200, Rust 1.97.1 MSVC. Built each with `cargo test --release --locked --offline -p xcl --lib -j 3 --no-run`, then ran only `gpu::dxil::compact_tests::scalar_load_compact_reload_comparison` with `XCL_2746_BENCH=1` in six separate processes in base/head/head/base/base/head order. Each process ran one warmup and three timed translations. All six test runs passed. - Median of nine samples per arm: **1,017.296 ms → 41.299 ms** (24.6× as fast, 95.9% less time). Baseline range 967.805–1,090.684 ms, PR range 39.775–43.283 ms. - The ordinary kernel (8,200 B), forced compact kernel (4,616 B), and auto-compact compute shader (24,980 B) all matched the base byte for byte. This measures CPU translation for the generated 16,385-block input. It does not measure GPU PSO compilation, retail load time, or frame rate. OpenAI Codex assisted with the benchmark and verification. The exact model identifier was unavailable in this session.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-26 14:44 UTC · original

Regression run of 526f097 on a newer retail title: no device removal, no crash, frames and commit within the limits.

Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main b49be18 (this PR's base) and of this PR's exact head, scripts/smoke.ps1 -Game <title> for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

this PR:

xcl-smoke v1
commit: 526f097fd99dad401955a05abe3a1ac17c2b7af3
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1459 (PresentX 1459)
presents per 2 s (last 3): 9 3 3
device removals: 0
crashes: 0
peak commit: 24916 MB

99 % of main's frames, 104 % of its peak commit. One run each.

Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD.

AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

**@⁠Anon64** on GitHub · 2026-11-26 14:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2805#issuecomment-7195246416) **Regression run of `526f097` on a newer retail title: no device removal, no crash, frames and commit within the limits.** **Setup:** RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main `b49be18` (this PR's base) and of this PR's exact head, `scripts/smoke.ps1 -Game <title>` for 60 s with `XCL_NETWORK=0` and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` this PR: ``` xcl-smoke v1 commit: 526f097fd99dad401955a05abe3a1ac17c2b7af3 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1459 (PresentX 1459) presents per 2 s (last 3): 9 3 3 device removals: 0 crashes: 0 peak commit: 24916 MB ``` 99 % of main's frames, 104 % of its peak commit. One run each. **Not tested:** the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2805/head:github-bot/gh-2805'
git switch 'github-bot/gh-2805'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2805'
git switch 'github-bot/gh-2805'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2805'
git switch 'github-bot/gh-2805'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2805'
git switch 'main'
git merge --squash 'github-bot/gh-2805'
git switch 'main'
git merge --ff-only 'github-bot/gh-2805'
git switch 'main'
git merge 'github-bot/gh-2805'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.