Skip to content

Research note: restoration coalescing across a recursion batch (read-free + composable-family boundary; no new kappa) - #1155

Merged
Mister-Meeseeks merged 5 commits into
CrocSwap:mainfrom
navinor:research/agent-13-recursive-seed53
Oct 15, 2026
Merged

Mister-Meeseeks merged 5 commits into
CrocSwap:mainfrom
navinor:research/agent-13-recursive-seed53

Conversation

@navinor

@navinor navinor commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Status: research note (scoped mechanism + complete cost recurrence; no new kappa)

Track recursive-interfaces (50-59), assignment seed 53 (OS CSPRNG). One
explicit way to eliminate boundary/restoration work with a complete cost
recurrence, a sufficient correctness condition (with the exact defect criterion
behind it), and a sharp cost boundary. Contributor:
Navinor (Aaron Wang), with help from opencode. Apache-2.0.

What is learned

A recursion node that restores its borrowed dirty workspace after every child
pays r restoration passes. This note prices one operator-level rewrite: let the
workspace drift across the batch and replace the r restorations by the one
composed restoration (G_r...G_1)^{-1} at the node exit. Two independent
questions decide it, both decidable exactly:

  • Correctness (vanishing defect; read-free is sufficient, not necessary).
    The single deferred restoration returns the same observables (final data and
    final workspace) exactly when the summed defect vanishes,
    sum_i B_i (G_{i-1}...G_1 - I) = 0. Read-free batches make every term vanish
    separately and are sufficient, but they are not necessary: nonzero readers
    can cancel (exact counterexamples:
    Recursive interface: coalesce restoration with cancelling readers #1199,
    Research: noncommuting reader restoration with a paid dirty-state wrapper #1203,
    Research: observer-safe restoration with nonzero readers (no new kappa) #1205). The certificate's
    reader example shows only that one reader child can break deferral; a second
    case replays the exact nonzero-reader cancellation (5 restorations -> 1).
  • Cost (composable family; density is not application cost). The rewrite
    removes passes only when the restoration operators stay cheap under
    composition: unit phases -> one phase pass, permutations -> one routing pass
    (r -> 1). The recurrence now charges composition explicitly under a succinct
    descriptor hypothesis (fixed-size parameter tuples; r * c_desc with
    c_desc = O(1)) and records Theta(r * N) to compose full length-N
    descriptor tables outside it; the N = 8 tests establish the tested
    instances, not an unpriced general recurrence. A heterogeneous mix
    (phase + Walsh + permutation) composes to
    a dense product that retains its cheap factorization: applying the factors
    sequentially costs the eager sum (16 = 16 multiplications at N = 8,
    verified against the exact dense product). Deferred application costs more
    only when no cheap factorization is retained and the dense product must be
    applied directly (64 vs 16 multiplications at N = 8 — a statement about
    direct dense application). Structure, not the count alone, decides.

Reproduce

Standard library only, Python 3.10+ (verified on 3.12 and 3.13), from the repo root:

python3 -I -O -B research/restoration-coalescing/verify.py

Expected first line:

PASS_RESTORATION_COALESCING phase=3->1(x3) perm=3->1 hetero_dense=True reader_diverges=True reader_cancels_5to1=True hetero_mults=eager16|factorized16|dense64

The checker recomputes the certificate and compares every field with
research/restoration-coalescing/CERTIFICATE.json, failing on drift. It builds
every operator explicitly at N = 8 over exact Gaussian rationals (no floating
point, no random tolerance, no imported supplier verifier), derives each composed
restoration from the exact dense product, and self-checks any cheap structured
application against that product on the standard basis before trusting its cost.

Base commit and pins

  • Base: ce7ad1b6ab09452c3478723a2e96ed5ff212dc08 (current origin/main).
  • Branch: research/agent-13-recursive-seed53 (isolated research
    package under research/restoration-coalescing/; no generator, upstream/, or
    selected-construction file touched).
  • Selected result at base unchanged: kappa = 836330098538459/500000000000000000
    (PR 1094 on PR 1087).
  • Exact source/dependency pins and file digests: research/restoration-coalescing/SOURCE-PINS.json.

Relationship to concurrent work

This is a second, independent treatment of the restoration question with a
meaningfully different method (exact operator algebra and structure detection,
standalone sub-second, versus assembly-level pricing on frozen payloads). It does
not claim priority on "restoration deferral" and does not reproduce others'
numbers.

  • CrocSwap/integer-mult-bounds#1012
    (thakrarsagar, same track) prices restoration deferral of U8 helper rank/frame
    climbs at the hosted T37 assembly level and finds it mass-neutral. Different
    layer and cost unit (rank mass vs. phase/routing passes); complementary, not a
    contradiction.
  • CrocSwap/integer-mult-bounds#974
    (avirazza, same track) prices the same boundary classes with zero parent cost.

Where those notes give the assembly-level ceiling effect, this note gives the
operator-level preconditions (vanishing summed defect + composable family) for a
genuine
r -> 1 pass reduction at all. Both are needed before deferral is placed in a
real supplier call.

Scope and inherited assumptions

A restoration-elimination mechanism, its recurrence, and its exact applicability
boundary. Not a construction, not a new kappa, not an all-size physical
compiler, precision contract, common tape, analytic transfer, owner schedule, or
the integer-multiplication theorem. Finite checks are exact algebraic identities
and exact cost counts; they do not certify a whole E8 word or the selected
kappa. Neither the selected frontier nor upstream/ changes. Inherited
all-size/compiler, hosting, precision/tape and analytic assumptions remain with
their existing constructions. No independent human or proof-assistant review is
claimed. Relevant check run: the package's own verifier (full make verify and
the selected cold replay are untouched by this isolated package and were not run).

