Skip to content

docs: correct BCPack BC1 history status and pin it in CI - #3877

Open
sds-228 wants to merge 2 commits into
ItsNotRexed:mainfrom
sds-228:asset291-bc1-history
Open

sds-228 wants to merge 2 commits into
ItsNotRexed:mainfrom
sds-228:asset291-bc1-history

Conversation

@sds-228

@sds-228 sds-228 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: ASSET-291

What and why

docs/textures.md still described the BC1 256-slot predictor window as an open blocker and listed pre-660b7fab counts (248 confirmed / 7 provisional). The shipped tables have all 255 reachable slots (252 confirmed / 3 provisional), and the BC4/BC5 counts had also moved. A counts-only local check found no missing or unknown BC1 history references; the three remaining provisional entries still lack exact evidence and are unchanged here.

This PR corrects the status text and table rows, and adds a standard-library test that pins those rows to the shipped tables so a future table update cannot leave stale status. That test also runs in the docs-only CI path.

Rebase

Rebased onto current main at d54a8662. The earlier explicit change to the docs-only CI step is dropped: main now runs every tests/test_docs_*.py file there, so the new test is already selected without a separate list entry. The PR diff is now only the three corrected status rows and the new test.

Tested

  • python -I tests/test_docs_bcpack_status.py: 3/3 (counts, BC1 provisional keys and BC4/BC5 unfitted notes; a doctored note fails the test)
  • python -I tests/test_bcpack_tables.py: 34/34; python -I tests/test_bcpack.py: 16/16
  • python -I tests/test_docs_links.py: 5/5; python -m compileall -q make_game.py tools tests: clean
  • CPU only; no runtime or GPU change.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

AI-assisted (OpenCode).

@shdann

shdann commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 49a8086 on Windows, CPython 3.14.7, CPU only (no GPU, no game files): pass.

  • python -I tests/test_docs_bcpack_status.py: 3 OK. With docs/textures.md from the merge base (aa2988c) it fails with (248, 7) != (252, 3), so the test does pin the row. tests/test_docs_links.py and tests/test_ci_registration.py: OK.
  • The numbers the test does not pin, checked against tools/bcpack_tables.py on this head: BC1's provisional entries are exactly 6, 71 and 122, with entry 0 in neither set (252 + 3 = 255); BC4 has 172 entries (84 of 256 unfitted) and BC5 214 (42 unfitted), as the new notes say; the confirmed and provisional sets do not overlap in any of the four.

No contradiction found. AI-assisted.

@tupacfan04

Copy link
Copy Markdown
Contributor

Checked at the head on Windows 11 / Python 3.13.0: the new test 3/3, test_bcpack_tables 34/34, test_bcpack 16/16, all docs/text tests pass, and the merge is clean with main, #3876 and #3879.

Every fact matches the code: BC1 252/3 with the provisional {6, 71, 122}, 255 reachable entries and entry 0 unreachable (tools/bcpack_tables.py, tools/bcpack.py:386-417); BC3 0/35, BC4 2/170 (84 unfitted), BC5 5/209 (42 unfitted). The CI pin runs on docs-only and full paths, and reverting the BC1 row fails it (248, 7 != 252, 3).

One gap: tests/test_docs_bcpack_status.py:54-63 pins the counts but not BC1's three provisional entries or the BC4/BC5 unfitted notes, so those parts of the row can change silently. Pinning them too would match the intent.

Ready. AI-assisted review, docs only.

@sds-228

sds-228 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Addressed @tupacfan04's gap: the test now derives the BC1 provisional keys and the BC4/BC5 unfitted-slot notes from the shipped tables too, with a negative control for each note form. 3/3 pass; doctored notes fail. AI-assisted (OpenCode).

@openmubr

Copy link
Copy Markdown

Code read (CPU only). I did not run the tests, but I checked the numbers against tools/bcpack_tables.py on main (aa2988c) by parsing the source with ast, without importing it.

  • BC1: 252 confirmed / 3 provisional, provisional keys {6, 71, 122}, union of 255 slots without entry 0. BC4: 2 / 170, 84 slots unfitted. BC5: 5 / 209, 42 unfitted. BC3 is unchanged at 0 / 35. All of it matches the new rows and notes.
  • bcpack_tables.py has no imports, so the new test is fine under python3 -I in the docs-only job.
  • Only the rows at lines 935-938 match the test's regex, and no other stale count (248 confirmed, 7 provisional) is left in docs/. Lines 734 and 746 still call the 256-slot window a blocker, but they describe the initial probe, so they read correctly as history.

Minor, not blocking: the BC3 note ("All 256 colour-quadrant and 64 alpha-pair rank entries populated") sits next to a history table with 35 entries. I assume "rank" is a different table, but the note is not pinned by the test, so it could drift unnoticed.

I did not run tests/test_docs_bcpack_status.py or the other tests listed in the description.

AI-assisted (Claude Code). No game files.

@kapitche

Copy link
Copy Markdown
Contributor

Tested e882d56 merged with main 98fa503 on Linux (Python 3.12.16): pass. the four tests/test_docs_*.py 5/5 ok. Docs-only change, no negative control.

@sds-228
sds-228 force-pushed the asset291-bc1-history branch from f12e430 to d54a866 Compare November 23, 2026 15:43
@sds-228

sds-228 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main at d54a866 to clear the merge conflict. The diff is now only the three corrected BCPack status rows and the new standard-library test (3 files inspected, 3/3 local test cases pass). The earlier explicit CI list change is dropped because main's docs-only job now runs every tests/test_docs_*.py file, which selects the new test. HEAD is mergeable and clean.

AI-assisted (OpenCode).

@hcampbell98

Copy link
Copy Markdown

Tested d54a86626 merged with main 5cf3dafe3 on Linux (WSL2, Python 3.14.4, CPU only, no game files): pass.

  • git diff --check, compileall, and python3 -I scripts/check_no_game_data.py: clean.
  • python3 -I tests/test_docs_bcpack_status.py -v: 3/3 OK.
  • python3 -I tests/test_bcpack_tables.py: 34/34 OK; python3 -I tests/test_bcpack.py: 17/17 OK.
  • python3 -I -m unittest discover -s tests -p "test_docs_*.py": 39 run, 2 pre-existing docs/dev-tools.md failures (test_docs_cli_flags and test_docs_links, also present on main 5cf3dafe3); all remaining docs tests pass.
  • Negative control (origin/main docs/textures.md): tests/test_docs_bcpack_status.py fails 1/3 ((248, 7) != (252, 3) : stale status row for BC1 in docs/textures.md).

AI-assisted.

@mewajda

mewajda commented Nov 23, 2026

Copy link
Copy Markdown

Code read (CPU) — standard library only, no game files.

  • python -I tests/test_docs_bcpack_status.py: 3/3 pass.
  • The design is the right one: the docs rows are compared against bcpack_tables.BC{1,3,4,5}_HISTORY_CONFIRMED/_PROVISIONAL rather than against literals in the test, so the numbers cannot drift when the tables change — only the prose can go stale, which is exactly what this pins. The notes are pinned too: all 255 reachable slots populated for BC1, N history slots still unfitted for BC4/BC5 computed as 256 - reachable, and BC1's provisional keys in the note must equal the table's set.
  • The two parser unit tests are worth having: they separate "the regex broke" from "the doc is stale", which is the usual failure of a docs test.

One gap, worth closing here rather than later. parse_status_rows builds {codec: …}, so a second row for the same codec silently overwrites the first and the stale duplicate survives: docs/textures.md would pass with two BC1 rows as long as the last one is current. This repository has already been bitten by exactly that in table rows — tests/test_docs_design_rows.py exists because merges kept both sides of an edited row — so one assertion would make this test cover it:

found = ROW.findall(text)
self.assertEqual(len(found), len(rows), "a codec has more than one status row")

Verdict: the numbers are right on an independent read of bcpack_tables, and the test fails loudly on a stale doc; no blocking issues. AI-assisted.

@sds-228

sds-228 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@mewajda Good catch — fixed at the current head. Both status-row parsers now raise on a second row for the same codec instead of silently overwriting the first, with a regression that fails on the old parser. Focused suite 4/4 and the docs suite 39/39 pass.

AI-assisted (OpenCode).

@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Tested 4ae99a9 on Linux (WSL), Python 3.13: pass.

Ran: python3 -I tests/test_docs_bcpack_status.py (4 tests, pass) and tests/test_bcpack_tables.py, tests/test_docs_links.py (pass) at the PR head. Then with the PR's docs/textures.md hunk and the new test applied on current origin/main (dde82f2; docs/textures.md changed there since your base, tools/bcpack_tables.py did not): the hunk applies cleanly and the new test passes. The other tests/test_docs_*.py give the same results with and without the PR (test_docs_cli_flags.py and test_docs_links.py each have one failure that is already on main in this clone, unrelated to this PR).
Not run: Windows.

I also checked the counts on their own against tools/bcpack_tables.py: BC1 252/3 with provisional keys {6, 71, 122} and 255 reachable slots, entry 0 not among them; BC3 0/35; BC4 2/170, 84 unfitted; BC5 5/209, 42 unfitted. All four rows match. The CI docs step already runs tests/test_docs_*.py (ci.yml:55), so the test needs no registration.

AI-assisted review (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants