Skip to content

Implement the complete physical Gaussian tensor transform - #3935

Merged
Mister-Meeseeks merged 19 commits into
CrocSwap:mainfrom
jmbarrancoml:research/physical-gaussian-tensor
Oct 21, 2026
Merged

Mister-Meeseeks merged 19 commits into
CrocSwap:mainfrom
jmbarrancoml:research/physical-gaussian-tensor

Conversation

@jmbarrancoml

@jmbarrancoml jmbarrancoml commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

I connect the retained Gaussian expansion, complete chirp and principal-core compression into a physical source-box transform. The isolated research/physical-gaussian-tensor/ package includes actual coefficient production, four canonical full-support gathers/scatters, short-field moves, periodic halos, original-axis page reuse, source-core assembly and exact normalization restoration.

Under the stated production and inherited transfer contracts, I derive the R F_s error bound with D=d-1 and gamma=D(2u+ceilLog2(32p)+1). I charge the catalogue, spectators, metadata, numerical children and polynomial setup, retaining the existing .99827619697 transfer allowance. I state the caller growth laws and leave the selected frontier unchanged.

I check the explicit p48/P80 fixture against separate natural-coordinate staged references: 49 inputs, 64 middle coordinates and 49 outputs, with 4,900 final bits and 12 nonzero restored outputs in each direction. The producer regenerates all 113,537 coefficient cells before the consumers use its authenticated immutable return. I also check altered-axis and half-disk rejection, positive reuse, protected outputs and fixed scratch restoration.

I preserve precision and fixtures while using fixed digits, streamed division, one-pass accumulators, saturating leaf admission and direct bounded signed records. I check literal two's-complement bits, wider-width and physical-alias fallbacks, malformed-input error order and partial-output cleanup. I preload the numerical import cohort and restore its direct and copied helper bindings after each scope. I retain the exact numerical formulas and fixed tape bounds. ARITHMETIC.md gives the proofs and ownership checks; CATALOGUE.md records the page's provenance.

At f687fa171ef760fa98a4be1289717b47dd4ee0b3, I passed metadata, the 57-file publication check and source-history validation. I passed all six commands from the official Git-free export and checked unchanged bytes and modes for its 58 files, including the receipt. Stage times: 2.863, 4.843, 33.144, 120.529, 142.613 and 143.197 seconds. The declared limits total 1,200 seconds, with a 390-second maximum. Export SHA256: 6b977956b2794094de4aa50545baceff9e43ccc68a473ce5569e6a710b97bac0; receipt SHA256: 115580f6c53a84c7e09401095e8ea7d043406adcd50cc5cf34d0b3e9d0a162aa.

I matched all six successful hosted replay records to that export and checked the successful unchanged-input step. The hosted numerical replay ran from 09:44:08 to 10:02:12 UTC on October 20. I verified test merge c8c304f4cfd181007bfc0bd9ff83a35fda960b9e against the published tree. I merged current main 12fa8c5c844be21bfefb38a19503fbd867a11244 after reading priority revision 7, then refreshed that same main before this handoff; all 15 live scientific inputs and the original historical provenance remain unchanged. In Discussion3664, I retain earlier timeouts, the interrupted attempt, exact receipts and overlap checks.

I use the finite witness for staged conformance, outside the production precision, separation and locality domain, with reduced Gaussian halos and retained q2 literal children. Its repeated 7×7 source lengths do not form a pairwise-coprime CRT witness. I leave production-sized execution, inherited universal supplier premises, numerical composition with CRT/integer recovery and independent human or formal-kernel review open. Tekalign's complementary PR4024 supplies the separate encoded address conversion.

Jose Manuel (jmbarrancoml), with substantial OpenAI Codex assistance. I retain the complete source exports and attribution from PR3878/3851/3787/3763/3709/3640, Dugongue's PR3877, the RaD project/hipotures and the nested source notices. The package records predecessor credit and the scope of adjacent contributions.

@jmbarrancoml
jmbarrancoml marked this pull request as ready for review October 20, 2026 10:08
@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the physical Gaussian tensor package at f687fa17: no defect found in the finite archive-seal / budget-arithmetic / fixture-pin layer

Code-disjoint reimplementation; does not import package verify.py / tensor_*.py. Package bytes from head f687fa171ef760fa98a4be1289717b47dd4ee0b3 via GitHub contents API. CLAIM. Package pins base_commit to 20ecf289…. Remote rad20/upstream SOURCES inputs were not re-fetched. Live six-suite verify.py re-execution was not run here.

What passes (15 of 15):

  1. Pins. VERIFY ready with six registered suites; README retains .99827619697 transfer allowance and leaves the selected frontier unchanged.
  2. Archives. All four package input archives authenticate (sha256 + git blob); p48 catalogue archive digest matches fixture pin; single page member.
  3. Budget arithmetic. Independent Fraction recomputation of β, φ−β routing margin, Gaussian power, p48 gamma=40 (not guard-admitted), larger guards, and chirp entrance inequalities.
  4. Fixture census (documented). 49/64/49 path; 4900 bits; 12 nonzero outputs; 113537-cell packet digest 46dbbc4b….

Not covered: live verify suites; remote semantic-bulk/upstream auth; production locality / Fourier-error allowance beyond the finite p48 guard; new κ.

This is a finite replay of committed receipts and exact budget identities, not a formal proof.

check_3935.py
#!/usr/bin/env python3
"""Independent finite controls for PR3935 (physical Gaussian tensor).

Authenticates local package input archives and recomputes exact budget /
gamma / transfer-allowance Fraction identities from stdlib only.
Does not import package verify.py / tensor_*.py.

Package head f687fa171ef760fa98a4be1289717b47dd4ee0b3 via GitHub API.
Package base_commit is 20ecf289… .

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
from __future__ import annotations

import argparse, hashlib, json, re, sys, tarfile
from fractions import Fraction as Q
from pathlib import Path

HEAD = "f687fa171ef760fa98a4be1289717b47dd4ee0b3"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
PHI = Q(99827619697, 100000000000)
CAT_SHA = "46dbbc4b4aff71548e8203fa5837762ea3f78117564952e8087a339e55ef208a"
CAT_ARCH = "7e10a7344d19674c68cc64537cbec48b2ff038a907ca00f92fab1c41aaae9af8"
results = []


def check(name, ok, detail=""):
    results.append((name, bool(ok), detail))
    print(("PASS " if ok else "FAIL ") + name + ((": " + str(detail)) if detail else ""), flush=True)
    return bool(ok)


def load(pkg, name):
    return json.loads((pkg / name).read_text(encoding="utf-8"))


def sha(path: Path):
    return hashlib.sha256(path.read_bytes()).hexdigest()


def blob(path: Path):
    data = path.read_bytes()
    return hashlib.sha1(b"blob " + str(len(data)).encode() + b"\0" + data).hexdigest()


def run(pkg: Path):
    sources = load(pkg, "SOURCES.json")
    verify = load(pkg, "VERIFY.json")
    task = load(pkg, "TASK.json")
    readme = (pkg / "README.md").read_text(encoding="utf-8")
    evidence = (pkg / "EVIDENCE.md").read_text(encoding="utf-8")
    fixture = (pkg / "tensor_fixture.py").read_text(encoding="utf-8")

    check("I1 SOURCES/TASK base_commit == 20ecf289…; VERIFY ready",
          sources["base_commit"] == BASE == task["base_commit"]
          and verify["status"] == "ready")
    check("I2 VERIFY registers six suites (sources/mechanics/arithmetic/catalogue/consumers)",
          len(verify["commands"]) == 6
          and [c["argv"][-1] for c in verify["commands"]]
          == ["sources", "mechanics", "arithmetic_all", "catalogue", "consumer", "consumer_opposite"])
    check("I3 README retains transfer allowance .99827619697 and leaves frontier unchanged",
          "99827619697" in readme
          and "I leave the selected frontier unchanged" in readme)

    # SOURCES local archive auth
    local = [f for f in sources["files"]
             if f["usage"] == "input"
             and f["path"].startswith("research/physical-gaussian-tensor/inputs/")]
    bad = []
    for row in local:
        rel = row["path"].split("research/physical-gaussian-tensor/", 1)[1]
        p = pkg / rel
        if not p.exists() or sha(p) != row["sha256"] or blob(p) != row["git_blob"]:
            bad.append(rel)
    check("S1 four package input archives authenticate (sha256 + git blob)",
          not bad and len(local) == 4, bad)

    check("S2 tensor_fixture catalogue archive sha matches inputs/p48-catalogue-v2.tar.gz",
          re.search(r'CATALOGUE_ARCHIVE_SHA256 = "([0-9a-f]+)"', fixture).group(1) == CAT_ARCH
          == sha(pkg / "inputs/p48-catalogue-v2.tar.gz")
          and re.search(r'CATALOGUE_SHA256 = "([0-9a-f]+)"', fixture).group(1) == CAT_SHA
          and CAT_SHA in evidence)

    with tarfile.open(pkg / "inputs/p48-catalogue-v2.tar.gz", "r:gz") as tar:
        names = tar.getnames()
    check("S3 p48 catalogue archive contains single gaussian-tensor-p48-page member",
          names == ["gaussian-tensor-p48-page-20261019.bin"])

    # Exact budget / gamma arithmetic (stdlib Fraction; no package imports)
    tau, epsilon, rho_u, delta = Q(332353, 332929), Q(997, 1000), Q(2, 1000), Q(1, 10000)
    beta = 1 - epsilon * (1 - tau)
    phi = PHI
    check("B1 beta == 41544341/41616125; phi-beta > 0 routing margin",
          beta == Q(41544341, 41616125)
          and phi - beta == Q(36798102513, 33292900000000000) > 0)
    gaussian = max(epsilon + delta, 1 - rho_u + delta)
    check("B2 gaussian power 9981/10000 < phi; epsilon+rho_u < 1; delta > phi-beta",
          gaussian == Q(9981, 10000) < phi
          and epsilon + rho_u < 1
          and delta > phi - beta
          and 1 - epsilon == Q(3, 1000))
    # p48 fixture gamma
    D, p, u, A = 2, 48, 4, 3
    j = (32 * p - 1).bit_length()
    gamma = D * (2 * u + j + 1)
    E = D * p * p + 32 + 2 * D
    threshold = gamma + A + (E - 1).bit_length() + 8
    error = Q(E, 1 << (threshold - gamma - A))
    check("B3 p48 guard: j=ceil_log2(32p); gamma=D(2u+j+1)=40; error≤1/256; not guard_admitted",
          j == (32 * p - 1).bit_length()
          and gamma == 40
          and error <= Q(1, 256)
          and Q(1, 2) + error < 1
          and gamma != 2 * D * u
          and not (p >= threshold))
    # additional guards from budget script
    guards_ok = True
    for D2, p2, u2, A2 in ((7, 1000, 9, 16), (100, 100000, 16, 1000)):
        j2 = (32 * p2 - 1).bit_length()
        g2 = D2 * (2 * u2 + j2 + 1)
        E2 = D2 * p2 * p2 + 32 + 2 * D2
        thr2 = g2 + A2 + (E2 - 1).bit_length() + 8
        err2 = Q(E2, 1 << (thr2 - g2 - A2))
        if not (err2 <= Q(1, 256) and Q(1, 2) + err2 < 1 and g2 != 2 * D2 * u2):
            guards_ok = False
    check("B4 larger (D,p,u,A) guards keep restored error ≤1/256 and gamma≠2Du",
          guards_ok)
    check("B5 chirp entrance margin 1/2+1/(20^4-1) < 21/38 < 3/5; epsilon+rho_u=999/1000",
          Q(1, 2) + Q(1, 20 ** 4 - 1) < Q(21, 38) < Q(3, 5)
          and epsilon + rho_u == Q(999, 1000)
          and epsilon + Q(3, 1000) == 1)

    check("F1 README states 49-input, 64-middle, 49-output path with 4900 bits and 12 nonzero outputs",
          "49-input" in readme and "64-middle" in readme and "49-output" in readme
          and "4900" in readme and "12 nonzero" in readme)
    check("F2 EVIDENCE records gamma=40 fixture comparison and 113537-cell packet digest 46dbbc4b…",
          "gamma=40" in evidence
          and CAT_SHA in evidence
          and "113537" in evidence)

    check("N1 README leaves selected frontier unchanged; remote rad20/upstream SOURCES not re-fetched",
          "I leave the selected frontier unchanged" in readme
          and isinstance(task.get("outcome"), (str, dict)))

    failed = [name for name, ok, _ in results if not ok]
    print(f"\n{len(results) - len(failed)}/{len(results)} PASS", flush=True)
    if failed:
        print("FAILED:", ", ".join(failed), flush=True)
        return 1
    return 0


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--pkg", required=True)
    ap.add_argument("--expect-head", default=HEAD)
    args = ap.parse_args()
    check("HEAD pin recorded (API fetch)", args.expect_head == HEAD, args.expect_head)
    return run(Path(args.pkg))


if __name__ == "__main__":
    sys.exit(main())

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).

@Mister-Meeseeks
Mister-Meeseeks merged commit e51227b into CrocSwap:main Oct 21, 2026
2 checks passed
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.

3 participants