Skip to content
Open
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
246 changes: 246 additions & 0 deletions research/connector-balanced-walk-threshold/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# Balanced closed walks improve unsigned connector capacity

This contribution was produced by Nick Petalas. Apache-2.0.

**Scoped written proof with an exact finite construction certificate.** In the
unsigned dirty-connector interface of PR4231/PR4248, define

```text
C(k) = 2 ceil(2^(k-1)/k),
L(c) = max { k >= 1 : C(k) <= c }.
```

For every integer characteristic `c >= 2`, the source capacity satisfies

```text
N(c) >= L(c) floor(c/2) + 2(c mod 2).
```

Moreover, `C(k)` is the exact maximum-coordinate-flip threshold among **closed
binary-cube covering walks** on `k` coordinates. This is a classical Gray-code
consequence applied here to the connector construction. It is not a lower bound
for arbitrary depth-two connector words.

For `c >= 8`, put `b = floor(log2 c)` and `m = floor(log2 b)`. Then

```text
b + m <= L(c) <= b + m + 2.
```

Thus the explicit lower bound gains the `log2 log2 c` source term missing from
PR6071's reflected-Gray specialization. At `c = 256`, it gives `N(256) >= 1408`;
PR6071's displayed reflected-Gray guarantee is 1152. This comparison concerns
those two guarantees, not a claim to know the best construction on main.

The new part is the explicit optimized connector threshold, its source-capacity
consequence, and a literal realization. Balanced Gray cycles are classical.
PR6071 supplies the covering-walk split; PR6107 explicitly suggests the balanced
direction without deriving this bound. Neither predecessor is audited here.
There is no new kappa or change to the selected frontier.

## Interface and proof

Let `R` be any nonzero unital ring of characteristic `c >= 2`. Sources `x_j`,
the borrowed connector `z`, and outputs `y_m` begin arbitrarily dirty. The only
complete calls are `B_j: z += B_j x_j` and `A_m: y_m += A_m z`, for compatible
linear maps. Each call restores its private scratch and heads, preserves every
other row, and has fixed ports. Sources and coefficients are immutable. Outputs
are unobserved until completion. There are no negative calls, extra connectors,
free copies, scalings, direct product calls, or mutable-source operations.

The desired action is `y_m += sum_(j in m) A_m B_j x_j`, with `z` restored.
The identity specialization forces every used operator to occur a positive
multiple of `c` times. A complete-call floor word uses each exactly `c` times.
PR4248's depth-two block criterion asks for every binary mask to be the sum
modulo `c` of at most two prefixes of a source word containing each source
exactly `c` times. Repeated read boundaries are allowed.

### Exact closed-walk threshold

Consider any finite closed single-coordinate walk that starts at zero and
visits every vertex of `{0,1}^k`, allowing repeated vertices. Let its length be
`s`, and let `f_j` count flips of coordinate `j`. Since it returns to its start,
each `f_j` is even. Its `s` distinct time slots before the repeated endpoint
must cover `2^k` vertices, so `s >= 2^k`. Consequently

```text
max_j f_j >= 2 ceil(s/(2k)) >= 2 ceil(2^(k-1)/k) = C(k).
```

The classical balanced cyclic Gray-code theorem supplies a Hamilton cycle
whose even coordinate flip counts differ by at most two. Their sum is `2^k`,
so their largest value is precisely `C(k)`. The two-step walk treats `k = 1`.
This attains the lower bound for every `k`. Existence is a cited classical
theorem, not a conclusion inferred from the finite witness.

