Recompiler: reuse scratch slots across disjoint payload lifetimes #2322

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

@⁠akimfomin on GitHub · 2026-11-25 14:21 UTC · original
akimfomin:codex/compact-scratch-afc5ee8 → main · +141 −23 · 2 files · 1 commits · draft

Part of #1269 and a follow-up to Kalmarv’s merged #2126. The PortBridge allocator reuses scratch slots after their last carrying stage and keeps the fixed layout when reuse saves no space.

What is in it

  • A two-file GPL-2.0-only change with provenance and a regression check for slot compaction.

Tested

  • Windows 11, RTX 4070 Ti SUPER driver 617.14, Rust 1.100.0 gnullvm, DXC/DXIL 1.9.2609.5. The exact tree at b3f7ab5574c4489761141e2de0ce31d2eb216412 passed 10 targeted split tests with zero skips. The open Wave32 fixture used 256 DWORDs per group and matched the whole-shader and CPU outputs. The same check on the fixed allocator reported 288.

  • ettehn independently reported 47,712 to 20,064 DWORDs per group on one translation record and eight passing checks on an RTX 5070 Ti Laptop. Report

  • nnonno91 independently passed all 10 targeted tests with zero skips on each of AMD Radeon Graphics and RTX 5090. luckyteagirl independently passed the same 10 without skips on a Radeon RX 6800M. All three runs used the exact PR head. The split readbacks matched and the Wave32 fixture reported 256 DWORDs. The guest-Wave64 split fixture executes as hardware Wave32 halves.

  • On the same Git tree (0e3b7fd2c023d3935f7d4e0b5725751409062e62), the open RTX 4070 Ti SUPER workspace build used cargo build --offline --locked --workspace -j 2. cargo test --offline --locked --workspace -j 2 --no-fail-fast -- --test-threads=4 reported 1,265 passed, 0 failed and 46 ignored. The harness printed 27 additional runtime skip lines inside those totals: 21 unavailable Wave64 paths, three lowering refusals, two missing debug-layer paths and one missing heap-window path.

Regression run

The paired retail xcl-smoke blocks on main and the exact PR head are pending. The PR remains a draft.

Not tested

Paired retail smoke and matched GPU time, cold driver compilation, and scratch sizes for the three workloads Kalmarv requested. The 57.9% scratch reduction above concerns one unnamed translation record. Aggregate-only review package

AI use

OpenAI Codex (GPT-6 family; the exact serving variant was unavailable) assisted with rebasing, testing and drafting.

**@⁠akimfomin** on GitHub · 2026-11-25 14:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322) `akimfomin:codex/compact-scratch-afc5ee8` → `main` · +141 −23 · 2 files · 1 commits · draft Part of #1269 and a follow-up to Kalmarv’s merged #2126. The PortBridge allocator reuses scratch slots after their last carrying stage and keeps the fixed layout when reuse saves no space. **What is in it** - A two-file GPL-2.0-only change with provenance and a regression check for slot compaction. **Tested** - Windows 11, RTX 4070 Ti SUPER driver 617.14, Rust 1.100.0 gnullvm, DXC/DXIL 1.9.2609.5. The exact tree at `b3f7ab5574c4489761141e2de0ce31d2eb216412` passed 10 targeted split tests with zero skips. The open Wave32 fixture used 256 DWORDs per group and matched the whole-shader and CPU outputs. The same check on the fixed allocator reported 288. - ettehn independently reported 47,712 to 20,064 DWORDs per group on one translation record and eight passing checks on an RTX 5070 Ti Laptop. [Report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2126) - [nnonno91](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2322) independently passed all 10 targeted tests with zero skips on each of AMD Radeon Graphics and RTX 5090. [luckyteagirl](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2322) independently passed the same 10 without skips on a Radeon RX 6800M. All three runs used the exact PR head. The split readbacks matched and the Wave32 fixture reported 256 DWORDs. The guest-Wave64 split fixture executes as hardware Wave32 halves. - On the same Git tree (`0e3b7fd2c023d3935f7d4e0b5725751409062e62`), the open RTX 4070 Ti SUPER workspace build used `cargo build --offline --locked --workspace -j 2`. `cargo test --offline --locked --workspace -j 2 --no-fail-fast -- --test-threads=4` reported 1,265 passed, 0 failed and 46 ignored. The harness printed 27 additional runtime skip lines inside those totals: 21 unavailable Wave64 paths, three lowering refusals, two missing debug-layer paths and one missing heap-window path. **Regression run** The paired retail `xcl-smoke` blocks on main and the exact PR head are pending. The PR remains a draft. **Not tested** Paired retail smoke and matched GPU time, cold driver compilation, and scratch sizes for the three workloads Kalmarv requested. The 57.9% scratch reduction above concerns one unnamed translation record. [Aggregate-only review package](https://github.com/akimfomin/PortBridge/tree/main/research/xcl-compact-scratch-adoption) **AI use** OpenAI Codex (GPT-6 family; the exact serving variant was unavailable) assisted with rebasing, testing and drafting.
Stack PortBridge's compact allocator on Kalmarv's merged #2126 baseline. Preserve the earlier scratch layout whenever packing saves no space and retain same-stage ordering.

