Skip to content

Research P104 singular-mixing lifetime floor - #3907

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

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

Conversation

@1337isnot1337

Copy link
Copy Markdown
Contributor

Summary

Adds a scoped review of the P104 correction-matrix source-lifetime lower bound in research/p104-source-lifetime-216-review/.

For the frozen 104-row correction matrix C = I - G/2 and widened X-only monotone grammar G′, the reviewed counting proof yields L >= 216. The package records the finite census, exact source pins, proof audit, limitations, and a local arithmetic verifier. The pinned upstream replay reports 216 for the full singular-mixing model, 219 for the full invertible model, and 234 for the final-frame model.

This is a lower-bound review for the full 104-row correction matrix. It is distinct from the 208-flag endpoint construction. The bound remains below the 333-lifetime decision threshold and does not change the selected frontier or budget.

Verification

  • Exact upstream replay from 743640530229e1821ae11dc104798871272d6f00 with frozen inputs: PASS_P104_RANK1_MIXER_TOP floor_full=219 floor_final_frame=234 floor_full_singular_mixing=216 pairs_passing_T_final_frame=288 pairs_passing_T_full=414 both_halves_T=0 demo_lifetimes=4974 controls=7 lemma_max_ST=48.
  • Upstream source snapshot hash check: PASS_UPSTREAM_SOURCE_SNAPSHOT_HASHES 11.
  • python3.12 -B scripts/research_package.py --package research/p104-source-lifetime-216-review --check-only: passed metadata and pins.
  • python3.12 -B scripts/research_package.py --package research/p104-source-lifetime-216-review: passed arithmetic floor recomputation and registered package check.
  • git diff --check: passed.

Limits and credit

The written argument and finite replay are scoped to the frozen PR1972/PR1991 paths and G′ as defined in the package. This does not prove a chronological executable correction, a complete hosting bill, a supplier, an all-size theorem, or a new κ. The written proof is not machine checked and no independent human review is claimed. The selected-frontier replay was not run.

Credit Sagar Thakrar, with substantial Claude assistance, for the pinned 216/219/234 theorem and checker; Philippe Van Velzen for the relay grammar and geometry lineage; and Rohan Arun, Chafik Boukhalfa, and Adam Gall for the P104 native-channel lineage. This package records a GPT-6 Luna xhigh (macbook-04) proof review.

Current overlap

Open PR #3882 submits a source-consuming P104 correction tail. This package audits a separate lower bound for the frozen 104-row correction matrix and constructs no correction word.

Publication validation

The registered package replay passed on CPython 3.12.3 with python3.12 scripts/research_package.py --package research/p104-source-lifetime-216-review. 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 P104 singular-mixing lifetime floor at 8e3360b4: arithmetic and pins agree (21/21)

Code-disjoint checks; does not import package verify.py. Package bytes from head 8e3360b40ea4edf71719240c49fb4213145525fb via GitHub contents API; frozen inputs re-fetched at base 20ecf289…. CLAIM.

No packaging defect in scope. FINITE-RESULTS.json is the committed finite census artifact (no RESULT.json required by this package layout).

What passes:

  1. Pins: base 20ecf289…; VERIFY ready; TASK completed; FINITE source_commit = UPSTREAM 74364053…; upstream replay starts PASS_P104_RANK1_MIXER_TOP .
  2. Declared input sha256 pins match SOURCES and match blobs at base for LOWRANK-WITNESS, P104-FIXTURE, and ceiling.py.
  3. Census fields: 104 = 84+20; exempt ids length 12 matching both_halves_Tprime_full_good_targets; Tprime_pairs_full=1038.
  4. Floor arithmetic: A = 84−12−2·20 = 32, E = ⌈A/4⌉ = 8, L = 208+8 = 216.

Not covered: re-running the geometric T′ census / mixer proof upstream; new κ; formal-kernel proof. This checks the recorded counting identity and pins only.

This is a finite arithmetic replay, not a formal proof.

check.py
#!/usr/bin/env python3
"""Code-disjoint audit of PR #3907 P104 singular-mixing lifetime floor."""

from __future__ import annotations

import hashlib
import json
from pathlib import Path

