Recompiler: keep BVH box intersection loops rolled #1542

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

@⁠coolpersonnn on GitHub · 2026-11-24 17:27 UTC · original
coolpersonnn:recomp/retail-compile-cost → main · +47 −1 · 2 files · 1 commits · open

DXC inlines the BVH intersection helper, so unrolling its four-child loop repeats the slab test and memory loads at every call site. Emit a single counted loop body for box intersections. Part of #1269.

What is in it

  • Keep the BVH child loop rolled in emit.rs. Add -O0 compile and GPU checks for packed children, distance clipping, and sorted output in tests.rs.

Tested

  • Windows 11 build 26300, Ryzen 9 9950X3D, RTX 5090 (621.01), stable MSVC Rust 1.100.0, DXC 1.8.2502.11.
  • .\scripts\test.ps1 on f6147f3 with XCL_ADAPTER=nvidia reported 778 passed, 0 failed, and 41 ignored (debug).
    • SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
    • SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • Release builds from 9e3831e and f6147f3 via cargo build --release -p xcl. One cold xcl shaders <dir> --precompile --only cs --windows 4 --split 1 per build/sample with isolated DXIL caches. --pipelines reruns used unique executable paths and the populated DXIL cache. Each made one pipeline, refused zero, loaded zero XCL driver-cache blobs, and kept the DXIL timestamp.
RDNA2 instructions Cold precompile (s) DXIL bytes Cold PSO pass (s)
18,396 36.99 -> 36.54 1,079,744 -> 995,200 154.04 -> 130.49
11,125 10.49 -> 9.32 627,672 -> 578,308 31.89 -> 25.58

Before rebasing, two larger -O0 inputs against b7aa9f3 produced 7.5-8.0% less DXIL. The larger input cut precompile time from 63.53 s to 50.31 s, and both of its PSO passes reached the 420 s cap. The earlier run of the 18,396-instruction sample took 35.97 s to precompile on main and 39.42 s with the patch.

Regression run

Both runs used .\scripts\smoke.ps1 -Game <folder> -Seconds 60 with XCL_ADAPTER=nvidia. Main had a warm DXIL cache (0 compilations). The head used the existing cache and compiled 11 shaders.

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 5090
title: RetailGame.Xbox.v1.0.2.1.Dump
seconds: 60
exit: 0x0
frames shown: 1120 (PresentX 1120)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15570 MB
xcl-smoke v1
commit: f6147f38d3a488f32d286f513dd48b8588469e4f
gpu: NVIDIA GeForce RTX 5090
title: RetailGame.Xbox.v1.0.2.1.Dump
seconds: 60
exit: 0x0
frames shown: 1126 (PresentX 1126)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15403 MB

Not tested

AMD, native wave64, heap-window performance, and in-game dispatch time for the benchmark shaders.

AI use

Codex in T3 Code (gpt-6.2-sol) wrote the change and tests, ran the measurements, and drafted this report.