Track recursive-interfaces, assignment seed 53. One explicit way to
eliminate restoration work with a complete cost recurrence.

A recursion node that restores its borrowed dirty workspace after every
child pays r restoration passes. Deferring to one composed restoration at
the node exit eliminates (r-1) passes exactly when (a) the batch is
read-free (no child reads the workspace's intermediate value into an
observable) and (b) the restoration operators compose while staying cheap
(unit phases -> one phase pass; permutations -> one routing pass). When the
restorations are a heterogeneous mix, the composed restoration is dense and
deferral costs more, not less. A single reader child breaks correctness.

Exact stdlib checker over Gaussian rationals at N=8: two positive cases
(phase 3->1 passes / 24->8 mults; permutation 3->1 passes) and two negative
controls (reader divergence; dense heterogeneous composition 64 vs 16 mults).
No new kappa; selected frontier and upstream/ unchanged.

Contributor: Navinor. With help from opencode. Apache-2.0.
The sprint's citation convention requires full GitHub autolinks or the
CrocSwap/integer-mult-bounds#NNN short form, never bare #NNN. Convert every
bare reference in README.md to the repository-prefixed short form and use
author names in prose. No content change.

Contributor: Navinor. With help from opencode. Apache-2.0.
Contributor: Navinor. With help from opencode. Apache-2.0.
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

100-PR batch review at 9821c6e9388f3fc097e94b72be9fa7b41a849527.

This remains open after scoped triage. Next review step: Read-free is sufficient, not necessary: #1199/#1203/#1205 give exact nonzero-reader counterexamples. Also a dense phase/Walsh/permutation product retains its cheap factorization; dense entries do not prove quadratic application cost. Correct the iff and cost claims.

This is a specific continuation point, not a rejection or a request to redo already recorded checks. Completed local evidence is retained separately from outstanding whole-head obligations.

Batch review, attribution and evidence. Thank you for the contribution.

