mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1538] bcpack_history_calib: deduplicate pools and guard outputs with report_paths (BCPACK-CALIB-DEDUP-PATH-GUARD) #1565
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#1565
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/1538
Author: @Vemast
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:bcpack-calib-dedup-path-guard📝 Commits (1)
4f383c8bcpack_history_calib: deduplicate pools and guard outputs with report_paths (BCPACK-CALIB-DEDUP-PATH-GUARD)📊 Changes
2 files changed (+191 additions, -31 deletions)
View changed files
📝
tests/test_bcpack_history_calib.py(+96 -0)📝
tools/bcpack_history_calib.py(+95 -31)📄 Description
Claimed in the coordination issue as: BCPACK-CALIB-DEDUP-PATH-GUARD (addresses finding https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148659650; #14 hit GitHub's 2,500-comment cap before a claim comment could be posted and no successor coordination issue was open yet)
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.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.