AI use: OpenAI Codex (GPT-6 family; exact serving variant was not exposed) assisted with rebasing, code review, synthetic regression checks and preparation of this fork branch for human review.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:27:26 +00:00
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 14:25 UTC · original

Independent Radeon and RTX 5090 check on b3f7ab5574c4489761141e2de0ce31d2eb216412.

Tested

  • Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742.
  • cargo test --locked -p xcl --lib gpu::dxil::module::split::tests -- --nocapture --test-threads=1 with XCL_ADAPTER=AMD Radeon and XCL_ADAPTER=NVIDIA GeForce RTX 5090 in separate processes. The runner printed each adapter. Each run gave 10 passed, 0 failed, 0 ignored and no skips.
  • The Wave32 fixture asserted the reused size of 256 dwords per group. The whole-versus-split GPU readbacks passed, including the case that preserves the payload across a reused edge slot.

Not tested

Retail records, compile or GPU timing, title smoke and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the checks, verified the logs and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-25 14:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7165250326) Independent Radeon and RTX 5090 check on `b3f7ab5574c4489761141e2de0ce31d2eb216412`. **Tested** - Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742. - `cargo test --locked -p xcl --lib gpu::dxil::module::split::tests -- --nocapture --test-threads=1` with `XCL_ADAPTER=AMD Radeon` and `XCL_ADAPTER=NVIDIA GeForce RTX 5090` in separate processes. The runner printed each adapter. Each run gave 10 passed, 0 failed, 0 ignored and no skips. - The Wave32 fixture asserted the reused size of 256 dwords per group. The whole-versus-split GPU readbacks passed, including the case that preserves the payload across a reused edge slot. **Not tested** Retail records, compile or GPU timing, title smoke and the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the checks, verified the logs and wrote this report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 14:48 UTC · original

Independent RX 6800M verification of exact PR head b3f7ab5574c4489761141e2de0ce31d2eb216412.

Environment: Windows 11 build 26200; Ryzen 9 5980HX; AMD Radeon RX 6800M driver 30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=wave64; isolated debug Cargo target.

cargo test --locked -p xcl --lib gpu::dxil::module::split::tests:: -- --test-threads=1 --show-output passed 10 passed, 0 failed, 0 ignored, with no SKIPPED line on the clean head. The suite includes the new slot-lifetime/compaction checks, whole-vs-split GPU readback for Wave32, a guest wave64 program split across hardware wave32 halves, oversized loops, persistent payloads across skipped stages, and divergent 3D forward edges. The suite logged CHAIN_GPU=AMD Radeon RX 6800M. The Wave32 compaction fixture asserted 256 scratch DWORDs per group and passed.

