Recompiler: close nested loop ranges with prefix maxima #1632

Open
pmilewsskiedu-gif wants to merge 1 commit from upstream-pr/1642 into main
pmilewsskiedu-gif commented 2026-11-24 18:34:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pmilewsskiedu-gif on 2026-11-24T18:34:24Z.


Part of #1269. The structured shader translator's nested_loop_ranges previously searched every pair of backward-jump intervals repeatedly until all strict overlaps were closed. Crossing chains can make this superquadratic. Close later-starting ranges first and query a Fenwick prefix maximum to compute the same fixed point in O(L log L), keeping the original strict endpoint and equal-start semantics.

What is in it

  • crates/xcl/src/gpu/recomp/mod.rs: replace repeated pair scans for nested loop closure with a descending-start prefix-max pass, including zero/one-range fast paths.
  • Two reference-oracle tests preserve the old algorithm in test code; cover all 32,768 subsets of 15 small intervals, touching endpoints, equal starts, long crossing chains, and 1,000 seeded randomized collections.

Tested

  • Windows 11 Pro build 26200; AMD Ryzen 7 7700; NVIDIA RTX 4060 Ti (8GB), driver 32.0.16.1088; Rust 1.100.0 MSVC; DXC 1.9.2602.17.
  • cargo build --workspace and cargo test --workspace -- --test-threads=4: 778 passed, 0 failed, 41 ignored. GPU SKIPPED messages: two tests on unavailable native wave64; one heap-window test on unavailable heap windows.
  • cargo build --release -p xcl: passed.
  • On a local retail 26,698-program shader pack (xcl shaders <pack> --recomp --top 0), both builds translated 26,698 programs with zero errors and emitted an aggregate 9,665.7 MB HLSL. The report lines matched except timing. Matched HLSL-dump pair: main 9e3831e 110.3 s, this branch 15e7f71 109.2 s (CLI-reported translation scan time). This small ~1% difference is within run noise, not a claim about DXC or GPU driver compilation.
  • XCL_DUMP_EVERY=100 XCL_DUMP_HLSL=<separate local folders>: 253/253 sampled generated HLSL files, 85.1 MiB, identical SHA-256 on main and this branch, no missing/extra files. No game data or dumps are committed.
  • A temporary debug-build scaling test (removed from the final source) compared the exact old algorithm with this one on 160 chained overlapping intervals: 318,074 µs → 50 µs, same interval output. This is synthetic worst-case behavior, not a retail shader FPS estimate.

Regression run
Both binaries were copied sequentially to the exact same temporary xcl.exe path and working directory on this computer, with SHA-256 verification after each swap. The title and run settings are identical. This controls for executable-path-dependent driver caches. All runs used scripts/smoke.ps1 -Seconds 60; no crash/device removal.

Pair 1, shared executable path:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 4060 Ti
title: local Xbox title (folder name redacted)
seconds: 60
exit: 0x0
frames shown: 1210 (PresentX 1210)
presents per 2 s (last 3): 5 9 2
device removals: 0
crashes: 0
peak commit: 25169 MB
xcl-smoke v1
commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
gpu: NVIDIA GeForce RTX 4060 Ti
title: local Xbox title (folder name redacted)
seconds: 60
exit: 0x0
frames shown: 1256 (PresentX 1257)
presents per 2 s (last 3): 10 23 40
device removals: 0
crashes: 0
peak commit: 25714 MB

Pair 2, same path and same build order:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 4060 Ti
title: local Xbox title (folder name redacted)
seconds: 60
exit: 0x0
frames shown: 1259 (PresentX 1259)
presents per 2 s (last 3): 2 6 38
device removals: 0
crashes: 0
peak commit: 25743 MB
xcl-smoke v1
commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
gpu: NVIDIA GeForce RTX 4060 Ti
title: local Xbox title (folder name redacted)
seconds: 60
exit: 0x0
frames shown: 1658 (PresentX 1658)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14771 MB

Caveat: Earlier tests from different release-executable paths yielded consistently lower frames/higher memory on the patch path (~1.25k frames/25 GB) than on the main path (~1.65k/14.8 GB). Moving the unmodified main binary to a third shared path reproduced the high-memory/low-frame state, establishing executable path or cache state as a confounder. The same-path tests above do not show a consistent regression, but these 60-second runs are too variable to claim FPS or memory benefits.

