Repository navigation
Recompiler: basic blocks, post-dominators and control dependence (#336) - #341
emirduran707 wants to merge 1 commit into
Conversation
|
Tested Arch Linux x86-64, rustc 1.97.1, head
Not tested Windows workspace build, DXC, GPU execution and retail titles. The shader-like input was hand-constructed for static analysis and was never executed. AI use Codex (GPT-6; exact variant unavailable) wrote the standalone test harness and this report. |
|
Reviewed commit Clean preparation PR overall, and the CHK
|
|
Tested RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, Pass: 675 passed, 0 failed, 41 ignored. SKIPPED: only the 2 Run and written with Claude Code (Claude Opus 5.5). |
…ll#336) Preparation for classifying wave64 VS / PS by whether their result depends on how a 32-lane GPU cuts their waves: that needs to know which blocks run because of a wave-wide vote. No behaviour change: nothing calls it yet. cfg::Cfg builds a program's basic blocks from upper_lanes::successors (now shared), and gives each block's immediate post-dominator (Cooper, Harvey and Kennedy's iteration on the reversed graph, with one exit after every block that ends the program) and the branches it is control-dependent on (Ferrante, Ottenstein and Warren). A program with an indirect jump has no graph; a block from which no path ends the program has no post-dominator. Measured over all 26 698 programs of a retail shader pack (release, one thread): no panic, 195 with an indirect jump, at most 15 995 blocks in one program, at most 15 ms for one program's graph, post-dominators and control dependence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4e6156c to
f7fd232
Compare
|
Thanks both – you were right, and it was the same gap: a successor from which no path ends the program. Fixed in f7fd232 (squashed, rebased on a6f5f7a):
Suite at f7fd232 on an RX 9060 XT: 683 passed, 0 failed, 41 ignored, no AI use: Claude Code with Claude Opus 5.5 made the fix, ran these tests and wrote this reply. |
|
Retested the new head RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed), rustc 1.100.0 MSVC, debug, Pass: 683 passed, 0 failed, 41 ignored (675 on Run and written with Claude Code (Claude Opus 5.5). |
Part of #336. Preparation for classifying wave64 VS / PS by whether their result depends on how a 32-lane GPU cuts their waves: that needs to know which blocks run because of a wave-wide vote. No behaviour change: nothing outside the tests calls it yet.
What is in it
gpu/recomp/cfg.rs(new):Cfg– a program's basic blocks built fromupper_lanes::successors, each block's immediate post-dominator (Cooper, Harvey and Kennedy's iteration on the reversed graph, one exit after every block that ends the program) and the branches it is control-dependent on (Ferrante, Ottenstein and Warren). A successor from which no path ends the program counts as the exit (so a branch into a loop with no way out decides both sides), and every block of such a region depends on the branch that leads into it. A program with an indirect jump gives no graph; a block from which no path ends the program has no post-dominator.gpu/recomp/upper_lanes.rs:successorsispub(super), unchanged otherwise.cfg.rs: an if, an if / else, a loop (control-dependent on its own branch), a loop with no way out, an indirect jump, and the two branches into a region with no way out from the review below (both fail without the fix).Tested
x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug for the suite, release for the runs.cargo test --workspace -- --test-threads=4at f7fd232: 683 passed, 0 failed, 41 ignored; noSKIPPEDlines.Regression run
The
gpu:line names a virtual display adapter of this machine (what #281 / #282 / #285 fix); XCL's log namesbackend 'real' – AMD Radeon RX 9060 XT (16188 MiB VRAM). Nothing in the runtime calls the new code, so this only shows the build is unchanged in use.main:
PR:
Not tested
AI use