**@⁠coolpersonnn** on GitHub · 2026-11-24 17:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542) `coolpersonnn:recomp/retail-compile-cost` → `main` · +47 −1 · 2 files · 1 commits · open DXC inlines the BVH intersection helper, so unrolling its four-child loop repeats the slab test and memory loads at every call site. Emit a single counted loop body for box intersections. Part of #1269. **What is in it** - Keep the BVH child loop rolled in `emit.rs`. Add `-O0` compile and GPU checks for packed children, distance clipping, and sorted output in `tests.rs`. **Tested** - Windows 11 build 26300, Ryzen 9 9950X3D, RTX 5090 (621.01), stable MSVC Rust 1.100.0, DXC 1.8.2502.11. - `.\scripts\test.ps1` on `f6147f3` with `XCL_ADAPTER=nvidia` reported 778 passed, 0 failed, and 41 ignored (debug). - `SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64` - `SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` - `SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` - Release builds from `9e3831e` and `f6147f3` via `cargo build --release -p xcl`. One cold `xcl shaders <dir> --precompile --only cs --windows 4 --split 1` per build/sample with isolated DXIL caches. `--pipelines` reruns used unique executable paths and the populated DXIL cache. Each made one pipeline, refused zero, loaded zero XCL driver-cache blobs, and kept the DXIL timestamp. | RDNA2 instructions | Cold precompile (s) | DXIL bytes | Cold PSO pass (s) | |---:|---:|---:|---:| | 18,396 | 36.99 -> 36.54 | 1,079,744 -> 995,200 | 154.04 -> 130.49 | | 11,125 | 10.49 -> 9.32 | 627,672 -> 578,308 | 31.89 -> 25.58 | Before rebasing, two larger `-O0` inputs against `b7aa9f3` produced 7.5-8.0% less DXIL. The larger input cut precompile time from 63.53 s to 50.31 s, and both of its PSO passes reached the 420 s cap. The earlier run of the 18,396-instruction sample took 35.97 s to precompile on main and 39.42 s with the patch. **Regression run** Both runs used `.\scripts\smoke.ps1 -Game <folder> -Seconds 60` with `XCL_ADAPTER=nvidia`. Main had a warm DXIL cache (0 compilations). The head used the existing cache and compiled 11 shaders. ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 5090 title: RetailGame.Xbox.v1.0.2.1.Dump seconds: 60 exit: 0x0 frames shown: 1120 (PresentX 1120) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15570 MB ``` ``` xcl-smoke v1 commit: f6147f38d3a488f32d286f513dd48b8588469e4f gpu: NVIDIA GeForce RTX 5090 title: RetailGame.Xbox.v1.0.2.1.Dump seconds: 60 exit: 0x0 frames shown: 1126 (PresentX 1126) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15403 MB ``` **Not tested** AMD, native wave64, heap-window performance, and in-game dispatch time for the benchmark shaders. **AI use** Codex in T3 Code (gpt-6.2-sol) wrote the change and tests, ran the measurements, and drafted this report.
DXC inlines the box slab test at each BVH instruction. Keep the four child tests in one loop body to cut repeated loads and IR. Add an O0 compile test and check packed children and sorting on the GPU.

Against main b7aa9f3 with four switch windows, four retail compute samples produced 7.5-8.0% less DXIL. Cold RTX 5090 pipeline passes completed 13.0% and 18.2% faster on the two samples that built on both runs.

Part of #1269

Assisted-by: Codex in T3 Code (gpt-6.2-sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:56:58 +00:00
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-24 17:39 UTC · original

Independent AMD check of f6147f38d3a488f32d286f513dd48b8588469e4f.

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. cargo build --workspace --locked passed.
  • cargo test --locked -p xcl --lib bvh -- --test-threads=1 --nocapture passed all 12, including the new packed-child test and the existing 64-bit intersection test across memory windows. No GPU skips in this run.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 778 passed, 0 failed, and 41 ignored. One reported GPU skip (heap_window_out_of_memory_falls_back_to_the_switch_form, no heap windows). The bundled title passed.
  • I compiled the same synthetic kernel containing one IMAGE_BVH_INTERSECT_RAY on base 9e3831e1f570d3646e53ab753b19ec07eb8f1485 and this PR with cargo test --locked -p xcl --test bvh_size_probe -- --exact synthetic_bvh_sizes --nocapture --test-threads=1 (temporary test). Four memory windows, three wave modes, and three optimization levels per DXC version. The test checked the change from [unroll] to [loop] in the emitted HLSL.
DXC 1.8.2502.11, native wave64 Base DXIL bytes PR DXIL bytes
-O0 16,784 11,324
-O1 12,780 9,732
-O3 12,748 9,692

DXIL was smaller in all 18 matched comparisons with DXC 1.8.2502.11 and 1.9.2609.5 across wave32, native wave64, and split wave64. The reductions ranged from 22.8% to 32.6% for this one fixture.

Not tested

Retail shaders, retail titles, and driver compile times. The size comparison used one synthetic kernel.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) prepared the temporary comparison, ran the checks, and drafted this report.

