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
149 changes: 149 additions & 0 deletions research/current-native-bank-selector/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# A charged selector at one native child view

## Contract and exact source

Fix the source in VENDORED.json. At zero-based clock 88263 the current
PR7663 word executes `MOVE 1510,477,1090,True`. Role 1510 has lifetime
ordinal 35, from INIT 88260 to CLEAR 91760. There are 34 live parent
lifetimes at this cut. The complete raw native plan has 234 lifetimes.
The verifier reconstructs the edited word and checks these facts directly.

Chart 1090 is a four-dimensional subspace of the eight-dimensional chart
477 in the nine-dimensional native frame. The retained native adapter
contract therefore exposes a positive rank-four child. This result does
not reconstruct or execute those adapters. It starts after they put the
complete view in canonical spectator-first order.

Let R,f,W be positive integers. Each complete complex address has W real
bits, a separator, W imaginary bits, a separator and one represented blank.
Its record length is 2W+3. The parent has R external rows and 9f native axes.
The child has R*2^(5f) external rows and 4f active axes. Both use the same
root width W. Both complete extents are

```text
L = (2W+3) R 2^(9f).
```

For parent address (r,s,c), with s in [0,2^(5f)) and c in [0,2^(4f)),
the linear index is r*2^(9f)+s*2^(4f)+c. The child index is
(r*2^(5f)+s)*2^(4f)+c. They are equal, and Euclidean division gives the
unique inverse. Every bit and structural cell of every record is thus in
the same position. No data permutation or physical copy implements this
reshape. The preceding adapters, their control, and any different address
order remain separate costs. Equal total extent without this shape and
order identity is insufficient.

## Two tapes, fixed banks and a finite selector

Fix P parent slots and C child slots before input sizes vary. Let B=P+C.
Each slot has L payload cells between two guards, so slot k begins at
k(L+2). Slots 0 through P-1 retain the parent. Slots P through B-1 are
distinct child homes. A child may borrow an explicitly named parent slot;
that slot is not also an owned child home.

The data tape and a separate read-only guide tape have B(L+2) cells each.
Each guide slot contains a typed left marker, L typed template cells and
a typed right marker. These are the unchanged PR7663 guide values. A
literal marker in old data cannot act as a guide boundary. The guide and
data heads start at the first slot's left guard. The construction retains
every slot, including inactive or cleared homes. Resident tape capacity
is exactly 2B(L+2) cells for this subsystem, plus its fixed control and
separately charged preparation workspace.

The forward selector starts in finite state k. At each typed left marker
it stops if the state is zero, or decreases the state by one. At all other
guide cells it keeps the state. A nonterminal step moves both heads one
cell right. Induction on the crossed left markers proves that it stops
at slot k, after exactly t=k(L+2) moves of each head. The reverse selector
uses the same states and moves left. From slot k it returns to slot zero
in exactly t moves of each head. Neither selector reads or writes data.

The state range is 0 through B-1. It is finite and independent of R,f,W.
Each selector has 10B literal rows: eight template symbols and two typed
boundaries per state. There is no variable-distance head instruction.
The two heads stay aligned but address distinct tapes.

## Exact local charge and restoration

Count each guide read, payload write, unit move of either head and executed
control row as one unit. One selector executes t+1 guide reads and control
rows, and 2t unit moves. Its cost is 4t+2.

Use the unchanged source reset graph at the selected slot. It executes
2L+3 guide reads and control rows, L payload writes and 4L+4 unit moves.
Its cost is 9L+10. INIT writes the complete scientific-zero template;
CLEAR writes the raw blank. The graph returns to the selected left guard.
The source's position induction applies to arbitrary old payload symbols.
The guide and both exterior guards stay unchanged.

Compose forward selection, reset and reverse selection. The complete
service has exact cost

```text
8k(L+2) + 9L + 14.
```

Only the selected payload is written. Both heads return to the first
slot's origin. Thus every suspended parent, every other child slot, all
guards and the guide are unchanged when k>=P. The conclusion concerns
complete historical backing, not just the current scientific length.

A borrower of parent slot j can instead enter through the two selectors.
If its own service returns both heads at that slot's origin and writes
only the granted payload and its distinct child homes, composition adds
8j(L+2)+4 to its separately charged service cost. The rest of the parent
remains unchanged. This is a frame-condition theorem. It does not provide
the child's Gaussian arithmetic or its internal allocation.

## Apply the complete raw lifetime plan

Give the source's 234 child lifetimes slots 234 through 467, and retain
234 distinct parent slots. Each child ordinal receives one INIT and one
CLEAR at the source clocks. The exact plan supplies the chronology; no
label reuse aliases two lifetime homes. Summing the formula above gives

```text
2 sum_(k=P)^(P+C-1) [8k(L+2)+9L+14]
= C(16P+8C+10)L + C(32P+16C+12).
```

For P=C=234 this is 1316484L+2631096. The 468-command literal replay checks
that sum at L=5 while preserving the complete parked parent. A separate
actual-extent fixture has R=f=W=1, L=2560 and 1199016 cells on each tape.
It executes INIT and CLEAR at the first and last child slots, checks every
unselected cell and guard, and tests a borrower confined to parent slot 35.
That borrower writes a fixed valid bit pattern. It is not a Gaussian child.

The two selectors and both reset graphs contain 9398 reusable service
rows at B=468. A complete static dispatcher is not free. For example,
unroll the fixed 468-command schedule, retain one operation's 19 reset
rows per command, and connect each terminal transition to the next phase.
This gives at most 468(20*468+19)+1 = 4389373 finite control rows. The
terminal transitions already appear in the charged row count; no extra
unpriced jump is needed. This is a constructive representation bound,
not a claim that the verifier stores that full unrolled table.

The same proof applies to any fixed P,C and a caller-supplied finite
schedule. The 234-slot child tuple here exercises one raw native lifetime
plan. It is not the actual inventory of an entire compiled recursive child.
That inventory can contain many raw occurrences and other workspace.

## Coverage and remaining obligations

The local position and frame-condition arguments hold for every stated
shape and arbitrary old private symbols. The finite cases corroborate
them. Controls detect equal-size wrong formats, missing spectators,
parent/child aliasing, a shortened guide and an omitted head return.

Guide production, staging and retirement have positive costs. The retained
source gives an O(L+1) construction per guide plus descriptor setup. The
verifier uses that producer, but does not compile its full bit-level
production, or provide a common physical tariff for the whole algorithm.
This proof charges the complete local service once the guide and slots
exist. It does not claim that their initial allocation or preparation is free.

The native adapter permutation, actual compiled occurrence tree, complete
child arithmetic, cross-depth ownership, compiler/primitive workspace,
root format delivery and analytic recovery remain open here. The source's
full conditional application was not replayed. No framework assumption is
discharged, no new kappa is established and the selected frontier is unchanged.
107 changes: 107 additions & 0 deletions research/current-native-bank-selector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Charged selection and return for current native banks

