Shaders: reuse the predicate when reading a zero-extended SCC #1546
No reviewers
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!1546
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1546"
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?
@Roroca-1 on GitHub · 2026-11-24 17:29 UTC · original
Roroca-1:dxil-opt-3-instcombine-cse→main· +53 −2 · 2 files · 2 commits · draftStacked on #1544. Only
ce8c103belongs here. Part of #1269.Direct lowering writes the scalar condition code (SCC) by zero-extending an i1 predicate to i32. Reading SCC tests that word against zero. The comparison can return the original predicate.
What is in it
module.rs, cover the comparison and two counterexamples, and bump the direct translator cache version to 6. The merged #1426 supplies CSE.Tested
ce8c103.TARGET_CFLAGS=/FIstring.h cargo xwin build --tests -p xcl --target x86_64-pc-windows-msvcsucceeded.wine xcl-67594ede252ac8b9.exe gpu::dxil::module::tests --nocaptureran 2 passed, 0 failed, 0 ignored, 0 skipped. Before the fold, the SCC test observed a new instruction instead of the original predicate and failed.wine xcl-67594ede252ac8b9.exe gpu::dxil::bitreader_tests --test-threads=4ran 3 passed, 0 failed, 0 ignored, 0 skipped.Regression run
Pending paired clean main/head retail-title runs.
Not tested
Native Windows GPU workspace suite, DXIL validation, retail shaders and performance.
AI use
T3 Code (Codex, gpt-6.2-astra) narrowed the original T3 Code (Antigravity, gemini-pro-orchestrator-neon) optimizer proposal, wrote the current patch and tests, and ran the Wine checks.
@DavidM1911 on GitHub · 2026-11-24 19:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@Toons29 on GitHub · 2026-11-25 03:33 UTC · original
Regression run of
ce8c1039on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.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.@DavidM1911 on GitHub · 2026-11-26 00:26 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.@gut0to on GitHub · 2026-11-24 17:32 UTC · original
On
crates/xcl/src/gpu/dxil/opt.rsline 1795 (outdated):Could each dominator child get its own CSE table scope? This
Exitruns only after every child has been visited, so an expression inserted in one branch remains available in its sibling even though that definition does not dominate the sibling. CSE can then replace the sibling value with a non-dominating SSA value. Please restore the table to the parent mark between child subtrees. AI-assisted review: I traced the sibling-block traversal and table lifetime.@Roroca-1 on GitHub · 2026-11-24 19:19 UTC · original
On
crates/xcl/src/gpu/dxil/opt.rsline 1795 (outdated):The replacement at
ce8c103removes this branch’s CSE implementation and uses the optimizer from merged #1426. I checked its sibling scoping with a diamond test under Wine. Both arms compute the same expression, one arm repeats it, and the join PHI uses the two incoming values. The same-arm duplicate folded and each PHI edge kept its own arm’s definition (1 passed). T3 Code (Codex, gpt-6.2-astra) wrote and ran the probe.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.Merge
Merge the changes and update on Forgejo.