Primary reference: G. S. Bhat and C. D. Savage, [Balanced Gray Codes, Theorem 1](https://doi.org/10.37236/1249),
Electronic Journal of Combinatorics 3, R25, 1996, pages 8-10.
Their [2005 historical comment](https://www.combinatorics.org/ojs/index.php/eljc/article/download/v3i1r25/comment/)
credits the earlier Bakos construction recorded by A. Adam in 1968. The
Robinson-Cohn construction and Bhat-Savage subsequence selection also produced
the supplied literal cycle. No new Gray-code existence theorem is claimed.

### Positive calls from a closed walk

Take a balanced cycle with `C(k) <= c`. In the notation of Armin Pourshafeie's
PR6071, let `U(t)` and `D(t)` count upward and downward flips through time `t`.
Then `U(t)-D(t)=g_t`, the visited binary vertex. Let `A` and `B` be the label
subsequences of upward and downward flips. Form the positive source word

```text
W = A · product_j j^(c-f_j) · reverse(B).
```

Each source occurs `c` times. At the two actual boundaries

```text
a(t) = |U(t)|, s(t) = kc - |D(t)|,
```

the integer prefix vectors are `U(t)` and `c*1-D(t)`. Their sum is `c*1+g_t`.
Both boundaries exist, lie in chronological order, and represent `g_t` modulo
`c`. The compiler retains the first occurrence of each mask. All executable
calls are positive, including those designed using downward flips.

Two output reads at these boundaries deliver the requested contribution.
Add `c-2` output reads at boundary zero to cancel the arbitrary connector
baseline. Every output is called exactly `c` times, including its padding.
Every source is also called exactly `c` times, restoring `z`. This uses only
linearity and characteristic `c`; neither primality nor commutation of the
operators is required. It is PR6071's split applied to a better walk.

### Capacity and the second-order term

Concatenate `floor(c/2)` disjoint `L(c)`-source blocks. Completed blocks have
zero prefix modulo `c`, so any global binary mask uses at most two reads per
nonzero block. If `c` is odd, add PR4248's depth-one two-source block
`a b a^(c-1) b^(c-1)`. Its prefixes at `1,2,c+1` give the three nonzero masks.
The total depth is at most `c`; pad each output with boundary-zero reads to
exactly `c`. This proves the displayed lower bound on `N(c)`. It does not
materialize the exponentially many outputs of a large composed batch.

For the lower estimate on `L(c)`, take `k=b+m`, with `b>=3`. Then
`2^k <= cb`, `k>=b+1`, and `c>=2^b>=2(b+1)`. Hence

```text
C(k) < 2^k/k + 2 <= cb/(b+1) + 2 <= c.
```

For the upper estimate, any allowed `k` obeys `2^k <= ck`. The function
`2^k/k` increases for integer `k>=2`. At `k=2b+2` it is at least `2^(b+1)>c`,
so `k<=2b+1`. Since `2b+1<2^(m+2)`, this yields
`2^k <= ck < 2^(b+m+3)`, and therefore `k<=b+m+2`.

These are bounds on the closed-walk subclass capacity `L(c)`. They do not
close PR6107's gap for unrestricted depth-two words or improve its leading
constant `1/2` for depth-at-most-two concatenations.

## Literal certificate and complete invoice

[WITNESS.json](WITNESS.json) contains one nine-coordinate Hamilton cycle.
Independent traversal finds 512 distinct vertices and coordinate counts
`56,56,56,56,56,58,58,58,58`. At characteristic 58, [connector.py](connector.py)
constructs a 522-call source word and two prefix boundaries for all 511
nonzero masks. Its complete interleaved word has exactly **30,160 calls**,
with each of the nine source operators and 511 output operators called 58
times. All padding reads are present. The 27 executed fixtures include every
source-coordinate basis vector, both connector basis vectors, zero, and six
mixed dirty inputs over `Z/58Z`, with dirty outputs and singular matrices.

Let `I` pay admission and layout, `P_F` pay coefficient preparation, `D_W` pay
the actual word's dispatch and instruction storage, and `c_F` be the complete
fixed-port call price, including private restoration and head return. For a
batch on `n` sources, the conditional bill is

```text
I + sum_F P_F + D_W + c sum_j c_Bj + c sum_(m != 0) c_Am.
```

No physical price is set to zero. Full-row storage, output layout, instruction
volume, compiler closure, native frame compatibility, precision, routing and
the outer caller remain uninstantiated. This abstract call-floor construction
does not supply a favorable physical supplier bill. The selected PR6030 and
all five framework assumptions retain their status.

The values `N(58)>=261`, `N(64)>=288`, `N(256)>=1408`, and `N(512)>=3072`
are evaluations of the proved formula. The complete composed batches at
these source counts were not executed. The literal executed batch has nine
sources and 511 outputs.

## Reproduction and verification scope

From the repository root, using CPython 3.12:

```sh
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -B research/connector-balanced-walk-threshold/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -O -B research/connector-balanced-walk-threshold/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/connector-balanced-walk-threshold
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/connector-balanced-walk-threshold --check-source-history
```

Expected marker: `PASS_CONNECTOR_BALANCED_WALK_THRESHOLD`. The verifier emits a
generated receipt bound to package hashes. Use `--output /absolute/scratch/result.json`
to retain it outside the checkout. The replay requires only the standard library.
Local interpreter: CPython 3.12.15, macOS, Clang 23.1.3. Hosted CI is recorded
separately in the PR body.

The finite corroboration checks 120 closed covering walks: dimension one at
lengths 2 through 4, and dimension two at lengths 2 through 8. Their compiled
blocks supply 356 mask checks. It also checks the literal nine-source cycle,
all 511 prefix pairs, 27 complete dirty-input executions, 1,023 exact capacity
rows for `c=2..1024`, and ten rejecting controls. These controls cover malformed
walks, insufficient characteristic, changed source pins, wrong reads and an
unpaid source or output call. No predecessor scientific verifier is imported.

The infinite result uses the written proof and the cited classical theorem.
It is not a proof-kernel result. Independent human and formal proof-kernel
review are unclaimed. No selected cold replay, Lean, Docker, physical native
supplier, rounded multiplier or complete multiplication theorem was run.

### Code limits

The literal compiler accepts dimension at most ten, characteristic at most
512, and at most `2^(dimension+1)` walk steps. Its largest complete word has
528,896 calls. The arithmetic-only threshold API accepts dimension through
4096. Every traversal is bounded by these inputs or the fixed replay domain;
there is no recursion or subprocess execution in the verifier.

Python and its standard containers allocate dynamically. This is a managed
runtime deviation from fixed steady-state allocation, with the explicit
limits above bounding live objects. Python also has no pointer-depth or
compile-time warning equivalent. Runtime checks remain active under `-O`;
warning-as-error replay and in-memory syntax/function-size checks cover the
kept code. No claim of a constant-workspace implementation follows.

## Open next questions

1. Does an open cube-covering path improve the threshold at dimensions where
only one coordinate has the largest flip count? This could reduce the
characteristic for the same split. First delete each edge of one balanced
cycle and price the resulting path counts. General path balancing is open
here, and no open-path optimality is claimed.
2. Can an unrestricted depth-two source word beat this closed-walk capacity by
more than a constant number of coordinates? First compare literal prefix
geometry with PR6107's weight-count obstruction. This package supplies no
unrestricted upper bound beyond the credited predecessor.
3. Can a named characteristic-c consumer use the extra sources at a favorable
complete price? First specify its immutable sources, physical endpoints,
output layout and complete `I,P,D,c_F` ledger. No such consumer is supplied.

## Sources and credit

The scope comes from Josie Elliston / [PR6107](https://github.com/CrocSwap/integer-mult-bounds/pull/6107),
Open next question 3. The main construction is Armin Pourshafeie / apoursh's
[PR6071](https://github.com/CrocSwap/integer-mult-bounds/pull/6071).
Nick Petalas's PR4231/PR4248 supplies the unsigned interface, prefix criterion,
concatenation and the depth-one pair, with Ross Richardson's PR934/PR943 and
Riquelme Soares's retained lineage. Josie Elliston's PR6061 and zxv's PR6057
supply earlier finite blocks. Bakos, Robinson-Cohn, and Bhat-Savage retain
credit for the classical Gray-code mathematics and construction. Source
READMEs and all predecessor credit lines remain unchanged.

[SOURCES.json](SOURCES.json) pins the canonical base, task card, selected record
and three live predecessor READMEs. [TASK.json](TASK.json) records the changed
card premise and structured next questions. Live overlap checking preceded
the [CLAIM](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19370235).
Sparse local notes and unpublished work remain coverage limitations.
36 changes: 36 additions & 0 deletions research/connector-balanced-walk-threshold/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"schema_version": 1,
"base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a",
"sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec",
"sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81"
},
{
"path": "research/connector-bounded-depth-cap/README.md",
"usage": "input",
"git_blob": "0127ee20090453b48024f8a1b279427a6612b0bf",
"sha256": "9e8800a27375b92b77b20cf3594f647a507bf17fd9bff2c4da1be10db2db98fa"
},
{
"path": "research/connector-depth-blocks/README.md",
"usage": "input",
"git_blob": "5d5b4a5b96e05f3818ff454d4dfdc5dc2959f6b4",
"sha256": "0ce59767f249b24d65d7d14b466115858d82c0bbfaaa8eab46b7406f4e975331"
},
{
"path": "research/connector-gray-growth/README.md",
"usage": "input",
"git_blob": "0c9041011c12aa1f617b624c721482a3817f62ec",
"sha256": "8129752acb681528f734ff6f1b95a127948bfcf8817ae5d7500ccf46523e042a"
}
]
}
86 changes: 86 additions & 0 deletions research/connector-balanced-walk-threshold/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"schema_version": 1,
"task_id": "connector-alphabet-change",
"priority_revision": 8,
"base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a",
"original_card": {
"id": "connector-alphabet-change",
"question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?",
"starting_points": [
"docs/research/research-family-status.md",
"research/universal-connector-boundary/README.md",
"certificates/selected-result.json"
],
"methods": [
"Construct and charge a legal extra operation on a minimal instance.",
"Prove a target-specific bound after adding one specified operation family."
],
"acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free. 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",
"research/universal-connector-boundary/verify.py"
],
"expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY",
"inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.",
"scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay."
},
"first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.",
"bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.",
"allowed_variations": [
"Choose one additional operation and a small source count for its first counterexample."
],
"scope_change_triggers": [
"Keeping the alphabet and only increasing the source count; record this as a changed assignment.",
"Extending a source-count census without naming a supplier/interface decision it could change; audit #2973 pruning concerns before relying on the affected predecessor exclusions."
],
"overlap_terms": [
"universal connector",
"source-toggle",
"connector alphabet"
]
},
"scope_status": "changed",
"actual_scope": "Exact closed-cube-covering-walk flip threshold C(k)=2 ceil(2^(k-1)/k), balanced unsigned connector source-capacity lower bound, and one literal nine-source certificate.",
"scope_change_reason": "The operation alphabet stays fixed. This takes PR6107 Open next question 3 and builds on PR6071 rather than adding an operation. It is a scoped local interface side result, not a completed supplier or a scientific audit.",
"bottleneck_link": "Larger immutable-source batches can improve the productive side of an interface only after a physical consumer and complete invoice are supplied; this theorem improves an abstract source-capacity guarantee and makes no selected budget claim.",
"budget_minutes": 60,
"stop_rule": "Stop at the first verified balanced-walk threshold and literal connector improvement; leave other walks and unrestricted words open.",
"outcome": "completed",
"evidence": "README.md written proof; WITNESS.json literal Hamilton cycle; verify.py independent prefixes, 27 complete dirty-input executions, 120 small closed walks, capacity bounds and rejecting controls.",
"author": "Nick Petalas",
"ai_assistance": "Independent human and formal proof-kernel review are unclaimed.",
"open_questions": [
{
"question": "Can an open cube-covering path improve this characteristic threshold?",
"why_it_matters": "Removing closure can lower a maximum coordinate count without changing the positive split interface.",
"first_step": "Delete each edge of a balanced cycle and compare maximum flip counts.",
"blocked_by": "No all-dimension optimal path theorem or full connector-optimality claim is supplied."
},
{
"question": "Can unrestricted depth-two words exceed this closed-walk capacity by an unbounded additive amount?",
"why_it_matters": "The closed-walk optimum does not settle the full prefix geometry.",
"first_step": "Combine literal prefix constraints with PR6107 weight counting.",
"blocked_by": "The predecessor upper bound and the new lower bound do not match."
},
{
"question": "Can one named physical consumer use the larger batches at a favorable complete bill?",
"why_it_matters": "Source capacity by itself changes no admitted supplier or kappa.",
"first_step": "Specify endpoints and price admission, preparation, dispatch, every complete call and output layout.",
"blocked_by": "No physical consumer or complete price assignment is supplied."
}
],
"coordination": {
"claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19370235",
"upstream_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a",
"priority_revision": 8,
"checked_utc": "2026-11-03T09:09:00Z",
"coverage": "Live open PRs and recent handoffs; merged distinctive/general-family searches; current-main README search; cached overlap has sparse local notes. Unpublished work and arbitrary historical diffs are not covered."
},
"environment": {
"python": "CPython 3.12.15",
"platform": "macOS",
"dependencies": "standard library only"
}
}
Loading