Shaders: infer double extensions from emitted instructions #1544

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

@⁠Roroca-1 on GitHub · 2026-11-24 17:28 UTC · original
Roroca-1:dxil-opt-1-prep → main · +23 −2 · 2 files · 1 commits · draft

Part of #1269. After the optimizer removes an unreachable block, its instructions still exist in the arena. A discarded int-to-double conversion could therefore set DoubleExtensions in the shader flags. Based on main after #1426.

What is in it

  • Scan instructions in the surviving blocks in module.rs. Exercise the production optimizer on an unreachable conversion. Bump the direct translator cache version to 5 in kernel.rs.

Tested

  • Ryzen 7 7800X3D, Linux x86-64, Windows MSVC debug target via cargo-xwin. CPU-side test under Wine on 593c65b.
  • TARGET_CFLAGS=/FIstring.h cargo xwin build --tests -p xcl --target x86_64-pc-windows-msvc succeeded.
  • wine xcl-67594ede252ac8b9.exe unreachable_conversion_does_not_require_double_extensions --nocapture ran 1 passed, 0 failed, 0 ignored, 0 skipped. With the test alone on c160d86, the post-optimization assertion failed.

Regression run
Pending paired clean main/head retail-title runs.

Not tested
Native Windows GPU workspace suite, DXIL validation, retail title.

AI use
T3 Code (Codex, gpt-6.2-astra) rebuilt the original scan fix against main, wrote the regression test and ran it under Wine. The initial fix was prepared with T3 Code (Antigravity, gemini-pro-orchestrator-neon).

**@⁠Roroca-1** on GitHub · 2026-11-24 17:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1544) `Roroca-1:dxil-opt-1-prep` → `main` · +23 −2 · 2 files · 1 commits · draft Part of #1269. After the optimizer removes an unreachable block, its instructions still exist in the arena. A discarded int-to-double conversion could therefore set DoubleExtensions in the shader flags. Based on main after #1426. **What is in it** - Scan instructions in the surviving blocks in `module.rs`. Exercise the production optimizer on an unreachable conversion. Bump the direct translator cache version to 5 in `kernel.rs`. **Tested** - Ryzen 7 7800X3D, Linux x86-64, Windows MSVC debug target via cargo-xwin. CPU-side test under Wine on `593c65b`. - `TARGET_CFLAGS=/FIstring.h cargo xwin build --tests -p xcl --target x86_64-pc-windows-msvc` succeeded. - `wine xcl-67594ede252ac8b9.exe unreachable_conversion_does_not_require_double_extensions --nocapture` ran 1 passed, 0 failed, 0 ignored, 0 skipped. With the test alone on `c160d86`, the post-optimization assertion failed. **Regression run** Pending paired clean main/head retail-title runs. **Not tested** Native Windows GPU workspace suite, DXIL validation, retail title. **AI use** T3 Code (Codex, gpt-6.2-astra) rebuilt the original scan fix against main, wrote the regression test and ran it under Wine. The initial fix was prepared with T3 Code (Antigravity, gemini-pro-orchestrator-neon).
An unreachable conversion survives in the instruction arena after optimization. Scan block instructions when inferring flags and invalidate cached containers.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:01 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 19:12 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main in crates/xcl/src/gpu/recomp/tests.rs — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-24 19:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1544#issuecomment-7141766128) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** in `crates/xcl/src/gpu/recomp/tests.rs` — needs a rebase before it can be tested.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:33 UTC · original

Regression run of 593c65bf on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 593c65bf0695ab22055266816531f9d5c44ed278
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14816 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1544#issuecomment-7152026864) Regression run of `593c65bf` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 593c65bf0695ab22055266816531f9d5c44ed278 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1631 (PresentX 1631) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14816 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:26 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 00:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1544#issuecomment-7178763774) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/dxil/kernel.rs
  • crates/xcl/src/gpu/dxil/module.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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