Tests: cover BC1 writes to scattered physical pages #755

Closed
gabrielsteglich wants to merge 1 commit from upstream-pr/760 into main
gabrielsteglich commented 2026-11-24 04:47:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gabrielsteglich on 2026-11-24T04:47:26Z.


Adds a synthetic regression test for BCPack BC1 requests that write to scattered physical pages. This revision is based directly on main at 930e8b4, which includes the decoder from #905 (67a3735).

What is in it

  • In crates/xcl/src/hle/dstorage.rs, reuse the synthetic bc1-16-1.bin fixture and compare the queue's 128-byte output with a linear decode. The successful request crosses a 64 KiB page boundary and resolves its second page after enqueue. The truncated request returns E_DECOMPRESSION, with the failure destination and guard bytes intact.
  • Run the two BC1 queue tests under the same test lock so the existing exact counter assertions stay deterministic.

Tested

  • Windows 11 Pro build 26300, Core i9-13900K, GeForce RTX 3090 (621.01), Rust 1.97.0, and DXC 1.9.2602.17, Release.
  • cargo build --release --locked --workspace and cargo test --release --locked --workspace --no-fail-fast -- --test-threads=4 --show-output completed successfully. On 9ee0cd3, Cargo reported 752 passed, 0 failed, and 41 ignored. Both BC1 queue tests passed, as did the GPU compute readback.
  • Four tests reported SKIPPED. Two require native wave64 and two require the D3D12 debug layer. Optional sample-data tests were disabled.

Regression run

scripts/smoke.ps1 ran the same retail title offline for 60 seconds per build with fresh title profiles and separate XCL DXIL caches. These runs check startup. The synthetic test exercises physical-page BC1 writes.

main

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 3090
title: retail
seconds: 60
exit: 0x0
frames shown: 1181 (PresentX 1181)
presents per 2 s (last 3): 36 38 36
device removals: 0
crashes: 0
peak commit: 11316 MB

PR head

xcl-smoke v1
commit: 9ee0cd33e97a9ca6e5c96df9da246cbd916453c1
gpu: NVIDIA GeForce RTX 3090
title: retail
seconds: 60
exit: 0x0
frames shown: 1160 (PresentX 1160)
presents per 2 s (last 3): 36 15 32
device removals: 0
crashes: 0
peak commit: 11490 MB

Not tested

  • In-game BC1 texture fidelity, gameplay, other GPU vendors, and optional sample-data tests.

AI use

  • OpenAI's coding agent with GPT-6 assisted with adapting and reviewing the test and running validation. The commands ran locally on the hardware listed above.
