BC7 rank 152: mode 3 measured by the ANCHOR status rule — pin (3, 21), partition still inferred #2434

Merged
z3r0rc merged 1 commit from upstream-pr/2434 into main 2026-11-28 23:47:18 +00:00
z3r0rc commented 2026-11-27 04:50:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by z3r0rc on 2026-11-27T04:50:07Z.


Claimed as BCPACK-BC7-RANK152-MODE3 in #1608.

What. Rank 152 currently carries the ordering's mode-2 guess (2, 38, 0, 0). The
mode is testable against the corpus without confirming the whole table: the ANCHOR
status rule (spec-fixed anchor pixel indices per partition) rejects every mode-2
reading of every retail corpus chunk whose lane-15 signature ranks at 152 — a full
64-partition scan over the ttdb_* pools finds no status-clean mode-2 decode. So 152
is a mode-3 entry; this pins BC7_CONFIG[152] = (3, 21, 0, 0).

  • Mode 3: measured (the ANCHOR-status scan; exact both ways — every confirmed
    mode-3 rank admits no clean mode-2 reading, every confirmed mode-2 rank admits one).
  • Partition 21: inferred. Colour coherence cannot pick partitions (within-family
    top-1 is 0/12 on confirmed ranks); 21 is top-1 among ≥10 status-clean mode-3
    readings. It stays a guess: 152 REMAINS in BC7_CONFIG_INFERRED, strict decoding
    still refuses chunks that reference it, and the fitted-profile runtime path is
    unaffected either way.

Consequence: the override duplicates rank 119's (3, 21, 0, 0) and drops
(2, 38, 0, 0), so BC7_CONFIG is no longer a bijection — 284 unique configs — and
that is pinned by tests, not hidden. Falsifier: if 119 is ever confirmed at (3, 21) by
its own signature, this entry or the mode-2 head order is wrong.

Measured effect (Wine 11.22, NVIDIA 620.73.04, RTX 4090, retail story load): BC7
chunks using rank 152 stopped refusing, and with a fitted history profile the last
standing dstorage_failure 0x89240030 refusal in a deep run cleared (that one entry
was BC6H, explained by the endpoint gap — the rank fix removed every rank/config-class
refusal it gated).

Tests. tests/test_bcpack_tables_bptc.py: new
test_bc7_rank152_override_deviation pins the duplicate, the dropped entry, and that
152 stays inferred. tests/test_bcpack.py: the completeness test becomes a structure
assertion (286 entries, sentinel intact, 284 unique) and the inferred-rank mode
assertion pins 152's mode-3 reading. python -m unittest tests.test_bcpack tests.test_bcpack_tables_bptc → 48/48 OK; check_no_game_data.py clean over the
changed files; no game files in the diff.

Docs. docs/textures.md: the codec-tables paragraph and the BC7 table row now say
the 10 flagged inferred ranks include one (152) that is mode-measured and
partition-inferred. Overlaps #2427 (same paragraph, docs-only) — will rebase onto
whichever lands first.

