Tests: the high-coordinate table check takes 2 s instead of 14 #1821

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

@⁠marquezinii on GitHub · 2026-11-24 21:20 UTC · original
marquezinii:tests/tiling-period-check → main · +19 −11 · 1 files · 1 commits · open

high_coordinate_tables_keep_their_offsets_at_one_period (gpu/tiling.rs) was the slowest unit test by far: 13.5–14.3 s here, next one 4 s. With --test-threads=4 the lib's run waited on it alone. Now it takes 2 s and checks the same things.

  • The reference table (one offset per 16-bit coordinate) is built from the offsets of the single coordinate bits. Each offset bit is the parity of a pattern mask and the coordinate, so it is linear in the coordinate, and the offset of c is the XOR of the offsets of its bits. The single-bit offsets still use the direct formula. Production's from_bits keeps the direct formula for every entry, so the reference is no longer the same code as what it checks.
  • Each table is compared over one period of the reference (0..want.len()) instead of 2^18 / 3 coordinates. Both lengths are powers of two and the table's divides the reference's, so t[c % t.len()] == want[c % want.len()] for one period means it for every c. The old loop reached those same residues, several times each. The two large coordinates stay.

How I checked that it still catches what it should: halving the table length in Layout::from_bits (table((1 << (32 - used.leading_zeros())) / 2, …)) fails the test, as it does on main.

What is in it

  • crates/xcl/src/gpu/tiling.rs: the test above only.

Tested

  • NVIDIA GeForce RTX 5070 12 GB, driver 621.40; Ryzen 5 5600X; Windows 11 Pro 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug.
  • The test alone: 13.55 s on main e9e94ce, 2.08 s on this head.
  • cargo test -p xcl --lib -- --test-threads=4, two runs each: 22.7 / 25.4 s on main, 14.7 / 15.0 s on this head (843 passed, 0 failed, 22 ignored).
  • cargo test --workspace -- --test-threads=4: 892 passed, 0 failed, 42 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache).

Regression run
Run by @⁠Toons29 on an AMD Radeon RX 9070, 60 s each, XCL_NETWORK=0, release, copied from their comment as posted. The diff itself is test-only, inside mod tests of tiling.rs. pr_check.py still fails on these two: their title: lines differ (game.exe and 34df7c50), so a main run that prints the same title line, or the test-only label, would settle it.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: fd62adeb24c164b96176723fc37b7354a2d8093a
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14816 MB

Not tested

  • Other CPUs: the ratio should hold, the absolute times won't.

AI use

  • Claude Code (Claude Opus 5.5): found the slow test from per-test timings, wrote the change and this description, and ran the tests and the mutation check on the hardware above.
**@⁠marquezinii** on GitHub · 2026-11-24 21:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821) `marquezinii:tests/tiling-period-check` → `main` · +19 −11 · 1 files · 1 commits · open `high_coordinate_tables_keep_their_offsets_at_one_period` (`gpu/tiling.rs`) was the slowest unit test by far: 13.5–14.3 s here, next one 4 s. With `--test-threads=4` the lib's run waited on it alone. Now it takes 2 s and checks the same things. - The reference table (one offset per 16-bit coordinate) is built from the offsets of the single coordinate bits. Each offset bit is the parity of a pattern mask and the coordinate, so it is linear in the coordinate, and the offset of `c` is the XOR of the offsets of its bits. The single-bit offsets still use the direct formula. Production's `from_bits` keeps the direct formula for every entry, so the reference is no longer the same code as what it checks. - Each table is compared over one period of the reference (`0..want.len()`) instead of 2^18 / 3 coordinates. Both lengths are powers of two and the table's divides the reference's, so `t[c % t.len()] == want[c % want.len()]` for one period means it for every `c`. The old loop reached those same residues, several times each. The two large coordinates stay. How I checked that it still catches what it should: halving the table length in `Layout::from_bits` (`table((1 << (32 - used.leading_zeros())) / 2, …)`) fails the test, as it does on `main`. **What is in it** - `crates/xcl/src/gpu/tiling.rs`: the test above only. **Tested** - NVIDIA GeForce RTX 5070 12 GB, driver 621.40; Ryzen 5 5600X; Windows 11 Pro 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug. - The test alone: 13.55 s on `main` `e9e94ce`, 2.08 s on this head. - `cargo test -p xcl --lib -- --test-threads=4`, two runs each: 22.7 / 25.4 s on `main`, 14.7 / 15.0 s on this head (843 passed, 0 failed, 22 ignored). - `cargo test --workspace -- --test-threads=4`: 892 passed, 0 failed, 42 ignored. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache). **Regression run** Run by @⁠Toons29 on an AMD Radeon RX 9070, 60 s each, `XCL_NETWORK=0`, release, copied from [their comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1821) as posted. The diff itself is test-only, inside `mod tests` of `tiling.rs`. `pr_check.py` still fails on these two: their `title:` lines differ (`game.exe` and `34df7c50`), so a `main` run that prints the same title line, or the `test-only` label, would settle it. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: fd62adeb24c164b96176723fc37b7354a2d8093a gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1632 (PresentX 1632) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14816 MB ``` **Not tested** - Other CPUs: the ratio should hold, the absolute times won't. **AI use** - Claude Code (Claude Opus 5.5): found the slow test from per-test timings, wrote the change and this description, and ran the tests and the mutation check on the hardware above.
high_coordinate_tables_keep_their_offsets_at_one_period was the slowest
unit test by far (13.5-14.3 s on a Ryzen 5 5600X, debug), so with four
test threads the lib's run waited on it alone. Its reference table is
now built from the offsets of the single coordinate bits (each offset
bit is the parity of a mask and the coordinate, so it is linear in the
coordinate), and each table is compared over one period of the
reference instead of 2^18 / 3 coordinates: both lengths are powers of
two, so one period covers every coordinate the old loop reached.

The checks are the same; halving the table length in Layout::from_bits
still fails the test.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:21 +00:00
Author
Owner

@⁠Toons29 on GitHub · 2026-11-24 21:43 UTC · original

Regression run of fd62adeb on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: fd62adeb24c164b96176723fc37b7354a2d8093a
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14816 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-24 21:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821#issuecomment-7145306152) Regression run of `fd62adeb` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: fd62adeb24c164b96176723fc37b7354a2d8093a gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1632 (PresentX 1632) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14816 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 21:54 UTC · original

@⁠Toons29 thank you for running these. I've copied both blocks into Regression run as you posted them, with credit.

One catch: pr_check.py compares the title: lines, and they differ here: game.exe on main, 34df7c50 on this head. So the check still says the runs are not of the same title. The run itself looks fine (101 % of the frames, same peak commit). It's only how smoke.ps1 named the title in each run, probably from the folder or exe path it was given. If you can rerun main the way you ran the PR, so it prints title: 34df7c50, I'll swap that block in. Otherwise the test-only label settles it, since the diff is only in mod tests.

AI use: Claude Code (Claude Opus 5.5) drafted this reply.

**@⁠marquezinii** on GitHub · 2026-11-24 21:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821#issuecomment-7145553653) @⁠Toons29 thank you for running these. I've copied both blocks into **Regression run** as you posted them, with credit. One catch: `pr_check.py` compares the `title:` lines, and they differ here: `game.exe` on `main`, `34df7c50` on this head. So the check still says the runs are not of the same title. The run itself looks fine (101 % of the frames, same peak commit). It's only how `smoke.ps1` named the title in each run, probably from the folder or exe path it was given. If you can rerun `main` the way you ran the PR, so it prints `title: 34df7c50`, I'll swap that block in. Otherwise the `test-only` label settles it, since the diff is only in `mod tests`. **AI use:** Claude Code (Claude Opus 5.5) drafted this reply.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 22:37 UTC · original · edited 2026-11-24 22:54 UTC

Full-suite run, since this PR has no test report yet. Tested exact head fd62ade (on its base e9e94ce).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 891 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 892 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • On NVIDIA, --skip leaves out five tests where this PR's base has them. They fail on main 689f2db too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. These are heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (follow-up on #1651). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 22:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821#issuecomment-7146460428) · edited 2026-11-24 22:54 UTC Full-suite run, since this PR has no test report yet. Tested exact head `fd62ade` (on its base `e9e94ce`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu`: **891 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - No new `#[test]` functions in the diff. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **892 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - On NVIDIA, `--skip` leaves out five tests where this PR's base has them. They fail on main `689f2db` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. These are `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 00:39 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 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 00:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821#issuecomment-7148742479) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

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

