Ship BCPack's rANS models from Microsoft's MIT reference decoder #465
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!465
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-465"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@zmelumian972 on GitHub · 2026-11-30 07:09 UTC · original
zmelumian972:bcpack-mit-models→main· +60197 −5442 · 207 files · 660 commits · closed without mergingMicrosoft published BCPack's 128 static rANS models in silicon-rans (
mdu_minirans.v, MIT, commit 2f6827d). Itsfreq_tablematches the first 2,304 bytes of the format tables row for row (128 of 128), so that part can ship under Microsoft's licence.bcpack_models.rsholds the values, generated from the Verilog, with the MIT notice.The runtime now refuses a
VICTORY_BCPACK_TABLESfile whose models differ, so a wrong or corrupt file is reported instead of decoding to block noise (#385). The synthetic test tables use the real models instead of uniform ones. The asset policy page notes the exception's source.The rank tables, BC7 control words and dictionaries (75.7 KB) still come only from the local file. The bcpack-rs findings on the same retail stores show that data alone solves the rank tables and most BC7 control codes exactly, but not the dictionaries: a BC5 fit got 61 of 428 entry halves exact and 135 within ±1. BC7 dictionaries haven't been fitted yet, so whether a fitted fallback is good enough is still open.
The 13 BCPack tests pass in
victory-formats. Under Wine, thedstorageBCPack tests pass, including the existing BC4 stream and a new test for the refusal. The staged asset policy check and clippy are clean.🤖 Generated with Claude Code
VICTORY_BCPACK_TABLES, textures turn to square noise and only one log line says why #385@zmelumian972 on GitHub · 2026-11-30 07:11 UTC · original
I am looking into mathematical model solution for the rest of the file, the LRU are MIT appearntly, which is good
@Kal0s-design on GitHub · 2026-11-30 08:27 UTC · original · reviewed
Checked the shipped models against the source and ran the tests natively on Windows.
freq_tablefrommdu_minirans.vat microsoft/silicon-rans2f6827d8and compared it withMODEL_FREQS. All 128 rows (g < 8, 16 each) are identical. The Verilog rows have 10 entries; the tenth, which the PR drops, is 0 in every one of these 128 rows, so nothing is lost. The 9-bit group (g = 8) is rightly left out, since the format has 128 models.bcpack_models.rsis the repository'sLICENSEword for word (the PR adds a final full stop the original lacks). Copyright lineCopyright (c) Microsoft Corporation.matches.read_bcpack_tablescompares the first 2,304 bytes beforeTables::parse, so a shorter file whose prefix happens to match falls through to the size check (bytes.len() != TABLES_SIZE) and is still refused, just with that message. That's fine.victory-formatsbcpack 13 pass (4 ignored: the ones that need real tables), andvictory-hledstorage 20 pass, includingbcpack_tables_with_other_models_are_refused. CI is green.What I couldn't check: real BCPack streams still need the rank tables, BC7 control words and dictionaries from a local file I don't have, so decoding actual game data isn't exercised here. The PR text already says so.
AI-assisted: yes
@zmelumian972 on GitHub · 2026-11-30 17:04 UTC · original
Superseded by the new main, which ships the full BCPack tables built in (
Tables::builtin,bcpack-tables.bin). There is no user table file left to check against the models.Pull request closed