**@⁠nnonno91** on GitHub · 2026-11-24 17:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542#issuecomment-7139524366) Independent AMD check of `f6147f38d3a488f32d286f513dd48b8588469e4f`. **Tested** - Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. `cargo build --workspace --locked` passed. - `cargo test --locked -p xcl --lib bvh -- --test-threads=1 --nocapture` passed all 12, including the new packed-child test and the existing 64-bit intersection test across memory windows. No GPU skips in this run. - `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` reported 778 passed, 0 failed, and 41 ignored. One reported GPU skip (`heap_window_out_of_memory_falls_back_to_the_switch_form`, no heap windows). The bundled title passed. - I compiled the same synthetic kernel containing one `IMAGE_BVH_INTERSECT_RAY` on base `9e3831e1f570d3646e53ab753b19ec07eb8f1485` and this PR with `cargo test --locked -p xcl --test bvh_size_probe -- --exact synthetic_bvh_sizes --nocapture --test-threads=1` (temporary test). Four memory windows, three wave modes, and three optimization levels per DXC version. The test checked the change from `[unroll]` to `[loop]` in the emitted HLSL. | DXC 1.8.2502.11, native wave64 | Base DXIL bytes | PR DXIL bytes | | --- | ---: | ---: | | `-O0` | 16,784 | 11,324 | | `-O1` | 12,780 | 9,732 | | `-O3` | 12,748 | 9,692 | DXIL was smaller in all 18 matched comparisons with DXC 1.8.2502.11 and 1.9.2609.5 across wave32, native wave64, and split wave64. The reductions ranged from 22.8% to 32.6% for this one fixture. **Not tested** Retail shaders, retail titles, and driver compile times. The size comparison used one synthetic kernel. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) prepared the temporary comparison, ran the checks, and drafted this report.
Author
Owner

@⁠lows78 on GitHub · 2026-11-24 17:45 UTC · original · edited 2026-11-24 18:43 UTC

Test report for #1542 at f6147f38d3a488f32d286f513dd48b8588469e4f (clean tree), on an RTX 4090. I am not a graphics developer: Claude Code ran this on my PC, and I can rerun things if that helps.

Tested

  • NVIDIA GeForce RTX 4090 (driver 621.01, 32-lane waves), Intel Core i9-14900KF, 32 GB RAM, Windows 11 Pro 10.0.26200, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug. XCL_SAMPLE_* unset.

  • cargo build --workspace && cargo test --workspace -- --test-threads=4, one run each:

    • main 9e3831e: 776 passed, 0 failed, 41 ignored
    • this PR f6147f3: 778 passed, 0 failed, 41 ignored
  • SKIPPED, the same three on both: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

  • XCL_ADAPTER=nvidia cargo test -p xcl --lib bvh -- --test-threads=4, 10 runs: 12 passed, 0 failed in each

  • [loop] against [unroll] on the GPU with random box16 / box32 nodes (temporary test, -O0, -O1, -O3): 7,680 results compared, 0 differences

  • Synthetic programs of BVH instructions at -O3, four windows, unroll → loop:

    • 32 instructions, separate inputs and outputs: DXIL 265,068 → 157,224 B, DXC 5,083 → 2,191 ms
    • 64 instructions that overwrite each other's results: DXIL 131,328 → 207,732 B (larger), DXC 21,452 → 7,707 ms
  • Added later: driver time (CreateComputePipelineState), loop against unroll on this commit. Synthetic kernels of N BVH instructions, split wave64, four windows, default DXC arguments, debug build. 6 pairs per N, driver calls in alternating order (DXC always compiled the unrolled form first), new random literals in every pair so no program repeats, and a wait for the process to be idle between pipelines. 48 pipelines, none refused. Medians, unroll → loop:

    N DXIL DXC driver call process CPU until idle
    1 14,152 → 10,900 B 0.037 → 0.029 s 0.037 → 0.026 s 0.06 → 0.05 s
    8 70,020 → 44,112 B 0.366 → 0.198 s 0.398 → 0.169 s 0.78 → 0.34 s
    16 135,136 → 81,996 B 1.190 → 0.557 s 1.163 → 0.388 s 2.36 → 0.79 s
    32 269,176 → 160,172 B 4.618 → 1.935 s 4.729 → 1.075 s 9.42 → 2.13 s

    From N = 8 on the loop's driver call was faster in all 18 pairs (0.22 to 0.45 of the unrolled time). At N = 1 the ratio ranged from 0.63 to 1.05. These kernels are almost only BVH instructions, so a real shader gains less.