Follow-up to the batch review comment on PR 1155
(CrocSwap#1155 (comment)).
Two claims in the note were wrong as stated and are corrected.

Correctness: read-free is SUFFICIENT, not necessary. The exact terminal
condition in this additive model is vanishing summed defect,
sum_i B_i (G_{i-1}...G_1 - I) = 0. Exact nonzero-reader counterexamples
exist: PR1199 (five children reading and negating the workspace with
coefficients [1,1,1,-1,1], restorations 5->1), PR1203 (distinct-output
criterion H_i(P_{i-1}-I)=0 versus shared-output summed defect), PR1205
(terminal theorem sum_i B_i(P_{i-1}-I)=0 and prefix theorem
B_i(P_{i-1}-I)=0 per child). The original reader example is kept and
re-scoped: it shows one reader child CAN break deferral.

Cost: matrix density of the composed product is not an application-cost
statement. The composed restoration retains its cheap factorization;
applying the factors sequentially costs the eager sum. Verified at N=8
with the existing exact machinery: heterogeneous phase/Walsh/permutation
example applies through its retained factorization for 16 multiplications
(eager structured sum 16), self-checked against the exact dense product on
every basis column. The existing 64 vs 16 numbers are kept as a statement
about DIRECT dense application only. Deferral costs more only when no
cheap factorization is retained and the dense product is applied directly.

Checker: new summed_defect criterion, a nonzero-reader cancellation case
(PR1199's shape, exact zero defect, 5->1), and the factorized-application
cost of the heterogeneous composition. Certificate regenerated additively
(existing numbers unchanged); the reader example and heterogeneous example
still run unchanged. Passes on CPython 3.12 and 3.13.

Contributor: Aaron Wang (Navinor). With help from opencode. Apache-2.0.
@navinor

navinor commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Corrected both claims per the batch review follow-up (review comment; batch review record). The correction commit is d7d50406fbdc7ac4141ba454b2e2440dc74942db on research/agent-13-recursive-seed53, pushed to the head branch; it supersedes the reviewed head 9821c6e9388f3fc097e94b72be9fa7b41a849527 for these two claims only. The PR description's summary bullets are re-scoped the same way.

1. Correctness: read-free is sufficient, not necessary

Old wording (wrong): "The single deferred restoration returns the same observables ... if and only if no child reads the workspace's intermediate value into an observable."

New wording (in research/restoration-coalescing/README.md and CLAIM.json): The deferred single restoration returns the same observables exactly when the summed defect vanishes, sum_i B_i (G_{i-1}...G_1 - I) = 0 (P_0 = I; this note's diagonal-reader additive model). A read-free batch makes every term vanish separately and is therefore sufficient, but it is not necessary: nonzero readers can cancel. Under prefix or adaptive observation each prefix defect B_i (P_{i-1} - I) must vanish separately.

Evidence:

  • Recursive interface: coalesce restoration with cancelling readers #1199 (thakrarsagar): exact nonzero-reader counterexample — five children that each read and negate the workspace with reader coefficients [1,1,1,-1,1]; eager and deferred both add 3W to the data and restore W, while the restoration bill falls from five negations to one. Exact interval defect criterion E_ab = sum_{i=a}^{b-1} b_i (p_i - 1), general linear form sum B_i (P_i - I) = 0; read-free intervals "are only one sufficient case".
  • Research: noncommuting reader restoration with a paid dirty-state wrapper #1203 (mightyOil): separates the observation contracts — distinct outputs: per-reader all-input condition H_i (P_{i-1} - I) = 0; one shared output observed at batch exit: only the summed defect must vanish (example G_1 = swap(0,1), G_2 = G_3 = I, readers 0, e_0, e_1, individual defects 0, (-1,1), (1,-1)).
  • Research: observer-safe restoration with nonzero readers (no new kappa) #1205 (adamgall): terminal theorem for the additive model — agreement on final (D, W) for every dirty input iff sum_i B_i (P_{i-1} - I) = 0; prefix theorem B_i (P_{i-1} - I) = 0 per child, which still does not require B_i = 0; its census finds 7,712 terminal-safe tuples containing a nonzero reader.

What was kept: the original Gaussian-rational reader example still runs unchanged and still shows one reader child can break deferral. It is now labeled as a counterexample to unrestricted deferral (sufficiency only), not as evidence of necessity. The checker now computes the exact summed-defect matrix for both reader cases (nonzero for the old example, exactly zero for the new one) and replays #1199 's cancellation shape as a new verified case: 5 reader children, coefficients [1,1,1,-1,1], summed_defect_zero=true, observables_equal=true, restorations 5 -> 1.

2. Cost: matrix density is not application cost

Old wording (wrong): "For a heterogeneous mix (phase + Walsh + permutation) the composed restoration is dense and the deferred application costs more (64 vs 16 multiplications at N = 8)" — density treated as proof of worse application cost.

New wording: Matrix density of the composed restoration is not an application-cost statement. The composed product retains its factorization into its cheap factors; applying those factors sequentially costs exactly the eager sum. Deferral costs more only when no cheap factorization is retained and the dense product must be applied directly. Deferral genuinely removes passes when the restorations collapse under composition into one cheap pass (unit phases -> one phase pass, permutations -> one routing pass, r -> 1).

Numbers, verified with the package's existing exact machinery at N = 8: the heterogeneous example composes to a dense inverse (64 of 64 entries nonzero) whose retained factorization, applied sequentially (G_3^{-1}, G_2^{-1}, G_1^{-1}), costs 16 multiplications — exactly the eager structured sum 16 — and matches the exact dense product on every standard basis column (factorized_matches_dense=true). The existing 64 vs 16 pair is kept in CERTIFICATE.json (deferred_dense_mults vs eager_structured_mults) and re-scoped in the note to a statement about direct dense application only. So deferral with the factorization retained is multiplication-neutral here (16 = 16) and collapses nothing to one pass; it is 4x more expensive only if the dense product is materialized and applied directly.

Files corrected (commit d7d50406fbdc7ac4141ba454b2e2440dc74942db)

  • research/restoration-coalescing/README.md — summary bullets, cost recurrence (heterogeneous family), evidence list, and a new "Correction after review (read-free is sufficient, not necessary)" section.
  • research/restoration-coalescing/CLAIM.json — corrected proposed_method and result, plus a post_review_correction record.
  • research/restoration-coalescing/CERTIFICATE.json — regenerated additively: every previously certified number unchanged; new fields deferred_factorized_mults: 16, deferred_factorized_passes: 3, factorized_matches_dense: true, a reader_cancellation case, and summed_defect_nonzero.
  • research/restoration-coalescing/verify.py — exact summed-defect criterion, the nonzero-reader cancellation case, and the factorized-application cost, each self-checked against the exact dense operator.
  • research/restoration-coalescing/SOURCE-PINS.json — pins for the three correction sources.

Verification

python3 -I -O -B research/restoration-coalescing/verify.py on CPython 3.12 and CPython 3.13, both:

PASS_RESTORATION_COALESCING phase=3->1(x3) perm=3->1 hetero_dense=True reader_diverges=True reader_cancels_5to1=True hetero_mults=eager16|factorized16|dense64

The recomputed certificate matches the committed CERTIFICATE.json field for field.

What remains open

  • The checkpoint/partition optimum under intermediate observation points is priced by Recursive interface: coalesce restoration with cancelling readers #1199 in its own diagonal-sign model; it is not derived in this note.
  • When a dense composition's factorization is discarded in an actual supplier call, N^2 direct application is the fallback. This note establishes only that direct dense application is the expensive case and that retained factors cost the eager sum; it makes no claim about what a compiler would retain.
  • Prefix/adaptive observation is a separate contract (B_i (P_{i-1} - I) = 0 per child, per Research: observer-safe restoration with nonzero readers (no new kappa) #1205); the terminal criterion corrected here does not cover it.

Aaron Wang (Navinor), with help from opencode. Apache-2.0.

@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

Thanks for the contribution. Review of d7d50406fbdc7ac4141ba454b2e2440dc74942db in the frozen 100-PR round found one remaining issue:

The algebraic corrections pass, but README Complete cost recurrence still prices arbitrary phase/permutation descriptor composition at O(r) and one Scan/routing pass without a succinct representation or implementation hypothesis. Supply that hypothesis and charge composition/routing; the explicit N=8 matrix test does not establish the stated general recurrence.

The scoped replay evidence is retained in the batch review. Passing finite checks and the scope of the written claim are tracked separately. This PR is staying open for the focused revision; contributor and predecessor credit are retained.

@navinor

navinor commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Corrective revision for the review comment (Aaron Wang, with help from opencode). Commit 02c9e171c98b1b4de4d2107b0134cee4446e10e0 on research/agent-13-recursive-seed53 (navinor@02c9e17).

1. Reproduced

The README's "Complete cost recurrence" priced descriptor composition and routing with no representation behind the terms:

plus the `O(r)` bookkeeping of composing `r` phase/permutation descriptors,
which is not an `N`-volume pass.
R(N, {k_i}) =  sum_i  (k_i/m)^sigma / W   +  Restore(N)  +  O(r)  +  unchanged

The note defined no descriptor representation anywhere, and the only cost evidence is the explicit N = 8 matrix test: verify.py composes through exact dense N = 8 products and detects surviving structure afterward, on r = 3 (phase, rotation, heterogeneous), r = 2 (reader) and r = 5 (cancellation) instances. As the review says, that does not establish the stated general recurrence for arbitrary r and N, and the "not an N-volume pass" claim is false outside a succinct representation (full descriptor tables cost Theta(r * N) to read and combine).

2. Representation hypothesis supplied, composition and routing charged

The README now states the representation the O(r) term prices (the shapes the checker actually uses):

  • phase: G = diag(omega^(a * chi(x))) with a per-node character chi fixed once (checker shape chi(x) = popcount(x), q = 4) and one stored exponent a;
  • permutation: rotation x -> x + s (mod N) (checker shape), or any dihedral map x -> +-x + s (mod N), a constant-size tuple.

Composing r descriptors in either family combines r tuples (a <- sum_i a_i; s <- sum_i s_i mod N): O(r) tuple operations, c_desc = O(1) per descriptor, and the product stays in the family. Applying the composed descriptor is exactly one pass (Scan(N, p) = N phase multiplications, or one routing pass = N moves, 0 multiplications), each pass priced Restore(N). Charged recurrence:

eager   :  r * Restore(N)  +  0
deferred:  1 * Restore(N)  +  r * c_desc
R(N, {k_i}) =  sum_i  (k_i/m)^sigma / W   +  Restore(N)  +  r * c_desc  +  unchanged

with c_desc = O(1) under the descriptor hypothesis. Outside it (arbitrary per-position phases or arbitrary permutations stored as full length-N tables) there is no succinct composition: forming the composed table must read r tables of N entries, so the composition bill is Theta(r * N) plus N storage, and the README records that as the general case rather than O(r). The applied restoration is still one pass there; what fails is the bookkeeping charge, not the pass count.

3. Old vs new wording

  • Old: "plus the O(r) bookkeeping of composing r phase/permutation descriptors, which is not an N-volume pass." New: composition charged r * c_desc with c_desc = O(1) under the stated descriptor hypothesis and Theta(r * N) for full length-N descriptor tables; the "not an N-volume pass" sentence is deleted, since it is N-volume outside the hypothesis.
  • Old recurrence line: + Restore(N) + O(r) + unchanged. New: + Restore(N) + r * c_desc + unchanged, with the eager/deferred pair r * Restore(N) + 0 vs 1 * Restore(N) + r * c_desc and saving (r - 1) * Restore(N) - r * c_desc.
  • Old (CLAIM.json): "pass reduction r->1 exactly when the restorations collapse under composition to one cheap pass". New: "pass reduction r->1 when the restorations collapse under composition to one cheap pass, with composition charged rc_desc under the succinct descriptor hypothesis (c_desc = O(1)) and Theta(rN) for full-length descriptor tables".
  • The evidence section now says what the checker establishes: exact observables and exact costs at N = 8 for the listed instances only; the general r, N recurrence is a priced hypothesis, not a tested identity. The PR body's cost bullet carries the same charge. No verified algebraic content or cost number changed: the earlier read-free-is-sufficient and density-is-not-application-cost corrections stand.

4. Verification

Registered replay python3 -I -O -B research/restoration-coalescing/verify.py, run on CPython 3.13 and 3.12, reproduces unchanged (first line identical to the previous head):

PASS_RESTORATION_COALESCING phase=3->1(x3) perm=3->1 hetero_dense=True reader_diverges=True reader_cancels_5to1=True hetero_mults=eager16|factorized16|dense64

verify.py and CERTIFICATE.json are untouched, so the in-checker certificate comparison passes without drift; the change is README.md and CLAIM.json only.

5. Remaining obligations

  • The descriptor hypothesis is an implementation hypothesis. This package has no succinct-descriptor composer (the checker composes dense N = 8 matrices); an O(r) composer over parameter tuples still has to be built and tested at general N and r.
  • The general-descriptor case is now charged Theta(r * N) but is also untested beyond N = 8.
  • As before: the checkpoint/partition optimum over intermediate observation points (priced by thakrarsagar's Recursive interface: coalesce restoration with cancelling readers #1199 for its own model, not derived here), and the question of when a dense composition whose factors are discarded must be paid as N^2.

Aaron Wang, with help from opencode.

@navinor navinor reopened this Oct 15, 2026
@Mister-Meeseeks
Mister-Meeseeks merged commit de32c88 into CrocSwap:main Oct 15, 2026
40 of 61 checks passed
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