Tests: skip sparse reinit when no sparse state exists #2748

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2758 into main
luckyteagirl commented 2026-11-26 10:18:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:18:58Z.


The sparse reinitialization fixture used a coherent UMA GPU address as proof that sparse windows existed. A coherent buffer can be imported without a sparse state, leaving the fixture to panic on sparse::alloc before it checks the #344 reinitialization behavior. This test-only change checks the sparse queue directly.

What is in it

  • crates/xcl/tests/sparse_reinit.rs: skip explicitly when no sparse queue was initialized; otherwise keep the existing sparse allocation and reinitialization assertions.

Tested

  • Windows 11 Home build 26200, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust stable 1.99.0 MSVC, debug build.
  • cargo +stable build --workspace --locked: passed.
  • With XCL_ADAPTER=RX 6800M and XCL_REQUIRE_GPU=wave64, cargo +stable test --locked -p xcl --test sparse_reinit -- --exact the_sparse_state_is_replaced_outside_its_lock --test-threads=4 --nocapture: 1 passed, 0 failed, 0 ignored, 0 skipped; three sparse windows were created and re-created.
  • With WARP on Windows PowerShell 7, the same focused test exited 0 with 1 explicit SKIPPED ...: no sparse GPU UMA, 0 exercised, 0 failed, 0 ignored.
  • In a disposable coherent-only fault injection (restored before commit), the old guard panicked on expect("a sparse block") (0 passed, 1 failed); the new guard explicitly skipped (0 exercised, 1 skip, 0 failed).
  • cargo test --workspace -- --test-threads=4 was attempted as cargo +stable test --workspace --locked -- --test-threads=4 on the RX 6800M. It exited 0xc0000005 in the first library binary after 83 logged passes and 1 ignored, with no final library summary or later target results. A separate clean-main serial run reproduced an access violation at raw_loads_in_root_windows_respect_exec_and_bounds; the exact four-thread crashing test is unproven.
  • git diff --check passed; only the fixture file changed.

Not tested

  • The full GPU suite could not complete because of the library access violation. No retail title, release build, or other physical GPU was tested. The change does not touch runtime code.

AI use

  • OpenAI Codex (GPT-6.2 Sol) wrote the fixture change and ran focused GPU, WARP, and fault-injection tests. OpenAI Codex (GPT-6.2 Astra) reviewed the diff, ran the workspace build and GPU suite, and prepared this PR.
<!-- greyfinch-sync:ivall/xcl:issue:5508159552 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2758). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T10:18:58Z. --- The sparse reinitialization fixture used a coherent UMA GPU address as proof that sparse windows existed. A coherent buffer can be imported without a sparse state, leaving the fixture to panic on `sparse::alloc` before it checks the #344 reinitialization behavior. This test-only change checks the sparse queue directly. **What is in it** - `crates/xcl/tests/sparse_reinit.rs`: skip explicitly when no sparse queue was initialized; otherwise keep the existing sparse allocation and reinitialization assertions. **Tested** - Windows 11 Home build 26200, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust stable 1.99.0 MSVC, debug build. - `cargo +stable build --workspace --locked`: passed. - With `XCL_ADAPTER=RX 6800M` and `XCL_REQUIRE_GPU=wave64`, `cargo +stable test --locked -p xcl --test sparse_reinit -- --exact the_sparse_state_is_replaced_outside_its_lock --test-threads=4 --nocapture`: 1 passed, 0 failed, 0 ignored, 0 skipped; three sparse windows were created and re-created. - With WARP on Windows PowerShell 7, the same focused test exited 0 with 1 explicit `SKIPPED ...: no sparse GPU UMA`, 0 exercised, 0 failed, 0 ignored. - In a disposable coherent-only fault injection (restored before commit), the old guard panicked on `expect("a sparse block")` (0 passed, 1 failed); the new guard explicitly skipped (0 exercised, 1 skip, 0 failed). - `cargo test --workspace -- --test-threads=4` was attempted as `cargo +stable test --workspace --locked -- --test-threads=4` on the RX 6800M. It exited `0xc0000005` in the first library binary after 83 logged passes and 1 ignored, with no final library summary or later target results. A separate clean-main serial run reproduced an access violation at `raw_loads_in_root_windows_respect_exec_and_bounds`; the exact four-thread crashing test is unproven. - `git diff --check` passed; only the fixture file changed. **Not tested** - The full GPU suite could not complete because of the library access violation. No retail title, release build, or other physical GPU was tested. The change does not touch runtime code. **AI use** - OpenAI Codex (GPT-6.2 Sol) wrote the fixture change and ran focused GPU, WARP, and fault-injection tests. OpenAI Codex (GPT-6.2 Astra) reviewed the diff, ran the workspace build and GPU suite, and prepared this PR.
github-actions[bot] commented 2026-12-01 02:33:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:48Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298750205 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2758#issuecomment-7298750205). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:33:48Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:53:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:53:37Z.


Triage (#1607) – head 1d0f954

No open or merged PR makes the same change. On main, sparse::queue() is set only by sparse::init (when the sparse state is installed), so skipping on queue().is_none() checks for exactly what the test then uses (sparse::alloc), and uma_gpu_va() != 0 did not guarantee it. No problems found in the diff.
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:7305924420 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2758#issuecomment-7305924420). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:53:37Z. --- **Triage (#1607)** – head 1d0f954 No open or merged PR makes the same change. On main, `sparse::queue()` is set only by `sparse::init` (when the sparse state is installed), so skipping on `queue().is_none()` checks for exactly what the test then uses (`sparse::alloc`), and `uma_gpu_va() != 0` did not guarantee it. No problems found in the diff. 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/2758:upstream-pr/2758'
git switch 'upstream-pr/2758'

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