Memory: fix Arena::take alignment/overflow and Uma::free pool validation #1437

Open
b3IKK wants to merge 1 commit from upstream-pr/1447 into main
b3IKK commented 2026-11-24 16:10:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T16:10:00Z.


Fixes three bugs in crates/xcl/src/gpu/uma.rs:

  • Arena::take returned GRAIN-aligned blocks even when align > GRAIN (violating the requested alignment), and computed align.next_power_of_two(), self.at + align - 1, and at + n without overflow checks (panicking in debug or wrapping past self.end in release).
  • Uma::free pushed any address inside [pool.0, pool.1) onto the pool free list without verifying ARENA_BLOCK alignment or checking for duplicate frees, allowing interior pointers or double-frees to corrupt or alias subsequent arena allocations.
  • Uma::reserve_pool overwrote self.pool if called a second time, leaking the prior pool's reservation in inner.used.

This routes align > GRAIN through u.alloc(n, align) and uses checked arithmetic in Arena::take, validates block alignment and non-duplication in Uma::free, and makes reserve_pool a no-op once a pool is already reserved.

What is in it

  • crates/xcl/src/gpu/uma.rs: fix Arena::take alignment and overflow checks, validate pool frees in Uma::free, guard repeated reserve_pool, and add unit tests arena_take_enforces_large_alignment_and_checks_overflow and pool_free_rejects_interior_and_duplicate_pointers (both verified failing before the fix).

Since the last push: rebased onto main 06c9f55. The conflict was the test module, where main had added runtime_layout_supports_eight_and_sixteen_heap_windows, expanded_heap_window_shaders_translate_and_validate and expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows at the same place; all are kept. The first push of the rebase had a missing brace in the merged test module (test builds only, so the release smoke still ran); f3d3344 fixes it, with the same non-test code.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1267 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib gpu::uma::tests: 9 passed, 0 failed (both new tests failed before the fix)

Regression run

main (426a5a7, clean tree, no local changes):

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15158 MB

PR (f3d3344, clean tree, no local changes):

xcl-smoke v1
commit: f3d3344728450ff48bdfc0dc78d097a4e7d08382
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1635 (PresentX 1636)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16158 MB

(The main block is 426a5a7, an ancestor of the current main, from the same machine and data folder.)

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: rebased onto main 06c9f55, resolved the conflicts, ran the suite and the scripts/smoke.ps1 pair at the head above.
<!-- greyfinch-sync:ivall/xcl:issue:5475873224 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T16:10:00Z. --- Fixes three bugs in `crates/xcl/src/gpu/uma.rs`: - `Arena::take` returned `GRAIN`-aligned blocks even when `align > GRAIN` (violating the requested alignment), and computed `align.next_power_of_two()`, `self.at + align - 1`, and `at + n` without overflow checks (panicking in debug or wrapping past `self.end` in release). - `Uma::free` pushed any address inside `[pool.0, pool.1)` onto the pool free list without verifying `ARENA_BLOCK` alignment or checking for duplicate frees, allowing interior pointers or double-frees to corrupt or alias subsequent arena allocations. - `Uma::reserve_pool` overwrote `self.pool` if called a second time, leaking the prior pool's reservation in `inner.used`. This routes `align > GRAIN` through `u.alloc(n, align)` and uses checked arithmetic in `Arena::take`, validates block alignment and non-duplication in `Uma::free`, and makes `reserve_pool` a no-op once a pool is already reserved. **What is in it** - `crates/xcl/src/gpu/uma.rs`: fix `Arena::take` alignment and overflow checks, validate pool frees in `Uma::free`, guard repeated `reserve_pool`, and add unit tests `arena_take_enforces_large_alignment_and_checks_overflow` and `pool_free_rejects_interior_and_duplicate_pointers` (both verified failing before the fix). **Since the last push**: rebased onto `main` `06c9f55`. The conflict was the test module, where `main` had added `runtime_layout_supports_eight_and_sixteen_heap_windows`, `expanded_heap_window_shaders_translate_and_validate` and `expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows` at the same place; all are kept. The first push of the rebase had a missing brace in the merged test module (test builds only, so the release smoke still ran); `f3d3344` fixes it, with the same non-test code. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): **1267 passed, 0 failed, 46 ignored** (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib gpu::uma::tests`: 9 passed, 0 failed (both new tests failed before the fix) **Regression run** main (`426a5a7`, clean tree, no local changes): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15158 MB ``` PR (`f3d3344`, clean tree, no local changes): ``` xcl-smoke v1 commit: f3d3344728450ff48bdfc0dc78d097a4e7d08382 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1635 (PresentX 1636) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16158 MB ``` (The main block is `426a5a7`, an ancestor of the current `main`, from the same machine and data folder.) **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: rebased onto `main` `06c9f55`, resolved the conflicts, ran the suite and the `scripts/smoke.ps1` pair at the head above.
futurepro62 commented 2026-11-24 17:06:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T16:54:51Z.


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

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, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 772 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: arena_take_enforces_large_alignment_and_checks_overflow, pool_free_rejects_interior_and_duplicate_pointers.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 772 passed, 0 failed, 41 ignored, no skips.

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.
<!-- greyfinch-sync:ivall/xcl:comment:7138401435 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7138401435). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T16:54:51Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `f7b6286` (on its base `b7aa9f3`). **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, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **772 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `arena_take_enforces_large_alignment_and_checks_overflow`, `pool_free_rejects_interior_and_duplicate_pointers`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **772 passed, 0 failed, 41 ignored**, no skips. **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.
DavidM1911 commented 2026-11-24 19:07:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:43Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7141278340 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7141278340). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:52:43Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
DavidM1911 commented 2026-11-26 06:06:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:27:30Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7183502445 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7183502445). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:27:30Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Decodere commented 2026-11-27 15:37:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T15:37:51Z.