This package proves a local two-head bank-selection theorem and binds it
to the owned MOVE at clock 88263 in
[PR #7663](https://github.com/CrocSwap/integer-mult-bounds/pull/7663).
It adds the travel to and from a private bank to the retained reset cost,
and proves that all other parent and child cells stay unchanged.
No new kappa or complete recursive allocator is claimed.

The exact source head is `b81f40997de646de30749d367484d89e59fc3013`.
The reconstructed word has SHA256
`f95eabd1734c7a74f58428cb12f261a81032bef01aed78c8147a4e4f90636939`.
The source executes `MOVE 1510,477,1090,True` during lifetime ordinal 35,
with 34 parent lifetimes live. A direct binary span check confirms the
nested rank-four boundary. The retained native adapter contract supplies
its canonical post-adapter view; those adapters are not replayed here.

## Result

[PROOF.md](PROOF.md) gives the all-size position and frame-condition proofs.
[RESULT.json](RESULT.json) records source binding, literal charges and
controls. [controller.py](controller.py) uses only guide reads, payload
writes, unit moves of two distinct heads and finite control transitions.
It does not jump to a bank address.

If bank k has L payload cells and two guards, selection, complete reset
and return cost exactly `8k(L+2)+9L+14` in those physical/control units.
The complete 234-lifetime plan, placed after 234 retained parent banks,
has reset overhead `1316484L+2631096`. Guide construction, all numerical
child work, adapters and complete recursive allocation have separate costs.
The general formula for P parent and C child banks is
`C(16P+8C+10)L+C(32P+16C+12)`.

In the canonical view, parent shape `(R,9f,W)` and child shape
`(R*2^(5f),4f,W)` have the same complete records in the same order.
The proof gives an inverse address map. Matching extent alone does not
establish that fact. All banks, including inactive historical homes,
remain resident. Data and immutable guide capacity is `2(P+C)(L+2)`
cells, with positive fixed control and preparation costs in addition.

The source-bound fixture reserves 234 parent and 234 child slots. It
checks every INIT and CLEAR in the native lifetime chronology at L=5.
A separate R=f=W=1 fixture uses L=2560 and 1199016 cells on each tape.
It executes both resets at the first and last child slots, then checks
every other cell and all guards. A confined write-only borrower checks
that parent slot 35 can change while all other parent cells stay fixed.
This borrower is a frame-condition witness, not a Gaussian transform.

The three shape checks cover 263680 complete addresses. Five controls
detect a same-size wrong format, missing spectators, aliased ownership,
a shortened guide and an omitted return. The proof quantifies over all
stated shapes and arbitrary old private symbols; finite cases supplement it.

## Scope and remaining obligations

The source's reset and guide functions are copied unchanged. This work
adds a two-head selector, a precise travel charge and a local composition
proof. Correct complete guides, distinct slots, the same root bit width
and canonical adapter order are premises. The guide producer has a
retained constructive source bound; its full physical compilation is open.

The 234-slot child tuple represents one raw native lifetime plan. It is
not the inventory of an entire compiled recursive child. The general P,C
formula is available once that actual inventory and schedule are supplied.
The complete occurrence tree, numerical child, root format delivery,
adapter movement, private auxiliary stock and common whole-algorithm
tariff remain outside this result. The five framework assumptions and
the selected frontier are unchanged. The full source application and
selected multiplier were not replayed.

## Reproduce

Use Python 3.12 and the standard library:

```sh
python3.12 -B scripts/research_package.py --package research/current-native-bank-selector
```

Normal and optimized isolated commands must each print
`PASS_CURRENT_NATIVE_BANK_SELECTOR`. The runner must print
`PASS_REGISTERED_RESEARCH_PACKAGE`. Normal verification writes no files
and needs no Git, network or solver. `--write` creates only an initial
receipt and refuses to replace an existing one.

## Open next questions

Export one actual finite compiled parent/child owner map, including every
raw occurrence and all caller and primitive workspace. Then instantiate
the general bank-count and schedule formulas. Separately compile and
charge the guide producer through production, head return and retirement.
[TASK.json](TASK.json) gives the exact scope and stop boundary.

## Credit

Ali Romman supplied the PR7663 construction and its reset/guide source
with substantial OpenAI Codex assistance. CubeJerry supplied the selected
primitive and prior typed reset in
[PR #7586](https://github.com/CrocSwap/integer-mult-bounds/pull/7586).
The exact candidate retains Clear1nsight, DreamingOfClouds, SYLforge,
Rohan Arun and the selected predecessor credit in [source/NOTICE](source/NOTICE)
and its copied notices. [VENDORED.json](VENDORED.json) authenticates each
copied file. The main selected proof is a declared input in
[SOURCES.json](SOURCES.json).

Ali Romman directed this new selector, cost proof and verification with
substantial OpenAI Codex assistance. New work is Apache-2.0. Canonical base:
`e54523517d0f03e58352e647c403a5af3e525a57`.
138 changes: 138 additions & 0 deletions research/current-native-bank-selector/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"boundary": {
"clock": 88263,
"event": [
"MOVE",
1510,
477,
1090,
true
],
"parent_owner_ordinal": 35,
"active_parent_ordinals": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
35
],
"parent_bank_count": 234,
"child_rank": 4,
"native_rank": 9,
"word_sha256": "f95eabd1734c7a74f58428cb12f261a81032bef01aed78c8147a4e4f90636939",
"lifetime_plan_sha256": "de16f7a197352722403440b3a33ffa77ed010c168f02fe1757f26db802cd8463"
},
"shapes": [
{
"rows": 1,
"factor": 1,
"width": 1,
"child_rows": 32,
"child_axes": 4,
"addresses": 512,
"extent": 2560
},
{
"rows": 2,
"factor": 1,
"width": 3,
"child_rows": 64,
"child_axes": 4,
"addresses": 1024,
"extent": 9216
},
{
"rows": 1,
"factor": 2,
"width": 1,
"child_rows": 1024,
"child_axes": 8,
"addresses": 262144,
"extent": 1310720
}
],
"source_lifetimes": {
"services": 468,
"extent": 5,
"charged": 9213516,
"trace_sha256": "ca72a87e69d936292b0da3218e5c6cbf6056befba6d91709183c78fcfcf38965",
"counts": {
"guide_reads": 2303496,
"control_rows": 2303496,
"unit_moves": 4604184,
"data_writes": 2340
}
},
"actual_boundary": {
"extent": 2560,
"banks": 468,
"payload_cells": 1199016,
"immutable_guide_cells": 1199016,
"reset_receipts": [
{
"slot": 234,
"operation": "INIT",
"charged": 4819118
},
{
"slot": 234,
"operation": "CLEAR",
"charged": 4819118
},
{
"slot": 467,
"operation": "INIT",
"charged": 9594686
},
{
"slot": 467,
"operation": "CLEAR",
"charged": 9594686
}
],
"borrowed_slot": 35,
"borrower_scope": "write-only frame-condition witness, not a Gaussian child"
},
"controls": [
"same extent with a different format rejected",
"missing child spectators rejected",
"aliased child slot changes parent",
"short guide leaves old backing",
"omitted selector return leaves both heads displaced"
],
"fixed_control_rows": 9398,
"single_service_cost": "8k(L+2)+9L+14",
"complete_child_reset_cost": {
"L": 1316484,
"constant": 2631096
}
}
Loading
Loading