XCL PR #1821 verification

Clean detached head fd62adeb24 on STOR-WINLAB. Windows 11 Enterprise Evaluation x64 (build 26200), Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175, WDDM 3.2), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized Cargo profiles with debug info and incremental compilation disabled. The diff changes one unit test in crates/xcl/src/gpu/tiling.rs.

Tested

  • cargo build --workspace passed in 29.03 s. cargo test --workspace --no-run passed in 50.26 s and built 19 test executables. Both ran outside the GPU mutex.
  • cargo test -p xcl --lib gpu::tiling::tests::high_coordinate_tables_keep_their_offsets_at_one_period -- --exact --test-threads=1 ran outside the mutex with XCL_ADAPTER=NONE_CPU_ONLY. It passed (1 passed, 0 failed, 0 ignored, 0 skipped, 864 filtered out). Cargo wall time was 6.59 s and the Rust harness measured 2.55 s. The test checks 2D and 3D X/Y/Z high-coordinate offset tables against a mask-parity reference over one complete reference period and at u32::MAX and 2^40 + 5. It also checks table length bounds.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Cargo exited 101 in 39.46 s (194.61 s including lock wait). The changed test passed again.

Workspace failures and skips

  • All 20 test result lines (19 executables plus doc-tests) sum to 874 passed, 18 failed, and 42 ignored. The library had 13 compute pipeline creation errors (0x80070057) and four assertion failures involving FMA, mip sampling, VALU and wave reductions. The e2e title failed the RSSetDepthBiasX dynamic depth-bias check.
  • Seven lines in pr1821-suite.log begin with SKIPPED. They report two wave64 skips, one tiled-tier skip, one driver-cache skip, one heap-window skip and two D3D12 debug-layer skips. The harness totals include these early returns. They provide no test coverage.

Not tested

Matched main run or baseline timing, retail-title smoke, AMD and NVIDIA GPUs. The AWC, RPF and TTPF sample inputs were unset.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1821-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1821#issuecomment-7152666113) ## XCL PR #1821 verification Clean detached head **fd62adeb24c164b96176723fc37b7354a2d8093a** on STOR-WINLAB. Windows 11 Enterprise Evaluation x64 (build 26200), Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175, WDDM 3.2), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized Cargo profiles with debug info and incremental compilation disabled. The diff changes one unit test in crates/xcl/src/gpu/tiling.rs. **Tested** - `cargo build --workspace` passed in 29.03 s. `cargo test --workspace --no-run` passed in 50.26 s and built 19 test executables. Both ran outside the GPU mutex. - `cargo test -p xcl --lib gpu::tiling::tests::high_coordinate_tables_keep_their_offsets_at_one_period -- --exact --test-threads=1` ran outside the mutex with XCL_ADAPTER=NONE_CPU_ONLY. It passed (1 passed, 0 failed, 0 ignored, 0 skipped, 864 filtered out). Cargo wall time was 6.59 s and the Rust harness measured 2.55 s. The test checks 2D and 3D X/Y/Z high-coordinate offset tables against a mask-parity reference over one complete reference period and at u32::MAX and 2^40 + 5. It also checks table length bounds. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Cargo exited 101 in 39.46 s (194.61 s including lock wait). The changed test passed again. **Workspace failures and skips** - All 20 test result lines (19 executables plus doc-tests) sum to 874 passed, 18 failed, and 42 ignored. The library had 13 compute pipeline creation errors (0x80070057) and four assertion failures involving FMA, mip sampling, VALU and wave reductions. The e2e title failed the RSSetDepthBiasX dynamic depth-bias check. - Seven lines in pr1821-suite.log begin with SKIPPED. They report two wave64 skips, one tiled-tier skip, one driver-cache skip, one heap-window skip and two D3D12 debug-layer skips. The harness totals include these early returns. They provide no test coverage. **Not tested** Matched main run or baseline timing, retail-title smoke, AMD and NVIDIA GPUs. The AWC, RPF and TTPF sample inputs were unset. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1821-suite.log` and published.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1821/head:github-bot/gh-1821'
git switch 'github-bot/gh-1821'

Merge

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