Repository navigation
bcpack_tables: the four width-9 tables match the MDU's own (BUILD-2010) - #6140
slint6614-dev wants to merge 1 commit into
Conversation
PROB_TABLES[(9, q)] for q = 8, 10, 13, 14 differed from FREQ_TABLE in third_party/bcpack-rs, which is generated from Microsoft's mdu_minirans.v, by 1 to 3 in a few bands. Both summed to 65536, so neither failed a check. mdu_minirans.v at silicon-rans 2f6827d has the bcpack-rs values; take them, and test every width 1-9 table against FREQ_TABLE so they stay in step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nWg6GaC13rCneTote8CNR
|
Independent Windows CPU check of 06c8965c on 561b65a8. Windows x64, CPython 3.12.8. An independent parse of the pinned Microsoft table found all 144 width-1–9 rows equal to the vendored Rust values and to the active Python entries. Width 10 has no corresponding hardware row in that source. The selected BCPack, BPTC, history, calibrated-texture, and line-ending suites passed 119 tests. Two optional calibrated-texture checks skipped because NumPy was unavailable. Synthetic fixtures and public tables only. AI-assisted. |
|
Tested 06c8965 merged with main 6adeaf0 on Linux/Python 3.12.16: pass Commands run (merged worktree,
Diff read: the PR corrects a handful of probability-table entries (widths 9 rows such as (9, 8), (9, 10), (9, 13), (9, 14)) in tools/bcpack_tables.py, and the new test compares every width 1 to 9 entry with the 9 x 16 rows of |
Claimed in the coordination issue as: BUILD-2010 (claim)
What and why
tools/bcpack_tables.pyPROB_TABLES[(9, q)]differed fromFREQ_TABLE[8][q]inthird_party/bcpack-rs/src/tables.rsfor q = 8, 10, 13 and 14, by 1 to 3 in a few bands (@TG0000's finding). Both versions sum to 65,536 (band p weighted by its 2^(p-1) symbols), so no existing check could tell which one is wrong.tables.rssays it is generated frommdu_minirans.vin microsoft/silicon-rans at2f6827d, the MDU decoder's own tables. I readfreq_tablein that file at that commit: all 144 entries (widths 1-9, q 0-15) equalFREQ_TABLE, and the four width-9 entries are the bcpack-rs values, for example q = 14 is31006, 16338, 6570, 1137(the Python table had31009, 16335, 6572, 1136). The other 140 Python entries already matched. So the Python side was off, probably from the fitting its docstring mentions, and this PR takes the hardware values:…, 1219, 1150, ……, 1221, 1149, ……, 2054, 1625, ……, 2056, 1624, …12593, 10175, …12594, 10174, …31009, 16335, 6572, 1136, …31006, 16338, 6570, 1137, …tests/test_bcpack_tables.pygetsProbTablesMatchHardware: everyPROB_TABLES[(w, q)]for widths 1-9 must equal the first w + 1 entries ofFREQ_TABLE[w - 1][q], read fromtables.rsin the repository (no network). Width 10 is inPROB_TABLESonly. The MDU tables stop at 9 alphabet bits, so there is nothing to compare it with, and this PR leaves it alone.Unused today, as the finding says: the default lane widths are at most 8.
Tested
Linux (WSL2 Ubuntu 26.04), Python 3.14; no GPU or game files involved.
python -I tests/test_bcpack_tables.py: OK; under pytest, 35 passed and 144 subtests.main'stools/bcpack_tables.pyfails exactly the four subtests(9, 8),(9, 10),(9, 13)and(9, 14).tests/test_bcpack.py,test_bcpack_tables_bptc.py,test_bcpack_history_calib.py,test_calibrated_texture.py,test_calibrated_texture_extra.py: OK.python -m compileall -q,git diff --check,tests/test_text_write_line_endings.py: OK.tools/bcpack_tables.py(ASSET-334: Add a standalone Rust BCPack DDS batch exporter #5303, ASSET-518: Report per-entry BCPack publication and fallback outcomes #6109) change other parts of it. That file merges cleanly with both (git merge-tree); they already conflict withmainintests/test_ttpf_assets.py.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (Not a translator change.)🤖 Generated with Claude Code
https://claude.ai/code/session_013nWg6GaC13rCneTote8CNR