Skip to content

Execute the completion/splitting pass as a lockstep rule and prove nested owned-bank lifetimes (no new kappa) - #5443

Open
Matarener wants to merge 3 commits into
CrocSwap:mainfrom
Matarener:lockstep-completion-splitting
Open

Matarener wants to merge 3 commits into
CrocSwap:mainfrom
Matarener:lockstep-completion-splitting

Conversation

@Matarener

@Matarener Matarener commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Mark

Change and mathematical scope

Before: the retained compiler premise prescribes zxv's chronological product, paid completion of small targets and disjoint splitting (p7-TENSOR.md, higher-moment-strictification) and then Sussman's lockstep flow; the completion/splitting step exists only as moment arithmetic, and FINITE-PRECOMPILATION.md §6 allocates one owned-centre bank per compiled unit instance, noting that "a smaller reuse allocation requires its own lifetime proof".

After: research/lockstep-completion-pass executes the pass and proves the lifetime statement. Status: two written lemmas with event-level corroboration; no new κ, no selected-record change.

  • Lemma A. Completion to the floor L on each small target's own owner, then splitting of every paid job at the cutoff J, is a transformation U -> U' of finite native units. U' satisfies the lockstep hierarchy; its compiled programs pass the ownership invariants I1–I6 of our research/lockstep-live-role-audit: live roles in the lockstep compiler and the #4470 outer constant C (no new κ) #4691 executor; every added job is a whole job on a field its unit owns; the rank-one surplus is preserved exactly; the net-tax identity (1) of net-tax-rank-compiler holds; the added records (pieces, completions, normalizer pairs, block relocations) have a closed per-unit count that the executor reproduces.
  • Lemma B. Owned-bank lifetimes in the lockstep schedule are properly nested (the live units are the classes on the current path plus the nested programs), so a LIFO stack of bank slots suffices; its peak is an explicit recursion. The executor runs the stack allocator with a new invariant I7 and its measured peak equals the recursion on every case. The owned-field inventory O in Z = W + O can be the peak instead of the instance count.

