BC6H BCPack: endpoint presets refitted on edge continuity #170

Manually merged
github merged 1 commit from gh-pr/170/head into gh-pr/170/base 2026-11-26 20:15:04 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 15:40 UTC · original
holdmysocks:claude/bcpack-bc6h-edges → master · +48 −48 · 1 files · 1 commits · merged 2026-11-24 16:18 UTC

Only bc6pack_tables.rs changes; 48 endpoint preset slots get new values (the commit message says 57, which counts nine slots twice across two sweeps).

Defect. Flat areas of some BC6H textures decoded as speckle: blocks whose endpoint chains start at different preset slots got different colours for the same background.

Check, needing no reference. For neighbouring blocks whose chains start at different places, the log2 pixel step across the shared edge should match the normal step (0.2). For 46 slots it was more than 1.0 higher, with a constant sign, so the slot value was off by a large constant.

Fit. Each slot's 12 values are refitted to minimise that step, with the no-wrap rule as a penalty. A slot changes only if its cost falls by more than 5 %.

Measure Before After
Real references (not used by the fit), down-mip 25.1 dB 32.7 dB
Real references, up-mip 32.2 dB 34.1 dB
Slots with edge step more than 1.0 above normal 46 1
Mip check, 89 BCPack-only BC6H textures, median 25.7 dB 29.1 dB
Same, textures under 20 dB 21.3 % 5.6 %
Same, textures better / worse 52 / 2
Blocks breaking the no-wrap rule 221 288

The two textures that got worse lost 0.1 and 0.2 dB. Plain BC6H textures of the same stores have a mip-check median of 28.7 dB, so BCPack BC6H is now level with them. 20 slots still show a moderate edge excess (0.5 to 1.0).

Tests: decoder tests pass.

**@⁠holdmysocks** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/holdmysocks/SixNG/pull/170) `holdmysocks:claude/bcpack-bc6h-edges` → `master` · +48 −48 · 1 files · 1 commits · merged 2026-11-24 16:18 UTC Only `bc6pack_tables.rs` changes; 48 endpoint preset slots get new values (the commit message says 57, which counts nine slots twice across two sweeps). **Defect.** Flat areas of some BC6H textures decoded as speckle: blocks whose endpoint chains start at different preset slots got different colours for the same background. **Check, needing no reference.** For neighbouring blocks whose chains start at different places, the log2 pixel step across the shared edge should match the normal step (0.2). For 46 slots it was more than 1.0 higher, with a constant sign, so the slot value was off by a large constant. **Fit.** Each slot's 12 values are refitted to minimise that step, with the no-wrap rule as a penalty. A slot changes only if its cost falls by more than 5 %. | Measure | Before | After | |---|---|---| | Real references (not used by the fit), down-mip | 25.1 dB | 32.7 dB | | Real references, up-mip | 32.2 dB | 34.1 dB | | Slots with edge step more than 1.0 above normal | 46 | 1 | | Mip check, 89 BCPack-only BC6H textures, median | 25.7 dB | 29.1 dB | | Same, textures under 20 dB | 21.3 % | 5.6 % | | Same, textures better / worse | | 52 / 2 | | Blocks breaking the no-wrap rule | 221 | 288 | The two textures that got worse lost 0.1 and 0.2 dB. Plain BC6H textures of the same stores have a mip-check median of 28.7 dB, so BCPack BC6H is now level with them. 20 slots still show a moderate edge excess (0.5 to 1.0). Tests: decoder tests pass.
Blocks whose endpoint chains start at different places should meet without
a step. For 46 preset slots the log2 step across such edges was more than
1.0 above the normal 0.2, with a constant sign: the slot value was off by a
large constant, which showed as speckle in flat areas. Each slot is refitted
to minimise that step, with the no-wrap rule as a penalty; 57 slots change.

Real references, which the fit does not use: down-mip 25.1 to 32.7 dB,
up-mip 32.2 to 34.1 dB. Mip check of the 89 BCPack-only BC6H textures:
median 25.7 to 29.1 dB, under 20 dB 21.3 % to 5.6 %, 52 better, 2 worse.
No-wrap violations 221 to 288.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:15:02 +00:00
github manually merged commit f44f70df87 into gh-pr/170/base 2026-11-26 20:15:04 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.