Recompiler: use u128 dependency masks for reload invalidation #2761

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

@⁠amazedturnip on GitHub · 2026-11-26 10:27 UTC · original
amazedturnip:xcl/recompiler-reload-sgpr-dependency-masks-101316 → main · +89 −2 · 2 files · 1 commits · open

Precomputes one u128 dependency mask per tracked address in gpu/dxil/reload.rs so fixed-point availability and recording time use a single regs & mask != 0 test instead of a 128-wide per-register scan, with identical emitted reload decisions. New sibling test file pins bitmask agreement with the original reads() scan across base/offset/sentinel shapes and adversarial changes() masks; full 60s retail smoke and the AMD Radeon suite remain green.

Fixes #2747

What is in it

  • crates/xcl/src/gpu/dxil/reload.rs: precompute one u128 dependency mask per tracked address (dep_mask: base pair + offset register, including the SOFFSET=125 sentinel) and replace the 128-wide reads(k, r) scan inside the fixed-point step closure and at recording time with a single regs & m != 0 test. Analysis results, transfer order, memory clobbers and instruction effects are unchanged.
  • crates/xcl/src/gpu/dxil/reload_dep_mask_tests.rs (new sibling test file, declared next to the existing mod tests): dep_mask_agrees_with_reads_for_all_tracked_address_shapes checks per-register-bit agreement across base/offset-sentinel shapes, and mask_intersection_matches_per_register_scan checks the mask decision against the per-register scan for every tracked key against adversarial changes() masks (0, u128::MAX, isolated base/offset bits, sentinel bit, pair bits).

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=4 — 1311 passed, 1 failed, 27 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1)
  • Verification / negative control: new integration test suite — verified 3x deterministic; mask/scan agreement is checked on the sentinel and pair/base-high shapes explicitly, and the pre-change 128-wide scan is the baseline the tests assert agreement with

Regression run
main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: AMD Radeon(TM) Graphics
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1473 (PresentX 1473)
presents per 2 s (last 3): 60 44 0
device removals: 0
crashes: 0
peak commit: 13978 MB

PR:

xcl-smoke v1
commit: 7cbc6513999534d4479c3ad4801bd6f5991bd678
gpu: AMD Radeon(TM) Graphics
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1492 (PresentX 1492)
presents per 2 s (last 3): 60 4 0
device removals: 0
crashes: 0
peak commit: 13979 MB

Not tested

  • Absolute wall-clock speedup measurement on this Windows host (author's probe on Linux: 99.1ms -> 4.3ms at 16 addrs, 1469ms -> 12ms at 256 addrs); analyzer results verified identical
  • NVIDIA wave32 GPU (verified on AMD Radeon native wave64)
  • Long-horizon shader compile timing across a full title (smoke.ps1 pair handled by gates.py/publish.py)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
  • Claude Code (Claude Opus 5.5) updated the test counts under Tested to the run on the current head.
**@⁠amazedturnip** on GitHub · 2026-11-26 10:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761) `amazedturnip:xcl/recompiler-reload-sgpr-dependency-masks-101316` → `main` · +89 −2 · 2 files · 1 commits · open Precomputes one u128 dependency mask per tracked address in gpu/dxil/reload.rs so fixed-point availability and recording time use a single regs & mask != 0 test instead of a 128-wide per-register scan, with identical emitted reload decisions. New sibling test file pins bitmask agreement with the original reads() scan across base/offset/sentinel shapes and adversarial changes() masks; full 60s retail smoke and the AMD Radeon suite remain green. Fixes #2747 **What is in it** - `crates/xcl/src/gpu/dxil/reload.rs`: precompute one `u128` dependency mask per tracked address (`dep_mask`: base pair + offset register, including the SOFFSET=125 sentinel) and replace the 128-wide `reads(k, r)` scan inside the fixed-point `step` closure and at recording time with a single `regs & m != 0` test. Analysis results, transfer order, memory clobbers and instruction effects are unchanged. - `crates/xcl/src/gpu/dxil/reload_dep_mask_tests.rs` (new sibling test file, declared next to the existing `mod tests`): `dep_mask_agrees_with_reads_for_all_tracked_address_shapes` checks per-register-bit agreement across base/offset-sentinel shapes, and `mask_intersection_matches_per_register_scan` checks the mask decision against the per-register scan for every tracked key against adversarial `changes()` masks (0, u128::MAX, isolated base/offset bits, sentinel bit, pair bits). **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=4` — 1311 passed, 1 failed, 27 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1) - Verification / negative control: new integration test suite — verified 3x deterministic; mask/scan agreement is checked on the sentinel and pair/base-high shapes explicitly, and the pre-change 128-wide scan is the baseline the tests assert agreement with **Regression run** main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: AMD Radeon(TM) Graphics title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1473 (PresentX 1473) presents per 2 s (last 3): 60 44 0 device removals: 0 crashes: 0 peak commit: 13978 MB ``` PR: ``` xcl-smoke v1 commit: 7cbc6513999534d4479c3ad4801bd6f5991bd678 gpu: AMD Radeon(TM) Graphics title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1492 (PresentX 1492) presents per 2 s (last 3): 60 4 0 device removals: 0 crashes: 0 peak commit: 13979 MB ``` **Not tested** - Absolute wall-clock speedup measurement on this Windows host (author's probe on Linux: 99.1ms -> 4.3ms at 16 addrs, 1469ms -> 12ms at 256 addrs); analyzer results verified identical - NVIDIA wave32 GPU (verified on AMD Radeon native wave64) - Long-horizon shader compile timing across a full title (smoke.ps1 pair handled by gates.py/publish.py) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64). - Claude Code (Claude Opus 5.5) updated the test counts under **Tested** to the run on the current head.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:14:56 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-26 10:35 UTC · original

