BCPack: BC7 presets with alpha, BC6H refit with the no-wrap rule #103

Manually merged
github merged 2 commits from gh-pr/103/head into gh-pr/103/base 2026-11-26 20:10:03 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 02:32 UTC · original
holdmysocks:claude/bcpack-tables-2 → master · +206 −206 · 2 files · 2 commits · merged 2026-11-24 02:39 UTC

Tables only; no decoder code changes. These commits were pushed to the branch of #58 after it had been merged, so they are not on master yet.

BC7. Index presets made consistent with the anchor rule, all presets refitted under the secondary-index reset rule of #58, and alpha added to the fit (it scored only red, green and blue before, so alpha presets were never fitted).

Whole-install mip check (mip 0 downsampled against mip 1), 1,433 BC7 textures:

master this PR
colour mean 38.7 dB 39.2 dB
colour under 30 dB 6.8% 4.6%
colour under 20 dB 1.7% 1.2%
alpha mean 39.8 dB 49.2 dB
alpha under 30 dB 40.8% 13.2%

BC6H. In a transformed mode an endpoint is w plus a signed delta and never wraps: no wrap in 1,606,398 endpoints on chains that do not touch the preset tables. The tables on master break this in 23,162 of 30,227,202 table-dependent endpoints. The fit now penalises wraps; 599 remain.

master this PR
mip check mean (BCPack-only textures) 22.0 dB 24.7 dB
mip check median 22.1 dB 24.0 dB
under 20 dB 36.0% 23.6%
real references, parent mip: blocks within tolerance 87.7% 87.7%
real references, child mip: blocks within tolerance 86.1% 88.4%

Plain BC6H scores 29.1 dB on the same mip check, so BC6H is still not exact.

Tests: cargo test --release -p sixng-core bc passes (18 tests).

**@⁠holdmysocks** on GitHub · 2026-11-24 02:32 UTC · [original](https://github.com/holdmysocks/SixNG/pull/103) `holdmysocks:claude/bcpack-tables-2` → `master` · +206 −206 · 2 files · 2 commits · merged 2026-11-24 02:39 UTC Tables only; no decoder code changes. These commits were pushed to the branch of #58 after it had been merged, so they are not on master yet. **BC7.** Index presets made consistent with the anchor rule, all presets refitted under the secondary-index reset rule of #58, and alpha added to the fit (it scored only red, green and blue before, so alpha presets were never fitted). Whole-install mip check (mip 0 downsampled against mip 1), 1,433 BC7 textures: | | master | this PR | |---|---|---| | colour mean | 38.7 dB | 39.2 dB | | colour under 30 dB | 6.8% | 4.6% | | colour under 20 dB | 1.7% | 1.2% | | alpha mean | 39.8 dB | 49.2 dB | | alpha under 30 dB | 40.8% | 13.2% | **BC6H.** In a transformed mode an endpoint is w plus a signed delta and never wraps: no wrap in 1,606,398 endpoints on chains that do not touch the preset tables. The tables on master break this in 23,162 of 30,227,202 table-dependent endpoints. The fit now penalises wraps; 599 remain. | | master | this PR | |---|---|---| | mip check mean (BCPack-only textures) | 22.0 dB | 24.7 dB | | mip check median | 22.1 dB | 24.0 dB | | under 20 dB | 36.0% | 23.6% | | real references, parent mip: blocks within tolerance | 87.7% | 87.7% | | real references, child mip: blocks within tolerance | 86.1% | 88.4% | Plain BC6H scores 29.1 dB on the same mip check, so BC6H is still not exact. Tests: `cargo test --release -p sixng-core bc` passes (18 tests).
Index presets made consistent with the anchor rule (no violation left in
131 million table-dependent anchor reads), then all presets refitted
against plain reference mips and arbitrated per field on every BC7
texture. The fits now score alpha as well as colour; before, alpha
presets were never fitted. Whole-install mip check on 1,433 BC7
textures: colour mean 38.7 -> 39.2 dB, under 30 dB 6.8% -> 4.6%, under
20 dB 1.7% -> 1.2%; alpha mean 39.8 -> 49.2 dB, alpha under 30 dB
40.8% -> 13.2%.
In a transformed mode an endpoint is w plus a signed delta and never
leaves [0, 2^bits): no wrap in 1,606,398 table-independent endpoints.
The old endpoint presets broke this in 23,162 of 30,227,202
table-dependent endpoints. The joint fit now penalises wraps; after
three rounds 599 remain. Mip check on BCPack-only textures: mean
22.0 -> 24.7 dB, under 20 dB 36.0% -> 23.6%. Real-reference check:
parent mip 87.7% of blocks within tolerance, 28.6 dB (unchanged);
child mip 86.1% -> 88.4%, 18.5 -> 23.6 dB.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:10:02 +00:00
github manually merged commit 2a70bca03f into gh-pr/103/base 2026-11-26 20:10:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.