Formats: test BC1 endpoint prediction and quadrant packing #2034

Merged
Dathinel merged 1 commit from upstream-pr/2036 into main 2026-11-25 21:53:28 +00:00
Dathinel commented 2026-11-25 03:50:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T03:50:03Z.


Add a two-block BC1 case to the default test suite. It checks RGB565 wraparound, endpoint prediction from the preceding block and the wire order of four distinct 2×2 index groups. The existing lane round-trip stops before block packing.

Run cargo test -p victory-formats bc1_endpoint_prediction_and_quadrant_order. Swapping the upper quadrants makes the assertion fail. The expected blocks were cross-checked with bcpack-rs's Python assembler using fresh indices and the synthetic fixture's ranks translated to BC1 wire codes. The test uses the crate's own fixture and adds no dependencies.

Windows checks: 39 format tests passed (5 ignored), and both workspace Clippy configurations passed. The full workspace run had five GPU/shader failures on this machine; all five also failed on unmodified main at 940d32f6.

NEW-60 coordination claim. AI-assisted with Codex and reviewed by Claude Code.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6596787676 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2036). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T03:50:03Z. --- Add a two-block BC1 case to the default test suite. It checks RGB565 wraparound, endpoint prediction from the preceding block and the wire order of four distinct 2×2 index groups. The existing lane round-trip stops before block packing. Run `cargo test -p victory-formats bc1_endpoint_prediction_and_quadrant_order`. Swapping the upper quadrants makes the assertion fail. The expected blocks were cross-checked with [bcpack-rs's Python assembler](https://github.com/Ahmet-Dedeler/bcpack-rs/blob/b1c3099a3402de8b76c9263a828791bd8bc0c930/python/bcpack.py) using fresh indices and the synthetic fixture's ranks translated to BC1 wire codes. The test uses the crate's own fixture and adds no dependencies. Windows checks: 39 format tests passed (5 ignored), and both workspace Clippy configurations passed. The full workspace run had five GPU/shader failures on this machine; all five also failed on unmodified main at 940d32f6. [NEW-60 coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7151973145). AI-assisted with Codex and reviewed by Claude Code.
DenRakEiw commented 2026-11-25 04:06:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T03:57:12Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-formats --lib bcpack:: — 10 passed, 0 failed (2 ignored), including bc1_endpoint_prediction_and_quadrant_order
  • cargo clippy -p victory-formats --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean regression test covering BC1 endpoint prediction and quadrant packing order. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051647989 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2036#pullrequestreview-6051647989). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T03:57:12Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-formats --lib bcpack::` — 10 passed, 0 failed (2 ignored), including `bc1_endpoint_prediction_and_quadrant_order` - `cargo clippy -p victory-formats --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean regression test covering BC1 endpoint prediction and quadrant packing order. Looks good. AI-assisted (Gemini 4 Neon).
jeremygold02 commented 2026-11-25 04:07:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T03:55:33Z.


Triage verdict — Ready as a standalone regression (3f69be2)

Evidence

  • @Dathinel's fixture adds a default byte-level assertion over two BC1 blocks: endpoint prediction from the preceding block, RGB565 wraparound, and the wire order of distinct index quadrants. This protects the packing behavior beyond the existing lane round-trip. BC1 regression

Checks and limits

  • The Windows check passed on this head. I also applied the exact test commit on top of the proposed history-ring change in #2034. The combined formats suite passed 39 tests with five ignored, including this fixture. Windows CI
  • This fixture checks one populated history slot. Separate maximum-distance and wraparound coverage belongs with the history implementation.

Next step

  • This can land independently of #2034. Keep the asserted on-wire bytes when integrating either decoder performance proposal so they share the same packing regression.

This verification was AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152367634 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2036#issuecomment-7152367634). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-25T03:55:33Z. --- **Triage verdict — Ready as a standalone regression** (`3f69be2`) **Evidence** - @Dathinel's fixture adds a default byte-level assertion over two BC1 blocks: endpoint prediction from the preceding block, RGB565 wraparound, and the wire order of distinct index quadrants. This protects the packing behavior beyond the existing lane round-trip. [BC1 regression](https://github.com/Marvisak/VIctory/blob/3f69be262fb175ac1f2a0207d35037d518cf8d92/crates/victory-formats/src/bcpack.rs#L1267-L1285) **Checks and limits** - The Windows check passed on this head. I also applied the exact test commit on top of the proposed history-ring change in #2034. The combined formats suite passed 39 tests with five ignored, including this fixture. [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/45542673823/job/138964701929) - This fixture checks one populated history slot. Separate maximum-distance and wraparound coverage belongs with the history implementation. **Next step** - This can land independently of #2034. Keep the asserted on-wire bytes when integrating either decoder performance proposal so they share the same packing regression. This verification was AI-assisted.
catminou4 commented 2026-11-25 05:05:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:17:03Z.

Review: APPROVED


Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, cargo test -p victory-formats --locked.

39 passed / 0 failed. BC1 endpoint prediction and quadrant packing tests (+1 test) — BC1 decode coverage; 39 passed / 0 failed / 5 ignored.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051786056 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2036#pullrequestreview-6051786056). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T04:17:03Z. **Review:** APPROVED --- Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, `cargo test -p victory-formats --locked`. 39 passed / 0 failed. BC1 endpoint prediction and quadrant packing tests (+1 test) — BC1 decode coverage; 39 passed / 0 failed / 5 ignored.
Marvisak commented 2026-11-25 10:07:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:19:07Z.


Automated triage for the maintainers.
Merge candidate.

  • This PR only adds a test: bc1_endpoint_prediction_and_quadrant_order in the crates/victory-formats/src/bcpack.rs tests. It decodes two BC1 blocks through the crate's synthetic tables() fixture and asserts the exact bytes on the wire. That covers endpoint prediction from the previous block, RGB565 wraparound and the order of the 2x2 index quadrants. No existing test reaches block packing through decode (every_layout_round_trips_through_the_lanes stops at the lanes).
  • The expected bytes were cross-checked against an independent public implementation, and the author reports that swapping the quadrants makes the test fail. It adds no data from the title or SDK and no dependencies. No other open PR adds this test; the BC1 test in #315 sits inside a large bundle and only checks bc1_color on its own.

CI: passing (check).

Recommending a look, not approving.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158169338 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2036#issuecomment-7158169338). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:19:07Z. --- <!-- victory-triage v1 head=3f69be262fb175ac1f2a0207d35037d518cf8d92 verdict=merge-candidate at=2026-11-25T09:19:00Z --> Automated triage for the maintainers. **Merge candidate.** - This PR only adds a test: `bc1_endpoint_prediction_and_quadrant_order` in the `crates/victory-formats/src/bcpack.rs` tests. It decodes two BC1 blocks through the crate's synthetic `tables()` fixture and asserts the exact bytes on the wire. That covers endpoint prediction from the previous block, RGB565 wraparound and the order of the 2x2 index quadrants. No existing test reaches block packing through `decode` (`every_layout_round_trips_through_the_lanes` stops at the lanes). - The expected bytes were cross-checked against an independent public implementation, and the author reports that swapping the quadrants makes the test fail. It adds no data from the title or SDK and no dependencies. No other open PR adds this test; the BC1 test in #315 sits inside a large bundle and only checks `bc1_color` on its own. CI: passing (`check`). Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 22:03:21 +00:00
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
Marvisak/VIctory!2034
No description provided.