Not tested
AMD/Intel GPU hardware; long-duration gameplay; full-byte HLSL comparison for every shader (sampled 253); cold cache and fixed driver-state PSO compile timings.

AI use
ChatGPT GPT-6 with Chat On Steroids Core wrote the source and tests, ran the Windows tests, synthetic/retail benchmarks and RTX 4060 Ti smoke checks, and prepared this PR. An independent Chat On Steroids worker reviewed the algorithm and every diff line; it made no edits.

<!-- greyfinch-sync:ivall/xcl:issue:5478084919 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642). Originally posted by [pmilewsskiedu-gif](https://github.com/pmilewsskiedu-gif) on 2026-11-24T18:34:24Z. --- Part of #1269. The structured shader translator's `nested_loop_ranges` previously searched every pair of backward-jump intervals repeatedly until all strict overlaps were closed. Crossing chains can make this superquadratic. Close later-starting ranges first and query a Fenwick prefix maximum to compute the same fixed point in O(L log L), keeping the original strict endpoint and equal-start semantics. **What is in it** - `crates/xcl/src/gpu/recomp/mod.rs`: replace repeated pair scans for nested loop closure with a descending-start prefix-max pass, including zero/one-range fast paths. - Two reference-oracle tests preserve the old algorithm in test code; cover all 32,768 subsets of 15 small intervals, touching endpoints, equal starts, long crossing chains, and 1,000 seeded randomized collections. **Tested** - Windows 11 Pro build 26200; AMD Ryzen 7 7700; NVIDIA RTX 4060 Ti (8GB), driver 32.0.16.1088; Rust 1.100.0 MSVC; DXC 1.9.2602.17. - `cargo build --workspace` and `cargo test --workspace -- --test-threads=4`: **778 passed, 0 failed, 41 ignored**. GPU SKIPPED messages: two tests on unavailable native wave64; one heap-window test on unavailable heap windows. - `cargo build --release -p xcl`: passed. - On a local retail 26,698-program shader pack (`xcl shaders <pack> --recomp --top 0`), both builds translated 26,698 programs with **zero errors** and emitted an aggregate 9,665.7 MB HLSL. The report lines matched except timing. Matched HLSL-dump pair: main `9e3831e` **110.3 s**, this branch `15e7f71` **109.2 s** (CLI-reported translation scan time). This small ~1% difference is within run noise, not a claim about DXC or GPU driver compilation. - `XCL_DUMP_EVERY=100 XCL_DUMP_HLSL=<separate local folders>`: **253/253 sampled generated HLSL files, 85.1 MiB, identical SHA-256** on main and this branch, no missing/extra files. No game data or dumps are committed. - A temporary debug-build scaling test (removed from the final source) compared the exact old algorithm with this one on 160 chained overlapping intervals: **318,074 µs → 50 µs**, same interval output. This is synthetic worst-case behavior, not a retail shader FPS estimate. **Regression run** Both binaries were copied sequentially to the exact **same temporary xcl.exe path and working directory** on this computer, with SHA-256 verification after each swap. The title and run settings are identical. This controls for executable-path-dependent driver caches. All runs used `scripts/smoke.ps1 -Seconds 60`; no crash/device removal. Pair 1, shared executable path: ```text xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 4060 Ti title: local Xbox title (folder name redacted) seconds: 60 exit: 0x0 frames shown: 1210 (PresentX 1210) presents per 2 s (last 3): 5 9 2 device removals: 0 crashes: 0 peak commit: 25169 MB ``` ```text xcl-smoke v1 commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd gpu: NVIDIA GeForce RTX 4060 Ti title: local Xbox title (folder name redacted) seconds: 60 exit: 0x0 frames shown: 1256 (PresentX 1257) presents per 2 s (last 3): 10 23 40 device removals: 0 crashes: 0 peak commit: 25714 MB ``` Pair 2, same path and same build order: ```text xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 4060 Ti title: local Xbox title (folder name redacted) seconds: 60 exit: 0x0 frames shown: 1259 (PresentX 1259) presents per 2 s (last 3): 2 6 38 device removals: 0 crashes: 0 peak commit: 25743 MB ``` ```text xcl-smoke v1 commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd gpu: NVIDIA GeForce RTX 4060 Ti title: local Xbox title (folder name redacted) seconds: 60 exit: 0x0 frames shown: 1658 (PresentX 1658) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14771 MB ``` **Caveat:** Earlier tests from different release-executable paths yielded consistently lower frames/higher memory on the patch path (~1.25k frames/25 GB) than on the main path (~1.65k/14.8 GB). Moving the *unmodified main* binary to a third shared path reproduced the high-memory/low-frame state, establishing executable path or cache state as a confounder. The same-path tests above do not show a consistent regression, but these 60-second runs are too variable to claim FPS or memory benefits. **Not tested** AMD/Intel GPU hardware; long-duration gameplay; full-byte HLSL comparison for every shader (sampled 253); cold cache and fixed driver-state PSO compile timings. **AI use** ChatGPT GPT-6 with Chat On Steroids Core wrote the source and tests, ran the Windows tests, synthetic/retail benchmarks and RTX 4060 Ti smoke checks, and prepared this PR. An independent Chat On Steroids worker reviewed the algorithm and every diff line; it made no edits.
Flyander commented 2026-11-24 19:08:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Flyander on 2026-11-24T19:08:19Z.

Review: APPROVED


I reviewed head 15e7f71 and ran cargo test -p xcl nested_loop_tests -- --nocapture on Windows/MSVC: 2 passed. The descending-start Fenwick pass preserves the strict overlap predicate and defers updates for equal starts; the exhaustive and seeded oracle cases agree with the previous pair-scan algorithm. No findings.

AI use: OpenAI Codex (GPT-6; exact variant unavailable).

<!-- greyfinch-sync:ivall/xcl:review:6045615694 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#pullrequestreview-6045615694). Originally posted by [Flyander](https://github.com/Flyander) on 2026-11-24T19:08:19Z. **Review:** APPROVED --- I reviewed head `15e7f71` and ran `cargo test -p xcl nested_loop_tests -- --nocapture` on Windows/MSVC: **2 passed**. The descending-start Fenwick pass preserves the strict overlap predicate and defers updates for equal starts; the exhaustive and seeded oracle cases agree with the previous pair-scan algorithm. No findings. AI use: OpenAI Codex (GPT-6; exact variant unavailable).
nnonno91 commented 2026-11-24 21:08:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-24T19:19:28Z.


Independent AMD run and synthetic loop-closure scaling at 15e7f71bb755ed35c1a79f8a3564f028cf5746bd (base c160d86ef2efe3a07e4dfb473e4fa72eafb413c0).

Tested

  • AMD Ryzen 7 9800X3D, integrated AMD Radeon(TM) Graphics (32.0.21042.62), Windows 11 25H2 26200.9974, Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11. XCL_ADAPTER='AMD Radeon'. Workspace builds used the unoptimized profile with debug info disabled.
  • cargo build --workspace --locked passed. cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 778 passed, 0 failed, 41 ignored. The bundled title passed. One GPU skip is included in the pass count (heap_window_out_of_memory_falls_back_to_the_switch_form, heap windows off).
  • With XCL_REQUIRE_GPU=wave64,mesh, cargo test --locked -p xcl --lib -- interval_closure gpu_scalar_loop_and_scc jumps_to_outer_loop_heads_are_structured --test-threads=1 --nocapture gave 4 passed, 0 failed, 0 ignored, 0 skips. The structured-control-flow test reported 120 of 120 programs structured and 120 run both ways, including 70 jumps into a loop.
  • A temporary standalone Rust probe used the PR's pair-scan reference and its new close_nested_loop_ranges verbatim (rustc --edition=2021 -C opt-level=3 pr1642-loop-closure-probe.rs -o pr1642-loop-closure-probe.exe, then ran the exe). The outputs matched for 512 seeded input sets and each set's shuffled order (1,024 comparisons). Inputs included duplicate and touching ranges and addresses near u64::MAX. The chain cases below also matched the independently constructed expected ranges.
Synthetic crossing chain Old pair scan, median PR prefix maximum, median
32 ranges 69.3 µs 0.467 µs
64 ranges 1,129.1 µs 1.056 µs
128 ranges 21,154.9 µs 2.432 µs
256 ranges 352,662.3 µs 5.628 µs

Each chain was (i, i+2) in ascending order. Medians use nine alternating-order samples, one call per old sample and 512 calls averaged per new sample. Input copies were prepared before timing.

Not tested

Retail packs or titles, full translator timing, DXC or driver compile timing, and other GPUs. The timing table covers only the CPU interval-closure step on these synthetic inputs.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary comparison harness, ran the tests, and drafted the report.

<!-- greyfinch-sync:ivall/xcl:comment:7141928239 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7141928239). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-24T19:19:28Z. --- Independent AMD run and synthetic loop-closure scaling at `15e7f71bb755ed35c1a79f8a3564f028cf5746bd` (base `c160d86ef2efe3a07e4dfb473e4fa72eafb413c0`). **Tested** - AMD Ryzen 7 9800X3D, integrated AMD Radeon(TM) Graphics (32.0.21042.62), Windows 11 25H2 26200.9974, Rust 1.100.0 MSVC, SDK DXC 1.8.2502.11. `XCL_ADAPTER='AMD Radeon'`. Workspace builds used the unoptimized profile with debug info disabled. - `cargo build --workspace --locked` passed. `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` reported **778 passed, 0 failed, 41 ignored**. The bundled title passed. One GPU skip is included in the pass count (`heap_window_out_of_memory_falls_back_to_the_switch_form`, heap windows off). - With `XCL_REQUIRE_GPU=wave64,mesh`, `cargo test --locked -p xcl --lib -- interval_closure gpu_scalar_loop_and_scc jumps_to_outer_loop_heads_are_structured --test-threads=1 --nocapture` gave **4 passed, 0 failed, 0 ignored, 0 skips**. The structured-control-flow test reported **120 of 120 programs structured and 120 run both ways**, including 70 jumps into a loop. - A temporary standalone Rust probe used the PR's pair-scan reference and its new `close_nested_loop_ranges` verbatim (`rustc --edition=2021 -C opt-level=3 pr1642-loop-closure-probe.rs -o pr1642-loop-closure-probe.exe`, then ran the exe). The outputs matched for 512 seeded input sets and each set's shuffled order (1,024 comparisons). Inputs included duplicate and touching ranges and addresses near `u64::MAX`. The chain cases below also matched the independently constructed expected ranges. | Synthetic crossing chain | Old pair scan, median | PR prefix maximum, median | | --- | ---: | ---: | | 32 ranges | 69.3 µs | 0.467 µs | | 64 ranges | 1,129.1 µs | 1.056 µs | | 128 ranges | 21,154.9 µs | 2.432 µs | | 256 ranges | 352,662.3 µs | 5.628 µs | Each chain was `(i, i+2)` in ascending order. Medians use nine alternating-order samples, one call per old sample and 512 calls averaged per new sample. Input copies were prepared before timing. **Not tested** Retail packs or titles, full translator timing, DXC or driver compile timing, and other GPUs. The timing table covers only the CPU interval-closure step on these synthetic inputs. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary comparison harness, ran the tests, and drafted the report.
DavidM1911 commented 2026-11-24 21:09:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:06:50Z.


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 unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7144493031 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7144493031). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T21:06:50Z. --- 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 unmodified `main`.) Thanks!
throny commented 2026-11-25 11:09:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T10:28:37Z.


