BCPack dictionary mode: the table layout to decode dictionary-backed BC blocks (as pinned by VIctory#658) #826

Closed
opened 2026-11-24 06:25:59 +00:00 by pickles976 · 3 comments
pickles976 commented 2026-11-24 06:25:59 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-24T06:25:59Z.


What this is: a gap note, format-documented, with attribution — no game data, no code copied.

The gap. Refusals of BCPack blocks in dictionary-backed modes are a measured part of the remaining wall (e.g., #781's 2,048 refusals; the cold-run hunt logged 314 residual BC5/BC6H/BC7 refusals after #208/#273 gave us BC1). XCL's dstorage.rs refuses BCPack paths wholesale rather than decoding them — and there is no issue tracking the dictionary table that dictionary-backed blocks resolve through, which will be the first thing any real implementation needs.

The format, as independently pinned by the sibling project. VIctory shipped the correct reader in Marvisak/VIctory#658 after discovering their first version misparsed it; the two subtleties they hit (both worth a unit test here):

  • the BC7 entry carries a redundant width u16 after the index sets ("again in all entries but the first") — skipping it misaligns everything downstream;
  • index set 1 has 15 slots, not 16 — "which no entry uses (0 bits)" — reading 16 shifts every following entry.

Their documented layout for the BC7 entry: u16 control, 24×u16, 2×u8, 2×u8, 16+15×i16, little-endian, no padding, with the validation invariant that every model must tile 65536 — plus the semantic checks that a set with 0 index bits holds no indices and pixel 0 is the anchor (top bit clear). That's a complete acceptance test in prose.

Why it matters now: with #549's submit-time snapshot removing the data wall, the residual refusals become the next thing every advanced run hits during world load — better to have the dictionary path tracked (and the two layout traps tested) before the swarm rediscovers them one refusal log at a time.

Attribution: format description from the sibling PR's public description/tests; no code lifted (their repo is GPL-3.0, ours GPL-2.0 — implementers should work from the format, not their source).

<!-- greyfinch-sync:ivall/xcl:issue:6576015369 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/832). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-24T06:25:59Z. --- **What this is:** a gap note, format-documented, with attribution — no game data, no code copied. **The gap.** Refusals of BCPack blocks in dictionary-backed modes are a measured part of the remaining wall (e.g., #781's 2,048 refusals; the cold-run hunt logged 314 residual BC5/BC6H/BC7 refusals after #208/#273 gave us BC1). XCL's `dstorage.rs` refuses BCPack paths wholesale rather than decoding them — and there is no issue tracking the **dictionary table** that dictionary-backed blocks resolve through, which will be the first thing any real implementation needs. **The format, as independently pinned by the sibling project.** VIctory shipped the correct reader in Marvisak/VIctory#658 after discovering their first version misparsed it; the two subtleties they hit (both worth a unit test here): - the BC7 entry carries a **redundant width `u16`** after the index sets ("again in all entries but the first") — skipping it misaligns everything downstream; - index **set 1 has 15 slots, not 16** — "which no entry uses (0 bits)" — reading 16 shifts every following entry. Their documented layout for the BC7 entry: `u16 control, 24×u16, 2×u8, 2×u8, 16+15×i16`, little-endian, no padding, with the validation invariant that every model must tile 65536 — plus the semantic checks that a set with **0 index bits** holds no indices and **pixel 0 is the anchor** (top bit clear). That's a complete acceptance test in prose. **Why it matters now:** with #549's submit-time snapshot removing the data wall, the residual refusals become the next thing every advanced run hits during world load — better to have the dictionary path tracked (and the two layout traps tested) before the swarm rediscovers them one refusal log at a time. Attribution: format description from the sibling PR's public description/tests; no code lifted (their repo is GPL-3.0, ours GPL-2.0 — implementers should work from the format, not their source).
ettehn commented 2026-11-24 07:06:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T06:43:48Z.


I’m taking the BC7 dictionary-entry reader and its synthetic regression tests. I have a local Rust prototype that reads consecutive 116-byte entries and checks the 16 + 15 index layout, zero-width sets, and the pixel-0 anchor. All four Rust tests passed on Windows x64 using synthetic records. DirectStorage integration is outside this patch.

Codex (GPT-6) assisted with implementation and verification.

<!-- greyfinch-sync:ivall/xcl:comment:7124231536 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/832#issuecomment-7124231536). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-24T06:43:48Z. --- I’m taking the BC7 dictionary-entry reader and its synthetic regression tests. I have a local Rust prototype that reads consecutive 116-byte entries and checks the 16 + 15 index layout, zero-width sets, and the pixel-0 anchor. All four Rust tests passed on Windows x64 using synthetic records. DirectStorage integration is outside this patch. Codex (GPT-6) assisted with implementation and verification.
Abuudiii commented 2026-11-24 07:06:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Abuudiii on 2026-11-24T06:59:16Z.


Independent synthetic check of the public dictionary reader at b8a791e3c7d284e38f6d5cbe44fa467d965174b4 on Arch Linux, Rust 1.99.1. Compiled the unchanged module under a small standalone rustc --test wrapper and ran bc7_dictionary::tests::: 4 passed, 0 failed, 0 ignored. This covers consecutive records, signed index placement, partial-record rejection, and the width/anchor checks. The separate mode-6 reconstruction checks also passed on synthetic inputs.

The two results do not verify a dictionary-backed block. The public material documents logical back-reference selection and record layout, but I did not find a verified mapping from the physical record and its 24 parameters to the mode-6 endpoint and p-bit predictors. No DirectStorage integration or new parser is proposed from these checks. No retail data or dictionary table bytes were used.

AI use: omp (GPT-6.2 Sol) ran the check and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7124495104 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/832#issuecomment-7124495104). Originally posted by [Abuudiii](https://github.com/Abuudiii) on 2026-11-24T06:59:16Z. --- Independent synthetic check of the [public dictionary reader](https://github.com/ettehn/xcl/commit/b8a791e3c7d284e38f6d5cbe44fa467d965174b4) at `b8a791e3c7d284e38f6d5cbe44fa467d965174b4` on Arch Linux, Rust 1.99.1. Compiled the unchanged module under a small standalone `rustc --test` wrapper and ran `bc7_dictionary::tests::`: **4 passed, 0 failed, 0 ignored**. This covers consecutive records, signed index placement, partial-record rejection, and the width/anchor checks. The separate [mode-6 reconstruction checks](https://github.com/ivall/xcl/pull/438#issuecomment-7124489529) also passed on synthetic inputs. The two results do not verify a dictionary-backed block. The public material documents logical back-reference selection and record layout, but I did not find a verified mapping from the physical record and its 24 parameters to the mode-6 endpoint and p-bit predictors. No DirectStorage integration or new parser is proposed from these checks. No retail data or dictionary table bytes were used. **AI use:** omp (GPT-6.2 Sol) ran the check and drafted this report.
ivall commented 2026-11-24 11:05:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T10:39:51Z.


Done by #905 (merged in 67a3735): it reads the BC7 dictionary entries with the layout of VIctory #658 (the repeated widths, 16 + 15 indices), and bc7_dictionary_indices_line_up checks every entry. Closing.

<!-- greyfinch-sync:ivall/xcl:comment:7129080532 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/832#issuecomment-7129080532). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T10:39:51Z. --- Done by #905 (merged in 67a3735): it reads the BC7 dictionary entries with the layout of VIctory #658 (the repeated widths, 16 + 15 indices), and `bc7_dictionary_indices_line_up` checks every entry. Closing.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#826
No description provided.