Not tested

  • Retail titles (no smoke.ps1 run) and retail shaders, driver time on real shaders, GPU run time of the loop, release builds, AMD, Intel, native wave64, heap windows, DXC 1.9. The PC was in use during the driver timing (GPU at 39 % just before it). main has moved to c160d86 since; not rerun on top of it

AI use

  • Claude Code, Claude Opus 5.5: ran the builds and tests, wrote the temporary tests and this report
**@⁠lows78** on GitHub · 2026-11-24 17:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542#issuecomment-7139670506) · edited 2026-11-24 18:43 UTC Test report for #1542 at `f6147f38d3a488f32d286f513dd48b8588469e4f` (clean tree), on an RTX 4090. I am not a graphics developer: Claude Code ran this on my PC, and I can rerun things if that helps. **Tested** - NVIDIA GeForce RTX 4090 (driver 621.01, 32-lane waves), Intel Core i9-14900KF, 32 GB RAM, Windows 11 Pro 10.0.26200, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug. `XCL_SAMPLE_*` unset. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`, one run each: - `main` `9e3831e`: 776 passed, 0 failed, 41 ignored - this PR `f6147f3`: 778 passed, 0 failed, 41 ignored - SKIPPED, the same three on both: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - `XCL_ADAPTER=nvidia cargo test -p xcl --lib bvh -- --test-threads=4`, 10 runs: 12 passed, 0 failed in each - `[loop]` against `[unroll]` on the GPU with random box16 / box32 nodes (temporary test, `-O0`, `-O1`, `-O3`): 7,680 results compared, 0 differences - Synthetic programs of BVH instructions at `-O3`, four windows, unroll → loop: - 32 instructions, separate inputs and outputs: DXIL 265,068 → 157,224 B, DXC 5,083 → 2,191 ms - 64 instructions that overwrite each other's results: DXIL 131,328 → 207,732 B (larger), DXC 21,452 → 7,707 ms - Added later: driver time (`CreateComputePipelineState`), loop against unroll on this commit. Synthetic kernels of N BVH instructions, split wave64, four windows, default DXC arguments, debug build. 6 pairs per N, driver calls in alternating order (DXC always compiled the unrolled form first), new random literals in every pair so no program repeats, and a wait for the process to be idle between pipelines. 48 pipelines, none refused. Medians, unroll → loop: | N | DXIL | DXC | driver call | process CPU until idle | |---:|---:|---:|---:|---:| | 1 | 14,152 → 10,900 B | 0.037 → 0.029 s | 0.037 → 0.026 s | 0.06 → 0.05 s | | 8 | 70,020 → 44,112 B | 0.366 → 0.198 s | 0.398 → 0.169 s | 0.78 → 0.34 s | | 16 | 135,136 → 81,996 B | 1.190 → 0.557 s | 1.163 → 0.388 s | 2.36 → 0.79 s | | 32 | 269,176 → 160,172 B | 4.618 → 1.935 s | 4.729 → 1.075 s | 9.42 → 2.13 s | From N = 8 on the loop's driver call was faster in all 18 pairs (0.22 to 0.45 of the unrolled time). At N = 1 the ratio ranged from 0.63 to 1.05. These kernels are almost only BVH instructions, so a real shader gains less. **Not tested** - Retail titles (no `smoke.ps1` run) and retail shaders, driver time on real shaders, GPU run time of the loop, release builds, AMD, Intel, native wave64, heap windows, DXC 1.9. The PC was in use during the driver timing (GPU at 39 % just before it). `main` has moved to `c160d86` since; not rerun on top of it **AI use** - Claude Code, Claude Opus 5.5: ran the builds and tests, wrote the temporary tests and this report
Author
Owner

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

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 19:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542#issuecomment-7141769344) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 20:03 UTC · original

Independent Windows release verification on NVIDIA RTX 3060 Ti (f6147f38d3a488f32d286f513dd48b8588469e4f vs base main 9e3831e1f570d3646e53ab753b19ec07eb8f1485).

Setup

  • GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, wave32), driver 32.0.16.2101
  • CPU / RAM: AMD Ryzen 5 5500 (6C/12T), 31.8 GB RAM
  • OS: Windows 11 Home Single Language, build 26200
  • Toolchain: rustc 1.100.0, DXC 1.9.2602.17, --release