The guest-wave64 split fixture uses KernelOptions { wave64: true, split: true } and runs on wave32 hardware waves; this result is not a test of a native-wave64 dispatch chain. I did not run the full workspace suite, an owned-title smoke pair, the requested three matched GPU measurements, or a shader-pack size survey on this head. A separate title smoke attempt for another PR had just stopped under the available-commit memory guard, so I kept this check focused.

AI use: OpenAI Codex (GPT-6; exact variant unavailable in this session) ran the native Windows suite, checked the exact head and clean worktree, and drafted this report. No game data was used.

**@⁠luckyteagirl** on GitHub · 2026-11-25 14:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7165844270) Independent RX 6800M verification of exact PR head `b3f7ab5574c4489761141e2de0ce31d2eb216412`. **Environment:** Windows 11 build 26200; Ryzen 9 5980HX; AMD Radeon RX 6800M driver `30.0.13002.13003`; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=wave64`; isolated debug Cargo target. `cargo test --locked -p xcl --lib gpu::dxil::module::split::tests:: -- --test-threads=1 --show-output` passed **10 passed, 0 failed, 0 ignored**, with no `SKIPPED` line on the clean head. The suite includes the new slot-lifetime/compaction checks, whole-vs-split GPU readback for Wave32, a guest wave64 program split across hardware wave32 halves, oversized loops, persistent payloads across skipped stages, and divergent 3D forward edges. The suite logged `CHAIN_GPU=AMD Radeon RX 6800M`. The Wave32 compaction fixture asserted 256 scratch DWORDs per group and passed. The guest-wave64 split fixture uses `KernelOptions { wave64: true, split: true }` and runs on wave32 hardware waves; this result is **not** a test of a native-wave64 dispatch chain. I did not run the full workspace suite, an owned-title smoke pair, the requested three matched GPU measurements, or a shader-pack size survey on this head. A separate title smoke attempt for another PR had just stopped under the available-commit memory guard, so I kept this check focused. **AI use:** OpenAI Codex (GPT-6; exact variant unavailable in this session) ran the native Windows suite, checked the exact head and clean worktree, and drafted this report. No game data was used.
Author
Owner

@⁠anes66 on GitHub · 2026-11-25 14:58 UTC · original · edited 2026-11-25 15:21 UTC

CPU-only allocator and planner checks passed on exact head b3f7ab5574c4489761141e2de0ce31d2eb216412. Optional companion d039ce5, with parent 440b261, contains tests only: the independent partition/liveness fixture from main plus exhaustive allocator intervals and checks through Module::scratch_slots.

Tested

  • Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug, SDK DXC/DXIL 1.9.2602.17. No GPU device or title run.
  • 8,000 lifetime sets, each allocated in forward and reversed input order: all triples of one/two-word values with inclusive first/last stages in 0–3. Checks deterministic layouts, nonzero slots, bounds, no overlap while two values are live, no growth beyond the fixed layout and full reuse for mutually disjoint intervals.
  • 216 module plans / 1,242 crossing payloads across block-allocation permutations, loop costs and limits. Independent reachability and forward liveness checks cover SCC integrity and exact edge payloads. The actual scratch_slots result is checked against the definition stage and last carrying destination for every value; overlapping inclusive lifetimes cannot share words. A no-saving result must preserve the original fixed offsets.
  • Exact-name selection of payload_slot_intervals_never_overlap_while_both_values_are_live, dispatch_plan_matches_forward_liveness_and_independent_sccs, payload_slots_reopen_only_after_the_last_consumer, oversized_loop_occupies_one_piece_up_to_the_hard_ceiling, and dispatch_chain_wave32_reuses_scratch_before_gpu_run, using cargo test --locked -p xcl --lib -j 2 -- --exact <full names> --nocapture --test-threads=1: 5 passed / 0 failed / 0 ignored / 0 skips.
  • The last selected test takes the author's run_gpu=false path. It builds/validates synthetic pieces and checks the 256-DWORD group layout, then returns before GPU execution.
  • Negative control: changing the release condition from last < first to last <= first makes the interval test fail immediately with three simultaneously-live values assigned to slot 1. Restored before final passing runs and commit.

Not tested
GPU output or timing, the requested matched GPU measurements, real scratch-memory savings, full workspace, release or a title. The CPU checks do not replace those remaining adoption requirements.

Integration follow-up: footprint expectation

With #1906/#1972 optimizer changes in a local combined tree, the existing run_gpu=false fixture has 320 fixed / 288 compact DWORDs per group, with a peak-live-word lower bound of 288. It still saves a full wave plane, but the literal 256 assertion fails. On standalone b3f7ab5, the corresponding values remain 288 / 256, peak 256.

Optional test-only e17bf0b, directly on this head, derives the exact expected footprint from inclusive live intervals plus the continuation tag, requires attaining that lower bound, and separately requires a reduction from the fixed layout. It passes 1/0/0/0 standalone and in the combined snapshot. As a negative control, returning the fixed layout makes it fail at 288 versus the 256-DWORD lower bound; restored before the final passing run. No GPU execution or title run.

**@⁠anes66** on GitHub · 2026-11-25 14:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7166113514) · edited 2026-11-25 15:21 UTC CPU-only allocator and planner checks passed on exact head `b3f7ab5574c4489761141e2de0ce31d2eb216412`. Optional companion [d039ce5](https://github.com/anes66/xcl/commit/d039ce5d54c7d718cb0dfc10ec59521996a62751), with parent [440b261](https://github.com/anes66/xcl/commit/440b261), contains tests only: the independent partition/liveness fixture from main plus exhaustive allocator intervals and checks through `Module::scratch_slots`. **Tested** - Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug, SDK DXC/DXIL 1.9.2602.17. No GPU device or title run. - **8,000 lifetime sets**, each allocated in forward and reversed input order: all triples of one/two-word values with inclusive first/last stages in 0–3. Checks deterministic layouts, nonzero slots, bounds, no overlap while two values are live, no growth beyond the fixed layout and full reuse for mutually disjoint intervals. - **216 module plans / 1,242 crossing payloads** across block-allocation permutations, loop costs and limits. Independent reachability and forward liveness checks cover SCC integrity and exact edge payloads. The actual `scratch_slots` result is checked against the definition stage and last carrying destination for every value; overlapping inclusive lifetimes cannot share words. A no-saving result must preserve the original fixed offsets. - Exact-name selection of `payload_slot_intervals_never_overlap_while_both_values_are_live`, `dispatch_plan_matches_forward_liveness_and_independent_sccs`, `payload_slots_reopen_only_after_the_last_consumer`, `oversized_loop_occupies_one_piece_up_to_the_hard_ceiling`, and `dispatch_chain_wave32_reuses_scratch_before_gpu_run`, using `cargo test --locked -p xcl --lib -j 2 -- --exact <full names> --nocapture --test-threads=1`: **5 passed / 0 failed / 0 ignored / 0 skips**. - The last selected test takes the author's `run_gpu=false` path. It builds/validates synthetic pieces and checks the 256-DWORD group layout, then returns before GPU execution. - Negative control: changing the release condition from `last < first` to `last <= first` makes the interval test fail immediately with three simultaneously-live values assigned to slot 1. Restored before final passing runs and commit. **Not tested** GPU output or timing, the requested matched GPU measurements, real scratch-memory savings, full workspace, release or a title. The CPU checks do not replace those remaining adoption requirements. **Integration follow-up: footprint expectation** With #1906/#1972 optimizer changes in a local combined tree, the existing `run_gpu=false` fixture has **320 fixed / 288 compact DWORDs per group**, with a peak-live-word lower bound of **288**. It still saves a full wave plane, but the literal `256` assertion fails. On standalone `b3f7ab5`, the corresponding values remain **288 / 256**, peak **256**. Optional test-only [e17bf0b](https://github.com/anes66/xcl/commit/e17bf0b), directly on this head, derives the exact expected footprint from inclusive live intervals plus the continuation tag, requires attaining that lower bound, and separately requires a reduction from the fixed layout. It passes **1/0/0/0** standalone and in the [combined snapshot](https://github.com/anes66/xcl/commit/cf25b623bb55217149a7b0fa5cff9d2edac8a6a0). As a negative control, returning the fixed layout makes it fail at 288 versus the 256-DWORD lower bound; restored before the final passing run. No GPU execution or title run.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 15:26 UTC · original

Thanks to nnonno91, luckyteagirl, and anes66 for checking the exact head. The combined-tree result from anes66 is useful for integration: it still saves a full wave plane, while the literal 256-DWORD fixture assertion depends on the optimizer stack. I’m keeping the head pinned for the current comparisons.

@⁠Kalmarv, if your authorized setup is available and you want to run the comparison, the remaining measurements are scratch DWORDs per group and matched GPU timestamps for the full dispatch chains for ef008c0f (early and late inputs), c3ae6819, and fb1c6d2d. The PortBridge aggregate-only kit checks equal grids, piece counts, and matching outputs for main versus the exact candidate. Please keep workloads and raw inputs on your own machine.

The two standard paired xcl-smoke summary blocks and approval of the fork CI are separate review requirements. This remains a draft. OpenAI Codex assisted with verification and drafting.

**@⁠akimfomin** on GitHub · 2026-11-25 15:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7166835346) Thanks to nnonno91, luckyteagirl, and anes66 for checking the exact head. The combined-tree result from anes66 is useful for integration: it still saves a full wave plane, while the literal 256-DWORD fixture assertion depends on the optimizer stack. I’m keeping the head pinned for the current comparisons. @⁠Kalmarv, if your authorized setup is available and you want to run the comparison, the remaining measurements are scratch DWORDs per group and matched GPU timestamps for the full dispatch chains for `ef008c0f` (early and late inputs), `c3ae6819`, and `fb1c6d2d`. The [PortBridge aggregate-only kit](https://github.com/akimfomin/PortBridge/tree/main/research/xcl-compact-scratch-adoption) checks equal grids, piece counts, and matching outputs for main versus the exact candidate. Please keep workloads and raw inputs on your own machine. The two standard paired `xcl-smoke` summary blocks and approval of the fork CI are separate review requirements. This remains a draft. OpenAI Codex assisted with verification and drafting.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 15:29 UTC · original

@⁠akimfomin yes, I'll run it. It matters for us too: porting #2097 onto #2126's fixed slots made the seven cascade-shadow programs need 4.4–6× more scratch per group (6d1e4583: about 1.4 MB per 16×16 group), so slot reuse is exactly what those chains need.

Our GPU is busy with world-load stall runs for the next few hours, so it comes after those. Plan: your kit on main and on b3f7ab5 for ef008c0f (early and late inputs), c3ae6819 and fb1c6d2d, comparing scratch DWORDs per group, piece counts, matching outputs and timestamps per full chain. Plus a smoke pair. Workloads and raw inputs stay on this machine, and I'll post aggregates only.

AI use: Claude Code (Claude Opus 5.5).

**@⁠Kalmarv** on GitHub · 2026-11-25 15:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7166919956) @⁠akimfomin yes, I'll run it. It matters for us too: porting #2097 onto #2126's fixed slots made the seven cascade-shadow programs need 4.4–6× more scratch per group (6d1e4583: about 1.4 MB per 16×16 group), so slot reuse is exactly what those chains need. Our GPU is busy with world-load stall runs for the next few hours, so it comes after those. Plan: your kit on `main` and on `b3f7ab5` for `ef008c0f` (early and late inputs), `c3ae6819` and `fb1c6d2d`, comparing scratch DWORDs per group, piece counts, matching outputs and timestamps per full chain. Plus a smoke pair. Workloads and raw inputs stay on this machine, and I'll post aggregates only. AI use: Claude Code (Claude Opus 5.5).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 17:52 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 17:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7170132220) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 15:55 UTC · original · edited 2026-11-26 01:33 UTC

Thanks, Kalmarv. I checked the live revisions before you start. For the allocator-only pair, please use the exact parent afc5ee86ae3a9521c9f15d96505cd73fe72f2191 and this draft b3f7ab5574c4489761141e2de0ce31d2eb216412. Current main already changed the splitter and chain dispatch, so a current-main comparison would need the candidate on that same commit. The updated PortBridge kit records both actual build revisions. The aggregate-only plan you described is enough. (Codex-assisted revision check.)

After #2371, the original head conflicts in split.rs. For current-main integration I published a separate candidate on b49be18. The original pair above remains available for your ongoing measurements. On an RTX 4070 Ti SUPER, all 11 split tests passed in each of two fresh processes, with the production allocator and with the upstream offline first-fit comparator. The new four-stage regression uses four words per lane in the first layout and six in the second. The divergent GPU fixture had matching output in both modes. The three workload timings and paired title smoke are still pending. OpenAI Codex (GPT-6) assisted with the adaptation and verification.

**@⁠akimfomin** on GitHub · 2026-11-25 15:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7167441435) · edited 2026-11-26 01:33 UTC Thanks, Kalmarv. I checked the live revisions before you start. For the allocator-only pair, please use the exact parent `afc5ee86ae3a9521c9f15d96505cd73fe72f2191` and this draft `b3f7ab5574c4489761141e2de0ce31d2eb216412`. Current main already changed the splitter and chain dispatch, so a current-main comparison would need the candidate on that same commit. The [updated PortBridge kit](https://github.com/akimfomin/PortBridge/tree/64a3e569b6980268cd5fca05289edbb7f8877f9b/research/xcl-compact-scratch-adoption) records both actual build revisions. The aggregate-only plan you described is enough. (Codex-assisted revision check.) After #2371, the original head conflicts in `split.rs`. For current-main integration I published a [separate candidate on b49be18](https://github.com/akimfomin/xcl/commit/dfb580beccbc1fe4353544a5068245d502de9bfa). The original pair above remains available for your ongoing measurements. On an RTX 4070 Ti SUPER, all 11 split tests passed in each of two fresh processes, with the production allocator and with the upstream offline first-fit comparator. The new four-stage regression uses four words per lane in the first layout and six in the second. The divergent GPU fixture had matching output in both modes. The three workload timings and paired title smoke are still pending. OpenAI Codex (GPT-6) assisted with the adaptation and verification.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-26 02:25 UTC · original

Kalmarv, thank you for explaining what scratch pressure means for the seven cascade-shadow programs. ettehn’s footprint comparison, the exact-head runs from nnonno91 and luckyteagirl, anes66’s interval checks and DavidM1911’s 3060 Ti run are all preserved here.

I’m stepping back from regular development of PortBridge. The draft stays pinned for anyone continuing the measurement. The two exact comparison revisions and separate post-#2371 patch are ready to use. The open question is scratch per group and GPU time per full chain on the three agreed workloads with matching outputs. Results can come here whenever the setup is free. Only aggregates are needed. The paired smoke and review remain with XCL.

I’ll still read incoming notes when I can. Project handover. Codex helped prepare this note.

**@⁠akimfomin** on GitHub · 2026-11-26 02:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7180794395) Kalmarv, thank you for explaining what scratch pressure means for the seven cascade-shadow programs. ettehn’s footprint comparison, the exact-head runs from nnonno91 and luckyteagirl, anes66’s interval checks and DavidM1911’s 3060 Ti run are all preserved here. I’m stepping back from regular development of [PortBridge](https://github.com/akimfomin/PortBridge). The draft stays pinned for anyone continuing the measurement. The [two exact comparison revisions and separate post-#2371 patch](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2322) are ready to use. The open question is scratch per group and GPU time per full chain on the three agreed workloads with matching outputs. Results can come here whenever the setup is free. Only aggregates are needed. The paired smoke and review remain with XCL. I’ll still read incoming notes when I can. [Project handover](https://github.com/akimfomin/PortBridge/issues/91). Codex helped prepare this note.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 08:45 UTC · original

@⁠akimfomin thank you for the allocator, the kit and for pinning the exact pair. Here's the comparison you asked for, aggregates only, on afc5ee86ae3a9521c9f15d96505cd73fe72f2191 (baseline) against b3f7ab5574c4489761141e2de0ce31d2eb216412 (candidate). Each was a clean release build in its own target directory.

Setup: RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 26200, DXC 1.9.2609, unlocked clocks. For each workload: the same grid (64×1×1 groups) and seeded input for both builds, the whole program as the reference, 3 s warm-up, then 4 interleaved rounds of 20 timed runs per form. A timestamp brackets the full chain, internal barriers included. Everything ran twice, once with the baseline chain timed first in each round (ab) and once with the candidate first (ba). Your compare_merged.py at 64a3e569 returned exit 0 on both orders: output_check: pass, scratch_nonincrease_check: pass.

Workload Pieces Scratch DWORDs / group Output (words differing / checked) Chain GPU median, baseline → candidate (ab) (ba)
ef008c0f, early exit 10 / 10 42,368 → 20,896 (−50.7 %) 0 / 2048 both 38.24 → 38.11 µs (−0.3 %) 38.27 → 37.81 µs (−1.2 %)
ef008c0f, late shading 10 / 10 42,368 → 20,896 (−50.7 %) 0 / 2048 both 123.22 → 123.00 µs (−0.2 %) 124.77 → 122.52 µs (−1.8 %)
c3ae6819, representative 12 / 12 43,040 → 16,800 (−61.0 %) 0 / 2048 both 219.78 → 220.22 µs (+0.2 %) 221.44 → 219.54 µs (−0.9 %)
fb1c6d2d, representative 12 / 12 47,776 → 18,848 (−60.5 %) 0 / 2048 both 217.89 → 216.63 µs (−0.6 %) 217.51 → 215.35 µs (−1.0 %)

The candidate cuts scratch per group by 51 to 61 %, with the same piece counts and identical outputs. Its full-chain time is within −1.8 % to +0.2 % of the baseline on every input and order. The per-round spread (round medians) stays within about ±0.5 % of each median.

Regression run (scripts/smoke.ps1, 60 s each, the same retail title, XCL_DIRECT_DXIL=1, each side with its own fresh XCL cache starting from the same pipeline list, one after the other in one job; two other test jobs of ours ran beside both runs, and one of them ended 13 s before the candidate's run did):

xcl-smoke v1
commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1366 (PresentX 1366)
presents per 2 s (last 3): 53 51 42
device removals: 0
crashes: 0
peak commit: 18882 MB
xcl-smoke v1
commit: b3f7ab5574c4489761141e2de0ce31d2eb216412
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1364 (PresentX 1364)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15226 MB

Candidate against baseline: 1364 / 1366 frames (99.9 %), peak commit 15226 / 18882 MB (81 %), no crash or device removal. Both runs logged compute split: 11 programs split, 66 pieces built, 0 chained dispatches, so in 60 s the title builds chains but doesn't dispatch them, and this pair is a regression check only. This is our second pair. In the first one, the candidate showed 642 against 1328 frames (peak 15229 / 18370 MB, no crash). That run had the driver's cache warm for the baseline's pipelines but cold for the candidate's re-laid-out pieces. After one run of each, they are level as above.

Not tested: AMD or Intel; the three workloads on title inputs other than these seeds; chained dispatches in a title run (none in 60 s); the post-#2371 candidate on b49be18.

AI use: Claude Code (Claude Opus 5.5) ran the builds, timings, comparator and smoke pairs on our machine and wrote this. The kit's comparator was run unchanged as a separate tool.

**@⁠Kalmarv** on GitHub · 2026-11-26 08:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2322#issuecomment-7186987594) @⁠akimfomin thank you for the allocator, the kit and for pinning the exact pair. Here's the comparison you asked for, aggregates only, on `afc5ee86ae3a9521c9f15d96505cd73fe72f2191` (baseline) against `b3f7ab5574c4489761141e2de0ce31d2eb216412` (candidate). Each was a clean release build in its own target directory. **Setup:** RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 26200, DXC 1.9.2609, unlocked clocks. For each workload: the same grid (64×1×1 groups) and seeded input for both builds, the whole program as the reference, 3 s warm-up, then 4 interleaved rounds of 20 timed runs per form. A timestamp brackets the full chain, internal barriers included. Everything ran twice, once with the baseline chain timed first in each round (ab) and once with the candidate first (ba). Your `compare_merged.py` at `64a3e569` returned exit 0 on both orders: `output_check: pass`, `scratch_nonincrease_check: pass`. | Workload | Pieces | Scratch DWORDs / group | Output (words differing / checked) | Chain GPU median, baseline → candidate (ab) | (ba) | |---|---|---|---|---|---| | ef008c0f, early exit | 10 / 10 | 42,368 → 20,896 (−50.7 %) | 0 / 2048 both | 38.24 → 38.11 µs (−0.3 %) | 38.27 → 37.81 µs (−1.2 %) | | ef008c0f, late shading | 10 / 10 | 42,368 → 20,896 (−50.7 %) | 0 / 2048 both | 123.22 → 123.00 µs (−0.2 %) | 124.77 → 122.52 µs (−1.8 %) | | c3ae6819, representative | 12 / 12 | 43,040 → 16,800 (−61.0 %) | 0 / 2048 both | 219.78 → 220.22 µs (+0.2 %) | 221.44 → 219.54 µs (−0.9 %) | | fb1c6d2d, representative | 12 / 12 | 47,776 → 18,848 (−60.5 %) | 0 / 2048 both | 217.89 → 216.63 µs (−0.6 %) | 217.51 → 215.35 µs (−1.0 %) | The candidate cuts scratch per group by 51 to 61 %, with the same piece counts and identical outputs. Its full-chain time is within −1.8 % to +0.2 % of the baseline on every input and order. The per-round spread (round medians) stays within about ±0.5 % of each median. **Regression run** (`scripts/smoke.ps1`, 60 s each, the same retail title, `XCL_DIRECT_DXIL=1`, each side with its own fresh XCL cache starting from the same pipeline list, one after the other in one job; two other test jobs of ours ran beside both runs, and one of them ended 13 s before the candidate's run did): ``` xcl-smoke v1 commit: afc5ee86ae3a9521c9f15d96505cd73fe72f2191 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1366 (PresentX 1366) presents per 2 s (last 3): 53 51 42 device removals: 0 crashes: 0 peak commit: 18882 MB ``` ``` xcl-smoke v1 commit: b3f7ab5574c4489761141e2de0ce31d2eb216412 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1364 (PresentX 1364) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15226 MB ``` Candidate against baseline: 1364 / 1366 frames (99.9 %), peak commit 15226 / 18882 MB (81 %), no crash or device removal. Both runs logged `compute split: 11 programs split, 66 pieces built, 0 chained dispatches`, so in 60 s the title builds chains but doesn't dispatch them, and this pair is a regression check only. This is our second pair. In the first one, the candidate showed 642 against 1328 frames (peak 15229 / 18370 MB, no crash). That run had the driver's cache warm for the baseline's pipelines but cold for the candidate's re-laid-out pieces. After one run of each, they are level as above. **Not tested:** AMD or Intel; the three workloads on title inputs other than these seeds; chained dispatches in a title run (none in 60 s); the post-#2371 candidate on `b49be18`. AI use: Claude Code (Claude Opus 5.5) ran the builds, timings, comparator and smoke pairs on our machine and wrote this. The kit's comparator was run unchanged as a separate tool.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/dxil/module/split.rs
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.
git fetch -u origin '+refs/pull/2322/head:github-bot/gh-2322'
git switch 'github-bot/gh-2322'

Merge

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