Repository navigation
build_dstorage_history: include packed depth-1 mips in first 256 blocks (DSTORAGE-FIT-SLICES-PACKED-MIP) - #2148
Conversation
…ks (DSTORAGE-FIT-SLICES-PACKED-MIP) In ools/build_dstorage_history.py::fit_slices(), packed depth-1 mips were previously skipped if their first block fell within the first 256 blocks ( ot 256 * 16 <= first < blocks * 16), under the assumption that the usual 2D fit already visited them. When those mips were skipped, their BC7 predictor rows were recorded with ep_bits=0, counting against the lost-block budget in untime/src/bcpack.cpp. Allow
No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rojectLeonida#2148 review) The comment now gives the reason: the usual 2D fit stops at each chunk's first 256 blocks, while a later block still reaches a built-in history entry through a chain of references, and these results only fill entries the usual fit left empty. The test's mip is the top mip at block 0 of its own chunk, not a packed tail mip; it is named after what it checks, with a docstring. It fails without the fit_slices change (entry 91 keeps 0 endpoint bits). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks! We merged
Measured on a full v1.0.2.1 copy (57 pools), running
So on this copy the wider pass costs about 4.7 minutes per build and fills no entry. We're keeping this open:
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Verified on main a73a57e (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) |
|
#2148 | head 45a7cbc (merged cleanly with main 039870e) | Audited |
|
Red/green: classified READY by oreo-lotK (red on main, green on head merged with main); head 45a7cbc unchanged since 2026-11-26, before that run. |
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).