Repository navigation
Add physical Gaussian row norm transfer audit - #3910
Draft
1337isnot1337 wants to merge 1 commit into
Draft
1337isnot1337 wants to merge 1 commit into
1337isnot1337 wants to merge 1 commit into
Conversation
Contributor
|
Independent scoped audit of the physical Gaussian row-norm transfer at Code-disjoint checks; does not import package Defect found:
What still passes:
Not covered: re-proving the layer-cake row sum analytically beyond the recorded rational consequences; new κ; formal-kernel proof. This is a finite rational replay, not a formal proof. Adding a committed check.py#!/usr/bin/env python3
"""Code-disjoint audit of PR #3910 physical Gaussian row-norm transfer."""
from __future__ import annotations
import hashlib
import json
from fractions import Fraction
from pathlib import Path
ROOT = Path(__file__).resolve().parent
PKG = ROOT / "pkg"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
HEAD = "e7bf247ed11f2b2fb168e3d221e71b824636b102"
EXPECTED_PROOF_SHA = "5452f3e2191824b4a8451c83fbdf58b3b2228f4e1966a6f22c3e60bd152e56b0"
def check(name: str, cond: bool) -> bool:
print(f"[{'PASS' if cond else 'FAIL'}] {name}")
return bool(cond)
def sha256_file(path: Path) -> str:
return hashlib.sha256(path.read_bytes()).hexdigest()
def main() -> int:
results: list[tuple[str, bool]] = []
sources = json.loads((PKG / "SOURCES.json").read_text(encoding="utf-8"))
task = json.loads((PKG / "TASK.json").read_text(encoding="utf-8"))
verify = json.loads((PKG / "VERIFY.json").read_text(encoding="utf-8"))
readme = (PKG / "README.md").read_text(encoding="utf-8")
proof_local = (PKG / "PROOF.md").read_text(encoding="utf-8")
pr3878 = PKG / "inputs" / "PR3878-PROOF.md"
results.append(("D1 RESULT.json absent (packaging)", not (PKG / "RESULT.json").exists()))
results.append(("D2 SOURCES.base_commit", sources.get("base_commit") == BASE))
results.append(("D3 TASK.base_commit", task.get("base_commit") == BASE))
results.append(("D4 VERIFY.status ready", verify.get("status") == "ready"))
results.append(("D5 TASK.outcome present", task.get("outcome") in ("completed", "partial", "negative-result")))
results.append(("D6 README mentions row-norm / unit ball", "row" in readme.lower() and ("unit" in readme.lower() or "3/4" in readme)))
results.append(("P1 PR3878 proof sha256", sha256_file(pr3878) == EXPECTED_PROOF_SHA))
results.append(("P2 PROOF.md cites alpha>=2 and 3/4", "alpha >= 2" in proof_local and "3/4" in proof_local))
# Independent rational checks (renamed from package verify)
q2 = (Fraction(2) + 1) / (2 * Fraction(2))
results.append(("A1 q(alpha=2) == 3/4", q2 == Fraction(3, 4)))
all_le = all(Fraction(a + 1, 2 * a) <= Fraction(3, 4) for a in (2, 3, 7, 32, 101))
results.append(("A2 q(alpha) <= 3/4 for sample alphas >=2", all_le))
results.append(("A3 alpha=1 gives q=1 (misses 3/4)", Fraction(1 + 1, 2 * 1) == 1))
C_up = Fraction(10, 7) + Fraction(1, 2048)
results.append(("A4 C_upper < 3/2", C_up < Fraction(3, 2)))
results.append(("A5 C_upper/8 < 3/16 < 1/4", C_up / 8 < Fraction(3, 16) < Fraction(1, 4)))
results.append(("A6 C_upper/2^101 < 1/4", C_up / (2**101) < Fraction(1, 4)))
results.append(("A7 3/4 + C_upper/8 < 1", Fraction(3, 4) + C_up / 8 < 1))
results.append(("N1 C_upper/4 > 1/4 (p=2 budget fails)", Fraction(1, 4) < C_up / 4))
results.append(("N2 exact+1/4 saturates unit ball at 1", Fraction(3, 4) + Fraction(1, 4) == 1))
digests = {}
for p in sorted(PKG.rglob("*")):
if p.is_file():
digests[str(p.relative_to(PKG))] = sha256_file(p)
(ROOT / "digests.json").write_text(json.dumps(digests, indent=2) + "\n", encoding="utf-8")
passed = sum(1 for name, cond in results if check(name, cond))
total = len(results)
print(f"SUMMARY {passed}/{total}")
(ROOT / "summary.txt").write_text(f"{passed}/{total}\n", encoding="utf-8")
return 0 if passed == total else 1
if __name__ == "__main__":
raise SystemExit(main())James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor). |
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.
Summary
Adds an independent proof of the all-center row-mass bound for the exact
normalized Gaussian map used by PR #3878. The layer-cake argument proves
sum_j exp(-pi (j-c)^2/alpha^2) <= 1+alphafor every real center andalpha >= 2, including periodic source labels. Hence the induced sup-norm ofS/2is at most3/4.Combining that bound with PR #3878's local error premise
C 2^-p,C=sqrt(2)+2^-11, shows that a unit-ball tile input has output normstrictly below one for
p >= 3; the source domainp > 100satisfies this.An exact
p=2control shows why the precision guard is part of this deduction.Scope
This is a local independent audit of the row-norm and input-domain implication
at PR #3878 head
1a86a8fb73bb7a0982fff99852a031832c191902. It does not replaythe physical tile, establish its analytic error estimate, prove a tensor
recurrence or implement the full caller. The active tensor-join work at
discussion #1166 comment 19010279 remains separate.
Verification
Each final scoped verification command listed above passed. Earlier baseline
attempts stopped at paths omitted from the initial sparse checkout. No selected
replay, Lean run, hosted CI, or PR #3878 registered replay is claimed.
Credit Jose Manuel (
jmbarrancoml) for PR #3878 and its source contract.Publication validation
The registered package replay passed on CPython 3.12.3 with
python3.12 scripts/research_package.py --package research/physical-gaussian-row-norm-transfer. The optional--check-source-historypreflight could not run because this MacBook checkout is shallow and the checker requires full Git history. This package's source manifest pins only files at its exact base commit20ecf2891d80b5acf18d980b2164fb44ea7faa90; it contains nohead:source pins. Any earlier pending note above refers to the state before this publication-time replay.