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
133 changes: 133 additions & 0 deletions research/crt-interchange-width-threshold/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Ordinary interchange threshold at the reservoir width

**Scoped exact computation with a written all-width argument. No new κ.**
The selected conditional exponent stays 60403/20000000. This does not
accept PR #4100.

## Result

BIT.md §4 runs the elementary digit-swap algorithm when `2k ≥ e` or the
body width is below 64. Here `e` is the q-ary field width, `q = 2^89 − 1`,
and `k` is the least integer with `q^k ≥ K(w)^{D(e)}`. Evaluated exactly,
this test gives:

1. **Exact threshold.** The elementary branch runs exactly for q-ary widths
`e ≤ 311308`. Every width `e ≥ 311309` takes the recursive branch.
In binary, an `h`-bit field reaches the recursive branch exactly when
`h ≥ 27706412`.
2. **Every #4174 reservoir up to 2.77 · 10^9 bits is elementary.** Since
`r_max = floor(L/(100G))`, `H = r_max G ≤ L/100`. A recursive H-bit
interchange therefore needs `L ≥ 2770641200`. The production plan
`p = 9240576`, `ell = 24` has `L = 1540096`, which is 1,799 times too
short. Its `H = 15360` bits is 173 q-digits. The smallest layout with
`L ≤ p` from #4938 (`p = 1310720`, `ell = 21`) has `H = 10752`, which
is 121 q-digits. Both are elementary.
3. **What this means for #4938's question.** One ordinary H-bit interchange
does fit `O(V H^{1−a} + V)`, because BIT.md's statement is uniform and
its finitely many elementary widths are absorbed into the constant. On
every elementary width, `E^{a2} < 2^{19 a2} < 2^{0.033}`, so the absorption
costs at most that factor over the elementary constant. At the actual
#4174 width, however, the factor `H^{−a}` is not realized. The callee does
elementary swaps, so there is no width saving.

## Argument

Fix `w`. BIT.md takes `w = ceil(e^c)` with `c = 8667/5000000`, so
`w = 2` exactly for `2 ≤ e ≤ 2^{1/c}`, and `1/c > 576`. Width `e = 1` is
elementary trivially.

*Stock digits.* Write `β = 269241600 N` with `N = |GL_64(F_q)|`. The
verifier checks `q^4096 < β < q^4097` exactly. At `w = 2`,
`K^D = q^{4096D} β^D`, so `k = 4096 D + j(D)`, where `j(D)` is the least
`j` with `q^j ≥ β^D`. Then `4096 D < j(D) ≤ 4097 D`, and `k ≤ 8193 D`.
The verifier computes `j(D)` exactly for `D ≤ 20`. In particular
`k = 155654` at `D = 19`, so `2k = 311308`.

*Depth blocks.* The map `n ↦ 42 floor(n/64)` is nondecreasing, so `D` is
nondecreasing by induction. `D(e) = D` therefore holds exactly on the block
`[m_D, m_{D+1})`, with `m_1 = 64` and `m_{D+1} = 64 ceil(m_D/42)`. Since
`k` depends on `e` only through `D(e)` at fixed `w`, the elementary set in
each block is an initial segment, ending at `max(2k_D, k_D + 127)`.

*Below the D = 20 block.* The verifier checks every width
`2 ≤ e < m_20` against the literal test. The result is elementary exactly
for `e ≤ 311308`. That boundary lies inside the `D = 19` block.

*From D = 20 up to 2^576.* For each block start `m_D ≤ 2^576` with
`D ≥ 20`, the verifier checks `2 · 8193 D < m_D` and
`(m_D − 8193 D)/2 ≥ 64`. By the block property, each whole block is then
recursive. There are finitely many such blocks, and all of them are
checked.

*Beyond 2^576 (`w ≥ 3`).* Put `x = log2 e ≥ 576`. Then
`w ≤ e^c + 1 ≤ 2^{cx+1}`. Each depth step multiplies by at most `21/32`,
so `D ≤ 1 + 1.65 x`. Also `k ≤ (4096 w + 1) D + D`. Together these give
`2k < 2^{17 + cx + log2 x}`, and at `x = 576` the exponent is below
`575 < x − 1`. The gap `x − cx − log2 x` increases for `x ≥ 2`, so
`2k < e/2` for all larger `e`. The body width `(e − k)/w ≥ e/2^{cx+2}` is
far above 64. This range lies far outside any physical width and is
included only so that the threshold statement covers all `e`.