ROOT = Path(__file__).resolve().parent
PKG = ROOT / "pkg"
UP = ROOT / "upstream"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
HEAD = "8e3360b40ea4edf71719240c49fb4213145525fb"
PASS_TOKEN = "PASS_P104_LIFETIME_FLOOR_216_ARITHMETIC"
UPSTREAM_COMMIT = "743640530229e1821ae11dc104798871272d6f00"

EXPECTED_INPUT_SHA = {
    "research/p104-native-channel/inputs/LOWRANK-WITNESS.json":
        "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e",
    "research/p104-native-channel/inputs/P104-FIXTURE.json":
        "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4",
    "research/complex-local-word-ceiling/ceiling.py":
        "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc",
}


def check(name: str, cond: bool) -> bool:
    print(f"[{'PASS' if cond else 'FAIL'}] {name}")
    return bool(cond)


def sha256_bytes(data: bytes) -> str:
    return hashlib.sha256(data).hexdigest()


def sha256_file(path: Path) -> str:
    return sha256_bytes(path.read_bytes())


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"))
    facts = json.loads((PKG / "FINITE-RESULTS.json").read_text(encoding="utf-8"))
    upstream = json.loads((PKG / "UPSTREAM-PINS.json").read_text(encoding="utf-8"))
    readme = (PKG / "README.md").read_text(encoding="utf-8")

    # Packaging / pins
    results.append(("D1 FINITE-RESULTS.json present with arrival_floor", (PKG / "FINITE-RESULTS.json").exists() and facts.get("arrival_floor") == 208))
    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 completed", task.get("outcome") == "completed"))
    results.append(("D6 FINITE source_commit matches UPSTREAM", facts.get("source_commit") == upstream.get("commit") == UPSTREAM_COMMIT))
    results.append(("D7 upstream replay has PASS_P104_RANK1_MIXER_TOP", str(upstream.get("replay", {}).get("result", "")).startswith("PASS_P104_RANK1_MIXER_TOP ")))
    results.append(("D8 README mentions 216 floor", "216" in readme))

    # SOURCES sha256 pins vs declared LOCAL expectations
    by_path = {e["path"]: e["sha256"] for e in sources.get("files", [])}
    pin_ok = all(by_path.get(p) == h for p, h in EXPECTED_INPUT_SHA.items())
    results.append(("P1 SOURCES.json input sha256 pins", pin_ok))

    # Fetched at base commit
    fetched_ok = True
    for path, expected in EXPECTED_INPUT_SHA.items():
        safe = path.replace("/", "__")
        fp = UP / safe
        if not fp.exists() or sha256_file(fp) != expected:
            fetched_ok = False
            break
    results.append(("P2 base-commit blobs match declared sha256", fetched_ok))

    # Independent floor arithmetic (no import of package verify.py)
    census = facts["census"]
    exempt = list(census["exempt_target_ids"])
    results.append(("C1 targets == 104", census["targets"] == 104))
    results.append(("C2 certified+permissive == 104", census["certified_targets"] + census["permissive_targets"] == 104))
    results.append(("C3 certified=84 permissive=20", census["certified_targets"] == 84 and census["permissive_targets"] == 20))
    results.append(("C4 exempt count 12 and matches both_halves", len(exempt) == 12 == census["both_halves_Tprime_full_good_targets"]))
    results.append(("C5 Tprime_pairs_full == 1038", census["Tprime_pairs_full"] == 1038))
    results.append(("C6 exempt ids unique sorted length 12", len(set(exempt)) == 12 and exempt == [1, 3, 6, 7, 12, 14, 41, 46, 54, 74, 81, 83]))

    a = census["certified_targets"] - len(exempt) - 2 * census["permissive_targets"]
    excess = (a + 3) // 4  # ceil(a/4)
    floor = facts["arrival_floor"] + excess
    results.append(("A1 A == 32", a == 32))
    results.append(("A2 excess == 8", excess == 8))
    results.append(("A3 arrival_floor == 208", facts["arrival_floor"] == 208))
    results.append(("A4 floor == 216", floor == 216))
    # ceil identity: (a+3)//4 == ceil(a/4)
    results.append(("A5 excess equals ceil(A/4)", excess == -(-a // 4)))

    digests = {p.name: sha256_file(p) for p in sorted(PKG.iterdir()) if p.is_file()}
    (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