BCPack: BC7 secondary-index reset rule and alpha fit, BC6H refit with exact rules #58
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!58
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/58/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-23 16:42 UTC · original
holdmysocks:claude/bcpack-rules→master· +359 −358 · 2 files · 2 commits · merged 2026-11-23 18:09 UTCChanges to the BCPack BC7 and BC6H decoders. One decoder rule changes; the rest is preset tables.
BC7: decoder rule fix. A block that has no secondary index set (every mode except 4 and 5) now resets that set to zero instead of carrying the previous one forward. Evidence: a valid BC7 block never has an anchor index with its top bit set. With the reset, that holds for all 24,316,547 anchor reads on chains that do not touch the preset tables (all 5,167 BC7 chunks); the old rule broke it for 29% of chained mode 4/5 blocks.
BC7: tables. Index presets made consistent with the anchor rule, all presets refitted under the new rule, 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:
BC6H: tables only. Every preset slot is fitted on real-reference and bootstrap chunks together, with two exact rules enforced: an anchor index never has its top bit set, and in a transformed mode an endpoint (w plus signed delta) never wraps. Both hold without exception on table-independent chains (2,433,955 anchor reads, 1,606,398 endpoints). Anchor violations in the tables: 0 left. Wraps: 23,162 before, 599 after.
Plain BC6H scores 29.1 dB on the same mip check, so BC6H is still not exact.
Tests:
cargo test --release -p sixng-core bcpasses (18 tests).