*Binary widths.* BIT.md embeds `2^h` into `q^E`, with `E` least such that
`q^E ≥ 2^h`. Then `E ≤ 311308` exactly when `2^h ≤ q^311308`. The bit
length of `q^311308` is 27706412, so the recursive branch starts at
`h = 27706412`.

*Both stages.* The test depends only on `e`, `w` and the fixed stock, and
not on the preceding saving `a`. The `a = 0 → a1` and `a1 → a2` wrappers
therefore share this threshold.

## Scope

Card `uniform-transfer-audit`, scope **refined** to the callee's branch at
the reservoir width (see `TASK.json`). This package follows BIT.md §4 as
written: the stock is `K(w)^{D(e)}` on the original radix width, and the
body width is `n = floor((e − k)/w)`.

The following are not covered: the constants `C` and `c_el` (BIT.md gives
neither), the three-field placement (#4174 proves it), the guard scan, the
sparse repair, and any statement about the complete CRT or multiplication
theorem. The threshold is a fact about the callee as written. A smaller
stock or a different wrapper test would move it.

Base: canonical main `cef4b52f2a59009865bf8eabde1be3f159063703`,
priority revision 7, fetched 2026-10-23T03:05Z. `find_overlap.py`, the PR
search for "interchange" and the handoff thread found no open claim on this
threshold. That is a search result, not a novelty proof. Claim:
[#1166 comment](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19136868).

## Reproduce

Python 3.12, standard library only, from the repository root:

```sh
python3.12 -B research/crt-interchange-width-threshold/verify.py
python3.12 -B scripts/research_package.py --package research/crt-interchange-width-threshold
```

The direct command prints `PASS_CRT_INTERCHANGE_WIDTH_THRESHOLD` in about
20 seconds. Most of that time goes to the exact `β^D` comparisons. Changing
the q-ary boundary to 311309, the binary boundary to 27706411 or the
production q-width to 172 makes the verifier fail.

## Open next questions

1. **At what reservoir length does the composed CRT bill first beat the
elementary-callee bill?** Below `L = 2770641200` every reservoir exchange
is elementary. Any CRT-layer saving in that range has to come from some
other source. *First step:* write the per-layer cost as `c_el V H`
(elementary) and `C V H^{1−a2}` (recursive), then solve for the smallest
#4174 layout at a stated ratio `C/c_el`. *Blocked by:* BIT.md states
neither constant, so the answer is conditional on the stated ratio.

## Credit

Cinna Davis, PR #4100, for the CRT construction, BIT.md and its wrapper
test. Hiroki KUMAZAKI (@kumagi), PR #4174, for the constructor and the
production plan. JoyboyBrian, PR #4938, for the evaluator binding and the
open question. PR2195, PR2234, PR2753/2809, PR2899 and PR2915 for the
retained interchange assembly lineage credited in BIT.md.

Prepared by James Reed with substantial Anthropic Claude (Claude Code)
assistance. Apache-2.0. No independent human review and no formal-kernel
acceptance are claimed.
36 changes: 36 additions & 0 deletions research/crt-interchange-width-threshold/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"schema_version": 1,
"base_commit": "cef4b52f2a59009865bf8eabde1be3f159063703",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395",
"sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602",
"sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72"
},
{
"path": "research/unconditional-batched-crt/BIT.md",
"usage": "input",
"git_blob": "2aa2544fa61259ac48b936b8c906ec9d31d813fa",
"sha256": "83a0cc082e52219a5f142becc8b5b92019e091cb3ede6c5bccbd8508993fc4da"
},
{
"path": "research/unconditional-batched-crt/CRT.md",
"usage": "input",
"git_blob": "d98dd8e368431cac33d5fc1c8c336696663641d6",
"sha256": "02c3a1e38cbee25aefe2640cc72676da62ba10eb7519fbcb9adb9d48b74eff2b"
},
{
"path": "research/crt-reservoir-placement/allocator.py",
"usage": "input",
"git_blob": "4b3ad89652a28f7d142248d1b5747272e696493c",
"sha256": "b764195fc6291e3c8fa8297b1f4ceaefc119d5664d8ff348b49eac8a2e79c688"
}
]
}
74 changes: 74 additions & 0 deletions research/crt-interchange-width-threshold/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"schema_version": 1,
"task_id": "uniform-transfer-audit",
"priority_revision": 7,
"base_commit": "cef4b52f2a59009865bf8eabde1be3f159063703",
"original_card": {
"id": "uniform-transfer-audit",
"question": "Does one quantified step of the proposed #4100 all-size construction hold at its actual caller?",
"starting_points": [
"docs/research/research-family-status.md",
"certificates/selected-result.json",
"research/unconditional-batched-crt/README.md"
],
"methods": [
"Prove one missing implication with explicit quantified hypotheses.",
"Find an exact counterexample at the claimed interface boundary."
],
"acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read PROOF.md and AUDIT.md in #4100. Select one distinct obligation: CRT total repair, native/free-algebra lifting, precision/conditioning, or complete fixed-tape cost. This is an author-submitted proof, not an accepted unconditional theorem.",
"scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately."
},
"first_experiment": "Check live handoffs; name one proposition, its caller, quantified domain and dependency closure. Independently prove the implication or exhibit a precise gap/counterexample. Prioritize CRT.md total repair or COMPLEX.md free-algebra lift only if unclaimed. Stop at the chosen obligation; do not substitute finite samples or root arithmetic for an all-size proof, or launch the complete package by default.",
"bottleneck_link": "Finite supplier improvements are useful only under the retained transfer obligations.",
"allowed_variations": [
"One CRT repair, native lift, precision/conditioning or tape-cost proposition, with its exact caller."
],
"scope_change_triggers": [
"Replacing a quantified obligation with another finite smoke test.",
"Treating archive intake, an author PASS receipt or a finite composed fixture as discharge of the universal hypotheses."
],
"overlap_terms": [
"uniform transfer",
"all-size",
"precision",
"4100",
"unconditional-batched-crt"
],
"existing_checks": [
{
"scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.",
"evidence": "research/unconditional-batched-crt/README.md",
"remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.",
"status": "author-checked",
"source_commit": "337d04939571a637aeab54a0f58f54fde811663a",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
}
]
},
"scope_status": "refined",
"actual_scope": "Decide whether BIT.md section 4's ordinary interchange runs its recursive or elementary branch at the #4174 reservoir width H = r_max G, by evaluating the wrapper test 2k >= e (or body width below 64) exactly at every q-ary width.",
"scope_change_reason": "PR #4938 open question 1 asks whether one ordinary H-bit interchange fits O(V H^(1-a) + V) at the actual #4174 width. The callee's statement is uniform in width, so the remaining content is which branch the callee takes at that width. This package computes the exact branch threshold and compares it with H. It does not price the elementary algorithm's constant, the three-field placement, or any other CRT step.",
"bottleneck_link": "The CRT layer's saving a - 2(1-epsilon) assumes the interchange's h^(-a) gain. Below the computed width the callee realizes no gain. That holds at the production plan and at every #4174 layout with L below 100 times the threshold. The asymptotic statement is unchanged, and so is the selected frontier.",
"budget_minutes": 60,
"stop_rule": "Stop after the exact threshold, its all-width monotonicity argument and the comparison with H on the two cited #4174 layouts. Do not build an interchange, price constants or revisit placement.",
"outcome": "completed",
"evidence": "python3.12 -B scripts/research_package.py --package research/crt-interchange-width-threshold",
"author": "James Reed",
"ai_assistance": "Substantial assistance from Anthropic Claude (Claude Code, Opus 5.5).",
"open_questions": [
{
"question": "Does the CRT layer's claimed saving survive with the interchange's actual threshold, i.e. at which reservoir length does the composed O(V p^(1-a) ell^2 polylog p) bill first improve on the elementary-callee bill, once the K = O(ell + log p) colors and O(ell log d) layers are counted?",
"why_it_matters": "Below L = 2,770,641,200 bits every reservoir interchange is elementary, so any CRT-layer saving below that size must come from elsewhere.",
"first_step": "Write the per-layer cost with an elementary callee as c_el V H and with a recursive callee as C V H^(1-a2), and find the smallest #4174 layout where the recursive form is smaller for a stated ratio C/c_el.",
"blocked_by": "The constants C and c_el are not stated in BIT.md; any answer is conditional on a stated ratio."
}
]
}
22 changes: 22 additions & 0 deletions research/crt-interchange-width-threshold/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/unconditional-batched-crt/BIT.md",
"research/unconditional-batched-crt/CRT.md",
"research/crt-reservoir-placement/allocator.py"
],
"commands": [
{
"argv": [
"{python}",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 180,
"checks": "Exact BIT.md section 4 branch test at w=2: elementary exactly for q-ary widths E <= 311308 (exhaustive below the D=20 block, block induction to 2^576, written bound beyond). Binary threshold 27706412 bits. The #4174 production H=15360 (173 q-digits) and smallest L<=p H=10752 (121 q-digits) are elementary; a recursive call needs L >= 2770641200."
}
]
}
Loading