bcpack_history_calib: deduplicate pools and guard outputs with report_paths (BCPACK-CALIB-DEDUP-PATH-GUARD) #1538
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1538"
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 Vemast on 2026-11-25T03:52:24Z.
Claimed in the coordination issue as: BCPACK-CALIB-DEDUP-PATH-GUARD (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7232954975; addresses finding https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7148659650)
What and why
Fixes two path-handling issues in
tools/bcpack_history_calib.py(reported as a finding in #14):_resolve_poolsdeduplication:_resolve_pools()previously deduplicated.ttpfpools withos.path.normcase(os.path.abspath(p)), which keeps distinct case spellings apart on macOS APFS/HFS+ and case-folding mounts (and does not collapse symlinks or hard links), scanning the same pool twice. It now deduplicates withreport_paths.path_key,report_paths.same_report_path, and(st_dev, st_ino)checks while keeping deterministic sort order.--outoverwrite guards and atomic JSON staging: Switcheswrite_outputs()from_ttpf.same_output_pathtoreport_paths.same_report_path(perCONTRIBUTING.md), validates all--outtarget paths up front inrun()before creating directories or scanning pools, guards--ref-dds(pool,dds) and--ref-pairs(pairs_path, plus nestedpool,dds,chunk_file, andref_fileentries) in addition to.ttpfpools, and stages JSON writes atomically viatempfile.mkstemp(newline="\n"),file_mode.published_mode, andreplace_retry.tests/test_bcpack_history_calib.pycovering macOS case-insensitive APFS and NFD/NFC accent deduplication, case-sensitive preservation, relative/hard-link/symlink deduplication, and pre-flight refusal when--outcollides withpairs.jsonor nested reference files.Tested
python -m compileall -q tools/bcpack_history_calib.py tests/test_bcpack_history_calib.py— cleanpython -I tests/test_bcpack_history_calib.py— 22 tests, OK (symlink subtest skipped on unprivileged Windows)python -I tests/test_text_write_line_endings.py— 3 tests, OKpython -I tests/test_report_paths.py— 22 tests, OK (2 skipped)python -I scripts/check_no_game_data.py tools/bcpack_history_calib.py tests/test_bcpack_history_calib.py— cleanGPUs tested: n/a (CPU-only Python tool and synthetic standard-library unit tests on Windows 11, Python 3.14; host GPU: NVIDIA GeForce RTX 5060, driver 621.24)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase). No open pull request changestools/bcpack_history_calib.pyortests/test_bcpack_history_calib.py.docs/design.md, with how it was confirmed. (No translator change.)Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T03:52:35Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T03:02:02Z.
Hi @Vemast, thanks for this pull request.
CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post
claiming: <ID>there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one (the IDBCPACK-CALIB-DEDUP-PATH-GUARDappears in the pull request, but there is noclaiming:line for it).The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time.
Could you post the claim in #1608 and add the ID to the pull request description? If you already claimed it in another form, a link to your comment is enough.
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by Vemast on 2026-11-28T03:18:11Z.
Thanks @MoonEyes!
#14had already hit GitHub's 2,500-comment cap when this PR opened, and#1608wasn't linked yet. I've now postedclaiming: BCPACK-CALIB-DEDUP-PATH-GUARDin #1608 (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7232954975, along withdone:at https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7232955325) and updated the PR description with the claim link.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T13:41:11Z.
Merged after local re-verification: this PR merged onto
main259be59b9without conflict, and its test file(s) (tests/test_bcpack_history_calib.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.