Skip to content
Closed
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
36 changes: 36 additions & 0 deletions .github/workflows/extended-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: extended-links

on:
pull_request:
paths:
- 'research/extended-links/**'
- 'scripts/paired_cube/**'
- 'scripts/paired_cube_physical.py'
- 'scripts/paired_cube_network.py'
- 'references/paired-cube/**'
- 'certificates/paired-cube-*.json'
- '.github/workflows/extended-links.yml'
push:
paths:
- 'research/extended-links/**'
- '.github/workflows/extended-links.yml'

jobs:
verify:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.14']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Verify the extended carrier matching
run: python3 research/extended-links/verify.py
- name: Regenerate the plan and compare
run: |
python3 research/extended-links/make_plan.py "$RUNNER_TEMP/plan"
cmp "$RUNNER_TEMP/plan/arcs.json" research/extended-links/data/arcs.json
cmp "$RUNNER_TEMP/plan/frames.json" research/extended-links/data/frames.json
cmp "$RUNNER_TEMP/plan/pairs.json" research/extended-links/data/pairs.json
12 changes: 12 additions & 0 deletions research/extended-links/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Extended carrier matching on #161's complex word
Copyright 2026 DaysSky. Licensed under the Apache License, Version 2.0.

Prepared by DaysSky with Anthropic Claude assistance.

This package imports and runs, unchanged, code from this repository by icekylinx (scripts/paired_cube/*,
scripts/paired_cube_network.py; PR #144, #130) and eumemic (scripts/paired_cube_physical.py and the module
sources; PR #161 and its lineage). cxlinks.compile_closure and verify.complex_profile are adapted from
scripts/paired_cube/frames.py and scripts/paired_cube_network.py. Their notices and licenses are retained.

baseline-pr161.tar.gz contains 32 unmodified files of PR #161 at commit d14e291 (scripts, frozen data and
certificates), under their original licenses and notices; SOURCE.json pins each one.
69 changes: 69 additions & 0 deletions research/extended-links/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Extended carrier matching: argument and scope

**Setting.** #161's complex word at p = 11: its signed DAG (searched triple module, annealed pair module, merged
face-2/edge-02 outputs), compiled by #144's `compile_graph`, gauged by #144's `select`, then given a physical
layer by `scripts/paired_cube_physical.py`. A carrier arc `x -> u` lets the control register of addition `x`, which
still holds one operand `y` of `x` after the gate, serve another use `u` of `y` instead of dying. Each arc removes
one role.

**The pre-test.** `compile_graph` first gives every node the frame

initial[x] = (intersection of the root frames reachable from x in the DAG) with unused coordinates removed

and accepts `x -> u` only if `initial[x]` lies inside the receiving frame `initial[t]` (or the root frame), with
`t` later than `x` in the order `(dim initial, node)`. It then discards these frames and recomputes every frame as
the full backward intersection over DAG successors, arc successors and roots, and asserts that each value span
lies in its frame. The pre-test guarantees that this final assertion holds. It is not what the construction uses.

**What the construction uses.** A physical frame must contain the span of the addresses in the value's support and
must lie inside every frame the register visits later. For an arc set A this is exactly:

1. the graph with DAG edges and arc edges `x -> t` is acyclic, so the operations can be ordered with every arc
forward;
2. with `ann[x]` the span of the root annihilators reachable from `x` through DAG or arc edges,
`span(x)` is orthogonal to `ann[x]` for every node.

`cxlinks.compile_closure` computes these frames, checks 1 and 2, orders the operations by (frame rank,
topological index), and then uses the repository's ledger formulas unchanged. Nothing else differs from
`compile_graph`: with #161's arcs and the repository's order it returns #161's certified record exactly, which
`verify.py` checks.

**Why the added arcs are sound.** They satisfy 1 and 2 by construction, and this is checked independently, not by
the code that chose them. The repository's `scripts/paired_cube/verify.py` receives the graph, the frames, the
order, the arcs and the compiled word, and re-derives:

- every DAG edge and every arc goes forward in the order;
- every frame equals the full backward intersection of its successors' frames (`Incomplete intersection`);
- every value span lies in its frame;
- the signed scalar word produces the exact matrix H, and K is its own inverse;
- the physical replay of all operations moves every role only upward, and its rank recount equals the ledger;
- the gauges are the forced intersections, on roles untouched by phase one, and the target chains ascend.

That checker has no pre-test. It passes unchanged on the extended word.

**Physical layer.** The layer follows #161's rules and is checked by #161's own
`scripts/paired_cube_physical.py`, unchanged: each moved operation frame contains its value span, every role chain
is nested with each hand-off spliced, each donor is ungauged, is not a root and dies before its recipient's read,
its last frame lies in the recipient's gauge, the target chains ascend in actual read order, the deficit
telescopes, and an exact aliased replay with arbitrary dirty scratch restores every slot and adds x to y. The
three negative controls are rejected.

**Accounting.** #161's shared-core ledger is unchanged: three copies of the local, source and target children,
`2v` endpoint children, `W = 2v + R - pairs`, deficit `2v - 3 loss = 1320`. Each added arc lowers R by one. The
largest child stays 20. The role count enters #161's finite bridge and row reserve only through quantities that
decrease, and `verify.py` evaluates both with #161's functions.

**Scope.** This is a finite conditional construction. Every interface #161 retains stays an assumption: the
paired source scheduling and completed-core sharing, the Clifford frame compiler, the uniform recursion and the
analytic and tape contracts.

Not established here:

- No optimality. The arcs are a greedy extension of #161's matching in node order, and the pairing is greedy by
first-order saving. The certified value does not depend on how either was found.
- The repository's operation order is replaced by another linear extension. The two orders give different
phase-one closures (11,302 operations here, 10,150 in #161). The gauges are selected by the repository's rule
on the new order and are checked by the repository's checker; there are 2,970 rank-18 gauges in both.
- #161's bit supplier is used as certified there and is not re-run by this package.
- #161 was closed in favour of #168 and is not on main. Its files are pinned at `d14e291` in `baseline-pr161.tar.gz`, so
this package stays valid for that commit.
67 changes: 67 additions & 0 deletions research/extended-links/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Extended carrier matching on #161's complex word

Built on #161 (eumemic, `d14e291`). Under #161's retained interfaces this package certifies

T(n) = O(n (log n)^(1 - kappa)), kappa = 5901881/10^10 = 5.901881e-4

That is +0.394% over #161 (5878747/10^10). #161 is complex-bound, so a complex-side change moves kappa directly.
Only the complex word's carrier arcs and its physical layer change. The graph, the gauges, the bit supplier, the
phase stop, the atom exponent and the assembly are #161's, unchanged.

#161 is not on main, so the package carries the 32 files of #161 it reads as a pinned archive
(`baseline-pr161.tar.gz`, 0.3 MB), following `research/coordinated-frames-and-entrance-banks`. `baseline.py`
rebuilds them in a temporary directory after checking the archive and every file's sha256 against `SOURCE.json`
(commit `d14e291`). Set `EXTENDED_LINKS_TREE` to a full #161 checkout to use that instead. No existing file changes.

| | carrier arcs | roles R | W per vertex | complex saving | kappa |
|---|---:|---:|---:|---:|---:|
| #161 | 6,201 | 16,011 | 15,681 | 5885669/10^10 | 5878747/10^10 |
| #161's arcs, layer rebuilt here | 6,201 | 16,011 | 15,681 | 5893384/10^10 | 5886444/10^10 |
| **this package** | **6,249** | **15,963** | **15,633** | **5908857/10^10** | **5901881/10^10** |

## What changes

1. **48 more carrier arcs.** `scripts/paired_cube/frames.py` accepts an arc only if the donor's coordinate-padded
maximal frame already lies inside the receiving frame. That pre-test is sufficient, not necessary. What the
construction needs, and what the repository's independent checker verifies, is weaker: the dependency graph
with the arcs is acyclic, and every value span still lies in its full backward-intersection frame. `cxlinks.py`
compiles with exactly that condition. Every arc of #161 is kept; 48 arcs that the pre-test rejects are added.
2. **The physical layer is rebuilt** for the new word with #161's own rules (frame descent, each gauged role in a
dead donor's slot, late old-value reads). The pairing here is chosen by first-order saving; on #161's own arcs
that alone is worth +0.13%.

Further output merges (`s`, `w12`, and a pair-level merge of face 1 with edge 01) and two other all-but-one modules
were tried under this pipeline. The merges are cost-neutral and the modules are worse, so none is used.

## Verify

python3 research/extended-links/verify.py # stdlib only, about 15 seconds; do not use -O

`verify.py` checks, in order:

1. **Control.** `cxlinks.compile_closure()` with #161's arcs and the repository's operation order returns #161's
certified complex record exactly. #161's frozen physical record prices to 5885669/10^10 and 5878747/10^10.
2. **Word.** The extended arcs compile, the repository's gauge selection runs unchanged (2,970 rank-18 gauges), and
the repository's `scripts/paired_cube/verify.py` passes on the result: 1,742,400 signed scalar pairs, K, full
backward intersections, the physical replay of every frame movement, gauges and target chains.
3. **Physical layer.** The repository's `scripts/paired_cube_physical.py` passes on `data/frames.json` and
`data/pairs.json`: value spans, nested spliced role chains, pair chronology, target chains in read order, the
telescoping deficit and the exact aliased dirty-scratch replay, with its three controls rejected.
4. **Pricing.** #161's `exact_moment`, `finite_bridge` and 47-constraint assembly give the complex saving and kappa
as the largest points of the 10^-10 grid; the next points are rejected. One check of #161's code is relaxed:
the complex role count is not pinned to 16,011, it must equal `c + q - matched` and not exceed 16,011.

`make_plan.py` regenerates the three data files byte for byte (about 20 seconds). Verification does not use it.

[PROOF.md](PROOF.md) gives the argument and the limits.

## Credits

- eumemic: #161 and its lineage (#117, #131, #143, #152, #155, #157): the complex DAGs, output merging, the
physical layer and its checker, used here unchanged.
- icekylinx: #144 and #130 (paired cubes, the compiler and its independent checker, gauges, shared cores, assembly).
- an664: #128 completed-core sharing. jamesyc: #124 birth-read reuse. geckods: #153, #158 phase stop.
- Zhihao Chen and Swapnil Jain: the bit lineage behind #161's unchanged bit supplier.

The closure-condition compile, the extended arcs and this physical layer were prepared by DaysSky, assisted with
Claude. No priority over concurrent work is claimed.
42 changes: 42 additions & 0 deletions research/extended-links/SOURCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"archive": "baseline-pr161.tar.gz",
"archive_sha256": "fd60f2652cc01137500f83b16393f29f3f4cbbb3a11dcba4c5ea1b5c432d2b3c",
"commit": "d14e29157bc905be1ced0776dd893d0714013f3a",
"files": {
"certificates/paired-cube-complex-input.json": "a499fe8824a8ffc212576f85e63ad3deeb8e63379c94925a4b7d0c026065146c",
"certificates/paired-cube-physical-input.json": "ec50292944fff281900961b929643da32760e1b12ff57c269724a616e230ff15",
"references/paired-cube/selected-module/SOURCE.json": "a7ea4e32112dddad4268c2a33cacbaabc6a951f32ef8d1200e3597e0eae7687c",
"references/paired-cube/selected-module/matching-arcs.json": "cbc3e1e0f332916511d775427c7f8dfa4441a8450e3f4a2ce9a30d3284bb74b3",
"references/paired-cube/sources/SOURCE.json": "93a574848569e06bc2ba0fd1be61c15c3c78415effa33bccb73ff8ceb66e2e32",
"references/paired-cube/sources/h20_g1.json.gz": "2da21138a3887b0b190b234033c08740e81e145dd0db059e8f24c45d52fa41e9",
"references/paired-cube/sources/pmod_C35_5.483127e-4.json": "55e1979722255b3b70acf0b93b3a62a1e4e603a56276b254858a5b99974f47a9",
"scripts/audit_short_guards.py": "c2c929c956e617bee739963b517b9069e0d067cfebc6820f401a4e90a1769eb1",
"scripts/certify.py": "2348d95008276c5d5764f7e028c3918e484582cd589bd4d9b82919161745e53e",
"scripts/compact_control_layer.py": "e814c9f8d84f2e5d3aa2e06c36697f27f110218addc40ff8df2801fde861ff9f",
"scripts/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1",
"scripts/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b",
"scripts/exclusion_circuit.py": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0",
"scripts/fast_gaussian.py": "11430c2df0783b933dc91080595bb7514bb052b8c7b12107e27a1ef701e31e43",
"scripts/paired_cube/__init__.py": "b5fb17c79fd41a75c0648e7a5f99076f9f42a619857d5e34e71699bf00ef0c91",
"scripts/paired_cube/frames.py": "7d897418dbfee47de0723ea4983098a982610ccba45e1bac9000a79626d8421c",
"scripts/paired_cube/gauges.py": "8a501c66e1330f054e0e11a35e9321d2deea7b51cd03ca56b6a41765e43fe061",
"scripts/paired_cube/graph.py": "c757d47997f2fa42a95c16f6e6855cf8b125216ae3335b3891e305cf1da82855",
"scripts/paired_cube/modules.py": "d64813a6a6721ebe1ad4bd3b7f807afafc86446bbe8d9cecda75cbc7ef76b9d6",
"scripts/paired_cube/verify.py": "b64f137847e4626ef70e543b1d28c1cb6c31d3e3ba4f365019a4b1c8439abf7d",
"scripts/paired_cube_network.py": "738831593efd98f200a6fd00adb12a7e1b2f46beec94c589a8970d2614f1322f",
"scripts/paired_cube_physical.py": "9c9ea1ea29e551ab6116d7c8ca09f4703ff9e2fa102032d5055327fde07ba319",
"scripts/paired_exclusion_circuit.py": "8f05f04cf06217befd6d0ee0f2d7d0c5c5eb32cfab8c9a8ca7917fd6d620b7d2",
"scripts/paired_network.py": "991223dc3c1374284c361ed017e42bf732dd971fa0bea2be2282cfb18257b3f7",
"scripts/partial_gauge_bit.py": "7d58e86061da2d73991531e9bc431589019359391adea866c61c7dd1f99ac855",
"scripts/partial_swap_network.py": "acdd81b4dea2815f8838a0c3ea8ac4968f2bc13fd7c99173473d865779096782",
"scripts/prepare_layers.py": "a6e2adc612f264b1c0e51d18ce6315de9ae5e2ae2420aa22e99a22d8bf304947",
"scripts/search_network.py": "3a4faa5037d9b8e7ca5828afac193a96b6966a8b114f14937921795b24ec4f6a",
"scripts/shared_point_circuit.py": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba",
"scripts/shared_point_network.py": "a85e7f0d8c42d6a27e3846308571ca324a1824ac5c2d59e4daa5c7673c33c697",
"scripts/structured_bulk_assembly.py": "e99467e14211fba699878ed036e1e2362eb8e395dc22f9ecdcecc7fbf2cc736d",
"scripts/three_stage_cover_network.py": "7e0ad6fd1921b6905a53ce1eeaa03d3bb3a8a8bbaa0382516ea98b636f46335e"
},
"note": "The exact files of #161 that verify.py and make_plan.py read (scripts, frozen arcs, physical layer, module sources and certificates), byte for byte from commit d14e291; reproducible with: git archive --format=tar d14e291 <paths> | gzip -n -9",
"pr": 161,
"repository": "CrocSwap/integer-mult-bounds"
}
Binary file added research/extended-links/baseline-pr161.tar.gz
Binary file not shown.
52 changes: 52 additions & 0 deletions research/extended-links/baseline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""The #161 files this package reads, rebuilt from a pinned archive.

#161 (eumemic) is not on main. Its 32 files that cxlinks.py, verify.py and make_plan.py read (scripts, frozen arcs and
physical layer, module sources and certificates) are kept in baseline-pr161.tar.gz, following the convention of
research/coordinated-frames-and-entrance-banks. tree() writes them into a temporary directory after checking the
archive's sha256 and every file's sha256 against SOURCE.json, whose hashes are those of commit d14e291. Set
EXTENDED_LINKS_TREE to a full #161 checkout to use that instead.
"""
import atexit
import hashlib
import io
import json
import os
import shutil
import tarfile
import tempfile
from pathlib import Path

HERE = Path(__file__).resolve().parent


def rebuild(dest):
src = json.loads((HERE / 'SOURCE.json').read_text())
data = (HERE / src['archive']).read_bytes()
if hashlib.sha256(data).hexdigest() != src['archive_sha256']:
raise SystemExit('baseline archive differs from SOURCE.json')
with tarfile.open(fileobj=io.BytesIO(data), mode='r:gz') as archive:
members = [x for x in archive.getmembers() if x.isfile()]
if sorted(x.name for x in members) != sorted(src['files']):
raise SystemExit('baseline archive lists other files than SOURCE.json')
for x in members:
part = Path(x.name)
if part.is_absolute() or '..' in part.parts:
raise SystemExit('unsafe path in baseline archive: ' + x.name)
handle = archive.extractfile(x)
if handle is None:
raise SystemExit('unreadable member in baseline archive: ' + x.name)
body = handle.read()
if hashlib.sha256(body).hexdigest() != src['files'][x.name]:
raise SystemExit('baseline file differs from SOURCE.json: ' + x.name)
(dest / part).parent.mkdir(parents=True, exist_ok=True)
(dest / part).write_bytes(body)
return src['commit']


def tree():
if os.environ.get('EXTENDED_LINKS_TREE'):
return Path(os.environ['EXTENDED_LINKS_TREE']).resolve()
dest = Path(tempfile.mkdtemp(prefix='extended-links-pr161-'))
atexit.register(shutil.rmtree, dest, True)
rebuild(dest)
return dest.resolve()
Loading
Loading