Test: reproduce/guard data.tar inflation over the archive lifecycle - #781
Draft
egpbos wants to merge 1 commit into
Draft
Test: reproduce/guard data.tar inflation over the archive lifecycle#781egpbos wants to merge 1 commit into
egpbos wants to merge 1 commit into
Conversation
Adds two tests to tests/utils/test_archive.py that replay the full proteus.py archive lifecycle (rolling update+remove_old cycles followed by the end-of-run full archive) on a realistic mini output/data/, and measure tar inflation by member content (SHA-256), not just by name. - test_lifecycle_final_pass_stores_reference_data_once: regression guard that the static EOS table and fixed-name runtime files enter data.tar exactly once across the whole lifecycle. Extends the rolling-only coverage of test_update_snapshots_only_bounds_tar_growth_across_cycles (#706) to the final remove_files=True pass, and adds a content-level check that a fixed-name file which legitimately changes each cycle (zalmoxis_output.dat) is preserved as distinct versions rather than counted as duplication. - test_lifecycle_snapshot_reappend_no_inflation: encodes the target "store each snapshot once / inflation ~1.0" contract. Marked xfail(strict=True): on main every timestamped snapshot lands in data.tar ~2x because the rolling archive keeps snapshots loose (remove_files=False) so each is re-appended on the next cycle before remove_old prunes it, and once more by the final full-archive pass. Strict so it becomes a hard failure once the archive redesign removes the duplication. Adds a _tar_content_stats helper (gross/distinct bytes, per-name member and distinct-content counts). Pre-existing archive tests unchanged.
egpbos
force-pushed
the
test/archive-snapshot-inflation
branch
from
July 24, 2026 14:10
1d20865 to
c482dc0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #781 +/- ##
=======================================
Coverage 92.66% 92.67%
=======================================
Files 110 110
Lines 15807 15807
Branches 2846 2846
=======================================
+ Hits 14648 14649 +1
+ Misses 1159 1158 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
@egpbos Please can you use the PROTEUS PR templates when creating the PRs? |
Member
Author
Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Phase 1 of an investigation into
data.tararchive inflation. Production profiling of a 1.1 TiB, 54-run dataset found ~97–98% ofdata.tarbytes were byte-identical duplicates. This PR pins the behaviour with tests before any redesign (Phase 2, separate); no production code is changed.Adds two end-to-end tests to
tests/utils/test_archive.pythat replay the fullproteus.pyarchive lifecycle (rollingupdate+remove_oldcycles, then the end-of-runupdate(remove_files=True)full archive) on a realistic minioutput/data/, and measure inflation by member content (SHA-256), not just by name:test_lifecycle_final_pass_stores_reference_data_once— regression guard that the static EOS table (spider_eos/) and fixed-name runtime files enterdata.tarexactly once across the whole lifecycle. Extends the rolling-only coverage oftest_update_snapshots_only_bounds_tar_growth_across_cycles(Super-Earth structure and thermal evolution: interior coupling, molten initial conditions #706) to the finalremove_files=Truepass, and adds a content-level check that a fixed-name file which legitimately changes each cycle (zalmoxis_output.dat) is preserved as distinct versions rather than mislabelled as duplication.test_lifecycle_snapshot_reappend_no_inflation— encodes the target contract (store each snapshot once, inflation ≈ 1.0). Markedxfail(strict=True): onmainevery timestamped snapshot lands indata.tar~2×, because the rolling archive keeps snapshots loose (remove_files=False) so each is re-appended on the next cycle beforeremove_oldprunes it, and once more by the final full-archive pass (observed inflation ~1.45× on this fixture).strictso it flips to a hard failure — forcing the marker's removal — once the archive redesign removes the duplication.Also adds a
_tar_content_statshelper (gross/distinct bytes, per-name member and distinct-content counts). Pre-existing archive tests are unchanged.Verdict recorded (measured on this fixture, not assumed): EOS/fixed-name files are fixed on
mainby #706'ssnapshots_only=Trueguard (green guard);.nc/.jsonsnapshots still inflate onmain(~2× per snapshot, strictxfail). The ~1.45× figure is fixture-specific and is not a claim about the production ratio.No linked issue yet — Phase 1 of the archiving-inflation investigation.
Validation of changes
pytest tests/utils/test_archive.py -q→ 21 passed, 1 xfailed, no regressions in the pre-existing archive tests.pytest ... --runxfailconfirms the xfail is a genuineassert 2 == 1(snapshot stored twice), not an incidental error masquerading as expected-fail.tools/check_test_quality.py --check,ruff check/format,tools/validate_test_structure.sh.Open question for reviewers (feeds the redesign, not asserted here): the
snapshots_only=Falsepath also retains multiple distinct versions ofzalmoxis_output.dat(append-only tar keeps every version under one name). Before deciding whether a redesign must preserve that version history, confirm whether any resume/extract path ever reads an older in-tar version or whether an overwrite was intended (tarfile.extractalllets the last member win).Checklist