Independent desktop NVIDIA verification of PR #1447 at head f3d3344728450ff48bdfc0dc78d097a4e7d08382 (1 commit; exact parent & merge-base: 06c9f5505f63f10c5ec49ef932d75b2c28177324, 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 (f3d33447)

Command Result
cargo test --release -p xcl --lib -- --nocapture arena_take_enforces_large_alignment_and_checks_overflow pool_free_rejects_interior_and_duplicate_pointers (3 consecutive runs) 2 passed; 0 failed; 0 ignored; 1222 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped)
cargo test --release -p xcl --lib -- --nocapture gpu::uma:: (3 consecutive runs) 14 passed; 0 failed; 0 ignored; 1210 filtered out × 3 (0.01s, 0.01s, 0.01s, 0 skipped; live DXC 1.9.2609.5 validated expanded_heap_window_shaders_translate_and_validate)
cargo build --release -p xcl Clean build (1m 32s, exit 0, 0 new warnings in gpu/uma.rs)

Paired quiet 60 s retail smoke (title: 29640639)

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

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14452 MB

PR #1447 (f3d3344728450ff48bdfc0dc78d097a4e7d08382):

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

Limits of coverage

  • arena_take_enforces_large_alignment_and_checks_overflow, pool_free_rejects_interior_and_duplicate_pointers, and the full gpu::uma:: suite (14/14, 0 skipped) passed 3/3, directly verifying align > GRAIN handling and checked overflow arithmetic in Arena::take, idempotent Uma::reserve_pool, and interior/duplicate pool-pointer rejection in Uma::free.
  • The 60 s retail smoke confirms live UMA allocation and runtime stability on desktop RTX 4060 (0 device removals, 0 crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance.

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

<!-- greyfinch-sync:ivall/xcl:comment:7222291801 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7222291801). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T15:37:51Z. --- Independent desktop NVIDIA verification of **PR #1447** at head `f3d3344728450ff48bdfc0dc78d097a4e7d08382` (`1` commit; exact parent & merge-base: `06c9f5505f63f10c5ec49ef932d75b2c28177324`, 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 (`f3d33447`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture arena_take_enforces_large_alignment_and_checks_overflow pool_free_rejects_interior_and_duplicate_pointers` (3 consecutive runs) | `2 passed; 0 failed; 0 ignored; 1222 filtered out` × 3 (`0.00s`, `0.00s`, `0.00s`, `0` skipped) | | `cargo test --release -p xcl --lib -- --nocapture gpu::uma::` (3 consecutive runs) | `14 passed; 0 failed; 0 ignored; 1210 filtered out` × 3 (`0.01s`, `0.01s`, `0.01s`, `0` skipped; live `DXC 1.9.2609.5` validated `expanded_heap_window_shaders_translate_and_validate`) | | `cargo build --release -p xcl` | Clean build (`1m 32s`, exit `0`, `0` new warnings in `gpu/uma.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`06c9f5505f63f10c5ec49ef932d75b2c28177324`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14452 MB ``` PR #1447 (`f3d3344728450ff48bdfc0dc78d097a4e7d08382`): ``` xcl-smoke v1 commit: f3d3344728450ff48bdfc0dc78d097a4e7d08382 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1527 (PresentX 1527) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14463 MB ``` ### Limits of coverage - `arena_take_enforces_large_alignment_and_checks_overflow`, `pool_free_rejects_interior_and_duplicate_pointers`, and the full `gpu::uma::` suite (`14/14`, `0` skipped) passed `3/3`, directly verifying `align > GRAIN` handling and checked overflow arithmetic in `Arena::take`, idempotent `Uma::reserve_pool`, and interior/duplicate pool-pointer rejection in `Uma::free`. - The 60 s retail smoke confirms live UMA allocation and runtime stability on desktop RTX 4060 (`0` device removals, `0` crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
ClosetPie107 commented 2026-11-27 16:12:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T16:12:34Z.


