BC1 BCPack: replace nine preset window slots #126
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!126
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/126/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-24 05:31 UTC · original
holdmysocks:claude/bcpack-bc1-window→master· +75 −1 · 4 files · 1 commits · merged 2026-11-24 05:54 UTCBC1 chunks are decoded by the public
bcpackcrate with its default preset window. Some slots of that window are wrong: every block chained to such a slot gets shifted colour endpoints, and blocks that flip into three-colour mode show black holes where they use index 3.How the wrong slots were found. A block in three-colour mode (c0 <= c1) should not use index 3. Textures with real cut-out alpha break this, so it is not exact, but on chains that start at the default prediction only 0.018 % of blocks do (1,705 of 9.4 million in a 5 % sample of chunks). On chains that start at preset slots it is 0.14 %, concentrated in a few slots (one at 24 %).
What changes. A new module
bc1packreturns the crate's window with nine slots replaced;ttpf.rscalls it instead ofWindow::default_table()(one line). A slot is replaced only where a refitOn those nine slots, in the 5 % sample: violations 28,387 to 907, reference cost down 11.6 %.
Not changed. 31 further slots moved in the fit but are left at the crate default: either they have no plain reference to confirm the move, or the reference error rose, which points to real cut-out textures. Three of them have violation rates of 31 to 55 % and stay open.
Tests:
cargo test --release -p sixng-core bc, 20 pass (two new).