<!-- greyfinch-sync:ivall/xcl:issue:5466258770 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/760). Originally posted by [gabrielsteglich](https://github.com/gabrielsteglich) on 2026-11-24T04:47:26Z. --- Adds a synthetic regression test for BCPack BC1 requests that write to scattered physical pages. This revision is based directly on `main` at `930e8b4`, which includes the decoder from #905 (`67a3735`). **What is in it** - In `crates/xcl/src/hle/dstorage.rs`, reuse the synthetic `bc1-16-1.bin` fixture and compare the queue's 128-byte output with a linear decode. The successful request crosses a 64 KiB page boundary and resolves its second page after enqueue. The truncated request returns `E_DECOMPRESSION`, with the failure destination and guard bytes intact. - Run the two BC1 queue tests under the same test lock so the existing exact counter assertions stay deterministic. **Tested** - Windows 11 Pro build 26300, Core i9-13900K, GeForce RTX 3090 (621.01), Rust 1.97.0, and DXC 1.9.2602.17, Release. - `cargo build --release --locked --workspace` and `cargo test --release --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` completed successfully. On `9ee0cd3`, Cargo reported 752 passed, 0 failed, and 41 ignored. Both BC1 queue tests passed, as did the GPU compute readback. - Four tests reported `SKIPPED`. Two require native wave64 and two require the D3D12 debug layer. Optional sample-data tests were disabled. **Regression run** `scripts/smoke.ps1` ran the same retail title offline for 60 seconds per build with fresh title profiles and separate XCL DXIL caches. These runs check startup. The synthetic test exercises physical-page BC1 writes. `main` ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 3090 title: retail seconds: 60 exit: 0x0 frames shown: 1181 (PresentX 1181) presents per 2 s (last 3): 36 38 36 device removals: 0 crashes: 0 peak commit: 11316 MB ``` PR head ``` xcl-smoke v1 commit: 9ee0cd33e97a9ca6e5c96df9da246cbd916453c1 gpu: NVIDIA GeForce RTX 3090 title: retail seconds: 60 exit: 0x0 frames shown: 1160 (PresentX 1160) presents per 2 s (last 3): 36 15 32 device removals: 0 crashes: 0 peak commit: 11490 MB ``` **Not tested** - In-game BC1 texture fidelity, gameplay, other GPU vendors, and optional sample-data tests. **AI use** - OpenAI's coding agent with GPT-6 assisted with adapting and reviewing the test and running validation. The commands ran locally on the hardware listed above.
MesshM commented 2026-11-24 07:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:15:56Z.


Test run of cb1de0f460a4bfe04f45b46d73e669dfa62eb173 on AMD RDNA4. I merged it onto current main 6025201 locally (clean merge), so the tree tested includes the stack under it (#273, #208).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 713 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 672 passed, 0 failed, 21 ignored
  • 0 SKIPPED; bcpack_bc1_requests_into_scattered_physical_pages passes.

Review: Test-only on top of #273; I reviewed the top commit only.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122783521 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/760#issuecomment-7122783521). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:15:56Z. --- Test run of `cb1de0f460a4bfe04f45b46d73e669dfa62eb173` on AMD RDNA4. I merged it onto current `main` `6025201` locally (clean merge), so the tree tested includes the stack under it (#273, #208). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **713 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 672 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `bcpack_bc1_requests_into_scattered_physical_pages` passes. **Review:** Test-only on top of #273; I reviewed the top commit only. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
ivall commented 2026-11-24 11:05:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T10:39:50Z.


#273 is superseded by #905 (merged in 67a3735), so this branch's base and fixture (bc1-16-1.bc1) are gone. The physical-page destination path with a BCPack request is still not covered by a test: if you want to keep this, rebase it onto main – #208's lane fixtures are in tests/data/bcpack, or a BC1 stream that the decoder takes can be built from them – and it can go in as a test-only PR.

<!-- greyfinch-sync:ivall/xcl:comment:7129080164 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/760#issuecomment-7129080164). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T10:39:50Z. --- #273 is superseded by #905 (merged in 67a3735), so this branch's base and fixture (`bc1-16-1.bc1`) are gone. The physical-page destination path with a BCPack request is still not covered by a test: if you want to keep this, rebase it onto `main` – #208's lane fixtures are in `tests/data/bcpack`, or a BC1 stream that the decoder takes can be built from them – and it can go in as a test-only PR.
gabrielsteglich commented 2026-11-24 17:06:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gabrielsteglich on 2026-11-24T16:11:28Z.


Thanks for the guidance, @ivall. I rebased the physical-page BC1 test onto main with the decoder from #905. The updated head is 9ee0cd3. The workspace suite reported 752 passed and 0 failed on the RTX 3090 test machine, and both 60-second smoke runs exited cleanly. I updated the PR description with the results. The description check passed, and the Windows CI run is awaiting maintainer approval.

<!-- greyfinch-sync:ivall/xcl:comment:7137263328 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/760#issuecomment-7137263328). Originally posted by [gabrielsteglich](https://github.com/gabrielsteglich) on 2026-11-24T16:11:28Z. --- Thanks for the guidance, @ivall. I rebased the physical-page BC1 test onto `main` with the decoder from #905. The updated head is `9ee0cd3`. The workspace suite reported 752 passed and 0 failed on the RTX 3090 test machine, and both 60-second smoke runs exited cleanly. I updated the PR description with the results. The description check passed, and the Windows CI run is awaiting maintainer approval.
JJAutoCompare commented 2026-11-25 07:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:18:20Z.


Empirical test report (9ee0cd33)

Commit 9ee0cd33e97a9ca6e5c96df9da246cbd916453c1 from PR #760.

Hardware / environment

  • Windows build 26200, x64, AMD CPU (family 23, model 113, stepping 0). The focused run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1 outside the Arc harness.
  • Rust 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5 (01b62ad47), unoptimized test profile with debug info and incremental compilation disabled.

Commands and results

  • cargo test --workspace --no-run compiled the workspace test binaries and exited 0.
  • cargo test -p xcl --lib hle::dstorage::tests::bcpack_bc1_requests_ exited 0 with 2 passed, 0 failed, 0 ignored, and 0 skipped. The filter selected both BC1 queue tests affected by the PR. Rust's test harness filtered out 727 other tests.

Observed behavior

  • The scattered-page test completed both requests. The valid synthetic BC1 stream returned S_OK and matched the linear decode across the two noncontiguous destination pages, including the page-table entry supplied after enqueue and before submit.
  • The truncated stream returned E_DECOMPRESSION. The five-page comparison verified that all bytes outside the valid request's two write ranges retained their 0xCD sentinel, including the truncated request's destinations.
  • The virtual-destination queue test passed its status, byte-range, and request-counter assertions with XCL_SAMPLE_BCPACK unset.

Not tested

  • The full GPU workspace suite and game smoke runs were omitted. The focused run used synthetic inputs and did not exercise retail BCPack samples.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr760-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154653475 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/760#issuecomment-7154653475). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:18:20Z. --- ### Empirical test report (9ee0cd33) Commit `9ee0cd33e97a9ca6e5c96df9da246cbd916453c1` from PR #760. **Hardware / environment** - Windows build 26200, x64, AMD CPU (family 23, model 113, stepping 0). The focused run used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1` outside the Arc harness. - Rust `1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5 (01b62ad47)`, unoptimized test profile with debug info and incremental compilation disabled. **Commands and results** - `cargo test --workspace --no-run` compiled the workspace test binaries and exited 0. - `cargo test -p xcl --lib hle::dstorage::tests::bcpack_bc1_requests_` exited 0 with 2 passed, 0 failed, 0 ignored, and 0 skipped. The filter selected both BC1 queue tests affected by the PR. Rust's test harness filtered out 727 other tests. **Observed behavior** - The scattered-page test completed both requests. The valid synthetic BC1 stream returned `S_OK` and matched the linear decode across the two noncontiguous destination pages, including the page-table entry supplied after enqueue and before submit. - The truncated stream returned `E_DECOMPRESSION`. The five-page comparison verified that all bytes outside the valid request's two write ranges retained their `0xCD` sentinel, including the truncated request's destinations. - The virtual-destination queue test passed its status, byte-range, and request-counter assertions with `XCL_SAMPLE_BCPACK` unset. **Not tested** - The full GPU workspace suite and game smoke runs were omitted. The focused run used synthetic inputs and did not exercise retail BCPack samples. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr760-focused.log and published.
DavidM1911 commented 2026-11-25 12:06:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:16:14Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7160822789 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/760#issuecomment-7160822789). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T11:16:14Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!

Pull request closed

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!755
No description provided.