"""Audit published Table III arithmetic, without rerunning a storage experiment.""" import argparse import hashlib import json from decimal import Decimal, localcontext, ROUND_FLOOR, ROUND_CEILING from pathlib import Path import re ROOT = Path(__file__).resolve().parent HALF = Decimal("0.0005") COLUMNS = ["method", "file", "key", "index", "chunks", "mapping", "printedTotal", "printedSavingPercent", "printedIndexOverheadPercent"] def require(condition, message): if not condition: raise ValueError(message) def unique_object(pairs): result = {} for key, value in pairs: require(key not in result, "Duplicate JSON key: " + key) result[key] = value return result def load(path): return json.loads(path.read_text(encoding="utf-8"), object_pairs_hook=unique_object) def decimal(value, places=3): require(isinstance(value, str) and re.fullmatch( r"[0-9]+\.[0-9]{" + str(places) + r"}", value) is not None, "Expected nonnegative fixed-precision decimal string") return Decimal(value) def reduction(before, after): require(before > 0, "Positive denominator required") return 100 * (before - after) / before def envelope(before, after, before_error, after_error): require(before > before_error and after >= after_error, "Invalid rounding envelope") return (reduction(before - before_error, after + after_error), reduction(before + before_error, after - after_error)) def fixed(value, places=6): return format(value, "." + str(places) + "f") def calculate(data): require(type(data.get("schemaVersion")) is int and data["schemaVersion"] == 1, "Unsupported schema") require(data["columns"] == COLUMNS, "Column identity") require([d["name"] for d in data["datasets"]] == ["FSL", "VM"], "Dataset coverage") cases, comparisons = [], [] with localcontext() as context: context.prec = 40 for dataset in data["datasets"]: require([r[0] for r in dataset["rows"]] == ["only", "ZC", "PC"], "Method coverage") baseline = None for row in dataset["rows"]: require(len(row) == len(COLUMNS), "Row width") method = row[0] require((row[5] is None) == (method != "PC"), "Mapping presence must match the source row") components = [decimal(v) for v in row[1:5]] if row[5] is not None: components.append(decimal(row[5])) total = sum(components, Decimal(0)) error = len(components) * HALF printed = decimal(row[6]) reported_saving = decimal(row[7], 2) decimal(row[8], 2) require(reported_saving <= 100, "Invalid reported saving") require(total > error and printed > HALF, "Positive totals required") residual = total - printed bound = error + HALF cases.append({ "dataset": dataset["name"], "method": method, "componentCount": len(components), "componentSumGB": fixed(total, 3), "printedTotalGB": row[6], "componentSumMinusPrintedGB": fixed(residual, 3), "roundingResidualBoundGB": fixed(bound, 4), "roundingCompatible": abs(residual) <= bound, "printedSavingPercent": row[7], "printedIndexOverheadPercent": row[8], }) if method == "only": baseline = (total, error, printed, reported_saving) continue before, before_error, before_printed, before_saving = baseline low, high = envelope(before, total, before_error, error) comparisons.append({ "dataset": dataset["name"], "method": method, "baseline": "Metadedup only in Table III; not raw metadata", "componentSumBeforeGB": fixed(before, 3), "componentSumAfterGB": fixed(total, 3), "componentSumReductionGB": fixed(before - total, 3), "remainingReductionPercent": fixed(reduction(before, total)), "remainingReductionRoundingEnvelopePercent": [fixed(low.quantize(Decimal("0.000001"), rounding=ROUND_FLOOR)), fixed(high.quantize(Decimal("0.000001"), rounding=ROUND_CEILING))], "printedTotalReductionGB": fixed(before_printed - printed, 3), "remainingReductionFromPrintedTotalsPercent": fixed(reduction(before_printed, printed)), "differenceOfPrintedSavingRatesPercentagePoints": fixed(reported_saving - before_saving, 2), }) return { "schemaVersion": 1, "kind": "published-rounded-table-arithmetic-audit", "unit": data["source"]["unit"], "roundingAssumption": "Each size cell rounded to nearest 0.001 source GB; closed envelopes are conservative, not confidence intervals.", "dataPayloadIncluded": False, "experimentalReplication": False, "cases": cases, "comparisons": comparisons, } def markdown(report): rows = report["cases"] comparisons = report["comparisons"] lines = [ "# Metadedup compression: count the decoder, name the denominator", "", "The VM + PC row in Table III prints 26.730 GB, but its five displayed", "components sum to 26.743 GB. Keep both values: the table alone cannot", "tell us whether a cell or an accounting convention caused the mismatch.", "", "## Why the mapping matters", "", "The 2019 experiment applies zero compression (ZC) or page-based", "compression (PC) after Metadedup, at a 1 MB average segment target.", "PC includes a separate decoding-mapping component. [1]", "Short page-oriented codewords need a way back to their fingerprints;", "the earlier recipe-compression paper explains that lookup dependency. [2]", "A shorter recipe is therefore not, by itself, a complete capacity budget.", "", "## Six-row accounting audit", "", "The following is original arithmetic on attributed numerical facts,", "not a new measurement. GB retains the source label; no byte conversion", "or pooling of the FSL and VM populations is performed.", "", "| Population | Method | Printed total (GB) | Sum of components (GB) | Sum minus printed (GB) | Rounding-compatible? |", "| --- | --- | ---: | ---: | ---: | --- |", ] for row in rows: lines.append("| " + " | ".join([ row["dataset"], row["method"], row["printedTotalGB"], row["componentSumGB"], row["componentSumMinusPrintedGB"], "yes" if row["roundingCompatible"] else "no", ]) + " |") lines += [ "", "For VM + PC, 0.039 + 0.309 + 1.244 + 25.138 + 0.013 = 26.743.", "The 0.013 GB residual equals the displayed mapping cell. This equality", "is an accounting clue, not proof that the authors omitted that cost.", "FSL + PC, by contrast, includes all five components in its printed sum.", "", "Under nearest rounding to 0.001 GB, five components plus one total", "can disagree by at most (5 + 1) * 0.0005 = 0.003 GB.", "The observed 0.013 GB gap exceeds that conservative bound.", "The conclusion is conditional on that stated rounding model;", "it does not identify the intended unrounded result.", "", "## Percentage points are not remaining-space reduction", "", "Let B be the component sum for Metadedup only and C the sum after", "additional compression, including index and listed mapping costs.", "Hesela's remaining-metadata reduction is 100 * (B - C) / B.", "This denominator is the metadata already left after Metadedup, not", "the original raw metadata and not the repository's data payload.", "", "| Population | Added method | Component reduction (GB) | Reduction of remaining metadata | Same ratio using printed totals | Difference of printed saving rates (pp) |", "| --- | --- | ---: | ---: | ---: | ---: |", ] for row in comparisons: lines.append("| " + " | ".join([ row["dataset"], row["method"], row["componentSumReductionGB"], fixed(Decimal(row["remainingReductionPercent"]), 3) + "%", fixed(Decimal(row["remainingReductionFromPrintedTotalsPercent"]), 3) + "%", row["differenceOfPrintedSavingRatesPercentagePoints"], ]) + " |") lines += [ "", "For FSL + PC, (10.767 - 9.949) / 10.767 is about 7.597% of the", "remaining inclusive metadata. Subtracting the printed saving rates", "instead gives 97.68 - 97.46 = 0.22 percentage point. These answers", "use different denominators and component scopes; neither is 7.597%", "of all stored data. A component breakdown is needed to assess value.", "", "For VM + PC, the component sum implies about 0.882% remaining-space", "reduction; the printed total implies about 0.930%. Both calculations", "are exposed. The first is not presented as a corrected experimental", "result. The printed-rate differences are differences of already rounded", "percentages, not exact gains reconstructed from unrounded observations.", "", "## Precision and reproduction", "", "Inputs are decimal strings in table3.json. A missing mapping row is", "null, not a claim that mapping storage was measured as zero. It adds", "nothing only to the sum of the components that the table lists.", "For n listed components, the sum envelope is plus/minus n * 0.0005.", "Ratio bounds use the smallest baseline with the largest after-value", "for the lower bound, and the reverse for the upper bound.", "They are arithmetic rounding envelopes, not confidence intervals.", "", "Download table3.json, compression.py, test_compression.py,", "compression-results.json and COMPRESSION.md into the same directory.", "Run python3 compression.py --check and python3 -m unittest test_compression.py.", "Run python3 compression.py to regenerate the two derived outputs.", "The verifier rejects stale output, duplicate JSON keys, malformed", "decimals and missing or duplicate cases. It deliberately reports", "the source inconsistency instead of rewriting or hiding it.", "", "## Evidence limits", "", "The source contains aggregate trace-simulation results: 115 FSL daily", "backups and 26 VM daily backups, not repeated trials of this arithmetic. [1]", "No raw traces, prototype, latency, CPU cost, key recovery or restore", "test was executed here. No general compression ranking, economic", "recommendation or universal storage saving follows from these cells.", "The older recipe-compression study supplies mechanism context only;", "its workloads and performance figures are not mixed into Table III.", "", "The existing Table II ledger and all five of its downloads remain", "unchanged. This companion audit has separate inputs and output hashes.", "", "## Sources", "", "[1] Li, Lee, Ren and Zhang, Metadedup, MSST 2019, section VI-C B.3,", "Table III, PDF page 12:", "https://msstconference.org/MSST-history/2019/Research/Metadedup.pdf", "", "[2] Meister, Brinkmann and Suss, File Recipe Compression in Data", "Deduplication Systems, FAST 2013, section 2.2, p. 177:", "https://www.usenix.org/system/files/conference/fast13/fast13-final54.pdf", "", ] return "\n".join(lines) def outputs(folder): source = folder / "table3.json" report = calculate(load(source)) report["inputSha256"] = hashlib.sha256(source.read_bytes()).hexdigest() return {"compression-results.json": json.dumps(report, indent=2) + "\n", "COMPRESSION.md": markdown(report)} def verify(folder): for name, expected in outputs(folder).items(): require((folder / name).read_text(encoding="utf-8") == expected, "Stale or falsified " + name) if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--check", action="store_true") args = parser.parse_args() if args.check: verify(ROOT) else: for name, content in outputs(ROOT).items(): (ROOT / name).write_text(content, encoding="utf-8") print("Six Table III rows audited; source discrepancy retained, not repaired.")