Tests: expand bcpack_parity integration tests for block sizes, errors, and decode validation #2239

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

@⁠heditrigui on GitHub · 2026-11-25 11:01 UTC · original
heditrigui:tests/bcpack-parity-and-invariants-suite → main · +100 −0 · 1 files · 1 commits · open

Summary

Expands crates/xcl/tests/bcpack_parity.rs with integration test invariants covering block sizes, error handling, and decoding validation:

  • Validates block_size mode mappings: BC1 and BC4 (8 bytes), BC3, BC5, BC6H, and BC7 (16 bytes), and None for unsupported modes (0, 2, 8, 9, 10, 255).
  • Verifies can_decode(mode) parity with block_size(mode).is_some() across all 256 modes (0..=255u8).
  • Validates Error variants (Unsupported, OutputSize, Decode), .kind() string mappings ("unsupported", "output size", "decode"), Display formatting, and value equality.
  • Verifies decode parameter validation: rejection of unsupported modes with Error::Unsupported, rejection of zero or non-block-aligned output lengths with Error::OutputSize, and graceful rejection of empty inputs with Error::Decode(_).
  • Verifies that truncated buffers and malformed pseudo-random byte streams return Error::Decode(_) safely across all supported modes without panicking.

Tested

  • crates/xcl/tests/bcpack_parity.rs integration suite additions.
  • Python test suite (python -m pytest scripts/ passing 25/25 in 0.45s).
  • Validated with scripts/pr_check.py --local.

Not tested

  • Retail game smoke execution (crates/xcl/tests/ files are integration tests and non-runtime code).

AI use

  • Antigravity (Gemini 3.8 Flash (High))
**@⁠heditrigui** on GitHub · 2026-11-25 11:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239) `heditrigui:tests/bcpack-parity-and-invariants-suite` → `main` · +100 −0 · 1 files · 1 commits · open ### Summary Expands `crates/xcl/tests/bcpack_parity.rs` with integration test invariants covering block sizes, error handling, and decoding validation: - Validates `block_size` mode mappings: BC1 and BC4 (8 bytes), BC3, BC5, BC6H, and BC7 (16 bytes), and `None` for unsupported modes (0, 2, 8, 9, 10, 255). - Verifies `can_decode(mode)` parity with `block_size(mode).is_some()` across all 256 modes (`0..=255u8`). - Validates `Error` variants (`Unsupported`, `OutputSize`, `Decode`), `.kind()` string mappings (`"unsupported"`, `"output size"`, `"decode"`), `Display` formatting, and value equality. - Verifies `decode` parameter validation: rejection of unsupported modes with `Error::Unsupported`, rejection of zero or non-block-aligned output lengths with `Error::OutputSize`, and graceful rejection of empty inputs with `Error::Decode(_)`. - Verifies that truncated buffers and malformed pseudo-random byte streams return `Error::Decode(_)` safely across all supported modes without panicking. **Tested** - `crates/xcl/tests/bcpack_parity.rs` integration suite additions. - Python test suite (`python -m pytest scripts/` passing 25/25 in 0.45s). - Validated with `scripts/pr_check.py --local`. **Not tested** - Retail game smoke execution (`crates/xcl/tests/` files are integration tests and non-runtime code). **AI use** - Antigravity (Gemini 3.8 Flash (High))
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:24:13 +00:00
Author
Owner

@⁠heditrigui on GitHub · 2026-11-25 11:09 UTC · original

Note: CI Build and test failure is due to the two pre-existing unit test breakages on upstream main (
erouted_disk_entries_follow_the_direct_translator and pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa), documented in #2242. All cpack_parity additions in this PR compiled and passed cleanly.

**@⁠heditrigui** on GitHub · 2026-11-25 11:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7160658819) Note: CI Build and test failure is due to the two pre-existing unit test breakages on upstream main ( erouted_disk_entries_follow_the_direct_translator and pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa), documented in #2242. All cpack_parity additions in this PR compiled and passed cleanly.
Author
Owner

@⁠jennydeth on GitHub · 2026-11-25 14:45 UTC · original

NVIDIA / Windows run.

Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 78bea20.

Result: cargo test --workspace -- --test-threads=4: 1254 passed, 0 failed, 46 ignored. tests/bcpack_parity.rs: 5 passed. SKIPPED: 18 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips.

Not tested: the XCL_SAMPLE_BCPACK retail comparison (variable not set).

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

**@⁠jennydeth** on GitHub · 2026-11-25 14:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7165770280) NVIDIA / Windows run. Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 78bea20. Result: cargo test --workspace -- --test-threads=4: 1254 passed, 0 failed, 46 ignored. tests/bcpack_parity.rs: 5 passed. SKIPPED: 18 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips. Not tested: the XCL_SAMPLE_BCPACK retail comparison (variable not set). AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 15:17 UTC · original

Independent Windows test of 78bea207bb1d728043c068b1c6e7f16bb7437f76. All four new synthetic integration tests and the six existing decoder unit tests passed.

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Rust 1.100.0 x64 MSVC, unoptimized test profile. These are CPU-side checks.
  • cargo test --locked -p xcl --test bcpack_parity -- --skip retail_chunks_match_the_reference --nocapture --test-threads=1: 4 passed, 0 failed, 0 ignored, 1 filtered out. This ran all new block-size, error and malformed-input assertions, with the optional retail comparison explicitly excluded.
  • cargo test --locked -p xcl --lib hle::bcpack::tests -- --nocapture --test-threads=1: 6 passed, 0 failed, 0 ignored, and no logged skips. This also exercised the bundled synthetic decoder fixtures.

