Skip to content

research: audit minimal joint-output connector charge - #3897

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

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

Conversation

@1337isnot1337

Copy link
Copy Markdown
Contributor

Minimal joint-output connector charge

Summary

Refines the connector-alphabet-change card to the smallest nonzero instance
of one output-side operation:

J_ik: (y_i, y_k) += (A_i z, A_k z)

With one source, one arbitrarily dirty connector and two arbitrarily dirty
targets, J_ik, B, J_ik, B computes both requested outputs and restores the
connector for arbitrary fixed F_2-linear maps. A dimension-independent
additivity proof accompanies an exhaustive check of all 1,048,576 combinations
of 2x2 maps and data states, plus three failure controls.

The complete bill charges both output-map evaluations and both targets on
every J_ik. If D is one root dispatch and phi is the extra joint-routing
and fusion overhead, the original schedule costs
2c_B+2c_i+2c_k+6D, while the extended schedule costs
2c_B+2c_i+2c_k+4D+2phi. The operation improves the completed bill exactly
when phi<D; leaf map work is unchanged. The package does not claim a physical
one-record implementation or supplier benefit.

Verification

python3 scripts/research_package.py --package research/joint-output-connector-minimal-charge-247794 --check-only
python3.12 scripts/research_package.py --package research/joint-output-connector-minimal-charge-247794
python3 scripts/check_research_commit.py --package research/joint-output-connector-minimal-charge-247794 --check-source-history

Results: PASS_PACKAGE_METADATA_AND_PINS;
PASS_JOINT_OUTPUT_CONNECTOR_MINIMAL cases=1048576 controls=3 records=6_to_4 leaves_equal delta=2*(phi-D);
PASS_REGISTERED_RESEARCH_PACKAGE outcome=completed;
PASS_RESEARCH_COMMIT_BYTES (9 package/input files).

Source and scope

Base 20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision 6.
The package is research/joint-output-connector-minimal-charge-247794/; exact
source blobs and SHA256 hashes are recorded in SOURCES.json.

The source-side pair operation is already covered by PR #2056, including dirty
replay and charged accesses. PR #3604's specialized P112 co-delivery is
adjacent but distinct: it shares tetrad products with a fused port and source
correction, and this package neither re-audits nor claims that factorization.
The live PR #3779 addresses a six-window restoration bill. No selected result,
supplier, or frontier changes here; there is no new κ.

Credit the fixed-alphabet and pair-source connector predecessors. Prepared by
OpenAI Codex with substantial assistance. No independent human or formal
proof-kernel review is claimed.

Publication validation

python3.12 scripts/research_package.py --package research/joint-output-connector-minimal-charge-247794 passed on CPython 3.12.3, and python3.12 scripts/check_research_commit.py --package research/joint-output-connector-minimal-charge-247794 --check-source-history passed. The registered replay left the worktree clean. This supersedes any earlier pending note above for the registered package replay; separate full selected cold-replay limits remain as stated.

@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the minimal joint-output connector package at 03444336: packaging defect (missing RESULT.json); exhaustive schedule math otherwise agrees

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

Defect found:

  • D1 — missing RESULT.json. verify.py prints PASS_JOINT_OUTPUT_CONNECTOR_MINIMAL …, and TASK cites the 1,048,576-case exhaustive result, but the package ships no committed RESULT.json.

What still passes (independent recomputation):

  1. Pins: base 20ecf289…; VERIFY ready; TASK outcome completed.
  2. All 1,048,576 positive J,B,J,B cases match the expected joint-output identity.
  3. Three negative controls expose omit_ak / omit_first / omit_final_b faults.
  4. Exact break-even Δ/D = 2(φ/D − 1) ties at φ = D.

Not covered: larger alphabets; new κ; formal-kernel proof.

This is a finite exhaustive replay on F₂², not a formal proof. Adding a committed RESULT.json would close D1.

