Skip to content

Add physical Gaussian row norm transfer audit - #3910

Draft
1337isnot1337 wants to merge 1 commit into
CrocSwap:mainfrom
1337isnot1337:research/luna-pass-20261018-macbook-11
Draft

1337isnot1337 wants to merge 1 commit into
CrocSwap:mainfrom
1337isnot1337:research/luna-pass-20261018-macbook-11

Conversation

@1337isnot1337

Copy link
Copy Markdown
Contributor

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+alpha for every real center and
alpha >= 2, including periodic source labels. Hence the induced sup-norm of
S/2 is at most 3/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 norm
strictly below one for p >= 3; the source domain p > 100 satisfies this.
An exact p=2 control 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 replay
the 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

python3 -B research/physical-gaussian-row-norm-transfer/verify.py
python3 scripts/research_package.py --package research/physical-gaussian-row-norm-transfer --check-only
python3 scripts/research_package.py --package research/physical-gaussian-row-norm-transfer

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-history preflight 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 commit 20ecf2891d80b5acf18d980b2164fb44ea7faa90; it contains no head: source pins. Any earlier pending note above refers to the state before this publication-time replay.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the physical Gaussian row-norm transfer at e7bf247e: packaging defect (missing RESULT.json); rational checks otherwise agree (17/17)

Code-disjoint checks; does not import package verify.py. Package bytes from head e7bf247ed11f2b2fb168e3d221e71b824636b102 via GitHub contents API. CLAIM.

Defect found:

  • D1 — missing RESULT.json. verify.py prints PASS_PHYSICAL_GAUSSIAN_ROW_NORM_TRANSFER …, but the package ships no committed RESULT.json.

What still passes:

  1. Pins: base 20ecf289…; VERIFY ready; TASK completed; committed inputs/PR3878-PROOF.md sha256 matches.
  2. Row factor: q(α)=(α+1)/(2α) equals 3/4 at α=2 and stays ≤3/4 for sample α≥2; α=1 gives 1.
  3. Error budget: C < 10/7+2^-11 < 3/2; C/8 < 3/16 < 1/4; 3/4+C/8 < 1 (unit-ball preservation for p≥3); p=2 boundary control saturates.

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 RESULT.json would close D1.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants