Skip to content

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

Open
heditrigui wants to merge 1 commit into
xcl-dev:mainfrom
heditrigui:tests/bcpack-parity-and-invariants-suite
Open

heditrigui wants to merge 1 commit into
xcl-dev:mainfrom
heditrigui:tests/bcpack-parity-and-invariants-suite

Conversation

@heditrigui

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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
heditrigui force-pushed the tests/bcpack-parity-and-invariants-suite branch from 8bd5a06 to 6c0c94a Compare November 25, 2026 11:20
@jennydeth

Copy link
Copy Markdown

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.

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@raylitebull

Copy link
Copy Markdown
Member

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).

@tiagonleal

Copy link
Copy Markdown
Contributor

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).

@throny

throny commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

merge-check claim
head: 78bea20

@github-actions github-actions Bot added area:tests Unit, integration, e2e tests, or testtitle needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Nov 29, 2026
@throny

throny commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: b10cc4c
head: 78bea20
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2611 passed, 0 failed, 49 ignored on the merge result with main b10cc4c (27 SKIPPED lines). I did not run b10cc4c alone; the tree of #2049 in the same batch (a script-only change) gave 2607 passed, 0 failed, 49 ignored.
review: no blocking finding; tests only, all hunks read. The new tests need no game data and no XCL_SAMPLE_* variable (only the existing retail test reads one and still returns when it is unset), and they are deterministic (a fixed-seed generator). The expected error texts match main's. Minor: they largely repeat lib tests main already has. The AMD run asked for in the thread is not needed for a CPU-only test target.
performance: none (tests only).
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).

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Nov 29, 2026
@futurepro62

futurepro62 commented Nov 30, 2026 •

Copy link
Copy Markdown

NVIDIA and AMD full-suite run, to go with the reports above by jennydeth, throny, tiagonleal, since none of them covers AMD. Tested exact head 78bea207 (on its base 1a0bbe3).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, 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 --no-fail-fast -- --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 --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::bridged_dpp_agrees_with_hlsl_on_the_gpu --skip hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap --skip gpu::dxil::fuzz_tests: 1242 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: mode_block_sizes_and_support_invariants, error_display_and_kind_invariants, decode_input_and_output_size_validation, decode_malformed_and_truncated_streams_fail_safely.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 --skip two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs: 1253 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 53e85fb1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, bridged_dpp_agrees_with_hlsl_on_the_gpu (no wave64 on this card) and two_pass_binds_set_the_shared_view_heap (heap windows are opt-in, XCL_HEAP_WINDOWS=1) fail the same way; gpu::dxil::fuzz_tests stays skipped as in earlier runs (seeds 70, 545, 1019 and 1507 failed CreateComputePipelineState with E_OUTOFMEMORY on this card; they passed on this main's baseline). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs fails on main too, since Tests: compare benchmark regression thresholds #2959 (Tests: two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs fails on an AMD RDNA2 iGPU since #2959: one two-pass state outlives its PSOs #3441). (Edited: this line first named the wrong merge.) 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.

@relativespace2K

relativespace2K commented Nov 30, 2026 •

Copy link
Copy Markdown

merge-check
base: 53e85fb
head: 78bea20
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2792 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, which is why 5 failing tests give 6 failures). All five fail the same way on base 53e85fb alone (2788 passed, 6 failed, 49 ignored there), so none of them comes from this PR. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: testing only: +100/-0 in crates/xcl/tests/bcpack_parity.rs, no production code, no new dependency, nothing outside that file; every hunk read. The expectations match crates/xcl/src/hle/bcpack/mod.rs on this base: 8-byte blocks for BC1/BC4 and 16 for BC3/BC5/BC6H/BC7, can_decode is block_size(..).is_some(), the three Error kinds and their Display strings, and decode's order (unsupported mode before the output-size check). The four new tests need no XCL_SAMPLE_BCPACK and all pass here (tests/bcpack_parity.rs: 5 passed, 0 failed). Minor, not blocking: the can_decode parity loop restates the definition, so it can only catch a future divergence, and the negative cases overlap the lib tests only_published_modes_decode, truncated_and_empty_streams_fail and junk_streams_do_not_panic. No duplicate: no group on #1607 holds this PR; #1381/#1438/#1785 (group D54) change bcpack::decode's allocation path rather than these invariants, and #1181 touches this file only for SKIPPED reporting.
performance: none: tests only, nothing in the runtime changes.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build, CPU-only test target. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 78bea20

No open PR adds the same tests. Much of this restates the unit tests already in hle/bcpack/tests.rs (only_published_modes_decode, truncated_and_empty_streams_fail, junk_streams_do_not_panic). The new parts are the exact block_size values, Error::kind/Display strings and the per-mode bad output sizes. These are unit-level checks; they would fit better in bcpack/tests.rs than in tests/bcpack_parity.rs, whose header says the file does nothing without XCL_SAMPLE_BCPACK.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Unit, integration, e2e tests, or testtitle off-goal Does not bear on the current goal (world loading); waits until it is reached ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants