mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #991] [CLOSED] RT-BCPACK-DECODER: BC6H, so the runtime decoder covers all six BCPack modes #1029
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#1029
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/991
Author: @iFeyz
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:feat/bcpack-bc6h📝 Commits (4)
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()📊 Changes
10 files changed (+4176 additions, -1 deletions)
View changed files
📝
docs/directstorage.md(+10 -1)📝
runtime/CMakeLists.txt(+15 -0)➕
runtime/src/bcpack.cpp(+956 -0)➕
runtime/src/bcpack.h(+91 -0)➕
runtime/src/bcpack_tables.h(+1173 -0)➕
runtime/test/bcpack_test.cpp(+116 -0)➕
runtime/test/bcpack_vectors.h(+1178 -0)➕
runtime/test/bcpack_vectors.py(+355 -0)➕
tests/test_bcpack_header.py(+48 -0)➕
tools/bcpack_header.py(+234 -0)📄 Description
Claimed in the coordination issue as: RT-BCPACK-DECODER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136759575)
Depends on: #976, #982 (this branch is built on both; its last commit is this pull request)
What and why
The last BCPack mode for the runtime decoder: with BC6H,
gta6rt_bcpackcovers all six (BC1, BC3, BC4, BC5, BC6H,BC7), so the DirectStorage request path can decode whatever BCPack request a title makes once it is wired.
runtime/src/bcpack.cpp):_bc6h_blocksoftools/bcpack.py, refusing in its order: a mode symbol past13 at once (
Status::bad_block), then a reference into the built-in history (unconfirmed_history;tools/bcpack_tables_bptc.pyknows none of it), then anchor indices that do not fit their bit (bad_block).Lenient decoding (#982) reads the unknown history as zeros, as Python's provisional mode does, and counts those
blocks and every block that predicts from one in
Result::guessed.tools/bcpack_header.pywrites the 14 BC6H modes (code, transform, base and delta bits, regions,header size) and their header bit plans as
_bc6h_plancomputes them from the D3D11 layouts, so the layout stringsare not parsed a second time in C++. It stops if the built-in BC6H history ever gains known entries.
tests/test_bcpack.py's encoder (mode symbols 0..13 and now and then one past 13,partitions, endpoint and index distances within the chunk or into the built-in history, random endpoint deltas,
index deltas that keep the anchors representable, a few corrupted streams), with the strict and, where it
succeeds, the provisional Python answers.
docs/directstorage.md,bcpack.h.Not in this PR: the user's calibrated BC6H/BC7 history (strict refuses, lenient takes zeros) and the request-path
wiring, which goes on top of RT-DSTORAGE-DEST-PAGES.
Tested
bcpack_test: 120 lane cases and 250 chunk cases (90 BC1/BC3/BC4/BC5, 80 BC7, 80 BC6H) all agree with the strictPython decoder: 140 decoded to the same bytes, the others refused with the same class of error. Lenient decoding
gives Python's provisional blocks on the 98 chunks where that succeeds and agrees with strict wherever strict
decodes. MSVC
/W4, no warning.tests/test_bcpack_header.py,tests/test_docs_links.py,tests/test_text_write_line_endings.py,tests/test_tool_startup.py,scripts/check_no_game_data.pyon every changed file.ctest302 of 306 pass,bcpackincluded. The 4 failures are the same as on
mainhere (d3d12_clear,d3d12_execute_indirect_validation,d3d12_texture_tiles,d3d12_pipeline_library_host, all already reported in #14).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.