Recompiler: pre-emission RDNA2 optimizer, dominator SMEM hoisting, and lane-local mask scalarization #1630
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!1630
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1630"
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?
@auswhalen999-debug on GitHub · 2026-11-24 18:25 UTC · original
auswhalen999-debug:shader-opt-1269→main· +7502 −206 · 5 files · 2 commits · openAdd a pre-emission RDNA2 CFG/liveness optimizer (
opt.rs) and matching HLSL lowering improvements (emit.rs,mod.rs) that reduce basic-block explosion, redundant scalar memory loads, convergent wave ballots, and branchy HLSL 2021 helpers across large retail compute shaders. Part of #1269.Measured across 12 stratified retail compute shaders (
150 KB – 1.15 MBDXIL,131,048RDNA2 instructions) on an NVIDIA GeForce GTX 1070 with cold driver-cache salt (109.0xcold/warm verified): -31.2% cold driverCreateComputePipelineStatetime (281.84 s -> 194.01 s, 12/12 faster, up to -40.7%), -18.7% DXC compile time (177.52 s -> 144.39 s), -26.1% end-to-end compile time (460.12 s -> 339.87 s, 12/12 faster), and -13.6% DXIL size (8,400.1 KB -> 7,256.3 KB).This PR is kept together as one cohesive optimizer pass because the dominator/reaching-def/liveness/hazard analysis in
opt.rsdirectly drives the emitter lowering inemit.rsand early-exit CFG inmod.rs; splitting them would leave dead unexercised analysis code or lose the combined CFG/driver-compile reduction measured below (if review bandwidth prefers a stacked split ofopt.rsahead ofemit.rs/mod.rs, happy to split on request).Relationship to other
#1269PRsbits_at,put_bits,bvh_intersect,dst_sel, andxcl_lvuntouched (0 lines changed on those helpers) so#1524and#1630stack cleanly without conflict or double-work.#680(rebased onto9e3831eand supports both default switch andheap_windowsforms),#1356,#1380,#1439,#1345,#1315/#1316,#1043,#1111/#1596/#1597, or#1426direct-DXIL.What is in it
crates/xcl/src/gpu/recomp/opt.rs, registered incrates/xcl/build.rsTRANSLATOR_SOURCES):scc, SGPRs, carrysdst, and conservative RMW VGPR liveness under divergentEXEC, preservingMode::Kernellive-outs) for deadscc, dead carry-outWaveActiveBallot(includingDst::Nulland wave64 pairs), and dead pure ALU elimination.s_load_*ands_buffer_load_*CSE/hoisting (HoistedSmemGroup,HoistedSbufGroup), non-consecutive intra-blocks_buffer_load_*grouping (IntraBlockSbufGroup), andknown_zero_hiWindow-0 fast paths (s[sbase+1] == 0/(s[sbase+1] & 0xFFFF) == 0, withMode::Kernel4 GiB wrap guards).boolmask scalarization (v_cmp_*/v_add_co*/v_sub_co*and dead-sccbitwise SALU chains consumed only per-lane byv_cndmask_b32/ carry-in ops, disabled inMode::Kernelandsplit_wave64), with explicit convergence &EXEC-widening hazard model documented inopt.rs.mem_coherent: zeroGLC/DLC/SLC, zero memory atomics, zero cache inv/wb ops, and!(has_s_barrier && has_mem_store)).opt::tests).crates/xcl/src/gpu/recomp/emit.rs):ProgramOptfor deadscc/ dead carry-out / dead pure-inst elision, hoisted/grouped SMEM & SBUF lowering (zero-loop single-switch in default switch mode,ResourceDescriptorHeap[MEM_HEAP_BASE + xcl_w]inheap_windowsmode, direct Window-0 fast path usingResourceDescriptorHeap[0u]underheap_windowsorxcl_mem0under switch mode), and lane-localbool ml_*masks (avoiding convergentWaveActiveBallot).NonUniformResourceIndexon wave-uniform SGPR handles inCompute | Mesh | Geometry(and non-splitKernel), keeping it inPixel,Vertex, and splitKernel; replacesimg_clsFMT_INFOtable lookup with constant bitmasks.globallycoherenton Computemem..mem3(andheap_windowsXCL_MW) gated onprogram_opt.mem_coherent; prunes non-ABI scratch SGPRio.Load()calls inMode::Computeand deadexec_lo/exec_hientry loads in non-Kernelmodes.?:/&&/||diamonds in ALU/conversion helpers (fma_legacy,f32_to_f16_rm,cvt_norm_*,perm_b32,fclass*,sdwa_*,lanemask_lt_*,s_cmp_*_u64,s_bfm_*,v_ffbh/v_ffbl, etc.) with branch-freeselect/bitwise equivalents (leaving#1524'sbits_at/put_bits/bvh_intersect/dst_seluntouched), and simplifiesv_mul_legacy_f32/float_compareon known constants while preserving-0.0fsign semantics.img_cls,uniform_sgpr_handles, andheap_windowsWindow-0 descriptor-heap emission (emit::opt_helper_tests).crates/xcl/src/gpu/recomp/mod.rs):opt::analyzeintotranslate()and routes block emission throughEm::emit_block_insts.return;({ xcl_s_barrier_exit(); return; }whensafe_barrieris active,return xo;forVertex) on earlys_endpgminCompute | Mesh | Vertex(preservingxcl_skip_endinKernel | Geometry | Pixel), extendsstructured_spanpastTerm::End, and emitscontinue;/break;inemit_rangeloops.crates/xcl/src/gpu/recomp/tests.rs):gpu_opt_lane_local_mask_exec_restore_and_carry_parity(Wave32 & Wave64 real GPU dispatch verifyings_and_saveexec+v_cmp+s_or+EXECrestore +v_cndmask_b32+ 64-bitv_add_co->v_add_co_cicarry chain with dead carry-out, bit-exact on every lane) andgpu_opt_hoisted_smem_store_hazard_and_branchless_helpers_parity(real GPU dispatch verifying hoisted/subsumeds_load_*, groupeds_buffer_load_*partial OOB, store-hazard non-hoisting, branchlessfma_legacy(0, NaN, 7), and constantmul_legacy(2.0, -0.0) == +0.0).scc, dead final carry-out, andDst::Nullcompare ballots are now elided.Tested
32.0.15.8180, Wave32, no HW mesh shaders), AMD Ryzen 5 3500X 6-Core Processor, Windows 11 (NT 10.0.26300.0),rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release build.cargo test --workspace --release -- --test-threads=4(aftercargo build --workspace --release, withXCL_DXC_DIRset) at91ae2c6: 797 passed, 0 failed, 41 ignored (748lib including both new GPU output-parity tests +49integration/e2e/oracle, includinggpu_compute_e2e4 passed, 0 failed and#680heap_window_tests).SKIPPEDGPU tests on GTX 1070:gpu::recomp::tests::gpu_geometry_mode_es_gs_strip: no mesh shadersgpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu::recomp::tests::gpu_mesh_mode_two_passes: no mesh shadersgpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64150 KB – 1.15 MBDXIL,split_wave64=true,mem_windows=4,heap_windows=false, retail-O1/-O3threshold, per-run non-DCE-ableio.Load(508u)salt defeating%LOCALAPPDATA%\NVIDIA\DXCache, coldness self-check on#0:cold1=3788.3 ms,warm=35.6 ms,cold2=3882.6 ms, ratio109.0x; note: compile-time benchmark only, as standalone retail CS expect live title UMA/descriptors — output parity is verified by the workspace GPU suite,gpu_compute_e2e, and the new GPU dispatch tests above):fnv64)0019989e00daa26e-O1) -> 7,511 (-O3)*076191bb0526ab240452488a1f04a85e001714bf0155621c0291d282008bfb7a008d625c04fd77f7*Note:
#1(00daa26e) shrank HLSL from1,085.4 KB -> 978.4 KB, crossingdxc.rs's 1 MiB threshold from-O1to-O3, and still reduced total E2E compile time by-14.8%(15.76 s -> 13.42 s). Across the 12 shaders,NonUniformResourceIndexdropped2,500 -> 0,xcl_mLoad*calls dropped8,506 -> 2,829(-66.7%), entryio.Loaddropped1,248 -> 145(-88.4%), andgloballycoherentdropped48 -> 16.Regression run
main:
PR:
Not tested
gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask), and hardware mesh-shader tests (gpu_mesh_mode_two_passes,gpu_geometry_mode_es_gs_strip) on this machine — GTX 1070 is Pascal Wave32 without mesh shaders (independently verified on AMD Radeon native-wave64 + mesh at17c0233in comments below).XCL_HEAP_WINDOWS=1(functional unit/GPU coverage viaheap_window_tests,gpu_compute_e2e, andheap_windows_window0_fast_paths_use_descriptor_heappassed).XCL_SAMPLE_*tests, and retail gameplay past the 60 s smoke window.AI use
Antigravity (Google DeepMind Gemini agent) — audited
gpu/recomp/and open PRs for zero overlap, profiled baseline DXIL IR and cold GTX 1070 PSO compile times, implementedopt.rsand theemit.rs/mod.rs/build.rschanges and unit/GPU parity tests, ran the workspace test suite, paired cold-PSO benchmarks, andscripts/smoke.ps1runs, and drafted the commits and PR description.@pickles976 on GitHub · 2026-11-24 18:29 UTC · original
Measurements read as the best-designed perf post in this repo yet — stratified corpus (150 KB–1.15 MB, 131k instructions), cold-cache salt, per-shader distribution not just mean (12/12, up to −40.7%), and cold/warm verified at 109× so the cold number cannot be cache luck. And it lands directly on the thread that measured one helper pattern at 230 s→63 s (#1524): if both hold, the cold-run watchdog arithmetic changes materially — worth a cross-reference in each PR description so the reviewers of one know the other exists. Four review-lane points on a 7,298-line optimizer rather than a rubber stamp: ① correctness artifact, not speed artifact — the single most valuable addition is the boring one: state (or add) whether the 12-shader corpus compares outputs, not just times, before/after the pass, and whether the full
gpu_compute_e2esuite ran at this head; for an optimizer whose failure mode is silently wrong pixels, "12/12 faster" and "12/12 bit-identical" are different sentences and the second is the merge prerequisite. ② The convergent-wave-ballot removal is the sharpest edge in the PR: wave intrinsics are convergence operations before they are values, so ballot dedup is only sound under a convergence-aware hazard model — name the model in the pass doc (which CFG shapes may the analysis move a ballot across, and what makes a region convergence-safe) so the next person extendingopt.rsinherits the constraint, not just the code. ③ Review bandwidth is the known graveyard here (see the validated-but-unmerged data fix): if review stalls on size, the natural seam is analysis passes (opt.rs) landing before the HLSL lowering changes (emit.rs/mod.rs) if they are behavior-preserving without each other — but the cohesion argument is plausible as written, so this is Plan B, not a request. ④emit.rs"branchy HLSL 2021 helpers" reduction intersects #1524 commit 1 (dynamic-index helpers) — please rebase against each other before merge so the two helper-lowering rewrites do not half-cancel.@vitor127wt on GitHub · 2026-11-24 18:50 UTC · original
Independent cold compute PSO timings on Linux / Proton
This is the #1630 data point for campaign #1269 (A14).
Tested
17c02330d8b5a78c938a1cc52f04874e1fb9087aagainst itsmainbase9e3831e1f570d3646e53ab753b19ec07eb8f1485, using five shaders matched by container hash from the PR's sample.x86_64-pc-windows-gnullvm). vkd3d-protonec207194with the Wine kit #257 patch, dxil-spirv7c048638.-O1. Built withcargo build --locked -j 5 --target x86_64-pc-windows-gnullvm --release -p xcl --example shader_bench. Ranwine shader_bench.exe compile <record> -O1 <dxil>andwine shader_bench.exe pipeline <record> <dxil>with Proton's Wine. PSO time is theCreateComputePipelineStatecall using XCL's ABI root signature and the matching build's precompiled DXIL.0019989e(2,632)00daa26e(4,497)076191bb(5,187)0452488a(10,753)04fd77f7(16,692)Totals are sums of per-shader medians. DXC time fell 14.6%, cold PSO creation time fell 27.5%, and DXIL bytes fell 12.5%. All five PSOs were faster.
Not tested
Native Windows, gameplay or shader execution correctness, and the full workspace suite.
AI use — OpenAI Codex (GPT-6, exact variant unavailable) wrote the local benchmark example, ran the tests and prepared the report.
@auswhalen999-debug on GitHub · 2026-11-24 18:54 UTC · original
@pickles976 Thanks for the sharp review — followed through on all four points in
91ae2c6(and updated the PR description + freshxcl-smoke):gpu_compute_e2e: Clarified honestly that the 12-shader retail corpus measures compile time only (standalone retail CS need live title UMA/descriptors), and thatgpu_compute_e2eran and passed (4/4) in the workspace suite. Added two permanent GPU dispatch output-parity tests incrates/xcl/src/gpu/recomp/tests.rs:gpu_opt_lane_local_mask_exec_restore_and_carry_parity(runs on both Wave32 and Wave64, testings_and_saveexec->v_cmp+s_or->EXECrestore ->v_cndmask_b32+ 64-bitv_add_co->v_add_co_ciwith dead final carry-out, verifying bit-exact output on every lane and 0ballot(and(on Wave32 / native Wave64).gpu_opt_hoisted_smem_store_hazard_and_branchless_helpers_parity(real GPU dispatch verifying hoisted/subsumeds_load_*, groupeds_buffer_load_*partial OOB bounds, store-hazard non-hoisting acrossglobal_store_dword, branchlessfma_legacy(0, NaN, 7), and constantmul_legacy(2.0, -0.0) == +0.0).cargo test --workspace --release -- --test-threads=4at91ae2c6: 797 passed, 0 failed, 41 ignored.opt.rs: Documented the formal constraint explicitly in both the module header andanalyze_lane_local_masks()— the pass never moves, hoists, or deduplicatesWaveActiveBallotacross CFG boundaries (strictly intra-block, dead at block exit!live_out_s[bi]), rejects any whole-mask/cross-lane consumer solanebit(WaveActiveBallot(and(act, cond))) == and(act, cond)per lane identically, and setsneeds_exec_mask = truewhenever anyEXEC-widening op can intervene between def and use.opt.rsahead ofemit.rs/mod.rsas a 2-PR stack if maintainers prefer.bits_at,put_bits,bvh_intersect,dst_sel,xcl_lvwere intentionally left untouched so both PRs stack cleanly).@nnonno91 Huge thanks for the independent AMD native-Wave64, mesh,
XCL_HEAP_WINDOWS=1, and EXEC-restore output-parity verification — promoted that exact EXEC-restore scenario into the permanentgpu_opt_lane_local_mask_exec_restore_and_carry_paritytest in91ae2c6!@nnonno91 on GitHub · 2026-11-24 18:37 UTC · original · edited 2026-11-24 19:01 UTC
Independent AMD native-wave64 and mesh coverage at
17c02330d8b5a78c938a1cc52f04874e1fb9087a.Tested
XCL_ADAPTER='AMD Radeon'.cargo build --workspace --lockedandcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputcompleted. The suite reported 795 passed, 0 failed, 41 ignored. One GPU skip was counted among the passes (heap_window_out_of_memory_falls_back_to_the_switch_form, heap windows off in this run). The bundled title test passed.XCL_REQUIRE_GPU=wave64,mesh,cargo test --locked -p xcl --lib -- gpu_geometry_mode_es_gs_strip gpu_geometry_wave32_prefix_count_over_a_mask gpu_mesh_mode_two_passes gpu_wave32_program_in_wave64_hardware gpu::recomp::opt::tests gpu::recomp::emit::opt_helper_tests --test-threads=1 --show-outputgave 23 passed, 0 failed, 0 ignored, 0 skips. All four GPU tests skipped in the GTX 1070 run executed here.XCL_HEAP_WINDOWS=1,cargo test --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --show-outputgave 4 passed, 0 failed, 0 ignored, 0 skips. The log confirmed use of the shared descriptor heap and a rebuild in switch form after the test injected an out-of-memory result.9e3831e1f570d3646e53ab753b19ec07eb8f1485:cargo test --locked -p xcl --test lane_mask_probe -- --exact native_wave64_mask_survives_exec_restore --nocapture --test-threads=1(one pass each, no skips). A native wave64 group enabled only lanes 0–39 withs_and_saveexec_b64, comparedlane < 48into VCC, restored EXEC and wrote each lane'sv_cndmask_b32result to memory. The PR emitted a lane-local boolean guarded by the pre-restore EXEC bit. Both builds matched all 64 expected outputs (2 for lanes 0–39 and 1 for lanes 40–63, including the eight restored lanes that would otherwise satisfy the compare).Not tested
Retail shader output parity, retail title smoke, performance, or other GPUs in this run.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary probe, ran the checks, and drafted this report.
Follow-up at
91ae2c62e89f049f241df4fed3d47295f19f2793Tested
XCL_ADAPTERand used separate caches.cargo build --workspace --lockedpassed.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 797 passed, 0 failed, 41 ignored on each adapter. The bundled title passed on both. Both pass counts includeheap_window_out_of_memory_falls_back_to_the_switch_form(heap windows off). NVIDIA also counted two native-wave64 skips (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).cargo test --locked -p xcl --lib -- gpu_opt_lane_local_mask_exec_restore_and_carry_parity gpu_opt_hoisted_smem_store_hazard_and_branchless_helpers_parity --test-threads=1 --nocapturewithXCL_REQUIRE_GPU=meshgave 2 passed, 0 failed, 0 ignored, 0 skips on each adapter. The earlier EXEC-restore scenario now runs in the permanent tests. It checked the restored mask and carry output on wave32 and native wave64 on AMD, and wave32 and split wave64 on the RTX 5090.s1at DXC-O0and-O3.cargo test --locked -p xcl --test hoist_branch_probe -- --exact hoisted_loads_agree_on_both_branch_paths --test-threads=1 --nocapturepassed once per adapter, with no skips. All eight dispatches returned the same six expected words, including zero for the out-of-bounds word and0xDEADBEEFfor the read after the store.Not tested in this follow-up
Retail shader output parity, retail title smoke, performance, or the optional heap-window mode.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary memory probe, ran the checks, and drafted the update.
@MatyEjsr on GitHub · 2026-11-24 20:12 UTC · original
Independent verification and code review of PR #1630 at commit
17c02330d8b5a78c938a1cc52f04874e1fb9087a.Environment
Tested
cargo build --workspace -j 8: exit 0 (12.25s; only the 2 pre-existingAtomic::fetch_updatedeprecation warnings).cargo test --workspace -j 8 -- --test-threads=8: 795 passed, 0 failed, 41 ignored (exit 0).SKIPPEDtests (counted as passed by libtest, not coverage):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowstest_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dllXCL_SAMPLE_*unset.XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- gpu_mesh_mode_two_passes gpu_geometry_mode_es_gs_strip gpu_bench_really_runs --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored, 0 SKIPPED (0.35s). Bothgpu_mesh_mode_two_passesandgpu_geometry_mode_es_gs_stripran on hardware and passed.XCL_HEAP_WINDOWS=1:XCL_HEAP_WINDOWS=1 cargo test --workspace -j 8 -- --test-threads=8: 795 passed, 0 failed, 41 ignored (exit 0), 3 explicit skips (no wave64x2,no d3d12SDKLayers.dllx1).heap_window_out_of_memory_falls_back_to_the_switch_form,gpu_raw_window_view_reaches_its_top,gpu_heap_windows_reject_out_of_uma_aliasing, and all 4gpu_compute_e2etests ran and passed with no device removal.origin/main(c160d86, after #1426):git merge-tree --write-tree origin/main 17c02330d8b5a78c938a1cc52f04874e1fb9087aexits 0 with no conflicts.Review notes
img_cls, earlys_endpgmdirectreturn/emit_rangecontinue/break, conditionalgloballycoherent,NonUniformResourceIndexelision, entryio.Loadpruning) and would be much cheaper to review and bisect if split into stacked PRs.soffonknown_zero_hi_sload/known_zero_hi_sbuf(opt.rs:3007-3020,emit.rs:1726,emit.rs:1815-1821): in non-Kernelmodes,known_zero_hi_sloadaccepts dynamicsoff != 125whenimm_off >= 0(andknown_zero_hi_sbufaccepts anysoff) and lowers to 32-bit addition against Window 0. Because a runtimesoffis unbounded, an overflowingbase_lo + soffwraps within Window 0 rather than carrying intohi >= 1. Restricting the 32-bit Window-0 fast path to constant offsets (soff == 125), or adding a carry guard for dynamicsoff, avoids 32-bit wrap aliasing.opt::testsandemit::opt_helper_tests) check static analysis metadata or Rust-side helper math; adding small GPU execution tests for hoisted SMEM/SBUF groups (switch andheap_windows), intra-block SBUF subsumption with partial OOB bounds, lane-localboolmask chains (includingEXECwidening), and earlys_endpgmundersafe_barrierwould directly exercise the emitted HLSL on hardware.Not tested
gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask).d3d12SDKLayers.dllnot installed on this host).XCL_SAMPLE_*tests, and retail title / smoke runs.AI use
17c02330d8b5a78c938a1cc52f04874e1fb9087a, ran the build and workspace test suites (default,XCL_REQUIRE_GPU=mesh, andXCL_HEAP_WINDOWS=1), reviewed the diff, and wrote this report from the captured logs.@DavidM1911 on GitHub · 2026-11-24 20:46 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@milesah3ad on GitHub · 2026-11-24 20:52 UTC · original
Native Windows Blackwell numbers for this head, on synthetic programs. Driver time and DXC time don't change for them. In the switch form, DXIL grows 15–27 % for the programs the optimizer changes, without costing the driver anything. The suite passes.
Setup: RTX 5080 16 GB, driver 621.24, Ryzen 7 9800X3D (16 threads), 64 GB, Windows 11 Pro 26300, rustc 1.100.0, DXC 1.9.2609.5. Head
91ae2c6against its base9e3831e, release for the probe, debug for the suite.Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4on91ae2c6: 797 passed, 0 failed, 41 ignored. SKIPPED: the two wave64-only tests, andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).nv680synthetic compute programs (#680's probe: 128 threads, wave64 + split wave64, 4 memory windows; 5 shapes × 250 / 1000 rounds × 2 seeds), translated on both trees throughtranslateat the runtime's DXC level. Then a coldCreateComputePipelineStateper program in its own process, base and head alternating which goes first. New seeds, so no driver-cache hits.XCL_HEAP_WINDOWS=1)atomic,atomic64, both forms). I'd expect that frommem_coherentturning off for them.base1000 rounds 592 → 746 KB,wave975 → 1,129 KB). The HLSL is about 1 % smaller (globallycoherentoff the four window buffers,selecthelpers), so the growth comes from DXC. The driver time for these is unchanged (1000-round means: 55.4 → 55.7 s, 72.1 → 70.2 s, 80.7 → 79.3 s).atomic/base/waveat 1000 rounds, switch form: 15.9 → 15.4 s, 9.5 → 9.3 s, 21.0 → 21.5 s. (A first, non-alternating pass showed +29 %. That was drift from running all base programs first, so I'm not counting it.)Reading: these shapes have none of the scalar loads, buffer loads, carry-outs or SDWA helpers this optimizer works on, so "no change" here doesn't contradict the GTX 1070 retail numbers. What they do show: on Blackwell, the optimizer doesn't cost driver time on programs it barely touches, and dropping
globallycoherentin the switch form makes DXC's output noticeably bigger without making the driver slower.Not tested
globallycoherentalone (I didn't bisect the emitter changes).AI use
@ -0,0 +3018,4 @@let soff = rdna2::field_value(d.enc, &d.words, "SOFFSET").unwrap_or(125);let raw_imm = fval(d, "OFFSET") as u32;let imm_off = ((raw_imm << 11) as i32 >> 11) as i64;let off_ok = if soff != 125 {@Flyander on GitHub · 2026-11-24 19:11 UTC · original
[P2] Preserve carry before selecting Window 0. This predicate proves only that the base high dword is zero. With dynamic SOFFSET,
imm_off >= 0does not preventsbase_lo + imm + sofffrom carrying into the next 4-GiB window (for example, base0x00000000_FFFFFFFCplussoff=4). Theknown_zero_hiemitter path then computes a 32-bit address and readsxcl_mem0, while the generic path forms a 64-bit effective address and selects the next window, so the loaded value differs whenmem_windows > 1. Theknown_zero_hi_sbufpath has the same issue ford0 + off. Could both fast paths retain/select the carry or prove a bound, with parity coverage at the 4-GiB boundary?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.