mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1715] dstorage: rebuild a BC6H/BC7 request with a few lost blocks instead of failing it (BCPACK-LOST-BLOCK-LIMIT) #1729
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#1729
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/1715
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:bcpack-bc7-partial📝 Commits (2)
7b25106dstorage: rebuild a BC6H/BC7 request with a few lost blocks instead of failing it (BCPACK-LOST-BLOCK-LIMIT)ca39fa9Merge upstream main into bcpack-bc7-partial📊 Changes
5 files changed (+81 additions, -6 deletions)
View changed files
📝
docs/directstorage.md(+11 -1)📝
runtime/shims/dstorage.cpp(+31 -1)📝
runtime/src/bcpack.cpp(+9 -3)📝
runtime/src/bcpack.h(+12 -1)📝
runtime/test/dstorage_test.cpp(+18 -0)📄 Description
Claim: BCPACK-LOST-BLOCK-LIMIT, https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7158195672
What and why
In fitted mode,
bcpack::decoderebuilds a BC6H/BC7 block from the local profile's history entry. Some blocks have a predictor chain that starts at an entry the profile does not know. They are rebuilt from the bits the profile has, and are counted as lost. Pastmax(2, blocks / 1024)lost blocks the whole request fails withE_DSTORAGE_DECOMPRESSION_ERROR(missing-endpoint/missing-index). The destination is then never written, so the texture region stays blank.On the 1.0.2.1 package, two BC7 requests in
data/ttdb/props/octa_imposters.ttpffail this way at every boot (DadaCap counted 6 of 6 runs in #1537; I see the same two in every boot of mine). With a profile rebuilt bytools/build_dstorage_history.pyon main, each request has exactly one unknown endpoint entry:A few approximate 4×4 blocks are far cheaper than a blank request. So:
runtime/src/bcpack.{h,cpp}:max(2, blocks / lost_divisor), through a newlost_divisorparameter;Reportreturns the block and lost counts;anchor-or-pbit) keep the 1-in-1,024 limit;runtime/shims/dstorage.cpp:LEONIDA_DSTORAGE_LOST_DIVISOR=Noverrides it, and1024is the old behaviour. A value that is not a positive number is logged once and 32 is used;[rt] dstorage: BC7 request approximated N of M blocks ...), the first eight and then at powers of two.docs/directstorage.md: the rule, the switch, and these two requests.Test
runtime/test/dstorage_test.cpp, for both BC6H and BC7, using the test profile with its slot 255 made unknown:missing-endpoint;lost_divisor = 1it decodes asfitted, and the report has every block and more than 2 lost;dstorage_test: 481 checks, 0 failures (Windows 11 Pro 26300, MSVC 19.50).gta6rtbuilds.The two real requests above were decoded with
tools/bcpack.pyand the locally fitted JSON profile:I did not boot the retail title with this branch, so the runtime log line on those two requests is not yet seen.
scripts/check_no_game_data.pyis clean.Why 32: it covers these requests (15 of 768 is 1 in 51), and it still refuses a request that has lost a real share of its blocks. It is a judgement, not a measurement. The switch is there to compare against.
AI-assisted: yes (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.