BC1 interoperability: two-block synthetic case for the second reference lane #10
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/Ahmet-Dedeler--bcpack-rs#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@tyr0nsur on GitHub · 2026-11-25 20:49 UTC · original
I compared the two BC1 assemblers at bcpack-rs
f5145dda7fusing two generated blocks and the default tables. The entropy decoders agree on every input symbol. Changing just the second symbol of lane 1 leaves bcpack-rs output identical, while VIctory's BC1 assembler changes both the endpoints and indices of the second block. No dictionary entry before block zero is needed. The zero-reference control agrees byte for byte.This generates the two streams using your public encoder:
00 00 00 00 aa aa aa aa00 00 00 00 aa aa aa aa00 00 00 00 aa aa aa aaa1 17 5d f0 0a 0a 5f f5Both runs have first block
a1 17 5d f0 50 50 fa af. Your BC1 assembler takes the endpoint distance from lane 0. VIctory uses the index reference from lane 1 plus the signed endpoint delta from lane 0. A comparison with an independent reference decoder for this pair could settle the intended semantics. I have verified the discrepancy on Windows x64. Thank you for the synthetic encoder. It also let us isolate and fix an unrelated end-of-fragment error in our entropy decoder.@Ahmet-Dedeler on GitHub · 2026-11-26 02:54 UTC · original
Thanks, this was a real bug and your two-block case made it easy to pin. Fixed in #11.
You're right about the semantics. bcpack-rs read lane 1 as unused because it was 0 in every retail chunk I measured, so the BC1 assembler took the endpoint reference straight from lane 0. The BC3/BC4/BC5 path in the same crate already did it properly through
format::references. Now BC1 does too: lane 1 is the index referencex, the endpoint reference isx + unzigzag(lane 0), and each pixel's index residual is added along the endpoint line, mod 4, to the same pixel of blocki - x.Your case is now a test (
bc1_lane1_index_reference). With lane 1 = 1 the second block comes outa1 17 5d f0 0a 0a 5f f5, same as VIctory's. With lane 1 = 0 nothing changes. The Python reference got the same fix and agrees with Rust on the synthetic vectors.One gap left: an index reference before block 0 has no known table here yet, so it reads zero and the block counts as unfitted. If you have a case where that matters, send it.