Test report for exact head 15e7f71.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on 15e7f71 as it is (its own base): 778 passed, 0 failed, 41 ignored. SKIPPED: 3 lines (no wave64 on this adapter, and the like).
  • scripts/smoke.ps1, the retail title, 60 s, release builds, main 568e7db first, then this head. Both runs started without the preload list newer builds leave behind (used-pipelines.txt in the DXIL cache), which makes builds on an older base run out of memory at start:

main:

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1607 (PresentX 1607)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14549 MB

PR:

xcl-smoke v1
commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
gpu: NVIDIA GeForce RTX 4080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1609 (PresentX 1609)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14763 MB

Not tested: AMD, the head merged onto current main, a world load.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.

<!-- greyfinch-sync:ivall/xcl:comment:7159747371 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7159747371). Originally posted by [throny](https://github.com/throny) on 2026-11-25T10:28:37Z. --- Test report for exact head `15e7f71`. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `15e7f71` as it is (its own base): **778 passed, 0 failed, 41 ignored**. `SKIPPED`: 3 lines (no wave64 on this adapter, and the like). - `scripts/smoke.ps1`, the retail title, 60 s, release builds, `main` `568e7db` first, then this head. Both runs started without the preload list newer builds leave behind (`used-pipelines.txt` in the DXIL cache), which makes builds on an older base run out of memory at start: main: ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1607 (PresentX 1607) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14549 MB ``` PR: ``` xcl-smoke v1 commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd gpu: NVIDIA GeForce RTX 4080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1609 (PresentX 1609) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14763 MB ``` **Not tested:** AMD, the head merged onto current `main`, a world load. AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
Decodere commented 2026-11-27 14:25:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T14:25:57Z.


Independent desktop NVIDIA verification of PR #1642 at head 15e7f71bb755ed35c1a79f8a3564f028cf5746bd (1 commit; exact parent & merge-base: 9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (15e7f71b)

Command Result
cargo test --release -p xcl --lib -- --nocapture gpu::recomp::nested_loop_tests:: (3 consecutive runs) 2 passed; 0 failed; 0 ignored; 748 filtered out × 3 (0.02s, 0.02s, 0.02s, 0 skipped; exhaustive 2^15 small-set parity + 1000 random duplicate/crossing cases vs. pair-scan reference)
cargo test --release -p xcl --lib -- --nocapture gpu::recomp:: (3 consecutive parallel runs) Run 1 (16.31s): 185 passed; 9 failed; 18 ignored; 538 filtered out (pre-existing parallel-GPU failure in gpu_sparse_vram_descriptors_buffers_and_xmem at tests.rs:3527:13, left: 0, right: 1077, accompanied by D3D12 0x887A0005 DXGI_ERROR_DEVICE_REMOVED cascading to 8 concurrent GPU tests; both nested_loop_tests:: and jumps_to_outer_loop_heads_are_structured passed on Run 1); Runs 2–3 (5.84s, 6.08s): 194 passed; 0 failed; 18 ignored; 538 filtered out (191 executed + 3 runtime skips: 2× no wave64, 1× XCL_SAMPLE_RPF not set)
cargo build --release -p xcl Clean build (1m 14s, exit 0, 0 new warnings in gpu/recomp/mod.rs)

Paired quiet 60 s retail smoke (title: 29640639)

(Note: scripts/smoke.ps1 at 9e3831e1 predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)

Exact parent & merge-base (9e3831e1f570d3646e53ab753b19ec07eb8f1485, cached baseline on the same machine):

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

PR #1642 (15e7f71bb755ed35c1a79f8a3564f028cf5746bd):

xcl-smoke v1
commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1477 (PresentX 1477)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14712 MB

Limits of coverage

  • gpu::recomp::nested_loop_tests:: (2/2, 0 skipped) and jumps_to_outer_loop_heads_are_structured (120 of 120 programs structured (76 jumps into a loop)) passed 3/3, directly verifying Fenwick prefix-maximum close_nested_loop_ranges parity against the prior pair-scan fixed point.
  • In the broader parallel gpu::recomp:: sweep, Run 1 hit an unrelated parallel D3D12 device removal (0x887A0005 alongside gpu_sparse_vram_descriptors_buffers_and_xmem), while Runs 2 and 3 passed cleanly (194/0/18: 191 executed + 3 Wave32/env self-skips); on the Wave32-only RTX 4060 host the two Wave64-only tests self-skip.
  • The 60 s retail smoke confirms end-to-end shader translation and runtime stability (0 device removals, 0 crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent (1477 vs. 1549 frames) reflects normal startup variance rather than steady-state frame pacing.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7220774604 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7220774604). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T14:25:57Z. --- Independent desktop NVIDIA verification of **PR #1642** at head `15e7f71bb755ed35c1a79f8a3564f028cf5746bd` (`1` commit; exact parent & merge-base: `9e3831e1f570d3646e53ab753b19ec07eb8f1485`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`15e7f71b`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture gpu::recomp::nested_loop_tests::` (3 consecutive runs) | `2 passed; 0 failed; 0 ignored; 748 filtered out` × 3 (`0.02s`, `0.02s`, `0.02s`, `0` skipped; exhaustive `2^15` small-set parity + `1000` random duplicate/crossing cases vs. pair-scan reference) | | `cargo test --release -p xcl --lib -- --nocapture gpu::recomp::` (3 consecutive parallel runs) | Run 1 (`16.31s`): `185 passed; 9 failed; 18 ignored; 538 filtered out` (pre-existing parallel-GPU failure in `gpu_sparse_vram_descriptors_buffers_and_xmem` at `tests.rs:3527:13`, `left: 0, right: 1077`, accompanied by D3D12 `0x887A0005` `DXGI_ERROR_DEVICE_REMOVED` cascading to 8 concurrent GPU tests; both `nested_loop_tests::` and `jumps_to_outer_loop_heads_are_structured` passed on Run 1); Runs 2–3 (`5.84s`, `6.08s`): `194 passed; 0 failed; 18 ignored; 538 filtered out` (`191` executed + `3` runtime skips: 2× `no wave64`, 1× `XCL_SAMPLE_RPF not set`) | | `cargo build --release -p xcl` | Clean build (`1m 14s`, exit `0`, `0` new warnings in `gpu/recomp/mod.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) *(Note: `scripts/smoke.ps1` at `9e3831e1` predates `9683e7a6` and printed the local folder basename on `title:`; replaced below with the standard `9683e7a6` title hash `29640639`, with all measured fields verbatim.)* Exact parent & merge-base (`9e3831e1f570d3646e53ab753b19ec07eb8f1485`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1549 (PresentX 1549) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14715 MB ``` PR #1642 (`15e7f71bb755ed35c1a79f8a3564f028cf5746bd`): ``` xcl-smoke v1 commit: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1477 (PresentX 1477) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14712 MB ``` ### Limits of coverage - `gpu::recomp::nested_loop_tests::` (`2/2`, `0` skipped) and `jumps_to_outer_loop_heads_are_structured` (`120 of 120 programs structured (76 jumps into a loop)`) passed `3/3`, directly verifying Fenwick prefix-maximum `close_nested_loop_ranges` parity against the prior pair-scan fixed point. - In the broader parallel `gpu::recomp::` sweep, Run 1 hit an unrelated parallel D3D12 device removal (`0x887A0005` alongside `gpu_sparse_vram_descriptors_buffers_and_xmem`), while Runs 2 and 3 passed cleanly (`194/0/18`: `191` executed + `3` Wave32/env self-skips); on the Wave32-only RTX 4060 host the two Wave64-only tests self-skip. - The 60 s retail smoke confirms end-to-end shader translation and runtime stability (`0` device removals, `0` crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent (`1477` vs. `1549` frames) reflects normal startup variance rather than steady-state frame pacing. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
brainhay5 commented 2026-11-30 05:42:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T05:42:56Z.


merge-check claim
head: 15e7f71bb7

<!-- greyfinch-sync:ivall/xcl:comment:7269934480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7269934480). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T05:42:56Z. --- merge-check claim head: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
brainhay5 commented 2026-11-30 05:56:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T05:56:51Z.


merge-check
base: d52ff48caa
head: 15e7f71bb7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2877 passed, 2 failed, 51 ignored; 29 SKIPPED lines

failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base". gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.

<!-- greyfinch-sync:ivall/xcl:comment:7270155893 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7270155893). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T05:56:51Z. --- merge-check base: d52ff48caade1f5350d513bfffd370396dadfeb6 head: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2877 passed, 2 failed, 51 ignored; 29 SKIPPED lines failing: test_title_runs_and_game_folder_is_untouched review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review. performance: not assessed beyond the suite. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017 correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base". `gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16` fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.
BBareth commented 2026-11-30 09:39:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:39:45Z.


merge-check claim
head: 15e7f71bb7

<!-- greyfinch-sync:ivall/xcl:comment:7274514343 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7274514343). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T09:39:45Z. --- merge-check claim head: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd
Elytes commented 2026-11-30 09:42:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Elytes on 2026-11-30T09:42:08Z.


merge-check
base: 9dfbe3ea66
head: 15e7f71bb7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer, 1 driver cache needs Developer Mode); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also failing on the base alone (base lib 2737 passed / 1 failed, merge 2739 / 1; the +2 are this PR's oracle tests, passing).
review: no blocking finding after reading the whole diff and the comments; the two oracle tests pass and the closure matches the old pair scan by construction (equal starts deferred, strict overlap kept). Scope today: nested_loop_ranges serves only the HLSL translator (recomp::translate: per-stage fallback from direct DXIL, xcl shaders), not the default direct DXIL path, so the gain applies there.
performance: translation time on the HLSL path only; output unchanged by construction (reasoned, not measured here).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.1742, wave32), Intel Core i9-14900KS, 192 GB, Windows 11 build 26300.10075, rustc 1.100.1, debug / Claude Code (Claude Opus 5.5) ran the merge, build, suite and base run, and reviewed the diff and comments.

