mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1103] RT-BCPACK-DECODER: the user's calibrated BC1/BC3/BC4/BC5 history in the sidecar and the request path #1139
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1139
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1103
Author: @iFeyz
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:feat/bcpack-history-bc15📝 Commits (7)
a371a73RT-BCPACK-DECODER: a runtime BCPack decoder, BC1/BC3/BC4/BC5, checked against tools/bcpack.pyeba0442RT-BCPACK-DECODER: BC7, and a lenient policy for the request path182b8c1RT-BCPACK-DECODER: BC6H, so the runtime decoder covers all six BCPack modes3a5f520RT-BCPACK-DECODER: review of #991 - say that lenient decoding never applies Python's loose limit, and reuse bytes in decode()e006370RT-BCPACK-DECODER: DirectStorage BCPack requests decode through the runtime decoderf7a18eeRT-BCPACK-DECODER: the user's calibrated BC6H/BC7 history in the runtime decoder and the request path0265612RT-BCPACK-DECODER: the user's calibrated BC1/BC3/BC4/BC5 history in the sidecar and the request path📊 Changes
14 files changed (+5788 additions, -47 deletions)
View changed files
📝
docs/directstorage.md(+50 -13)📝
runtime/CMakeLists.txt(+19 -2)📝
runtime/shims/dstorage.cpp(+139 -24)➕
runtime/src/bcpack.cpp(+1113 -0)➕
runtime/src/bcpack.h(+114 -0)➕
runtime/src/bcpack_tables.h(+1173 -0)➕
runtime/test/bcpack_test.cpp(+183 -0)➕
runtime/test/bcpack_vectors.h(+1885 -0)➕
runtime/test/bcpack_vectors.py(+443 -0)📝
runtime/test/dstorage_test.cpp(+148 -8)➕
tests/test_bcpack_header.py(+48 -0)➕
tests/test_bcpack_history_sidecar.py(+128 -0)➕
tools/bcpack_header.py(+234 -0)➕
tools/bcpack_history_sidecar.py(+111 -0)📄 Description
Claimed in the coordination issue as: RT-BCPACK-DECODER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136759575)
Depends on: #976, #982, #991, #1020, #1044 (this branch is built on them; its last commit is this pull request)
What and why
#1044 brought the user's calibrated BC6H/BC7 history to the runtime decoder and left BC1/BC3/BC4/BC5 out. Those
matter as much: the repository's tables confirm 252 BC1 entries but none for BC3, 2 for BC4 and 5 for BC5, so
without a calibration nearly every BC3/BC4/BC5 block that predicts from the built-in history is decoded from zeros
on the request path (and the retail title asks for mode 5, issue #14 comment 7135719755).
tools/bcpack_history_sidecar.py: when the history JSON has abc1/bc3/bc4/bc5section (read byload_bc_history, astools/bcpack.py --historyreads it), aBC15HIS1section follows the BC6H/BC7 tables: permode a given byte, the section's
replacebyte and its 256 confirmed entries (int16, -1 where not confirmed).71,192 bytes in all. A history without those sections still gives the 60,936-byte file of #984's profile, byte
for byte; only a file with BC1-5 history is longer, which #984's profile reader may not take.
runtime/src/bcpack.{h,cpp}:History::replace, andread_history_sidecarreads the optional section. Themerge is
_resolve_bc_history's: an entry given there wins over the built-in one, and withreplacethe built-intable is not read. Provisional entries are not written, as for the built-in tables (strict decoding takes confirmed
history only).
runtime/shims/dstorage.cpp: the request path reads files up to 128 KiB (it stopped at 70,000 bytes, whichwould have cut the longer sidecar and ignored it), and its log line says whether BC1-5 history came with it.
docs/directstorage.md; the "not done yet" entry for this is gone.Tested
bcpack_test: the synthetic history now has BC1-5 sections (BC1 replacing its table, the one with many confirmedentries; BC4 and BC5 merged, with confirmed and provisional entries; BC3 not given), and 100 BC1-5 chunks that read
the built-in history often, each with
tools/bcpack.py's strict answer for that same history. All agree; 10 decodeonly with the history, and BC1's
replacedecides the result of 9 (checked by decoding them with the flag off).The sidecar without its BC1-5 section (#984's size) still reads. The earlier cases are unchanged: the BC1-5 part
has a random generator of its own, so the regenerated header only adds.
dstorage_test: 355 checks, 0 failures. Its BC1 chunk is now one whose blocks are the same with the calibratedhistory, since that history replaces BC1's built-in table for the whole process; a failing check now names its case.
tests/test_bcpack_history_sidecar.py(6): the BC15HIS1 offsets, flags and a provisional entry left out, and theunchanged size without BC1-5 sections.
ctest302 of 306 pass,dstorageandbcpackincluded. The 4 failures are the same as onmainhere (d3d12_clear,d3d12_execute_indirect_validation,d3d12_texture_tiles,d3d12_pipeline_library_host, all already reported in #14).tests/test_bcpack_header.py,runtime/test/bcpack_vectors.py --check,tests/test_docs_links.py,tests/test_tool_startup.py,tests/test_text_write_line_endings.py,scripts/check_no_game_data.pyon everychanged file.
GPUs tested: n/a (CPU only)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.