Tested on AMD / Linux: f3d33447 (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental experimental-11.0-20261112 with vkd3d-proton master ec207194 plus a local patch dropping the lpVtbl checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, x86_64-pc-windows-gnu debug build, tests run under Wine)

The head as it is (not merged onto current main), with its base 06c9f550 as the baseline.

Tests (XCL_REQUIRE_GPU=wave64)

  • cargo test -p xcl --lib -- gpu::uma:: --test-threads=1: 14 passed, 0 failed, 0 ignored (includes arena_take_enforces_large_alignment_and_checks_overflow and pool_free_rejects_interior_and_duplicate_pointers).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (here the first loses the RADV device, the other two run out of memory under Wine): lib 1181 passed, 17 failed, 26 ignored; base 06c9f550 (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the base's plus one, gpu_geometry_wave32_prefix_count_over_a_mask, which is flaky here: run alone 3 times on each tree it failed once on this head and once on the base. The other binaries fail the same 3 tests as on the base (e2e, pls_quota, predication_e2e).
  • d3d12_resource_and_sync: its fence and queue test ended the process here, as it does on the base and most other trees in this setup.

Not tested

  • Native Windows, NVIDIA / Intel
  • A retail title

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7222986488 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7222986488). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T16:12:34Z. --- **Tested on AMD / Linux: `f3d33447`** (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental `experimental-11.0-20261112` with vkd3d-proton master `ec207194` plus a local patch dropping the `lpVtbl` checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, `x86_64-pc-windows-gnu` debug build, tests run under Wine) The head as it is (not merged onto current `main`), with its base `06c9f550` as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`) - `cargo test -p xcl --lib -- gpu::uma:: --test-threads=1`: **14 passed, 0 failed**, 0 ignored (includes `arena_take_enforces_large_alignment_and_checks_overflow` and `pool_free_rejects_interior_and_duplicate_pointers`). - `cargo test --workspace --no-fail-fast -- --test-threads=4` with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (here the first loses the RADV device, the other two run out of memory under Wine): lib 1181 passed, 17 failed, 26 ignored; base `06c9f550` (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the base's plus one, `gpu_geometry_wave32_prefix_count_over_a_mask`, which is flaky here: run alone 3 times on each tree it failed once on this head and once on the base. The other binaries fail the same 3 tests as on the base (`e2e`, `pls_quota`, `predication_e2e`). - `d3d12_resource_and_sync`: its fence and queue test ended the process here, as it does on the base and most other trees in this setup. **Not tested** - Native Windows, NVIDIA / Intel - A retail title **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
throny commented 2026-11-27 23:28:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:28:17Z.


merge-check claim
head: f3d3344728

<!-- greyfinch-sync:ivall/xcl:comment:7230166000 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7230166000). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:28:17Z. --- merge-check claim head: f3d3344728450ff48bdfc0dc78d097a4e7d08382
throny commented 2026-11-27 23:41:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:41:23Z.


merge-check
base: 2c717a04
head: f3d3344728
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines)
review: none. reserve_pool takes the pool lock and then the inner lock, and nothing on main takes them the other way round; the new contains check scans at most 256 entries; an alignment above the grain gets its own allocation that honours it. Both new tests fail on main by reading the code (interior and duplicate frees are accepted there; the alignment is not honoured).
performance: a 256-entry scan when a pool block is freed; nothing per draw (reasoned).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7230332959 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7230332959). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:41:23Z. --- merge-check base: 2c717a04 head: f3d3344728450ff48bdfc0dc78d097a4e7d08382 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines) review: none. reserve_pool takes the pool lock and then the inner lock, and nothing on main takes them the other way round; the new contains check scans at most 256 entries; an alignment above the grain gets its own allocation that honours it. Both new tests fail on main by reading the code (interior and duplicate frees are accepted there; the alignment is not honoured). performance: a 256-entry scan when a pool block is freed; nothing per draw (reasoned). verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-28 03:53:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T03:53:31Z.


merge-check claim
head: f3d3344728

<!-- greyfinch-sync:ivall/xcl:comment:7233484012 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7233484012). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T03:53:31Z. --- merge-check claim head: f3d3344728450ff48bdfc0dc78d097a4e7d08382
KOLESNiii commented 2026-11-28 10:19:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T10:19:05Z.


merge-check
base: e429936c10
head: f3d3344728
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2128 passed, 9 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole, gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops, gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange, gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output, gpu::recomp::tests::gpu_compute_mode_dispatch_abi, gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred: these 9 fail on the base too (the base e429936c's suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9 failing), and each also failed when rerun alone on this merge (the two debug-layer e2e tests stop on the D3D12 debug layer rejecting a pixel shader as corrupt or unsigned, and test_title_runs_and_game_folder_is_untouched on the test title's console command list memory-methods check, "post-Wait32/64 write failed"); not caused by this PR. The suite ran on this PC at the same time as 4 other PRs' suites, in one queued job.
review: none. Whole diff read (uma.rs reserve_pool runs once under its lock, a pool block freed twice or by an interior pointer is refused, Arena::take checks overflow and gives an over-aligned piece (align > GRAIN) a block of its own; 2 tests). The free-list check is a linear scan of a list of at most a pool's blocks, only on frees inside the pool.
performance: reasoned, not measured: one comparison more per arena take, a scan of the pool's free list per pool free; no change to the common path.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge dc4b09a32d52d9c4179c804760e08b4e5f08912b (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.

<!-- greyfinch-sync:ivall/xcl:comment:7237817209 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7237817209). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T10:19:05Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: f3d3344728450ff48bdfc0dc78d097a4e7d08382 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2128 passed, 9 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole, gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops, gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange, gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output, gpu::recomp::tests::gpu_compute_mode_dispatch_abi, gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred: these 9 fail on the base too (the base e429936c's suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9 failing), and each also failed when rerun alone on this merge (the two debug-layer e2e tests stop on the D3D12 debug layer rejecting a pixel shader as corrupt or unsigned, and test_title_runs_and_game_folder_is_untouched on the test title's console command list memory-methods check, "post-Wait32/64 write failed"); not caused by this PR. The suite ran on this PC at the same time as 4 other PRs' suites, in one queued job. review: none. Whole diff read (uma.rs reserve_pool runs once under its lock, a pool block freed twice or by an interior pointer is refused, Arena::take checks overflow and gives an over-aligned piece (align > GRAIN) a block of its own; 2 tests). The free-list check is a linear scan of a list of at most a pool's blocks, only on frees inside the pool. performance: reasoned, not measured: one comparison more per arena take, a scan of the pool's free list per pool free; no change to the common path. verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge dc4b09a32d52d9c4179c804760e08b4e5f08912b (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft). correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.
Foniass commented 2026-12-01 05:47:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:47:10Z.


Triage (#1607) – head f3d3344

No open or merged PR makes the same change. #1386 hardens Arenas::take in d3d12x/vram.rs, which is a different allocator. main's uma.rs still has the unchecked Arena::take arithmetic and the unvalidated pool free.
In Uma::free, g.2.contains(&p) is a linear scan of the free pool list on every pool-block free (hundreds to thousands of entries with a large pool). A bitset or a sorted check would avoid that. The PR combines three fixes (Arena::take alignment/overflow, the pool free check, idempotent reserve_pool) that could be separate commits. It conflicts with main.
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:7302136051 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1447#issuecomment-7302136051). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:47:10Z. --- **Triage (#1607)** – head f3d3344 No open or merged PR makes the same change. #1386 hardens `Arenas::take` in d3d12x/vram.rs, which is a different allocator. `main`'s `uma.rs` still has the unchecked `Arena::take` arithmetic and the unvalidated pool free. In `Uma::free`, `g.2.contains(&p)` is a linear scan of the free pool list on every pool-block free (hundreds to thousands of entries with a large pool). A bitset or a sorted check would avoid that. The PR combines three fixes (`Arena::take` alignment/overflow, the pool free check, idempotent `reserve_pool`) that could be separate commits. It conflicts with `main`. 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/1447:upstream-pr/1447'
git switch 'upstream-pr/1447'

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/1447'
git switch 'upstream-pr/1447'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1447'
git switch 'upstream-pr/1447'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1447'
git switch 'main'
git merge --squash 'upstream-pr/1447'
git switch 'main'
git merge --ff-only 'upstream-pr/1447'
git switch 'main'
git merge 'upstream-pr/1447'
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!1437
No description provided.