formats: BC2 joins the randomized BCPack sweeps #604

Open
qnjk wants to merge 1 commit from qnjk/Darner:bcpack-bc2-sweep into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: nothing. This is a tests-only change for the BCPack sweeps (no production line is edited).

  • What it pins: BC2 was the only supported BCPack format with no entry in the randomized sweep tests (crates/darner-formats/src/bcpack.rs, around the check_layout!/sweep area at :3239), though BC2 is the format whose endpoints are not taken from the shipped table file — its 64-entry BC2 colour table is generated in code (bcpack_bc2_tables.rs). A regression in that generator or in the BC2 lane schedule would have been caught by no test at all.

  • This change adds BC2 to the same randomized sweeps the other formats use, in both the plain and the golden-file variants, with synthetic blocks only.

How it was tested

  • Tested revision: 1f640dc (one commit on c8258f9).
  • Commands and results:
    • cargo test --locked -p darner-formats --lib -- bcpack — 17 passed, 3 ignored (the sweeps and goldens).
    • cargo clippy --locked -p darner-formats --all-targets -- -D warnings passes.
    • Fail-before (the assertion's teeth, by mutating the code under test, each reverted):
      1. making lanes_strip refuse a 15-lane schedule: the new sweep fails; with the old BC2 check_layout! line removed the same mutant passes — i.e. before this change the sweep never reached a 15-lane schedule.
      2. making decode_bc2 panic on entry: the sweep fails.
  • Changes a default: no. Tests only.
  • A/B result: not applicable — tests-only change.
  • Gates run on that revision:
    • Gate 1, cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
    • Gate 2, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
    • Gate 3, cargo test --workspace --locked: not run to completion here; the pre-existing darner-gpu test deadlock (#224) and darner-shader waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. darner-formats' suite is green.
  • Gameplay, when relevant: not applicable — tests-only change.
  • Shader wave sizes tested, when relevant: not applicable.
  • Hardware dependence: none.
  • Coverage gaps: the sweep is randomized over synthetic bytes; no real BCPack stream was decoded, and the golden variant's expected hashes are pinned in source as the crate requires.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not applicable: tests-only change, stated at the top.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md (cargo xtask policy: 576 files ok).
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found. No open pull request changes crates/darner-formats/src/bcpack.rs or bcpack_goldens.rs, and no open or closed issue mentions the BC2 sweep.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: nothing. This is a **tests-only** change for the BCPack sweeps (no production line is edited). - What it pins: BC2 was the only supported BCPack format with no entry in the randomized sweep tests (`crates/darner-formats/src/bcpack.rs`, around the `check_layout!`/sweep area at `:3239`), though BC2 is the format whose endpoints are **not** taken from the shipped table file — its 64-entry BC2 colour table is generated in code (`bcpack_bc2_tables.rs`). A regression in that generator or in the BC2 lane schedule would have been caught by no test at all. - This change adds BC2 to the same randomized sweeps the other formats use, in both the plain and the golden-file variants, with synthetic blocks only. ## How it was tested - Tested revision: `1f640dc` (one commit on `c8258f9`). - Commands and results: - `cargo test --locked -p darner-formats --lib -- bcpack` — 17 passed, 3 ignored (the sweeps and goldens). - `cargo clippy --locked -p darner-formats --all-targets -- -D warnings` passes. - Fail-before (the assertion's teeth, by mutating the code under test, each reverted): 1. making `lanes_strip` refuse a 15-lane schedule: the new sweep fails; with the old BC2 `check_layout!` line removed the same mutant **passes** — i.e. before this change the sweep never reached a 15-lane schedule. 2. making `decode_bc2` panic on entry: the sweep fails. - Changes a default: no. Tests only. - A/B result: not applicable — tests-only change. - Gates run on that revision: - Gate 1, `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - Gate 2, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passes. - Gate 3, `cargo test --workspace --locked`: not run to completion here; the pre-existing `darner-gpu` test deadlock (#224) and `darner-shader` waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. `darner-formats`' suite is green. - Gameplay, when relevant: not applicable — tests-only change. - Shader wave sizes tested, when relevant: not applicable. - Hardware dependence: none. - Coverage gaps: the sweep is randomized over synthetic bytes; no real BCPack stream was decoded, and the golden variant's expected hashes are pinned in source as the crate requires. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - Not applicable: tests-only change, stated at the top. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md` (`cargo xtask policy`: 576 files ok). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found. No open pull request changes `crates/darner-formats/src/bcpack.rs` or `bcpack_goldens.rs`, and no open or closed issue mentions the BC2 sweep. - Replaces or overlaps: none found
BC2 was the only supported format missing from `noise_never_panics` and from
`every_layout_round_trips_through_the_lanes`. Its fifteen-lane,
two-symbols-per-block layout is the only odd lane count in the file, and it
was exercised only by the imported goldens, which carry well-formed streams
by construction: the reference oracle rejects BC2, so the oracle parity
sweeps cannot include it either.

`2` is now in the noise sweep, and `check_layout!(BC2_WIDTHS, 15, 2, 30)`
round-trips the layout against the scalar scheduler at the same block counts
as every other format. `valid_records_for` names the BC2 layout rather than
silently mapping `2` onto BC7's widths, and a new test decodes a 300-block,
multi-fragment request over the synthetic tables, pins its
(4800, 0x06712a7b157b5473) answer and rejects truncated streams. No reference
data is added.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TrustNo1 changed title from [pr-tests] formats: BC2 joins the randomized BCPack sweeps to formats: BC2 joins the randomized BCPack sweeps 2026-12-06 03:26:25 +00:00
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 'bcpack-bc2-sweep:qnjk-bcpack-bc2-sweep'
git switch 'qnjk-bcpack-bc2-sweep'

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 'qnjk-bcpack-bc2-sweep'
git switch 'qnjk-bcpack-bc2-sweep'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-bcpack-bc2-sweep'
git switch 'qnjk-bcpack-bc2-sweep'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-bcpack-bc2-sweep'
git switch 'Main'
git merge --squash 'qnjk-bcpack-bc2-sweep'
git switch 'Main'
git merge --ff-only 'qnjk-bcpack-bc2-sweep'
git switch 'Main'
git merge 'qnjk-bcpack-bc2-sweep'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!604
No description provided.