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
171 changes: 171 additions & 0 deletions research/selected-rank-control/GENERAL-CONTROL-PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Online rank-dependent recursion on three fixed tapes

Prepared for @CubeJerry with substantial OpenAI assistance; Apache-2.0.
Written all-width theorem with finite executable corroboration. No kernel proof.

## 1. Domain and theorem

Fix integers m>=2 and a nonempty ordered paid list (r_0,...,r_(s-1)), with
1<=r_i<m. These are compile-time constants. For every positive width f, stop
if f<m; otherwise visit all s ordered children of widths floor(r_i*f/m).
Repeated equal ranks remain distinct child sites. Set rho=max_i(r_i/m)<1.
Every internal child width lies in [1,f-1], so the tree is finite.

Input: a marked unary WIDTH stream 1^f, marked-empty CHILD, and STACK at a
blank top h immediately after its original separator. The entire stack below
that separator is arbitrary over the finite alphabet. Origins may be translated
independently. Unused suffixes are blank. K0 counts every retained entry cell,
including arbitrary warm blank backing; it is never declared free by erasure.

The literal three-tape program has exactly

Q = 10m+13+s(67+3m)+2*sum_i r_i

instruction locations and s+4 symbols. It emits the ordered contour, restores
all initial cells and heads, never visits STACK below h-1 and never writes
below h. No input length, supplied depth/tree, host recursion, run-time
arithmetic, dynamic tape selector or input-sized alphabet chooses an action.
If f_v denotes each visited node width and D is the maximum number of descents,
its complete transition count satisfies

T <= 100(s+1)*sum_v f_v.

Time depends on s. Retained allocation satisfies

S <= K0+2(f+2)+f/(1-rho)+D+2
<= K0+(3+1/(1-rho))*f+6.

Only the backing bound is independent of sibling count. The latter inequality
uses D<=f-1; it deliberately has slack. All historically visited erased prefixes
are included. The finite program is machine control, not run-time storage;
compiling a different fixed profile is outside this theorem.

## 2. Machine and interface

`controller.py` compiles read, write, unit-move, goto, emit and halt instructions.
Each is one global multitape transition; unmentioned tapes stay stationary.
Reads branch solely on the scanned symbol. An emit is a labelled stationary
finite-control edge: E for internal entry, L for leaf, D_i for descent at site i,
U_i for return at site i, and X for completed node. It does not append to a
physical event tape. Python event lists, counters and visited-interval logs are
verifier observations and are never read by an instruction.

A later consumer may be linked to these finite states if its own transitions
are paid and it preserves the controller's three-tape frame at return. No
payload consumer or binary external-descriptor conversion is supplied here.
In particular a materialized event transcript is not free storage.

At enter, the classifier scans at most m WIDTH symbols, rewinds and emits E
or L. Zero width rejects. Internal entries execute the fixed ordered site list.
A completed site's finite tag determines the next site or node completion.
The only changing control value is the finite program state.

## 3. Exact child widths

For fixed rank r, the scanning state stores c in {0,...,m-1}. On each unary
parent symbol it replaces c by (c+r) mod m and appends a CHILD symbol precisely
when c+r>=m. After k symbols, CHILD has floor(rk/m) symbols and c=rk mod m.
Induction on k proves this Euclidean-division invariant. At scan completion,
n=floor(rf/m), and both heads rewind. For internal f>=m and 1<=r<m, 1<=n<f.
Termination follows without a depth descriptor or inspecting payloads.

The source's `divmod` constructs finite transitions at compile time. Neither
`divmod` nor any decoded width appears in `Machine.step`.

## 4. Continuation and restoration

Before descent, parent WIDTH is copied to STACK and erased from WIDTH. The
fixed site tag t_i is appended. CHILD is moved into WIDTH and physically erased;
both heads rewind. D_i is emitted and control jumps to the single enter state.
Thus STACK contains blocks 1^(parent width) t_i along the live ancestor path,
and its head is at the next blank. It contains no dynamic objects or pointers.

On X, one left move reads the preceding tag. If it is the original separator,
the root is complete: advance right and halt without erasing root WIDTH.
Otherwise retire tag t_i, clear/rewind the owned child WIDTH, and copy the
immediately preceding unary parent block back into WIDTH while erasing it.
Stop at the preceding tag or original separator, preserve that symbol, move
STACK right to the old record origin, rewind WIDTH, emit U_i and resume the
next fixed site. Unary reversal does not alter the restored descriptor.

Induction over the finite tree proves the contour and all exact endpoints.
Every push writes at or above its entry top. Every pop reads at most its own
preceding separator and writes only its own record. This proves locality for
every execution prefix; endpoint restoration alone is not used to infer it.
The machine never scans farther ancestors. This is a valid-input theorem;
malformed input need not roll back.