Remaining obligations: the native content of completion jobs and normalizers, the all-column lift, the strict moment inequality, precision and analytic recovery are inherited. The physical half of native_all_columns (tape execution of g^{⊗f} at the retained tariff, see #5442) is not addressed; this package supplies exact record counts for that bill, not prices.

Task and overlap

Base: canonical main 32890bc5de034ab8fc93ac88ead7279a6a416d04; package commit 38097c7f1. Inputs pinned in SOURCES.json: FINITE-PRECOMPILATION.md, p7-TENSOR.md, higher-moment-strictification/README.md, net-tax-rank-compiler/PROOF.md, the #5413 invoice.json/funding.json, FINITE-DAG-AUDIT.json, and our lockstep-live-role-audit/live_roles.py. Object: the completion/splitting pass and the lockstep flow on the p7 and selected #5413 profiles (cutoffs c=10,b=15 and c=20,b=21), tensor powers 1..3 at histogram level, one generation for compiled counts.

Task card selected-stock-envelope, scope refined (TASK.json): it continues #4691 (same card) toward the compiler/owned_erasure premises named in target 10 of #5428. Nearest work: #4691 (executor, separated rules only), #4832 (sharp split charge; moment arithmetic only), #4586/#4638 (chronological batch widths), #5364/#5404 (continuation tapes), #4192 (Beneš arena scan), #5442 (algebraic half of native_all_columns). None executes the pass or proves bank lifetimes.

Validation

python3.12 -B scripts/research_package.py --package research/lockstep-completion-pass

PASS locally on CPython 3.12 (Windows), standard library only: verify 148 s, controls 168 s; check_research_commit.py passes. Evidence:

  • counting parity with research/lockstep-live-role-audit: live roles in the lockstep compiler and the #4470 outer constant C (no new κ) #4691 on the toy rule (N = 4..64) and the BIT-shaped rule (N = 50..3200), and the FINITE-DAG-AUDIT receipt at toy rank 40;
  • complete p7 and selected profiles at tensor powers 1, 2, 3: identity (1) to 40 digits, surplus unchanged (608 and 752 to the power v), equal added masses, separation; at v = 1 the selected unit has 77,204 rounds after the pass (64,260 original, 5,152 pieces, 7,792 completions), 15,584 normalizer records and 12,944 relocations;
  • event-level execution with the stack allocator on the toy rule (full width to N = 28), an overlapping toy rule after the pass (full width, N = 40 and 64: 12,048 and 112,738 bank allocations, peaks 732 and 8,751), p7-shaped and selected-shaped rules with the caller's chronology shape and random, all-on-centre and one-owner owners: peak, total and all record counts equal the formulas;
  • compiled counts of the complete profiles at one generation: selected profile N = 3045, 84,996 units per copy, 7,793 live at peak, total/peak banks = 346;
  • twelve rejecting controls (test_verify.py): overlapping rule before the pass, cutoff not below floor, dropped remainder, short completion, foreign completion owner, release-early allocator, per-depth bank, eager parent, repeated exit field, peak recursion without its nested term, wrong tax, tampered RESULT.json.

Finite executions corroborate the written lemmas; they are not the all-size proof. Not run: the literal owner of each selected paid call (shaped chronologies instead), two-generation compiled counts for the selected profile, the v = 1024 template, Lean, hosted CI before this PR.

Credit

Jacob Alan Sussman (Theorem 1G lockstep flow), Cinna Davis (PR4412/4414/4416 product and completion), zxv (higher-moment-strictification, net-tax-rank-compiler, #5428), Nick Petalas (#4832), Chris R / Clear1nsight (#5413), Dillon (#5402), Ali Romman (#5383/#5398), Cao Yifan (#4610), and our #4691 executor. Apache-2.0. Prepared by Mark (Matarener) with substantial Claude Code assistance; no independent human or formal-kernel review.

Open next questions

  1. Bind the actual owners of the selected caller's paid calls and execute the literal 77,204-round rule at two lockstep copies (first step: per-event owner fields from NEUTRAL-BACKWARD-v16c.json).
  2. Price the added records with the retained native tariff (171-record monomial bound, block-permutation price) for a numeric movement bill.
  3. Evaluate peak(N)/total(N) at two generations with memoisation over dilations.

🤖 Generated with Claude Code

Matarener and others added 2 commits October 24, 2026 18:01
…sted owned-bank lifetimes (no new kappa)

Target 10 of CrocSwap#5428, one narrow lemma pair in research/lockstep-completion-pass:

- Lemma A: completion of small targets to the floor L on their own owners and
  splitting of every paid job at the cutoff J (p7-TENSOR, higher-moment
  strictification) is a transformation of finite native units whose result
  satisfies the lockstep hierarchy; its compiled programs pass the ownership
  invariants I1-I6 of the CrocSwap#4691 executor; rank-one surplus is preserved; the
  net-tax identity (1) holds; the added records have an exact per-unit count.
- Lemma B: owned-bank lifetimes in the lockstep schedule are properly nested,
  so a LIFO stack of bank slots suffices (the lifetime proof that
  FINITE-PRECOMPILATION section 6 asks for); explicit peak recursion, executed
  and equal to the measured peak on every case (invariant I7).

Checked on the complete p7 and selected CrocSwap#5413 profiles at tensor powers 1..3
(identity, surplus, separation, record counts) and on toy, overlapping, p7-shaped
and selected-shaped rules with the stack allocator. Selected profile, v=1,
N=3045: total/peak owned banks = 346. Twelve rejecting controls.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@zxv

zxv commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Reviewed current head 1fb616aaa6f32fd5500ec58a407f0c46e32e7aeb. One correctness finding remains.

[P2] The peak recurrence combines maxima from different execution paths. counts.py:220–228 adds the largest live class-path inventory to the largest nested exit-program peak. These need not occur together: the exit rank depends on the paid ranks along that same path, which also determine its class sizes. This invalidates the equality asserted in Lemma B.

Full-width counterexample, run from this checkout:

import sys
sys.path.insert(0, 'research/lockstep-completion-pass')
import counts as C, executor as E
raw = E.RawRule('two ranks', (('a', 3), ('b', 5)),
                ((1, 'C0'), (2, 'C0')))
rule = E.complete_and_split(raw, J=2, L=3)
cc = C.Counts(rule)
run = E.audit(rule, 45, owned_policy='stack')
print(run['full_width_executed'], cc.flow(45).G,
      cc.banks(45)[1], run['peak_banks'])
# True 2 2050 2048

Here a=512, B=4096, and the executor completes all ownership checks. An independent path-conditioned recursion also gives 2048. The formula's 2048 live parent banks and its extra 2 nested banks occur on different paths. Please keep the maximization over compatible (path, exit) pairs, or state/prove this expression as an upper bound and change the exactness claims accordingly. Add a multi-generation regression where path sizes vary. This counterexample does not show that the LIFO allocation is unsafe; the current formula overestimates this peak.

The earlier JSON comparison failure at 38097c7f1 was fixed by the new head’s JSON normalization; it is not an outstanding finding. The complete registered replay, including all twelve controls, passes on the revised head. The counterexample above is a full-width two-generation execution that passes the executor and disagrees with the claimed exact peak.

Validation ran serially on CPython 3.12.8 / Darwin arm64 under a sampled 1 GiB descendant-RSS limit and explicit timeouts, with no resource stop. Literal selected-call owners, the 1024-fold template, physical tape prices, and the full retained compiler theorem were not independently validated here.

Review performed with OpenAI Codex assistance.

…ak recursion

The peak recursion added the largest live class-path inventory to the
largest nested exit peak, which can come from different paths. Keep, per
deepest dilation, the largest live path and maximise over compatible
(path, exit) pairs. Adds the two-generation rule from the CrocSwap#5443 review
(N=45: executed peak 2048, decoupled sum 2050) as a verify case and a
rejecting control; all earlier frozen results are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Matarener

Copy link
Copy Markdown
Contributor Author

Thanks, confirmed and fixed in 38119b3. Counts.banks now keeps, for each deepest dilation, the largest live inventory of a path reaching it, and maximises over compatible (path, exit) pairs: exit ranks r * dil(path) of that same path. Your two-generation rule is a verify.py case at N = 45 and 69 (executed peaks 2048 and 16,386, equal to the formula). It is also a control: the decoupled sum gives 2050. On the full rule the formula matches the executor at every N from 3 to 69. Lemma B in PROOF.md states the path-conditioned recursion. All earlier frozen results are unchanged, including total/peak 346 for the selected profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants