From 5a082968713ae78a563985b37eef0762961118de Mon Sep 17 00:00:00 2001 From: Cinna Davis <1337isnot1337@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:40:11 -0500 Subject: [PATCH] Add P104 flag 0 coefficient transport audit --- .../README.md | 70 ++++++ .../RESULT.json | 63 +++++ .../SOURCES.json | 54 +++++ .../TASK.json | 88 +++++++ .../VERIFY.json | 23 ++ .../verify.py | 218 ++++++++++++++++++ 6 files changed, 516 insertions(+) create mode 100644 research/p104-flag0-coefficient-transport/README.md create mode 100644 research/p104-flag0-coefficient-transport/RESULT.json create mode 100644 research/p104-flag0-coefficient-transport/SOURCES.json create mode 100644 research/p104-flag0-coefficient-transport/TASK.json create mode 100644 research/p104-flag0-coefficient-transport/VERIFY.json create mode 100644 research/p104-flag0-coefficient-transport/verify.py diff --git a/research/p104-flag0-coefficient-transport/README.md b/research/p104-flag0-coefficient-transport/README.md new file mode 100644 index 0000000000..f5081b1ab1 --- /dev/null +++ b/research/p104-flag0-coefficient-transport/README.md @@ -0,0 +1,70 @@ +# P104 flag 0: coefficient and sign through the native word + +**Scoped exact row audit. No new kappa, correction program, supplier, or cost claim.** + +## Question and result + +For the first record of PR #2981's 208-flag collection, does the exact +coefficient for source `X0` reach target `Y34` through the cited 4,058-event +native word, and what sign does the complementary `I-G/2` term require? + +Flag 0 is `(X0, Y34)` with basis head `232`. The source and target roots have +dot product `4` in the fixture's doubled E8 coordinates (root norm `8`). Thus +the native `G/2` coefficient is `4/8 = +1/2`, while the off-diagonal +coefficient required from `I-G/2` is `-1/2`. + +The exact one-hot row replay sets `x0=z`, all other source and dirty +coefficients to zero, and the `y34` baseline to zero. It follows the scalar +rows through the pinned word: transports retain rows, additions use their +literal `Fraction` coefficient, and private zero/copy/erase events update the +row as specified by the native-channel proof. The `Y34` additions carrying +`z` occur at events 2815 (`+z/2`), 2998 (`-z/2`, canceling it), and 3369 +(`+z/2`). The final native row is therefore `z/2`; the required side term is +`-z/2`. + +The zero-based event order is `Y34` first touched at 129, `X0` first touched at +591, `Y34` last touched at 3500, and `X0` last touched at 3954. PR #3242's +whole-word scan reports no X/Y pair sharing an event; this check confirms that +`X0` and `Y34` do not share one. The one-hot replay shows that first-touch +ordering alone does not rule out later relay delivery in this native word: +`Y34` gets its nonzero `X0` coefficient after event 591. These are +native-channel additions, not an executable side correction. + +## Scope and limits + +This checks one exact coefficient row for one named flag. It uses the +independent linear-row invariant already proved for the pinned native +realization; it does not rerun that package's Clifford or all-column proof. +The dirty coordinates are zero in this one-hot coefficient slice. The audit +does not deliver the opposite side term, restore arbitrary dirty inputs, +certify frame availability for a correction, or price correction/idle/hosting +work. The newer pooled support audits (#3259, #3803, and #3810) concern whether +fixed-cover correction coefficients have support; this package checks the +opposite-sign native row for one actual word path and does not extend those +support claims. + +Reproduce the bounded check from the repository root: + +```sh +python3 scripts/research_package.py --package research/p104-flag0-coefficient-transport --check-only +python3.12 scripts/research_package.py --package research/p104-flag0-coefficient-transport +``` + +## Open next questions + +Can an added correction deliver `-z/2` to `Y34` at a legal common-frame cut +while restoring all dirty inputs? This matters because the native word +delivers `+z/2`, and the opposite sign is required for this off-diagonal entry. +The next step is to name a legal source/target frame cut and an explicit +correction writer, then test its full dirty row. A complete bill and the +correction construction remain outstanding. + +## Credit + +Credit Nick Petalas / PR #2981 for the static flag certificate; Rohan Arun / PR +#1972 and Chafik Boukhalfa / PR #1991 for the low-rank channel and native row +invariant; and jwr404 / PR #3242 for the event-index chronology that motivated +this flag-0 check. The coefficient trace and sign comparison here are new. +The pooled support lineage remains credited to PR #3182, #3259, #3803, and +#3810. Prepared by OpenAI Codex, laptop-03 session; no independent human or +formal-kernel review is claimed. New work is Apache-2.0. diff --git a/research/p104-flag0-coefficient-transport/RESULT.json b/research/p104-flag0-coefficient-transport/RESULT.json new file mode 100644 index 0000000000..2cac05ac75 --- /dev/null +++ b/research/p104-flag0-coefficient-transport/RESULT.json @@ -0,0 +1,63 @@ +{ + "status": "PASS_P104_FLAG0_COEFFICIENT_TRANSPORT", + "flag0": { + "source": "X0", + "target": "Y34", + "basis_head": 232 + }, + "events": { + "target_first": 129, + "source_first": 591, + "target_last": 3500, + "source_last": 3954, + "X0_Y34_joint_events": 0 + }, + "raw_doubled_root_dot": 4, + "native_G_over_2_coefficient": "1/2", + "required_I_minus_G_over_2_coefficient": "-1/2", + "target_additions": [ + { + "event": 2815, + "source": "D17", + "scale": "-1/4", + "source_coefficient": "-2", + "delta": "1/2", + "after": "1/2" + }, + { + "event": 2998, + "source": "D13", + "scale": "1/4", + "source_coefficient": "-2", + "delta": "-1/2", + "after": "0" + }, + { + "event": 3369, + "source": "D23", + "scale": "1/4", + "source_coefficient": "2", + "delta": "1/2", + "after": "1/2" + } + ], + "one_hot_fixture": "x0=z; other x and dirty coefficients zero; y34=0", + "controls": [ + { + "z": "1", + "native_y34": "1/2", + "required_side_addition": "-1/2" + }, + { + "z": "7/11", + "native_y34": "7/22", + "required_side_addition": "-7/22" + }, + { + "z": "-3/5", + "native_y34": "-3/10", + "required_side_addition": "3/10" + } + ], + "no_correction_program_or_cost_claim": true +} diff --git a/research/p104-flag0-coefficient-transport/SOURCES.json b/research/p104-flag0-coefficient-transport/SOURCES.json new file mode 100644 index 0000000000..3e578c1bc7 --- /dev/null +++ b/research/p104-flag0-coefficient-transport/SOURCES.json @@ -0,0 +1,54 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/p104-joint-unit-flags/CERTIFICATE.json", + "usage": "input", + "git_blob": "0fa7d2d40566e92f3ea1539723abf438ba65adb8", + "sha256": "a98126428a8da6eae91c50afcc42e014a284c82b554ef77e5b3a34fc6d228128" + }, + { + "path": "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "usage": "input", + "git_blob": "86beaf424e9f0f800ae3a62797d94ec9386b7706", + "sha256": "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e" + }, + { + "path": "research/p104-native-channel/inputs/P104-FIXTURE.json", + "usage": "input", + "git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9", + "sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4" + }, + { + "path": "research/p104-endpoint-geometric-budget/geometry.py", + "usage": "input", + "git_blob": "f49752bcfc321a6129186d4daa774b2c3fdb84f1", + "sha256": "1a2792189beaf15aa8180136ca007cd2301992a62e77ba72edea99b298e4148f" + }, + { + "path": "research/p104-native-channel/PROOF.md", + "usage": "provenance", + "git_blob": "a69311b74f74a2f8e8f411c1451baacd9bacddce", + "sha256": "5d743145d389ffdfaffc66096fa7e32c7155b18f73d74755403151d0435bb94c" + }, + { + "path": "research/p104-flag-channel-schedule/RESULT.json", + "usage": "provenance", + "git_blob": "c2d7443350e7a8fdb77910689df75516b789b55d", + "sha256": "4ba6fd7555d8907ce28d52d8de5087133e3649431f8ef0617a8961ebcbb73e16" + } + ] +} diff --git a/research/p104-flag0-coefficient-transport/TASK.json b/research/p104-flag0-coefficient-transport/TASK.json new file mode 100644 index 0000000000..9cae71588d --- /dev/null +++ b/research/p104-flag0-coefficient-transport/TASK.json @@ -0,0 +1,88 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "p104-side-correction", + "question": "Can the proposed P104 joint endpoint flags be realized by a chronological correction program with coefficients, dirty restoration and an affordable complete bill?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/p104-native-channel/README.md", + "research/p104-native-channel/PROOF.md", + "docs/research/community-efficient1000-review.md", + "research/p104-joint-unit-flags/README.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the revision-6 family record and #2981 static joint flags, alongside the reviewed #1991 channel. #2981 is an author-checked source archive, not an independently validated executable correction or a refutation of program-level lifetime floors.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "After checking live handoffs, pin one named collection from #2981 and attach acquisition/delivery times, source dependencies and coefficient requirements. Test legal access and arbitrary dirty restoration; price any completion against the full channel/endpoint/hosting allowance. Stop with the exact missing implication or a scoped counterexample rather than expanding the static cover census.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier.", + "Repeating a correction or physical conversion already supplied by a pending follow-up without adding independent coverage or a different unresolved obligation.", + "Repeating the 208-flag static matching or calling a static nested cover a chronological correction program. Independent audit of that certificate is distinct and remains useful." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991", + "2586", + "endpoint transport", + "physical dual", + "relay composition", + "2981", + "joint unit flags", + "acquisition delivery", + "static nesting" + ], + "existing_checks": [ + { + "scope": "PR #2981 reports static joint endpoint flags and a matching of 208 departure and arrival flags; archival intake is not independent verification.", + "evidence": "research/p104-joint-unit-flags/README.md", + "remaining": "Independent flag check and a chronological coefficient program with dirty restoration and a complete cost.", + "status": "author-checked", + "source_commit": "3d24b92d8ba057b57cb2d480170ec407520e6882", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "refined", + "actual_scope": "For PR #2981 flag 0 (X0 -> Y34), exact-check the native G/2 coefficient and opposite I-G/2 side sign through the PR #1991 4,058-event scalar word using a one-hot x0=z row. Record event chronology; do not construct the side correction.", + "scope_change_reason": "Live overlap already covers static flag schedules and pooled correction support: PR #3242 reports flag-0 event order; PR #3259 and #3803 audit fixed-cover support, and open PR #3810 further checks that support model and coefficient signs. This scope complements them by tracing one actual native coefficient through the original chronological word.", + "bottleneck_link": "The changed channel needs its complementary I-G/2 row to cancel the native G/2 contribution. An exact one-entry sign trace checks this interface obligation; it does not supply the correction or improve the selected exponent.", + "budget_minutes": 60, + "stop_rule": "Stop after reproducing flag 0's exact one-hot coefficient, sign, and event trace. Do not expand to other flags, correction construction, lifetime floors, or hosting prices; those are separate live scopes and the family gate requires a complete boundary ledger before another construction round.", + "outcome": "partial", + "evidence": "Exact Fraction replay of one formal source coordinate through all 4,058 scalar events gives native Y34 coefficient +1/2; root pairing requires side coefficient -1/2. The target is first touched before X0's first event, then receives +1/2, -1/2, +1/2 at events 2815, 2998, 3369 and finishes at +1/2.", + "author": "OpenAI Codex (laptop-03)", + "ai_assistance": "Substantial OpenAI Codex assistance. No independent human review or formal-kernel proof is claimed.", + "open_questions": [ + { + "question": "Can a correction program add -z/2 to Y34 at a legal common-frame cut while restoring every arbitrary dirty role?", + "why_it_matters": "The native word contributes +z/2 at this entry, so the complementary side term must be delivered with the opposite sign before the channel can meet its exact row contract.", + "first_step": "Name one cut with source and target frames available, then trace the correction on the X0 and every dirty basis coordinate through the full word.", + "blocked_by": "No correction word or complete dirty-restoration/interface invoice is established here; construction and lifetime/hosting work remains separate." + } + ] +} diff --git a/research/p104-flag0-coefficient-transport/VERIFY.json b/research/p104-flag0-coefficient-transport/VERIFY.json new file mode 100644 index 0000000000..dc781e00c2 --- /dev/null +++ b/research/p104-flag0-coefficient-transport/VERIFY.json @@ -0,0 +1,23 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-endpoint-geometric-budget/geometry.py", + "research/p104-joint-unit-flags/CERTIFICATE.json", + "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact port/root pairing, source-bound flag 0, zero-based event cut, exact Fraction one-hot row replay, three relay contributions, opposite-side sign controls, and explicit no-correction scope." + } + ] +} diff --git a/research/p104-flag0-coefficient-transport/verify.py b/research/p104-flag0-coefficient-transport/verify.py new file mode 100644 index 0000000000..1951bb7b0e --- /dev/null +++ b/research/p104-flag0-coefficient-transport/verify.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python3 +"""Trace one arbitrary-input coefficient through the pinned P104 word.""" + +from fractions import Fraction +from hashlib import sha256 +from itertools import combinations, product +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +PACKAGE = Path(__file__).resolve().parent +INPUTS = { + "research/p104-endpoint-geometric-budget/geometry.py", + "research/p104-joint-unit-flags/CERTIFICATE.json", + "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json", +} + + +def need(condition, message): + if not condition: + raise SystemExit("FAIL_P104_FLAG0_COEFFICIENT_TRANSPORT " + message) + + +def read(path): + return json.loads((ROOT / path).read_text(encoding="utf-8")) + + +def authenticate(): + sources = read("research/p104-flag0-coefficient-transport/SOURCES.json") + pinned = {row["path"]: row for row in sources["files"] if row["usage"] == "input"} + need(set(pinned) == INPUTS, "input inventory changed") + for path, row in pinned.items(): + actual = sha256((ROOT / path).read_bytes()).hexdigest() + need(actual == row["sha256"], "input digest changed: " + path) + + +def ports(fixture): + roots = [] + for i, j in combinations(range(8), 2): + for sign in (-1, 1): + row = [0] * 8 + row[i], row[j] = 2, 2 * sign + roots.append(tuple(row)) + roots += [ + (1, *signs) + for signs in product((-1, 1), repeat=7) + if signs.count(-1) % 2 == 0 + ] + section = fixture["section4_explicit_P104"] + excluded = {tuple(row) for row in section["F0"] + section["C"]} + return sorted(set(roots) - excluded) + + +def chronology(program, source, target): + source_events = [i for i, event in enumerate(program) if source in event] + target_events = [i for i, event in enumerate(program) if target in event] + pair_joint = sum(source in event and target in event for event in program) + need(source_events and target_events, "a named register has no event") + return source_events[0], source_events[-1], target_events[0], target_events[-1], pair_joint + + +def trace_one_hot(program, source, target): + # Coefficients of the formal input z in each logical register row. + rows = {source: Fraction(1)} + target_adds = [] + for index, event in enumerate(program): + kind = event[0] + if kind == "add": + _, dst, src, scalar, *_ = event + scalar = Fraction(scalar) + source_coefficient = rows.get(src, Fraction(0)) + delta = scalar * source_coefficient + before = rows.get(dst, Fraction(0)) + rows[dst] = before + delta + if dst == target and delta: + target_adds.append( + { + "event": index, + "source": src, + "scale": str(scalar), + "source_coefficient": str(source_coefficient), + "delta": str(delta), + "after": str(rows[dst]), + } + ) + elif kind == "transport": + # The pinned native-channel proof says a transport changes only the + # frame and retains the logical coefficient row. + continue + elif kind == "zero": + rows[event[1]] = Fraction(0) + elif kind == "copy": + rows[event[1]] = rows.get(event[2], Fraction(0)) + elif kind == "erase": + rows[event[1]] = Fraction(0) + else: + need(False, f"unknown event {index}: {kind}") + return rows.get(target, Fraction(0)), target_adds + + +def evaluate(): + authenticate() + certificate = read("research/p104-joint-unit-flags/CERTIFICATE.json") + witness = read("research/p104-native-channel/inputs/LOWRANK-WITNESS.json") + fixture = read("research/p104-native-channel/inputs/P104-FIXTURE.json") + geometry = (ROOT / "research/p104-endpoint-geometric-budget/geometry.py").read_text( + encoding="utf-8" + ) + need("ports = sorted(roots -" in geometry, "P104 port ordering source changed") + need("paths[f'X{s}']" in geometry and "paths[f'Y{t}']" in geometry, + "source/target path naming changed") + helpers = certificate["helpers"] + need(len(helpers) == 208, "joint flag collection size changed") + flag = helpers[0] + need( + (flag["source"], flag["target"], flag["basis"][0]) == (0, 34, 232), + "selected flag 0 changed", + ) + + vectors = ports(fixture) + need(len(vectors) == 104, "P104 port count changed") + src_vec, dst_vec = vectors[0], vectors[34] + raw_dot = sum(x * y for x, y in zip(src_vec, dst_vec, strict=True)) + need(sum(x * x for x in src_vec) == 8, "source root scale changed") + need(sum(y * y for y in dst_vec) == 8, "target root scale changed") + need(raw_dot == 4, "flag 0 Gram pairing changed") + native_expected = Fraction(raw_dot, 8) + side_required = -native_expected # off-diagonal entry of I - G/2 + + program = witness["program"] + need(len(program) == 4058, "native word length changed") + source, target = "X0", "Y34" + source_first, source_last, target_first, target_last, pair_joint = chronology( + program, source, target + ) + need(target_first == 129 and source_first == 591, "flag 0 event cut changed") + need(target_last == 3500 and source_last == 3954, "flag 0 last event changed") + need(pair_joint == 0, "X0 and Y34 now share an event") + need(target_first < source_first < target_last, "event ordering changed") + + native_coefficient, target_adds = trace_one_hot(program, source, target) + need(native_coefficient == native_expected, "one-hot native coefficient mismatch") + expected_adds = [ + { + "event": 2815, + "source": "D17", + "scale": "-1/4", + "source_coefficient": "-2", + "delta": "1/2", + "after": "1/2", + }, + { + "event": 2998, + "source": "D13", + "scale": "1/4", + "source_coefficient": "-2", + "delta": "-1/2", + "after": "0", + }, + { + "event": 3369, + "source": "D23", + "scale": "1/4", + "source_coefficient": "2", + "delta": "1/2", + "after": "1/2", + }, + ] + need(target_adds == expected_adds, "flag 0 relay additions changed") + + controls = [] + for value in (Fraction(1), Fraction(7, 11), Fraction(-3, 5)): + native = native_coefficient * value + correction = side_required * value + need(native + correction == 0, "side coefficient sign control failed") + need(native != correction, "native and correction signs collapsed") + controls.append( + { + "z": str(value), + "native_y34": str(native), + "required_side_addition": str(correction), + } + ) + + return { + "status": "PASS_P104_FLAG0_COEFFICIENT_TRANSPORT", + "flag0": {"source": source, "target": target, "basis_head": 232}, + "events": { + "target_first": target_first, + "source_first": source_first, + "target_last": target_last, + "source_last": source_last, + "X0_Y34_joint_events": pair_joint, + }, + "raw_doubled_root_dot": raw_dot, + "native_G_over_2_coefficient": str(native_coefficient), + "required_I_minus_G_over_2_coefficient": str(side_required), + "target_additions": target_adds, + "one_hot_fixture": "x0=z; other x and dirty coefficients zero; y34=0", + "controls": controls, + "no_correction_program_or_cost_claim": True, + } + + +def main(): + observed = evaluate() + expected = read("research/p104-flag0-coefficient-transport/RESULT.json") + need(observed == expected, "RESULT.json differs from exact replay") + print( + "PASS_P104_FLAG0_COEFFICIENT_TRANSPORT " + "flag0=X0->Y34 events=591:2815,2998,3369,3500 " + "native=+1/2 side=-1/2 arbitrary_z no_correction_claim" + ) + + +if __name__ == "__main__": + main()