## 5. Complete transition invoice

Literal loop counts for parent f and child n<=f are as follows. They include
terminal reads, delimiter work, erasures and head returns.

| Phase | Bound |
| --- | ---: |
| Generate child and rewind both streams | 6f+5n+8 |
| Park/erase parent, append tag and rewind | 9f+6 |
| Move child into WIDTH and rewind both | 12n+7 |
| D_i and jump to entry | 2 |
| Erase returned child and rewind | 7n+4 |
| Pop parent and rewind | 9f+5 |
| Return dispatch, tag retirement, U_i and successor | 6 |

An n-cell rewind takes 3n+3: one initial left move, three instructions per cell
and two at the marker. Adding the table gives a round trip outside the child
execution of at most 48f+38. Entry classification and E/L take at most 6f+7;
X takes one. The root's final check and halt add at most four.
Internal local cost is therefore at most s(48f+38)+6f+8 and leaf cost at most
6f+8, with that root constant. Since every f_v>=1 and s>=1, summing proves
the stated 100(s+1)*sum_v f_v. Each sibling repeats its own generation and
park/return bill; no sibling-independent time constant is asserted.

## 6. Retained backing and shape inflation

WIDTH and CHILD remain between their fixed marker and an endpoint at most f
cells away, including historical prefixes left blank by smaller later uses.
At an active path f_0=f,f_1,...,f_D, one has f_j<=rho^j*f. STACK holds one
unary parent and one tag per descent. All its visits lie between h-1 and
h+sum_(j<D) f_j+D. Adding the three historical tape intervals gives the stated
K0+2(f+2)+f/(1-rho)+D+2 bound. Every path obeys that same cap and reuses the
same origins. Erased regions are never reclaimed by assumption.

For m=2, three ranks r_i=1, and root f=2^d, the complete tree has exactly
(3^(d+1)-1)/2 nodes. A literal one-symbol-per-node contour needs superlinear
space in f, whereas the online controller uses O(f) backing. The node count is
the geometric series, not an inference from tests. This observation does not
exclude other compressed encodings. The verifier's retained event lists are
outside the machine whose backing is bounded.

## 7. Selected-source compatibility and limitations

The selected #7000 application review, Section 5, keeps the original complete
D-bit root factor in each descendant and partitions only external ROW axes.
If a consumer maintains this invariant, supplies at least one complete root
factor per node, and has f_v<=D, then for D>=1 its logical bit volume satisfies
V_v>=2^D>=D>=f_v. The producer overhead is consequently at most
100(s+1)*sum_v V_v, a fixed node-volume fee. This is a conditional implication;
it does not prove that an actual selected dispatcher has made those grants or
that its exact rank-rounding rule equals this floor recurrence.

Different cutoffs, remainder jobs, multiple backend types and different rank
rounding must be bound to actual source before substitution. This producer does
not emit #6719's H/A/R grants, route payloads, execute native maps or provide
binary-to-unary input conversion. Stock, numerical precision, ownership of
payloads and analytic recovery remain separate. All five selected assumptions
and selected kappa are unchanged.

## 8. Novelty and credit

JoyboyBrian's #5158 already gives physical fixed-bank dyadic complete-row
recursion. Thu-nmrc's #6719 already gives a richer delayed-cover root, recursive
grant and payload program from binary inputs and supplied unary depth. ToikY's
#6722 reviews a specific producer/router join. Their results retain credit;
this does not claim the first fixed-tape recursion or geometric backing proof.

The delta is the rank-dependent termination and heterogeneous-child shape
producer with no supplied depth/tree, arbitrary fixed paid branching, an exact
small transition census and a sibling-independent retained-space bound.
Finite remainder machines, depth-first stacks and geometric sums are standard.
This is one enabling interface theorem, with payload integration and external
descriptor preparation open; no new exponent, assumption discharge, complete
multiplier, independent human verification or proof-kernel acceptance is claimed.
104 changes: 104 additions & 0 deletions research/selected-rank-control/PR-DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
## What changed and why

The physical caller work already supports fixed-bank recursion. Binding that
work to the selected finite compiler still requires exact runtime child
widths, stopping control and paid remainder handling. This package supplies a
literal control producer for the final rank-one law, backed by a general
rank-profile lemma and source-pinned cutoff/remainder analysis.

The raw mixed-rank BIT law is r_i floor(e/m), not floor(r_i e/m). The selected
finite-precompilation source instead makes every final paid leaf rank one, so
all P child calls have width floor(e/N). The source binding makes this
distinction explicit and retains the supplied root cutoff L.

## Exact result

For fixed N >= 2 and P >= 1, a four-tape finite controller stops below
max(N,L), generates the ordered rank-one calls and emits pre/post hooks for
e mod N. It restores unary descriptors, the cutoff tape and arbitrary
suspended ancestors. Every return, head rewind and hook dispatch is paid.

- Instruction count: 30N+42+P(69+3N), independent of e and L.
- Complete control time: at most 200(P+1) sum_v e_v.
- Retained backing: at most K0+(4+N/(N-1))e_root+8; K0 includes the entire
supplied cutoff and preexisting historical backing.
- Cutoff comparison: at most 11 min(e,L)+10, including both head returns.
- Each remainder scan: 6e+7; both scans: 12e+14. B0/A0 explicitly skip
remainder payload actions, with finite dispatch still paid.

The reusable three-tape lemma supports arbitrary fixed 1 <= r_i < m and
children floor(r_i f/m), with complete time 100(s+1) sum_v f_v and retained
backing K0+(3+1/(1-rho))f_root+6. It requires no supplied tree or depth.

The all-width results are proved by explicit loop and stack invariants.
The conditional node-volume corollary additionally assumes complete-root
factors/row stock and paid payload consumers. It does not establish those
interfaces.

## Novelty and predecessors

#5134 and #5158 already provide literal complete-row parking and dyadic
fixed-bank recursion. #6719 provides the richer supplied-depth delayed-cover
binary-root/grant/payload program; #6722 reviews a particular join. They
retain credit. The present delta is online rank-dependent shape control and
its exact final rank-one cutoff/remainder connection, with no raw mixed-floor
substitution. Classical finite remainder transducers and depth-first stacks
are standard techniques.

Pending #7150 and #7151 cover primitive microcontrol and stratified retained
backing. Their inspected heads are pinned as complementary work, not merged
dependencies. The scientific base is
`e54523517d0f03e58352e647c403a5af3e525a57`; `SOURCES.json` pins the actual
batched-row notes, finite-precompilation source, #7000 review and predecessor
proofs by commit/blob/hash.

## Reproduction and checks

```sh
python3 -B research/selected-rank-control/verify_all.py
```

Expected: `PASS_SELECTED_RANK_CONTROL_PACKAGE`. This runs each bounded suite
normally and under `-O`, requiring byte-identical receipts.

- General: 896 cases, 13,540 nodes, 3,469,732 transitions, nine separate dense
CPU cases and ten negative controls.
- Selected: 2,400 cases, 10,878 nodes, 3,443,893 transitions, eight separate
dense CPU cases and eight controls.
- Checks observe actual unary widths as well as labels; they cover cutoff
equality, restored heads/cells, ancestor locality, historical backing,
remainder identity/omission, wrong return tags and undercharged execution.

Proofs, finite receipts and validation metadata are included. Finite checks
corroborate universal written proofs; neither interpreter is a formal kernel.
Normal execution and optimized execution are regression checks, not separate
mathematical proofs.


A separate reviewer read both proofs and executed a code-disjoint dense CPU
against an explicit address-tree oracle. It passed 125 cases, 837 nodes,
3,654 events and 488,423 transitions, checking actual widths, full ancestor
stacks, hostile exterior cells and 556 exact remainder-scan charges. Three
semantic mutants were rejected. From this directory run
`python3 -I -W error -B independent_check.py .`; see REVIEW.md and
evidence/independent.json for the complete independent receipt.

## Limitations and kappa status

**No new kappa. All five selected foundational assumptions remain.** The
accepted conditional kappa stays 0.00363005817. This is a control/interface
lemma, not a complete multiplication implementation or unconditional theorem.

The actual selected final word and its owner manifest are not emitted. The
external width/cutoff adapter, row grants, chronological scalar/frame segments,
both BIT remainder consumers and complete native endpoint contracts remain
open. Generating L=ceil(d^beta) is not free. Consumers must preserve descriptor
tapes and pay their work; complex remainder completion and BIT ungathering are
not supplied by the event producer.

## Attribution

Prepared for @CubeJerry with substantial OpenAI assistance. Credit JoyboyBrian,
thu-nmrc, ToikY, commdata2338, Ali Romman, David Arias and all retained native,
physical and compiler contributors. New material is Apache-2.0. Independent
human review and formal-kernel acceptance are not claimed.
1 change: 1 addition & 0 deletions research/selected-rank-control/PR-TITLE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generate the selected rank-one recursion on fixed tapes with paid cutoff comparison and two-sided remainder hooks
Loading
Loading