Repository navigation
Audit hashes of regenerated gzip containers and propose a one-paragraph rule (no κ) - #220
Closed
maxime-fleury wants to merge 1 commit into
Closed
maxime-fleury wants to merge 1 commit into
maxime-fleury wants to merge 1 commit into
Conversation
maxime-fleury
force-pushed
the
research/gzip-container-reproducibility
branch
from
October 9, 2026 19:24
eed0de4 to
d656775
Compare
Two observations establish the failure mode: CrocSwap#202's canonical check requires the sha256 of a container it regenerates (exact_complex_flow_lift.py:409 and :419, required by source-assisted-v4/verify.py:162) and fails on unchanged inputs, while CrocSwap#194 passes in the same environment; and PR212's pinned archive rebuilds byte for byte as a tar payload but not as a container. The repository already has the fixes in use -- CrocSwap#194 decompresses before comparing, CrocSwap#217 pins payload hashes and CrocSwap#207 checks semantic fields -- so this adds a scanner that locates the pattern, the audit with file and line evidence, and one CONTRIBUTING.md paragraph stating the rule once. Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
maxime-fleury
force-pushed
the
research/gzip-container-reproducibility
branch
from
October 9, 2026 19:31
d656775 to
24e51c7
Compare
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.
No κ, no certificate change, no new mathematics. This audits one reproducibility pattern and proposes a rule for it.
The pattern
A package writes a container with
gzip.compress(...), hashes the compressed bytes, and requires that hash to equal a value committed or pinned when the container was produced elsewhere. A gzip container's deflate stream depends on the writing interpreter and zlib build, so that check can fail on unchanged inputs and can hide a real change behind an environment difference.Two observations establish it, from opposite directions:
research/source-assisted-v4/verify.py:162) stops withCanonical certificate does not reproduce. Exactly seven leaves differ and all derive from one value: the sha256 of the compressed lift certificate, written byresearch/source-assisted/decision/exact_complex_flow_lift.py:409and recorded at:419ascertificate_sha256=digest(cert_path)of the file. Every other leaf, including κ, the complex saving, the bit effective saving and the assembly records, is equal. PR Replays of the verifiers of #207, #202, #197 and #199 (no new κ) #214 reproduces this on CPython 3.13.16 with the pinned numpy 2.3.5 / scipy 1.17.0, and reports the same failure for Source-assisted v4 complex word with PR189's bit supplier: conditional κ = 6.674324e-4 #194's own verifier under CPython 3.12.3, with the lift inputs unchanged between the two commits; Source-assisted v4 complex word with PR189's bit supplier: conditional κ = 6.674324e-4 #194's CI passed the same check under the same versions.a1175449(verified), but not as a container: shipped316aa694…/ 1,405,363 bytes againstcb71d72d…/ 1,404,558 bytes here, and no zlib level 1–9 reproduces the shipped length. No number changes;ceiling.pystill checks the archive's file hashes.What the repository already does right
research/paired-cube-bit/paired_cube_bit_word.py:935-937(at Source-assisted v4 complex word with PR189's bit supplier: conditional κ = 6.674324e-4 #194's head, inherited by its successors) carries the reason in a comment:if name.endswith('.gz'): # gzip bytes depend on the zlib build; compare the compressed content→old, data = gzip.decompress(old), gzip.decompress(data)→require(old == data, …). Source-assisted v4 complex word with PR189's bit supplier: conditional κ = 6.674324e-4 #194'sbit/prove.pydecompresses before comparing too.research/pair-assembly/frame/frame_compile.py:41-49recordsgzip_sha256next toword_sha256; Conditional κ = 6.84696826673891e-4: paid XOR butterflies with cascade-optimized frames #217'srun_bit.py:151recordsprime_witness_sha256next toprime_canonical_sha256; Conditional κ = 6.84696826673891e-4: paid XOR butterflies with cascade-optimized frames #217'sexpected-bit.jsonpins payload hashes forgraph_p12.json,word_p12.json,frames_p12.json.verify_inner.py:23,29-30comparesexact_scalar_program_sha256and the complex profile's fields instead of a container..gzis safe — those bytes are fixed and no check regenerates them (research/aligned-final-pricing-result/SOURCE.json:12-21, and the vendored upstreamSOURCE.jsonfiles).What is added here
research/gzip-container-reproducibility/with the audit above (file and line evidence),gzip_hash_audit.py(a heuristic scanner: writes / container-digest / comparison, printed with its evidence), andCONTRIBUTING-note.md, which carries the paragraph proposed forCONTRIBUTING.md— place it after the paragraph asking contributors to include regenerated certificates. Its text: compare payloads not containers when a check regenerates a file; pin payloads or semantic fields rather than container digests; committed containers are fine to pin; a container digest may be recorded only as an environment receipt, with the interpreter and zlib versions beside it, and must not be required to match across environments.Scanner findings, one full-tree checkout per pinned head (
git worktree add --detach), "risky" being a file that writes a container and records a digest of it:main3b6b668639.pyfiles, 3 risky (research/pair-assembly/frame/frame_compile.py:48,research/machine-transfer-verification/stream-transfer/experiments/balanced_split.py:64,scripts/experiments/probe_pair_ranked.py:41); #194a8c8778578 files, 3 (those three, plusresearch/source-assisted/decision/exact_complex_flow_lift.py:419, the record observation 1 follows); #2028d8d67b605 files, 3 (the same three); #207cd14825650 files, 4 (the merged tree's three pluscoordinated-crossover-pr200/geometry/audit-gauge-charts.py:50); #2129b6ad03640 files, 3 (the merged tree's three); #21634abdc5660 files, 5 (theirs plusaudit-gauge-charts.py:50twice, in the package and in its vendored baseline); #217b739fc2654 files, 3 (the merged tree's three; the scanner does not flagrun_bit.py:151). Opened rather than counted, the three shared flags read as records beside the payload digest (frame_compile.py:48), a record nothing reads back (probe_pair_ranked.py:41), and the one container digest in the merged tree that is required against a stored value --balanced_split.py:64withverify_balanced_split.py:67, safe while the container and its receipt travel together from one run, observation 1 if a harness ever regenerates the container from the candidate's inputs. The scanner is a heuristic, not a proof of absence: it cannot see a digest recorded in one file and required in another (the #202 case is written out as a chain of file and line for that reason).Prepared with Anthropic Claude assistance; Apache-2.0. No existing file is changed; the
CONTRIBUTING.mdedit is left to the maintainers.