Workspace tests (cargo test --workspace --release --no-fail-fast -- --test-threads=4)

  • Exit 0: 778 passed, 0 failed, 41 ignored across 20 result blocks (SKIPPED: 2 no wave64, 2 no D3D12 debug layer, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).

Regression run (scripts/smoke.ps1, 60 s, XCL_NETWORK=0, title folder name redacted)

  • PR head vs base main: 1493 / 1566 frames (95.3%), 15704 / 14715 MB peak commit (106.7%), 0 device removals, 0 crashes.

Base (main 9e3831e):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14715 MB

PR head (f6147f3):

xcl-smoke v1
commit: f6147f38d3a488f32d286f513dd48b8588469e4f
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1493 (PresentX 1493)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15704 MB

Not tested: cold-cache BVH compute shader compile-time benchmark on the retail shader pack, AMD / wave64 hardware.

AI use: Antigravity (Gemini 4 Neon) built and ran the test suite and smoke pair on this hardware and drafted this report from the captured outputs; reviewed before posting. No game files attached.

**@⁠LocranKing** on GitHub · 2026-11-24 20:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542#issuecomment-7142983902) Independent Windows release verification on NVIDIA RTX 3060 Ti (`f6147f38d3a488f32d286f513dd48b8588469e4f` vs base `main` `9e3831e1f570d3646e53ab753b19ec07eb8f1485`). **Setup** - GPU: NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, wave32), driver `32.0.16.2101` - CPU / RAM: AMD Ryzen 5 5500 (6C/12T), `31.8 GB` RAM - OS: Windows 11 Home Single Language, build `26200` - Toolchain: `rustc 1.100.0`, DXC `1.9.2602.17`, `--release` **Workspace tests (`cargo test --workspace --release --no-fail-fast -- --test-threads=4`)** - Exit `0`: **778 passed, 0 failed, 41 ignored** across 20 result blocks (`SKIPPED`: 2 `no wave64`, 2 `no D3D12 debug layer`, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`). **Regression run (`scripts/smoke.ps1`, 60 s, `XCL_NETWORK=0`, title folder name redacted)** - PR head vs base `main`: `1493 / 1566` frames (**95.3%**), `15704 / 14715 MB` peak commit (**106.7%**), `0` device removals, `0` crashes. Base (`main` `9e3831e`): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14715 MB ``` PR head (`f6147f3`): ``` xcl-smoke v1 commit: f6147f38d3a488f32d286f513dd48b8588469e4f gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1493 (PresentX 1493) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15704 MB ``` **Not tested:** cold-cache BVH compute shader compile-time benchmark on the retail shader pack, AMD / wave64 hardware. **AI use:** Antigravity (`Gemini 4 Neon`) built and ran the test suite and smoke pair on this hardware and drafted this report from the captured outputs; reviewed before posting. No game files attached.
Author
Owner

@⁠Melow-code on GitHub · 2026-11-24 23:02 UTC · original

The rolled-loop change is a clear win: 8% smaller DXIL, 15% faster cold PSO, no GPU output differences over 7,680 comparisons from lows78. The 58% growth on one synthetic case with overlapping outputs is expected — rolled loops trade code size for iteration overhead, and a fully overlapping box set hits every iteration.

One thing to watch: the [loop] attribute relies on DXC respecting it. If a future DXC version decides to unroll despite the hint, the compile-time regression comes back. A comment noting this would help.

The -O0 test coverage is good — it catches the rolled/unrolled difference at the DXIL level where it matters.

**@⁠Melow-code** on GitHub · 2026-11-24 23:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1542#issuecomment-7146940304) The rolled-loop change is a clear win: 8% smaller DXIL, 15% faster cold PSO, no GPU output differences over 7,680 comparisons from lows78. The 58% growth on one synthetic case with overlapping outputs is expected — rolled loops trade code size for iteration overhead, and a fully overlapping box set hits every iteration. One thing to watch: the `[loop]` attribute relies on DXC respecting it. If a future DXC version decides to unroll despite the hint, the compile-time regression comes back. A comment noting this would help. The `-O0` test coverage is good — it catches the rolled/unrolled difference at the DXIL level where it matters.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/1542/head:github-bot/gh-1542'
git switch 'github-bot/gh-1542'

Merge

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