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

Closed
opened 2026-11-26 04:33:59 +00:00 by github-bot · 3 comments
Owner

@⁠pickles976 on GitHub · 2026-11-24 06:25 UTC · original

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).

**@⁠pickles976** on GitHub · 2026-11-24 06:25 UTC · [original](https://github.com/xcl-dev/xcl/issues/832) **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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:59 +00:00
Author
Owner

@⁠ettehn on GitHub · 2026-11-24 06:43 UTC · original

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.

**@⁠ettehn** on GitHub · 2026-11-24 06:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/832#issuecomment-7124231536) 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.
Author
Owner

@⁠Abuudiii on GitHub · 2026-11-24 06:59 UTC · original

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.

**@⁠Abuudiii** on GitHub · 2026-11-24 06:59 UTC · [original](https://github.com/xcl-dev/xcl/issues/832#issuecomment-7124495104) 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.
Author
Owner

@⁠ivall on GitHub · 2026-11-24 10:39 UTC · original

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.

**@⁠ivall** on GitHub · 2026-11-24 10:39 UTC · [original](https://github.com/xcl-dev/xcl/issues/832#issuecomment-7129080532) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.