Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions research/p104-index-tensor-bridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Index-to-tensor bridge for the scalar P104 code

**Audit of one published convention. No new κ.** Selected κ stays
`0.001672660197076918`.

PR #3996 checks 763,392 literal events and, separately, the block algebra of
`U`. Its proof states the bridge between them and does not execute that
bridge. This package executes it.

## Scope and evidence

The index in that proof is

```text
index(bank, i, j) = (bank*104 + i)*104 + j
```

Axis 0 varies `i` at fixed `j`. Axis 1 varies `j` at fixed `i`. On every
coefficient of widths 2 and 8, and on one dense width-104 state:

- broadcasting a one-axis map `K` along axis 0 is `K tensor I` (left multiplication);
- broadcasting it along axis 1 is `I tensor K`, which right-multiplies by `K^t`.

The second identity fails if the column fiber is implemented as right
multiplication by `K`. The four sweeps `U`, `U^{-1}`, `U^t` and `U^{-t}` of
the canonical code are checked in that form. The four shears are the block
maps with factors `A` and `M`: lower/upper `A` use axis 0 and axis 1 of `A`,
and the coded Gram shears use `M = U U^t`.

On the canonical fixture
`research/p104-native-channel/inputs/P104-FIXTURE.json`
(SHA256 `516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4`),
an independent root enumeration rebuilds the 768 signed-half entries. Their
ASCII digest is
`88e9a726e8c8aec055bfd7cd024883b5c8ecbda0cd6471e591a08c43a108a535`,
the same digest PR #3996 binds. For this `U`:

- `A = U^t P U` satisfies `A^2 = 13 A`, and `(I-A)` has an exhibited rational inverse;
- `M = U U^t` is invertible, and `M` is not `U^t U`;
- the bank block `P tensor (M - U^t U)` has Frobenius square **18432**;
- `N - P = U^{-t}(I-A)U^{-1}` is invertible, so each omitted side
`(N-P) tensor M` and `M tensor (N-P)` has rational rank **10816**.

The contraction identity
`||sum c_k A_k tensor B_k||_F^2 = sum c_k c_l <A_k, A_l> <B_k, B_l>`
was checked against the dense Kronecker matrix at widths 2 and 3, including
a nonzero sample. The width-104 gap uses that identity. Both factors of an
omitted side have exhibited inverses. The identity
`(A tensor B)(A^{-1} tensor B^{-1}) = I` was checked on a 2-by-2 pair. At
width 104 it is the same entrywise rule, not a stored 10816-square product.
That is the rank step.

This does **not** replay the 763,392 events, localize a fiber of PR #3979, or
supply a physical consumer. Algebraic rank is not a native-call price. No
supplier is admitted.

## Reproduce

Python 3.12, standard library, from the repository root:

```sh
python3.12 -B research/p104-index-tensor-bridge/verify.py
python3.12 -B research/p104-index-tensor-bridge/test_verify.py
python3.12 -B scripts/research_package.py --package research/p104-index-tensor-bridge
```

Expected markers:

```text
PASS_P104_INDEX_TENSOR_BRIDGE
PASS_P104_INDEX_TENSOR_BRIDGE_TESTS
```

The tests reject a column convention that drops the transpose, and they reject
a one-entry change to `B2`.

## Open next questions

1. One frozen encoder fiber from PR #3996 should be compared with axis 0 of
`U`, without calling that package's checker. The word bytes are on head
`b8dd4e04bf8490aca121abc7ba0e503651db6c97`, not on this main checkout.
2. A repeated physical consumer still has to pay `(N-P) tensor M` or show a
different interface. Rank 10816 says the Gram shear is not that payment.

## Credit

The code, the index sentence, and the rank claim under audit are Chris R /
Clear1nsight's PR #3979, audited by ToikY in PR #3996. The fixture and root
normalization come from the retained P104 native channel (Rohan Arun, Chafik
Boukhalfa, Adam Gall, and the native/E8 lineage named there). This package
does not import either checker's source.

Prepared by unpaidmoon with substantial Cursor Grok assistance. Apache-2.0.
No independent human review is claimed.
24 changes: 24 additions & 0 deletions research/p104-index-tensor-bridge/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"schema_version": 1,
"base_commit": "bb4bccbf42844d2801487450727c2f63e10d1d0f",
"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-native-channel/inputs/P104-FIXTURE.json",
"usage": "input",
"git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9",
"sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4"
}
]
}
94 changes: 94 additions & 0 deletions research/p104-index-tensor-bridge/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"schema_version": 1,
"task_id": "p104-side-correction",
"priority_revision": 6,
"base_commit": "bb4bccbf42844d2801487450727c2f63e10d1d0f",
"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": "changed",
"actual_scope": "Under the index in PR #3996, do the eight stated local sweeps and shears equal the published tensor factors, and is the omitted identity side full rank?",
"scope_change_reason": "The catalogue card asks for a chronological correction program. Discussion #1166 comment 19035716 instead asks for an independent inspection of PR #3996's literal-index-to-tensor bridge. This package answers that audit and does not construct a new correction word.",
"bottleneck_link": "No kappa change. The bridge decides whether the scalar code's local maps are the tensors P tensor M and M tensor P with M = U U^t. Replacing M by U^t U changes the coded shear. The omitted identity side stays rank 10816, so the Gram-only saving is not an identity-shear completion.",
"budget_minutes": 60,
"stop_rule": "Stop after the index bridge, the transpose-order gap, and the rank consequence. Do not replay the 763,392 events and do not build a physical consumer.",
"outcome": "partial",
"evidence": "PASS_P104_INDEX_TENSOR_BRIDGE and PASS_P104_INDEX_TENSOR_BRIDGE_TESTS. The wrong-factor block Frobenius square is 18432/1. Literal events were not replayed.",
"author": "unpaidmoon",
"ai_assistance": "Cursor Grok 4.7 agent, including the verifier and tests.",
"open_questions": [
{
"question": "Does one frozen fiber of PR #3979's event list implement these eight broadcasts?",
"why_it_matters": "This package certifies the operator interpretation of the stated maps. It does not read the 763,392 events, so a wrong event could still fail to be the tensor factor.",
"first_step": "Localize one encoder fiber from the frozen PR #3996 word bytes and compare it with axis-0 of U, without calling that package's checker.",
"blocked_by": "The word bytes live on PR #3996 head b8dd4e04bf8490aca121abc7ba0e503651db6c97 and are not on this main checkout."
},
{
"question": "Is there one repeated physical consumer whose complete bill keeps the k=2 Gram saving?",
"why_it_matters": "Rank 10816 says the identity shear is not the Gram shear. A consumer that pays the omitted side can erase the scalar saving.",
"first_step": "Pin one chronological producer/consumer pair and price N-P tensor M with owners, frames, and dirty return before any native expansion.",
"blocked_by": "No such pair is fixed. PR #3996 open question 1 is still open."
}
]
}
29 changes: 29 additions & 0 deletions research/p104-index-tensor-bridge/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/p104-native-channel/inputs/P104-FIXTURE.json"
],
"commands": [
{
"argv": [
"{python}",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 120,
"checks": "Index bridge at widths 2, 8 and 104; A^2=13A; exhibited inverse of N-P; positive transpose-order gap 18432."
},
{
"argv": [
"{python}",
"-B",
"{package}/test_verify.py"
],
"timeout_seconds": 120,
"checks": "Wrong column convention and a one-entry B2 mutation both fail closed."
}
]
}
54 changes: 54 additions & 0 deletions research/p104-index-tensor-bridge/test_verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env python3
"""Failure controls for the index-to-tensor bridge. Standard library only."""
from __future__ import annotations

import json
from pathlib import Path
import sys

sys.path.insert(0, str(Path(__file__).resolve().parent))
import verify


def require(condition, message):
if not condition:
raise SystemExit("FAIL: " + message)


def test_wrong_column_convention():
operator = verify.witness(verify.N)
state = verify.state_from(verify.N, 4)
fiber = verify.axis1_broadcast(operator, state)
omitted_transpose = verify.matmul(state, operator)
gaps = verify.compare(fiber, omitted_transpose)
require(gaps > 0, "omitting K^t must disagree on the non-symmetric witness")


def test_mutated_coefficient_breaks_square():
b2, _gram = verify.load_b2()
mutated = [row[:] for row in b2]
mutated[0][0] += 1
try:
verify.check_geometry(mutated)
except SystemExit as exc:
require(str(exc).startswith("FAIL:"), "mutation must fail closed")
return
raise SystemExit("FAIL: mutated B2 was accepted")


def test_receipt_shape():
b2, gram = verify.load_b2()
require(gram[0][0] == 8 and len(b2) == 8 and len(b2[0]) == 96, "fixture shape")
require(verify.factored_frobenius_square([(1, [[1]], [[1]])]) == 1, "one-cell contraction")


def main():
test_wrong_column_convention()
test_mutated_coefficient_breaks_square()
test_receipt_shape()
print("PASS_P104_INDEX_TENSOR_BRIDGE_TESTS " + json.dumps({
"groups": 3, "new_kappa": False}, sort_keys=True))


if __name__ == "__main__":
main()
Loading