Not tested

Retail chunks against a reference decoder, parent revision, or the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the tests, verified the results, and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-25 15:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7166616507) Independent Windows test of `78bea207bb1d728043c068b1c6e7f16bb7437f76`. All four new synthetic integration tests and the six existing decoder unit tests passed. **Tested** - Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Rust 1.100.0 x64 MSVC, unoptimized test profile. These are CPU-side checks. - `cargo test --locked -p xcl --test bcpack_parity -- --skip retail_chunks_match_the_reference --nocapture --test-threads=1`: 4 passed, 0 failed, 0 ignored, 1 filtered out. This ran all new block-size, error and malformed-input assertions, with the optional retail comparison explicitly excluded. - `cargo test --locked -p xcl --lib hle::bcpack::tests -- --nocapture --test-threads=1`: 6 passed, 0 failed, 0 ignored, and no logged skips. This also exercised the bundled synthetic decoder fixtures. **Not tested** Retail chunks against a reference decoder, parent revision, or the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the tests, verified the results, and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 16:42 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 16:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7168398862) 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!
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 18:28 UTC · original

Code review on 78bea20 (crates/xcl/tests/bcpack_parity.rs): clean unit/integration coverage for block sizes, mode roundtrips, and invalid stream handling, and CI is green.

Remaining before merge: Dual-vendor (AMD + NVIDIA) verification running --test bcpack_parity on 78bea20 (--lib alone does not execute integration test targets).

**@⁠raylitebull** on GitHub · 2026-11-25 18:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7170959668) Code review on `78bea20` (`crates/xcl/tests/bcpack_parity.rs`): clean unit/integration coverage for block sizes, mode roundtrips, and invalid stream handling, and CI is green. **Remaining before merge:** Dual-vendor (**AMD** + **NVIDIA**) verification running `--test bcpack_parity` on `78bea20` (`--lib` alone does not execute integration test targets).
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-25 18:58 UTC · original

Verification on NVIDIA RTX 5070 Ti (Windows 11), head 78bea207bb1d728043c068b1c6e7f16bb7437f76: --test bcpack_parity passes

Tested

  • Head 78bea207bb1d728043c068b1c6e7f16bb7437f76 (git rev-parse HEAD of a clean detached worktree, no local changes, built as is, not merged with main). The PR was open and the head unchanged when I started and again before writing this.
  • Windows 11 Pro 10.0.26300 (Developer Mode on), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42, 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, release profile. The tests in this target run on the CPU; the GPU is not used.
  • cargo test --release --locked -p xcl --test bcpack_parity -j 8 -- --nocapture --test-threads=1: 5 passed, 0 failed, 0 ignored (0 filtered out). Tests: decode_input_and_output_size_validation, decode_malformed_and_truncated_streams_fail_safely, error_display_and_kind_invariants, mode_block_sizes_and_support_invariants, retail_chunks_match_the_reference.
  • XCL_SAMPLE_BCPACK was not set, so retail_chunks_match_the_reference returns early and is counted as passed without comparing any chunk.
  • cargo test --release --locked -p xcl --lib hle::bcpack::tests -j 8 -- --nocapture --test-threads=1: 6 passed, 0 failed, 0 ignored. git status --short was empty afterwards.

Not tested

  • An AMD host.
  • The retail-chunk comparison (XCL_SAMPLE_BCPACK), cargo test --workspace, a debug build, the parent revision, the retail game and xcl-smoke.

Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).

**@⁠tiagonleal** on GitHub · 2026-11-25 18:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2239#issuecomment-7171651914) Verification on NVIDIA RTX 5070 Ti (Windows 11), head `78bea207bb1d728043c068b1c6e7f16bb7437f76`: `--test bcpack_parity` passes **Tested** - Head `78bea207bb1d728043c068b1c6e7f16bb7437f76` (`git rev-parse HEAD` of a clean detached worktree, no local changes, built as is, not merged with `main`). The PR was open and the head unchanged when I started and again before writing this. - Windows 11 Pro 10.0.26300 (Developer Mode on), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42, 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, release profile. The tests in this target run on the CPU; the GPU is not used. - `cargo test --release --locked -p xcl --test bcpack_parity -j 8 -- --nocapture --test-threads=1`: 5 passed, 0 failed, 0 ignored (0 filtered out). Tests: `decode_input_and_output_size_validation`, `decode_malformed_and_truncated_streams_fail_safely`, `error_display_and_kind_invariants`, `mode_block_sizes_and_support_invariants`, `retail_chunks_match_the_reference`. - `XCL_SAMPLE_BCPACK` was not set, so `retail_chunks_match_the_reference` returns early and is counted as passed without comparing any chunk. - `cargo test --release --locked -p xcl --lib hle::bcpack::tests -j 8 -- --nocapture --test-threads=1`: 6 passed, 0 failed, 0 ignored. `git status --short` was empty afterwards. **Not tested** - An AMD host. - The retail-chunk comparison (`XCL_SAMPLE_BCPACK`), `cargo test --workspace`, a debug build, the parent revision, the retail game and `xcl-smoke`. Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
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/2239/head:github-bot/gh-2239'
git switch 'github-bot/gh-2239'

Merge

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