mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #2148] build_dstorage_history: include packed depth-1 mips in first 256 blocks (DSTORAGE-FIT-SLICES-PACKED-MIP) #2152
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#2152
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/2148
Author: @abnalstlll-byte
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/dstorage-fit-slices-packed-mip📝 Commits (3)
fc609e0build_dstorage_history: include packed depth-1 mips in first 256 blocks (DSTORAGE-FIT-SLICES-PACKED-MIP)5c343d2Merge main into fix/dstorage-fit-slices-packed-mip (#2148)45a7cbcbuild_dstorage_history: say why every 2D mip is fitted in fit_slices (#2148 review)📊 Changes
2 files changed (+55 additions, -3 deletions)
View changed files
📝
tests/test_bcpack_history_calib.py(+48 -0)📝
tools/build_dstorage_history.py(+7 -3)📄 Description
Include packed depth-1 mips whose first block lies in the chunk's first 256 blocks in
fit_slices()(DSTORAGE-FIT-SLICES-PACKED-MIP).Problem
In
tools/build_dstorage_history.py::fit_slices(), packed depth-1 mips were skipped if their first block fell within the chunk's first 256 blocks:This was based on the premise that "the usual 2D fit visits only the first 256 physical blocks". However, in packed tails,
calibrate_from_pools()does not necessarily visit or fit all packed mips with sibling context (especially where sibling mips share packed tail layouts). Skipping these mips caused the affected BC7 predictor rows to be recorded withep_bits=0, whichruntime/src/bcpack.cpptreats as an unknown predictor entry and counts against the lost-block budget.Solution
tools/build_dstorage_history.py::fit_slices(), change the check toif not 0 <= first < blocks * 16: continue. This ensures any packed depth-1 mip whose blocks lie within the chunk is visited and fitted against its sibling.tests/test_bcpack_history_calib.py, addtest_fit_slices_includes_packed_depth1_mip_in_first_256_blocksverifying that a packed depth-1 mip in the first 256 blocks is properly visited and recovers the expected predictor endpoint bits (depth 8 on entry 91).Finding by @Undefined3301 in issue #1608.
Verification
python -I scripts/check_no_game_data.py tools/build_dstorage_history.py tests/test_bcpack_history_calib.py-> 0 violations.python -I tests/test_text_write_line_endings.py-> 3/3 PASS.python -m compileall -q make_game.py tools tests-> Clean.python -I tests/test_bcpack_history_calib.py-> 20/20 PASS.AI-assisted (Claude Code).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.