Skip to content

Audit QQ16 high-count scratch and exact installation costs - #5363

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/qq16-high-count-installation
Oct 24, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/qq16-high-count-installation

Conversation

@mihir-s-05

Copy link
Copy Markdown
Contributor

Change and mathematical scope

The QQ16 Context lifecycle handoff leaves the numerical new_context producer separate from finite-handle restoration. This package proves and checks one exact part of that producer: the temporary high count uses exactly two simultaneous scratch Tape leases, and its installation into the fixed highs role has a complete source/destination operation bill.

For M=q^w, the inherited count is H=q^((w-1)d^2). With n=bit_length(H)+1 (including RIGHT) and an old destination body of length D, the literal save_count path costs 7n+2D+10 reads, 2n+D writes and 6n+2D+14 unit moves. The written loop proof covers the stated parameter domain; finite tests corroborate it. The actual recursive caller parks streams before construction, giving D=0.

This is a scoped source audit, not a new count formula, full constructor tariff, supplier or kappa improvement. Numerical-word production, pool-selection/control cost, backing storage, metadata compilation, complete parent parking and the full F(K)/D* versus B* comparison remain open. The source loader and complete Ordinary/controller are not replayed. Only this five-file package is added.

Task and overlap

Base: canonical main 7c472563474e60185e6ca101a17622133d047e56; priority revision 7. Contribution: 5ac02c05ad29f4b136cab8fb787985a1ea64de80. Task joint-query-controller, refined to one numerical-producer obligation.

Canonical investigation and scope correction. The complete overlap refresh revealed an earlier concurrent restore_context claim, so this work moved to its explicitly excluded numerical producer. PR5034 supplies the graph cap; PR5330 supplies adoption and the open constructor question. R437 descendant ingress already reaches new_context; the delta here is its exact scratch/installation audit.

All live source inputs are pinned at the base commit. The algorithms are taken from the retained PR2809 nested archive inside research/physical-gaussian-leaf/inputs/pr3087.tar, without editing that archive. Latest overlap covers 307 open PRs, 4,638 Discussion records and all 7,267 tracked top-level notes, with complete reported pagination. Historical diffs and unpublished work are outside coverage. Refreshed main has no relevant source/guidance changes.

Validation

CPython 3.12.0 on Windows; standard library only.

  • Registered normal and optimized replay pass: 82 cases, three executed rejection controls and three arithmetic discriminators. Each case checks canonical values, aliases, scratch cleanup, dirty spectators, exact operation counts, ended-lease reuse and owned cleanup.
  • Discriminating witness: q=3, w=2, d=2, D=0 gives H=81 and exactly 66 reads, 16 writes, 62 moves. The largest tested Count has 203 value bits.
  • Metadata/source pins and all eight committed package/input byte checks pass. The official export integrity check passes.
  • Both isolated Git-free export replays pass, all nine exported files remain byte-identical, and a corrupted source archive is rejected in both modes.
  • Selected source-binding orientation passes; no selected native cold replay, Lean, Docker or whole-controller run. The optional full-history preflight was not run in this shallow checkout; every declared source pin is at the direct parent base.

Reproduce:

python3.12 -B scripts/research_package.py --package research/qq16-high-count-installation --check-only
python3.12 -B scripts/research_package.py --package research/qq16-high-count-installation

Credit

Credit Jose Manuel/jmbarrancoml's PR2753/PR2769/PR2809 caller/cardinality/pool/parking sources, JoyboyBrian's PR5034/PR5330 and handoff, Chris R/Clear1nsight, Tekalign, ywz65, Mihir Srivastava and the retained QQ16/control lineage. The count formula and source implementation are inherited. The new contribution is the scoped proof, exact meter decomposition and source-bound verification.

Prepared by Mihir Srivastava with substantial OpenAI Codex assistance; Apache-2.0. No independent human or formal proof-kernel acceptance is claimed.

Open next questions

The package README/TASK name two bounded follow-ups: price the reached radix_power/divmod numerical-word loops, and compose the producer with finite-handle restoration and the real parent parking protocol. Those costs are required before claiming a complete constructor or caller advantage.

@jwr404

jwr404 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review (James Reed, with Claude Code). Head 5ac02c05ad29f4b136cab8fb787985a1ea64de80. This is a lighter-scope review; see "Not checked".

Checked

  • Source. I extracted the retained chain pr3087.tar → pr3055 → pr2899 → pr2809 myself and read macro_machine.py. new_context calls save_count(context.highs, "highs"), which is commit(value.tape, label) (target.clear(), append_tape, rewind, then Lease.clear()) followed by value.close(). The audited path is exactly this literal code, with no hidden extra copy.
  • Arithmetic. For q = 3, w = 2, d = 2: H = 3^((2−1)·4) = 81, n = bit_length(81) + 1 = 8, giving 7n + 10 = 66 reads, 2n = 16 writes and 6n + 14 = 62 moves. That matches the stated witness.
  • The D terms. The +2D reads, +D writes and +2D moves are the expected shape for clearing an old destination body of length D (read and erase each cell, walk out and back). The expected_install(8,7) ≠ expected_install(8,0) control correctly prevents charging a dirty overwrite at the empty tariff.
  • Replay. The registered replay passes locally (PASS_REGISTERED_RESEARCH_PACKAGE).

Not checked

I did not independently re-derive the per-loop constants (7, 2, 6 and +10, +14) from the deeper tape primitives (append_tape, Lease.clear, and the scratch pool's meter forwarding). Nor did I re-run an instrumented count outside your harness. The "exactly two simultaneous scratch leases" claim also rests on your harness's lease accounting. Your 82 cases exercise all three claims, but this review does not add independent evidence for them.

Suggestion. A short table in the README deriving 7n + 2D + 10 term by term from clear, append_tape and rewind (the same style as #5364's invoice) would make the constants checkable without running the harness.

@Mister-Meeseeks
Mister-Meeseeks merged commit e36f783 into CrocSwap:main Oct 24, 2026
2 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.

3 participants