build_dstorage_history: include packed depth-1 mips in first 256 blocks (DSTORAGE-FIT-SLICES-PACKED-MIP) #2148
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2148"
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?
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T23:34:44Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-26T00:42:42Z.
Thanks! We merged
maininto the branch and pushed one review commit (45a7cbc67):Measured on a full v1.0.2.1 copy (57 pools), running
build_dstorage_history.pybefore and after:So on this copy the wider pass costs about 4.7 minutes per build and fills no entry. We're keeping this open:
build_dstorage_history.pyon the pools where you saw the missing-endpoint failures, with and without this branch, and post theAvailable predictorsline from both runs (counts only)? If your copy fills more entries with it, that shows where it helps.fit_slicesas it is: it only takes raw or zlib siblings, and the thirdread_rangeargument is a decode cache. If you saw it somewhere else, please say where.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T12:23:49Z.
Verified on main
a73a57e1(Ubuntu 24.04 x86-64, Python 3.13, no GPU, no game data). Merges cleanly. With this PR, python -I tests/test_bcpack_history_calib.py: 20 tests OK. The PR's test file against main's tool: 1 failure, so the new test fails on main and passes with the change. compileall clean.AI-assisted: yes (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:09:05Z.
#2148 | head
45a7cbc674(merged cleanly with main039870ea2) |python -I tests/test_bcpack_history_calib.py| red on main:FAILED (failures=1)(historyEndpointBits[91][:8]remained[0]*8instead of[8]*8when a 2D mip started inside its chunk's first 256 blocks) | green on PR+main:20 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
0 <= first < blocks * 16infit_slices(tools/build_dstorage_history.py) andtest_fit_slices_fits_a_2d_mip_that_starts_in_the_chunks_first_256_blocksintests/test_bcpack_history_calib.py. Also verified clean merge (0conflicts) and combined execution alongside #2236 (4/4 OKintest_dstorage_multilevel_fit.pyand20/20 OKintest_bcpack_history_calib.py), plustests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:03:55Z.
Red/green: classified READY by oreo-lotK (red on main, green on head merged with main); head
45a7cbc674unchanged since 2026-11-26, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)