<!-- greyfinch-sync:ivall/xcl:comment:7274568735 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7274568735). Originally posted by [Elytes](https://github.com/Elytes) on 2026-11-30T09:42:08Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer, 1 driver cache needs Developer Mode); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also failing on the base alone (base lib 2737 passed / 1 failed, merge 2739 / 1; the +2 are this PR's oracle tests, passing). review: no blocking finding after reading the whole diff and the comments; the two oracle tests pass and the closure matches the old pair scan by construction (equal starts deferred, strict overlap kept). Scope today: nested_loop_ranges serves only the HLSL translator (recomp::translate: per-stage fallback from direct DXIL, `xcl shaders`), not the default direct DXIL path, so the gain applies there. performance: translation time on the HLSL path only; output unchanged by construction (reasoned, not measured here). verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.1742, wave32), Intel Core i9-14900KS, 192 GB, Windows 11 build 26300.10075, rustc 1.100.1, debug / Claude Code (Claude Opus 5.5) ran the merge, build, suite and base run, and reviewed the diff and comments.
BBareth commented 2026-11-30 09:45:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:45:56Z.


merge-check
base: 9dfbe3ea66
head: 15e7f71bb7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. Both new tests passed (interval_closure_matches_pair_scan_for_all_small_sets, interval_closure_matches_pair_scan_with_duplicates_and_crossing_chains).
review: no blocking finding; one file, every hunk read. loop_ranges keeps its inputs and hands the closure of crossing ranges to a new close_nested_loop_ranges (ranges sorted by start, later starts closed first, a Fenwick prefix maximum over starts strictly inside the range). The old pair-scan loop is kept in the test module as the reference: the new function is compared with it on every subset of the 15 intervals over 0..6 (32,768 sets) and on 1,000 random sets plus hand-picked chains, equal starts and duplicates included. Output order changes from sort to sort_unstable on (u64, u64) pairs, which is the same order. I did not find another PR making this change (searched open and merged for loop_ranges / nested loop closure).
performance: CPU time of shader translation only, lower for programs with many crossing backward jumps (the PR's claim; not measured here). No effect on frame time or memory; the generated code is the same when the closure is the same, which is what the tests check.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7274654028 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7274654028). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T09:45:56Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 15e7f71bb755ed35c1a79f8a3564f028cf5746bd merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. Both new tests passed (`interval_closure_matches_pair_scan_for_all_small_sets`, `interval_closure_matches_pair_scan_with_duplicates_and_crossing_chains`). review: no blocking finding; one file, every hunk read. `loop_ranges` keeps its inputs and hands the closure of crossing ranges to a new `close_nested_loop_ranges` (ranges sorted by start, later starts closed first, a Fenwick prefix maximum over starts strictly inside the range). The old pair-scan loop is kept in the test module as the reference: the new function is compared with it on every subset of the 15 intervals over 0..6 (32,768 sets) and on 1,000 random sets plus hand-picked chains, equal starts and duplicates included. Output order changes from `sort` to `sort_unstable` on `(u64, u64)` pairs, which is the same order. I did not find another PR making this change (searched open and merged for loop_ranges / nested loop closure). performance: CPU time of shader translation only, lower for programs with many crossing backward jumps (the PR's claim; not measured here). No effect on frame time or memory; the generated code is the same when the closure is the same, which is what the tests check. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Foniass commented 2026-12-01 06:22:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:22:22Z.


Triage (#1607) – head 15e7f71

No open or merged PR makes the same change. Main still runs the repeated pair scan in nested_loop_ranges.
No problems found in the diff. The descending-start Fenwick prefix max computes the same closure, because later starts are closed first, the query is strict (start < end), and writes for equal starts wait until the group is done. The test against the old algorithm on every subset of 15 intervals, plus 1000 random sets, covers equal starts and touching endpoints.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302796220 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1642#issuecomment-7302796220). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:22:22Z. --- **Triage (#1607)** – head 15e7f71 No open or merged PR makes the same change. Main still runs the repeated pair scan in `nested_loop_ranges`. No problems found in the diff. The descending-start Fenwick prefix max computes the same closure, because later starts are closed first, the query is strict (`start < end`), and writes for equal starts wait until the group is done. The test against the old algorithm on every subset of 15 intervals, plus 1000 random sets, covers equal starts and touching endpoints. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1642:upstream-pr/1642'
git switch 'upstream-pr/1642'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1642'
git switch 'upstream-pr/1642'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1642'
git switch 'upstream-pr/1642'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1642'
git switch 'main'
git merge --squash 'upstream-pr/1642'
git switch 'main'
git merge --ff-only 'upstream-pr/1642'
git switch 'main'
git merge 'upstream-pr/1642'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1632
No description provided.