NVIDIA wave32 run (listed as untested) on an RTX 3060, plus an RX 9070 XT: both new tests pass, and nothing else changes in the direct-DXIL GPU suite.

Head fdbf8bf applied on main b49be18, debug, Windows 11 Pro 26200, XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4 on main and with the PR, card chosen with XCL_ADAPTER:

main this PR
RTX 3060 (Ampere, 32-lane waves only, 32.0.16.1088) 710 passed, 0 failed, 24 SKIPPED 712 passed, 0 failed, 24 SKIPPED
RX 9070 XT (RDNA4, 32.0.32029.2010) 708 passed, 2 failed, 6 SKIPPED 710 passed, 2 failed, 6 SKIPPED

On both cards, the only result changes against main are the new dep_mask_agrees_with_reads_for_all_tracked_address_shapes and mask_intersection_matches_per_register_scan, both ok, with no new skips. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on main.

Not tested: translation timings on Windows, Intel, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-26 10:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7189574537) NVIDIA wave32 run (listed as untested) on an RTX 3060, plus an RX 9070 XT: both new tests pass, and nothing else changes in the direct-DXIL GPU suite. Head `fdbf8bf` applied on `main` `b49be18`, debug, Windows 11 Pro 26200, `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4` on `main` and with the PR, card chosen with `XCL_ADAPTER`: | | `main` | this PR | |---|---|---| | RTX 3060 (Ampere, 32-lane waves only, 32.0.16.1088) | 710 passed, 0 failed, 24 SKIPPED | 712 passed, 0 failed, 24 SKIPPED | | RX 9070 XT (RDNA4, 32.0.32029.2010) | 708 passed, 2 failed, 6 SKIPPED | 710 passed, 2 failed, 6 SKIPPED | On both cards, the only result changes against `main` are the new `dep_mask_agrees_with_reads_for_all_tracked_address_shapes` and `mask_intersection_matches_per_register_scan`, both ok, with no new skips. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on `main`. Not tested: translation timings on Windows, Intel, a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠frenziedcoder on GitHub · 2026-11-26 10:44 UTC · original

Checked "identical emitted reload decisions" on a real shader pack: the direct DXIL of every program in the retail title of #505 is byte-for-byte the same with and without this PR.

xcl shaders <shaders.rpf> --direct --sample 0 --threads 12 --dump DIR, release builds of main b49be183 and of fdbf8bf (this PR on that base), Windows 11, RTX 5080 box (CPU-only translation), DXC 1.8.2502.11:

b49be183 fdbf8bf
programs translated 22,445 of 22,445 (CS 1636, GS 390, MS 8724, PS 9511, VS 2184) same
distinct .direct.dxil outputs 21,844 21,844
byte-identical to the other side 21,844 of 21,844 (none differ, none missing)
translation time per program, p50 / p95 11.93 / 75.16 ms 11.94 / 76.07 ms

So the mask form makes the same reload decisions as the per-register scan on this corpus. End-to-end translation time doesn't move measurably here; the fixed-point step isn't a visible share of whole-program translation on these shaders.

AI use: Claude Code (Claude Opus 5.5) built both trees, ran the dumps on my machine, compared them and wrote this comment. The dumps were deleted afterwards.

**@⁠frenziedcoder** on GitHub · 2026-11-26 10:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7189765469) **Checked "identical emitted reload decisions" on a real shader pack: the direct DXIL of every program in the retail title of #505 is byte-for-byte the same with and without this PR.** `xcl shaders <shaders.rpf> --direct --sample 0 --threads 12 --dump DIR`, release builds of `main` `b49be183` and of `fdbf8bf` (this PR on that base), Windows 11, RTX 5080 box (CPU-only translation), DXC 1.8.2502.11: | | `b49be183` | `fdbf8bf` | |---|---|---| | programs translated | 22,445 of 22,445 (CS 1636, GS 390, MS 8724, PS 9511, VS 2184) | same | | distinct `.direct.dxil` outputs | 21,844 | 21,844 | | byte-identical to the other side | | **21,844 of 21,844** (none differ, none missing) | | translation time per program, p50 / p95 | 11.93 / 75.16 ms | 11.94 / 76.07 ms | So the mask form makes the same reload decisions as the per-register scan on this corpus. End-to-end translation time doesn't move measurably here; the fixed-point step isn't a visible share of whole-program translation on these shaders. *AI use: Claude Code (Claude Opus 5.5) built both trees, ran the dumps on my machine, compared them and wrote this comment. The dumps were deleted afterwards.*
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-26 10:45 UTC · original

Independent AMD RDNA4 (native wave64) verification of exact PR head fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC 1.9.2602.17).

Tested

  • cargo build --workspace (debug): passed (0 errors).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1435 passed, 2 failed, 47 ignored (8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1 heap_window_out_of_memory_falls_back_to_the_switch_form no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record Windows Developer Mode off).
    • Both new tests passed:
      • gpu::dxil::reload::reload_dep_mask_tests::dep_mask_agrees_with_reads_for_all_tracked_address_shapes
      • gpu::dxil::reload::reload_dep_mask_tests::mask_intersection_matches_per_register_scan
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3) are pre-existing on unmodified main on this RX 9060 XT / driver 32.0.31044.16.
  • cargo build --release -p xcl + 60 s retail-title smoke test (scripts/smoke.ps1, offline):
xcl-smoke v1
commit: fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1591 (PresentX 1591)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18774 MB

(Compare against main b49be183 on this machine: 1603 frames, 18576 MB peak, 0 device removals, 0 crashes.)

Not tested

  • NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.
**@⁠emirduran707** on GitHub · 2026-11-26 10:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7189807260) Independent AMD RDNA4 (native wave64) verification of exact PR head `fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a` on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver `32.0.31044.16`, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC `1.9.2602.17`). **Tested** - `cargo build --workspace` (debug): passed (`0` errors). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `1435 passed, 2 failed, 47 ignored` (`8 SKIPPED`: 6 per-lane DXIL forms refused by host adapter/driver, 1 `heap_window_out_of_memory_falls_back_to_the_switch_form` no heap windows, 1 `pso_measurement_compiles_an_exact_synthetic_record` Windows Developer Mode off). - Both new tests passed: - `gpu::dxil::reload::reload_dep_mask_tests::dep_mask_agrees_with_reads_for_all_tracked_address_shapes` - `gpu::dxil::reload::reload_dep_mask_tests::mask_intersection_matches_per_register_scan` - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` and `fuzz_validate_and_gpu_3`) are pre-existing on unmodified `main` on this RX 9060 XT / driver `32.0.31044.16`. - `cargo build --release -p xcl` + 60 s retail-title smoke test (`scripts/smoke.ps1`, offline): ``` xcl-smoke v1 commit: fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1591 (PresentX 1591) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18774 MB ``` (Compare against `main` `b49be183` on this machine: `1603 frames, 18576 MB peak, 0 device removals, 0 crashes`.) **Not tested** - NVIDIA / Intel GPUs, Linux / Wine. **AI use** - Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 11:10 UTC · original

A synthetic case where reload analysis takes a large share of translation time shows where the masks help. The fixture uses 8,199 instructions, 4,097 blocks and 128 tracked addresses. I used the same test-only overlay on parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 and exact head fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a, with separate release builds and confirmed different test binary hashes.

Median of three timed samples after warm-up Parent PR head
Reload analysis 224.582 ms 3.595 ms
Whole ordinary DXIL translation 316.679 ms 95.435 ms

The large fixture and a second 11-load fixture both produced byte-identical reload-decision traces (36,448 and 137 bytes) and DXIL (99,608 and 3,420 bytes). The focused test was 1 passed, 0 failed, 0 ignored per revision. Both upstream mask tests passed on the head with zero failures or ignores. No capability skips.

Tested on an i5-13600K, Windows 11 25H2 26200.9974, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. The host has an RTX 4080 with driver 621.01. Translation ran on the CPU. XCL_DIRECT_COMPACT=0 XCL_DIRECT_SPLIT_INSTRUCTIONS=0 cargo test --release -p xcl --lib --locked -j 2 gpu::dxil::reload_comparison_tests::ordinary_reload_analysis_and_dxil_comparison -- --exact --test-threads=1 --nocapture.

These times describe the synthetic input with all 128 addresses in play. The retail pack results above show no measurable overall translation speedup on that corpus.

**@⁠CryingLaughing** on GitHub · 2026-11-26 11:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7190380069) A synthetic case where reload analysis takes a large share of translation time shows where the masks help. The fixture uses **8,199 instructions, 4,097 blocks and 128 tracked addresses**. I used the same test-only overlay on parent `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7` and exact head `fdbf8bf69a5f518f02b82f6d52ce96df56e57b7a`, with separate release builds and confirmed different test binary hashes. | Median of three timed samples after warm-up | Parent | PR head | | --- | ---: | ---: | | Reload analysis | 224.582 ms | 3.595 ms | | Whole ordinary DXIL translation | 316.679 ms | 95.435 ms | The large fixture and a second 11-load fixture both produced byte-identical reload-decision traces (36,448 and 137 bytes) and DXIL (99,608 and 3,420 bytes). The focused test was **1 passed, 0 failed, 0 ignored** per revision. Both upstream mask tests passed on the head with zero failures or ignores. No capability skips. **Tested** on an i5-13600K, Windows 11 25H2 26200.9974, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. The host has an RTX 4080 with driver 621.01. Translation ran on the CPU. `XCL_DIRECT_COMPACT=0 XCL_DIRECT_SPLIT_INSTRUCTIONS=0 cargo test --release -p xcl --lib --locked -j 2 gpu::dxil::reload_comparison_tests::ordinary_reload_analysis_and_dxil_comparison -- --exact --test-threads=1 --nocapture`. These times describe the synthetic input with all 128 addresses in play. The retail pack results above show no measurable overall translation speedup on that corpus.
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 11:12 UTC · original

I’m happy with the implementation at fdbf8bf for #2747. The mask is equivalent to the old scan for every key the analyzer accepts, including the SOFFSET=125 sentinel. Both analysis passes share the same transfer function, and slot numbering, memory clobbers, and instruction effects are preserved.

I ran the analyzer tests in a standalone Linux harness with rustc --edition=2024 --test and the gpu::reload:: filter. Baseline b49be183 passed 5 tests and fdbf8bf passed 7, with zero failures, ignores, or skips. The harness excluded the Windows DXIL emitter test. I did not run the workspace suite or retail smoke.

One test improvement would be to cover two load slots with distinct bases and a write that invalidates only one. All seven current analyzer tests passed when I deliberately reversed the mask vector in the harness. The two-slot fixture passed on the PR and failed with the reversed vector.

AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for review, the standalone harness, and this comment.

**@⁠KOLESNiii** on GitHub · 2026-11-26 11:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7190409997) I’m happy with the implementation at `fdbf8bf` for #2747. The mask is equivalent to the old scan for every key the analyzer accepts, including the `SOFFSET=125` sentinel. Both analysis passes share the same transfer function, and slot numbering, memory clobbers, and instruction effects are preserved. I ran the analyzer tests in a standalone Linux harness with `rustc --edition=2024 --test` and the `gpu::reload::` filter. Baseline `b49be183` passed 5 tests and `fdbf8bf` passed 7, with zero failures, ignores, or skips. The harness excluded the Windows DXIL emitter test. I did not run the workspace suite or retail smoke. One test improvement would be to cover two load slots with distinct bases and a write that invalidates only one. All seven current analyzer tests passed when I deliberately reversed the mask vector in the harness. The two-slot fixture passed on the PR and failed with the reversed vector. AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for review, the standalone harness, and this comment.
github-bot force-pushed github-bot/gh-2761 from fdbf8bf69a to 0cff1698dc 2026-11-26 11:35:14 +00:00 Compare
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-26 11:33 UTC · original

Thanks for the careful reports. Added the requested two-slot fixture (a_write_to_one_slot_base_invalidates_only_that_slot): two loads with distinct bases (s[4:5] vs s[20:21]), a write to the first base's low dword, and assertions that the first slot becomes unavailable while the second stays available (negative control: it fails with the mask deliberately reversed). Analyzer tests: 9 passed. Other review comments were passing test reports; no code changes needed for them.

**@⁠amazedturnip** on GitHub · 2026-11-26 11:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7190873903) Thanks for the careful reports. Added the requested two-slot fixture (`a_write_to_one_slot_base_invalidates_only_that_slot`): two loads with distinct bases (s[4:5] vs s[20:21]), a write to the first base's low dword, and assertions that the first slot becomes unavailable while the second stays available (negative control: it fails with the mask deliberately reversed). Analyzer tests: 9 passed. Other review comments were passing test reports; no code changes needed for them.
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 12:03 UTC · original

Re-review of head 0cff1698dc377edc3678550a5cbabb7881528d1f. The only change since fdbf8bf is the two-slot test I asked for, and it looks good to me.

  • a_write_to_one_slot_base_invalidates_only_that_slot is correct. The second load's base is s[20:21], neither load writes into the other's address registers, and the s_mov to s4 kills only the first slot.
  • Negative control: with the mask vector reversed (by_slot.iter().rev().map(dep_mask)), the new test fails and the other 8 still pass. So the gap I described is covered now.
  • The mask still matches the old scan exactly. key() limits the base register to 123 or less and the offset register to 124 or less, or the 125 sentinel. So no shift goes past bit 125, and dep_mask sets exactly the registers reads() checks.

One note on the description: Tested still shows the counts from before the push, run with --test-threads=2. CONTRIBUTING.md asks for a run with --test-threads=4.

Tested

  • NVIDIA GeForce RTX 2070 SUPER (wave32 only), Windows 11 Home 26300, stable-x86_64-pc-windows-msvc, DXC 1.9.2609
  • cargo test -p xcl --lib gpu::dxil::reload (debug) at 0cff1698: 9 passed, 0 failed, 0 ignored, 0 skipped
  • the same filter with the mask vector reversed: 8 passed, 1 failed (a_write_to_one_slot_base_invalidates_only_that_slot)
  • scripts/smoke.ps1 on a retail game, 60 s, release builds of main's b49be183 and this PR's head, both with no uncommitted changes, run on an otherwise idle machine:

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1401 (PresentX 1402)
presents per 2 s (last 3): 57 60 60
device removals: 0
crashes: 0
peak commit: 17718 MB

PR:

xcl-smoke v1
commit: 0cff1698dc377edc3678550a5cbabb7881528d1f
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1397 (PresentX 1397)
presents per 2 s (last 3): 33 42 59
device removals: 0
crashes: 0
peak commit: 17869 MB

The PR's run reached 99.7 % of main's frames and 100.9 % of its peak commit, with no device removals and no crashes.

Not tested

  • the full workspace suite on this revision
  • AMD / wave64
  • any speedup on the retail game: this was only a regression check

AI use

  • Claude Code (Claude Opus 5.5) did the review, ran the tests and the negative control, ran the smoke runs and wrote this comment. I checked each point.
**@⁠KOLESNiii** on GitHub · 2026-11-26 12:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7191517588) Re-review of head `0cff1698dc377edc3678550a5cbabb7881528d1f`. The only change since `fdbf8bf` is the two-slot test I asked for, and it looks good to me. - `a_write_to_one_slot_base_invalidates_only_that_slot` is correct. The second load's base is s[20:21], neither load writes into the other's address registers, and the `s_mov` to s4 kills only the first slot. - Negative control: with the mask vector reversed (`by_slot.iter().rev().map(dep_mask)`), the new test fails and the other 8 still pass. So the gap I described is covered now. - The mask still matches the old scan exactly. `key()` limits the base register to 123 or less and the offset register to 124 or less, or the 125 sentinel. So no shift goes past bit 125, and `dep_mask` sets exactly the registers `reads()` checks. One note on the description: **Tested** still shows the counts from before the push, run with `--test-threads=2`. CONTRIBUTING.md asks for a run with `--test-threads=4`. **Tested** - NVIDIA GeForce RTX 2070 SUPER (wave32 only), Windows 11 Home 26300, stable-x86_64-pc-windows-msvc, DXC 1.9.2609 - `cargo test -p xcl --lib gpu::dxil::reload` (debug) at `0cff1698`: 9 passed, 0 failed, 0 ignored, 0 skipped - the same filter with the mask vector reversed: 8 passed, 1 failed (`a_write_to_one_slot_base_invalidates_only_that_slot`) - `scripts/smoke.ps1` on a retail game, 60 s, release builds of `main`'s `b49be183` and this PR's head, both with no uncommitted changes, run on an otherwise idle machine: main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1401 (PresentX 1402) presents per 2 s (last 3): 57 60 60 device removals: 0 crashes: 0 peak commit: 17718 MB ``` PR: ``` xcl-smoke v1 commit: 0cff1698dc377edc3678550a5cbabb7881528d1f gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1397 (PresentX 1397) presents per 2 s (last 3): 33 42 59 device removals: 0 crashes: 0 peak commit: 17869 MB ``` The PR's run reached 99.7 % of main's frames and 100.9 % of its peak commit, with no device removals and no crashes. **Not tested** - the full workspace suite on this revision - AMD / wave64 - any speedup on the retail game: this was only a regression check **AI use** - Claude Code (Claude Opus 5.5) did the review, ran the tests and the negative control, ran the smoke runs and wrote this comment. I checked each point.
github-bot force-pushed github-bot/gh-2761 from 0cff1698dc to 7cbc651399 2026-11-26 12:25:57 +00:00 Compare
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-26 12:22 UTC · original