AI-assisted (OpenCode agent on a private mirror; branch is one commit on
d1dff7949).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5521376874 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2434). Originally posted by [z3r0rc](https://github.com/z3r0rc) on 2026-11-27T04:50:07Z. --- Claimed as `BCPACK-BC7-RANK152-MODE3` in #1608. **What.** Rank 152 currently carries the ordering's mode-2 guess `(2, 38, 0, 0)`. The mode is testable against the corpus without confirming the whole table: the ANCHOR status rule (spec-fixed anchor pixel indices per partition) rejects every mode-2 reading of every retail corpus chunk whose lane-15 signature ranks at 152 — a full 64-partition scan over the `ttdb_*` pools finds no status-clean mode-2 decode. So 152 is a mode-3 entry; this pins `BC7_CONFIG[152] = (3, 21, 0, 0)`. - **Mode 3: measured** (the ANCHOR-status scan; exact both ways — every confirmed mode-3 rank admits no clean mode-2 reading, every confirmed mode-2 rank admits one). - **Partition 21: inferred.** Colour coherence cannot pick partitions (within-family top-1 is 0/12 on confirmed ranks); 21 is top-1 among ≥10 status-clean mode-3 readings. It stays a guess: 152 REMAINS in `BC7_CONFIG_INFERRED`, strict decoding still refuses chunks that reference it, and the fitted-profile runtime path is unaffected either way. Consequence: the override duplicates rank 119's `(3, 21, 0, 0)` and drops `(2, 38, 0, 0)`, so `BC7_CONFIG` is no longer a bijection — 284 unique configs — and that is pinned by tests, not hidden. Falsifier: if 119 is ever confirmed at (3, 21) by its own signature, this entry or the mode-2 head order is wrong. **Measured effect** (Wine 11.22, NVIDIA 620.73.04, RTX 4090, retail story load): BC7 chunks using rank 152 stopped refusing, and with a fitted history profile the last standing `dstorage_failure 0x89240030` refusal in a deep run cleared (that one entry was BC6H, explained by the endpoint gap — the rank fix removed every rank/config-class refusal it gated). **Tests.** `tests/test_bcpack_tables_bptc.py`: new `test_bc7_rank152_override_deviation` pins the duplicate, the dropped entry, and that 152 stays inferred. `tests/test_bcpack.py`: the completeness test becomes a structure assertion (286 entries, sentinel intact, 284 unique) and the inferred-rank mode assertion pins 152's mode-3 reading. `python -m unittest tests.test_bcpack tests.test_bcpack_tables_bptc` → 48/48 OK; `check_no_game_data.py` clean over the changed files; no game files in the diff. **Docs.** `docs/textures.md`: the codec-tables paragraph and the BC7 table row now say the 10 flagged inferred ranks include one (152) that is mode-measured and partition-inferred. Overlaps #2427 (same paragraph, docs-only) — will rebase onto whichever lands first. AI-assisted (OpenCode agent on a private mirror; branch is one commit on `d1dff7949`).
zmasi commented 2026-11-28 03:13:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T03:13:37Z.


#2434 | head 70792ddf1f (merged cleanly with main 02f71ccfe) | python -I tests/test_bcpack.py && python -I tests/test_bcpack_tables_bptc.py | red on main: test_bcpack FAILED (failures=1) in 20 tests; test_bcpack_tables_bptc FAILED (failures=3) in 28 tests | green on PR+main: test_bcpack 20 tests OK; test_bcpack_tables_bptc 28 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across all 4 touched files (rank 152 stays in BC7_CONFIG_INFERRED so strict mode still refuses it, and runtime/CMakeLists.txt generates C++ tables directly from tools/bcpack_tables_bptc.py at build time so no checked-in generated file drifts). Also verified on merged PR+main: test_bcpack_history_calib.py (19/19 OK), test_bcpack_tables.py (34/34 OK), test_bcpack_tool.py (18/18 OK, skipped=1), test_docs_links.py (17/17 OK), test_docs_table_rows.py (2/2 OK), test_runner_calls_all_tests.py (3/3 OK), test_text_write_line_endings.py (3/3 OK), git diff --check, and scripts/check_no_game_data.py (clean).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232899085 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2434#issuecomment-7232899085). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T03:13:37Z. --- #2434 | head 70792ddf1f244626b3f341b0c4ff25d97d07ae8f (merged cleanly with main 02f71ccfe) | `python -I tests/test_bcpack.py && python -I tests/test_bcpack_tables_bptc.py` | red on main: test_bcpack FAILED (failures=1) in 20 tests; test_bcpack_tables_bptc FAILED (failures=3) in 28 tests | green on PR+main: test_bcpack 20 tests OK; test_bcpack_tables_bptc 28 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across all 4 touched files (rank 152 stays in `BC7_CONFIG_INFERRED` so strict mode still refuses it, and `runtime/CMakeLists.txt` generates C++ tables directly from `tools/bcpack_tables_bptc.py` at build time so no checked-in generated file drifts). Also verified on merged `PR+main`: `test_bcpack_history_calib.py` (19/19 OK), `test_bcpack_tables.py` (34/34 OK), `test_bcpack_tool.py` (18/18 OK, skipped=1), `test_docs_links.py` (17/17 OK), `test_docs_table_rows.py` (2/2 OK), `test_runner_calls_all_tests.py` (3/3 OK), `test_text_write_line_endings.py` (3/3 OK), `git diff --check`, and `scripts/check_no_game_data.py` (clean).
timbot103 commented 2026-11-28 14:36:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T14:36:44Z.

Review: COMMENTED


Static code audit against PR head 70792ddf1 and main ec740bcc3.

  • Please qualify “mode 3 measured” or add independent evidence. The ANCHOR rule can exclude mode 2 for the states tested. Modes 3 and 7 share the same primary index width and anchors, and the synthetic scan produced identical passing partitions for both.
  • The inferred bit still gates strict decoding. The fitted runtime uses the new tuple for endpoint coverage and block output. Two anchor-clean partitions produced different bytes in a synthetic check. Please clarify the fitted-path impact and compare the partition against independent output.
  • Please add a rank-152 decode test that asserts strict refusal and exact provisional output. The current decode test exercises rank 149.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6098419261 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2434#pullrequestreview-6098419261). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T14:36:44Z. **Review:** COMMENTED --- Static code audit against PR head `70792ddf1` and main `ec740bcc3`. - Please qualify “mode 3 measured” or add independent evidence. The ANCHOR rule can exclude mode 2 for the states tested. Modes 3 and 7 share the same primary index width and anchors, and the synthetic scan produced identical passing partitions for both. - The inferred bit still gates strict decoding. The fitted runtime uses the new tuple for endpoint coverage and block output. Two anchor-clean partitions produced different bytes in a synthetic check. Please clarify the fitted-path impact and compare the partition against independent output. - Please add a rank-152 decode test that asserts strict refusal and exact provisional output. The current decode test exercises rank 149. AI-assisted.
TheGeogeo commented 2026-11-28 23:38:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T23:38:03Z.


Tested 70792ddf1 merged (no commit) with main aa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • Green: test_bcpack.py (20 tests) and test_bcpack_tables_bptc.py (30 tests) pass.
  • Red: with tools/bcpack_tables_bptc.py back to main, test_bcpack_tables_bptc.py fails 3 tests ((2, 38, 0, 0) != (3, 21, 0, 0)) and test_bcpack.py fails 1.

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247561103 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2434#issuecomment-7247561103). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-28T23:38:03Z. --- Tested `70792ddf1` merged (no commit) with `main` `aa918e5d9`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - Green: `test_bcpack.py` (20 tests) and `test_bcpack_tables_bptc.py` (30 tests) pass. - Red: with `tools/bcpack_tables_bptc.py` back to `main`, `test_bcpack_tables_bptc.py` fails 3 tests (`(2, 38, 0, 0) != (3, 21, 0, 0)`) and `test_bcpack.py` fails 1. No blocker from my side. AI-assisted (Claude Code).
MoonEyes commented 2026-11-28 23:47:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T23:47:20Z.


Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto main fa2fd0a99 without conflict, and its test file(s) (tests/test_bcpack.py, tests/test_bcpack_tables_bptc.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247663886 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2434#issuecomment-7247663886). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T23:47:20Z. --- Merged after **TheGeogeo**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/2434#issuecomment-7247561103)) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto `main` fa2fd0a99 without conflict, and its test file(s) (`tests/test_bcpack.py`, `tests/test_bcpack_tables_bptc.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!2434
No description provided.