check_3897.py
#!/usr/bin/env python3
"""Independent finite controls for PR3897 (minimal joint-output connector).

Recomputes the F2^2 exhaustive schedule and negative controls without importing
package verify.py. Also checks packaging seals.

Package head 03444336c7b327e12ab3b69dde4def7b8dfae27c via GitHub API.

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

import argparse, json, sys
from fractions import Fraction
from itertools import product
from pathlib import Path

HEAD = "03444336c7b327e12ab3b69dde4def7b8dfae27c"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
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 parity(value):
    return value.bit_count() & 1


def apply(matrix, vector):
    row0, row1 = matrix
    return parity(row0 & vector) | (parity(row1 & vector) << 1)


def joint_readout(z, yi, yk, ai, ak, *, omit_ak=False):
    yi ^= apply(ai, z)
    if not omit_ak:
        yk ^= apply(ak, z)
    return yi, yk


def replay(ai, ak, b, x, z, yi, yk, *, omit_first=False, omit_ak=False,
           omit_second=False, omit_final_b=False):
    if not omit_first:
        yi, yk = joint_readout(z, yi, yk, ai, ak, omit_ak=omit_ak)
    z ^= apply(b, x)
    if not omit_second:
        yi, yk = joint_readout(z, yi, yk, ai, ak, omit_ak=omit_ak)
    if not omit_final_b:
        z ^= apply(b, x)
    return x, z, yi, yk


def expected(ai, ak, b, x, z0, yi0, yk0):
    signal = apply(b, x)
    return (x, z0, yi0 ^ apply(ai, signal), yk0 ^ apply(ak, signal))


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

    check("I1 TASK/SOURCES base_commit == 20ecf289…; VERIFY ready; outcome completed",
          task["base_commit"] == BASE == sources["base_commit"]
          and verify["status"] == "ready"
          and task["outcome"] == "completed")
    check("D1 packaging: RESULT.json absent despite PASS_JOINT_OUTPUT_CONNECTOR_MINIMAL in verify.py",
          not (pkg / "RESULT.json").exists()
          and "PASS_JOINT_OUTPUT_CONNECTOR_MINIMAL" in verify_py
          and "1,048,576" in task["evidence"])

    matrices = tuple(product(range(4), repeat=2))
    cases = 0
    bad = 0
    for ai, ak, b in product(matrices, repeat=3):
        for x, z, yi, yk in product(range(4), repeat=4):
            if replay(ai, ak, b, x, z, yi, yk) != expected(ai, ak, b, x, z, yi, yk):
                bad += 1
            cases += 1
    check("M1 exhaustive positive: 1,048,576 cases; zero mismatches",
          cases == 1_048_576 and bad == 0, {"cases": cases, "bad": bad})

    identity = (1, 2)
    zero = (0, 0)
    controls = 0
    args = (identity, identity, identity, 1, 0, 0, 0)
    if replay(*args, omit_ak=True) != expected(*args):
        controls += 1
    args = (identity, identity, zero, 0, 1, 0, 0)
    if replay(*args, omit_first=True) != expected(*args):
        controls += 1
    args = (identity, identity, identity, 1, 0, 0, 0)
    if replay(*args, omit_final_b=True) != expected(*args):
        controls += 1
    check("M2 three negative controls expose omit_ak / omit_first / omit_final_b faults",
          controls == 3)

    def delta_over_d(phi_over_d):
        return 2 * (phi_over_d - 1)

    check("M3 exact break-even: delta/D = 2(phi/D - 1); ties at phi=D",
          delta_over_d(Fraction(0)) == -2
          and delta_over_d(Fraction(1)) == 0
          and delta_over_d(Fraction(2)) == 2
          and "2(phi-D)" in task["evidence"])

    check("N1 README: dimension-independent identity + exhaustive 1,048,576-case check",
          "dimension-independent" in readme.lower()
          and "1,048,576" in readme)

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

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