BC1 BCPack: preset window checked per texture, 20 slots replaced #154

Manually merged
github merged 1 commit from gh-pr/154/head into gh-pr/154/base 2026-11-26 20:13:48 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 13:26 UTC · original
holdmysocks:claude/bcpack-bc1-window2 → master · +18 −7 · 1 files · 1 commits · merged 2026-11-24 13:40 UTC

Follow-up to #126. Only bc1pack_tables.rs changes.

The plain references of a preset slot come from few textures (often under 50), so one large texture could decide a slot. Every texture now counts once, and a value is kept only if it wins on held-out textures.

  • Six of the nine slots replaced in #126 are no better than the default under that measure and go back to it: 48, 73, 120, 159, 194, 208. Slot 194 had made some textures up to 13 dB worse.
  • Three stay (33, 166, 222) and 17 are added, among them slots 127 and 192, which broke the index-3 rule most often.
  • One candidate (slot 153) passed the reference check but made textures worse in the mip check, so it is left at the default.

Mip check of 35,533 BCPack BC1 textures, against the default window:

Default window This PR
Mean 33.58 dB 33.79 dB
Under 20 dB 0.77 % 0.39 %
Textures better / worse 2,003 / 207
More than 2 dB better / worse 837 / 1

Largest loss 4.3 dB (one texture), largest gain 31.8 dB. Three-colour blocks that use index 3 on preset-rooted chains (5 % sample): 121,918 to 50,334.

The commit message gives the counts of an earlier run (1,834 / 81, on 33,993 textures of one pixel format); the table above is the measurement of this exact window on both BC1 formats.

Tests: decoder tests pass.

**@⁠holdmysocks** on GitHub · 2026-11-24 13:26 UTC · [original](https://github.com/holdmysocks/SixNG/pull/154) `holdmysocks:claude/bcpack-bc1-window2` → `master` · +18 −7 · 1 files · 1 commits · merged 2026-11-24 13:40 UTC Follow-up to #126. Only `bc1pack_tables.rs` changes. The plain references of a preset slot come from few textures (often under 50), so one large texture could decide a slot. Every texture now counts once, and a value is kept only if it wins on held-out textures. - Six of the nine slots replaced in #126 are no better than the default under that measure and go back to it: 48, 73, 120, 159, 194, 208. Slot 194 had made some textures up to 13 dB worse. - Three stay (33, 166, 222) and 17 are added, among them slots 127 and 192, which broke the index-3 rule most often. - One candidate (slot 153) passed the reference check but made textures worse in the mip check, so it is left at the default. Mip check of 35,533 BCPack BC1 textures, against the default window: | | Default window | This PR | |---|---|---| | Mean | 33.58 dB | 33.79 dB | | Under 20 dB | 0.77 % | 0.39 % | | Textures better / worse | | 2,003 / 207 | | More than 2 dB better / worse | | 837 / 1 | Largest loss 4.3 dB (one texture), largest gain 31.8 dB. Three-colour blocks that use index 3 on preset-rooted chains (5 % sample): 121,918 to 50,334. The commit message gives the counts of an earlier run (1,834 / 81, on 33,993 textures of one pixel format); the table above is the measurement of this exact window on both BC1 formats. Tests: decoder tests pass.
The plain references of a slot come from few textures, so every texture now
counts once. Six of the nine slots replaced before are no better than the
default under that measure and go back to it (48, 73, 120, 159, 194, 208);
slot 194 had made some textures up to 13 dB worse. Seventeen slots are added.

Mip check of 33,993 BC1 textures against the default window: 1,834 better,
81 worse; more than 2 dB better 782, worse 5. Under 20 dB: 0.79 % to 0.40 %.
Three-colour blocks that use index 3 on preset-rooted chains (5 % sample):
121,918 to 50,334.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:13:48 +00:00
github manually merged commit 063d35e8f8 into gh-pr/154/base 2026-11-26 20:13:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.