Addressed the description note: Tested now shows cargo test --workspace -- --test-threads=4 (1311 passed, 1 failed, 27 ignored), run on head 0cff1698 on the AMD Radeon iGPU with the pre-existing gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 failure excluded. The reload-slice tests at --test-threads=4 are 9 passed, 0 failed. No code changes were needed; all other comments were passing reports.

**@⁠amazedturnip** on GitHub · 2026-11-26 12:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7191913435) Addressed the description note: **Tested** now shows `cargo test --workspace -- --test-threads=4` (1311 passed, 1 failed, 27 ignored), run on head 0cff1698 on the AMD Radeon iGPU with the pre-existing gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 failure excluded. The reload-slice tests at --test-threads=4 are 9 passed, 0 failed. No code changes were needed; all other comments were passing reports.
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-26 12:32 UTC · original

Correction to the reply above: the head did change, to 7cbc6513, but only because the same commit was signed again. git diff 0cff1698 7cbc6513 is empty (same tree), so the re-review of 0cff1698 covers it. The counts under Tested come from cargo test --workspace -- --test-threads=4 on 0cff1698; the PR block under Regression run is from 7cbc6513. No further pushes are planned for this PR unless a review asks for one.

AI use: Claude Code (Claude Opus 5.5) compared the two heads and wrote this note.

**@⁠amazedturnip** on GitHub · 2026-11-26 12:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2761#issuecomment-7192126653) Correction to the reply above: the head did change, to `7cbc6513`, but only because the same commit was signed again. `git diff 0cff1698 7cbc6513` is empty (same tree), so the re-review of `0cff1698` covers it. The counts under **Tested** come from `cargo test --workspace -- --test-threads=4` on `0cff1698`; the PR block under **Regression run** is from `7cbc6513`. No further pushes are planned for this PR unless a review asks for one. **AI use**: Claude Code (Claude Opus 5.5) compared the two heads and wrote this note.
This pull request can be merged automatically.
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/2761/head:github-bot/gh-2761'
git switch 'github-bot/gh-2761'

Merge

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