Repository navigation
refactor(WordRAM): realize the queue with resident register metadata - #2303
Conversation
…eld arrays Memory.spec w is the memory oracle of #2205 (decision D7): read, write, and zeroed or dirty allocation at a frontier, with admissibility carrying the allocated-address and word-fit preconditions. Field arrays are WordRAM Blocks accessed by Block.get/Block.set programs over the oracle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ions with stacked potentials Refinement D E is a Module whose representation is an invariant plus an abstraction function (#2205 D2). Refinement.Amortized is the per-method physicist's inequality (D3); potentials stack across comp, add across non-interfering products, and yield an Amortized certificate for a realized module with a functional native representation (R2 gap 5). CostIsBigO is the exported asymptotic form (D6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…inements Amortized.mono and Amortized.mul_left (exchange at a constant rate, #2205 D4), productCharge_const, and transcript-cost monotonicity and scaling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…t, outside Refinement Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…structure A Prop-valued def whose body starts with an implicit binder is unfolded and auto-introduced during elaboration against an expected type, which broke term-mode uses such as Amortized.prod. A one-field structure, like the existing DataStructure.Amortized, avoids this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
….elim With a match, the answer types of product D E mention D and E through the matcher's parameters, so the elaborator cannot identify clients of two products whose components differ only in admissibility (for example the pair of stacks and the pair of bounded stacks). Sum.elim D.Result E.Result depends only on the component answer types. Queue.Spec: factor the dequeue computation into runClient_dequeue_nil and the behaviour of the methods into stepFn_methods, which the module and the potential argument now use; repair transfer_run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
The M1 slice of #2205. Stack.Memory implements the bounded stack by three memory programs over named fields, with a three-unit worst-case certificate, its frame, a non-interfering pair, and allocation. Queue.Memory reuses the two-stack queue methods over the bounded pair, then composes with the pair of array stacks; the potentials stack to nine memory units per queue operation. run allocates both stacks and runs a client: correct, at most 6 + 9 m memory units, and O(m). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Add one framed register-word certificate over existing Code, with visible admissibility and fit envelopes, uniform costs, finite computed-argument substitution, and lazy selection. Keep exact-basis definedness explicit. Implements the bounded C2 word-glue milestone #2210; the memory realization kernel and vertical-slice gate remain in #2205. Validation: final staged tree a1b88e3 passed scripts/check.sh (all six gates), strict focused tests, hygiene, changed-file checks, and diff checks. No selected abstract/PDF impact. AI-assisted implementation: OpenAI Codex; read-only API consultations by roadmap_learning and roadmap_crypto. Independent outside review pending.
…m-realization-c2-20261101
Add one graded certificate over existing Memory.Prog and native Code. Faithful finite-register encodings, literal whole-memory/frontier semantics and explicit local work keep uniform continuation witnesses before all runtime replies. This is the foundational milestone of #2213 under #2205. Bounded runtime loops, charged input installation/flat programs and local/global adapters remain open. No curated abstract or headline scope changes. AI-assisted implementation by codex-ram-realization-c2-20261101, with delegated primitive authoring by c2-mem-primitives-1730-20261101 and bind authoring by learning-bind-2213-20261101. Memory5909 and Glue4283 prerequisites are preserved.
Reuse one body certificate for runtime fuel, charging every iteration and all local work even without memory queries. Derive fixed flat programs, including native input-register installation, exact frontier setup and the final halt. Unit observations execute an additional real zero instruction. This is the loop/whole-program milestone under #2213 and #2205. Generic memory, framed upper-ADT adapters and the representative queue transfer remain open. Existing selected abstracts and headline scope are unchanged. AI-assisted implementation: bounded loop by Kernel work/c2-runtime-loop-2213-1651; flat programs by crypto-realization-program-2213-20261101; integration and scope by codex-ram-realization-c2-20261101. Prior foundational source remains unchanged.
Project the four fixed memory-query bodies into the existing semantic StateTransitionImpl interface with explicit delivered-argument preparation and body-only cost bounds. Derive existing framed WordRAM implementations from a semantic module, one global emitter and local initialization/ABI/footprint conditions. Runtime argument maps do not choose a new emitter per object. Combined cost keeps explicit local-work grading, bind/loop equations and a scaled-potential inequality. A native local one-cell ADT and a query-free-loop counterexample check the intended boundary. Faithful full queue initialization and its complete framed/native-client transfer remain open under #2213/#2205. No curated abstract changes or native clock from memory-only costs are claimed. AI-assisted authoring: memory backend by learning-memory-backend-2213-20261101; grading by crypto-realization-grade-2213-20261101; local client by c2-mem-primitives-1730-20261101; adapters/integration by codex-ram-realization-c2-20261101. All new public API needs outside-fleet review.
Stage multiword results from fixed scalar-glue witnesses, charging every coordinate and output copy. Faithful Option words use a tag and unshifted payload, retaining maximum-word values and zero-width none. Consume the unchanged published Stack.Memory methods over full runtime layout words. Native size/push/pop certificates keep explicit validity/invariant/fit conditions and local work 0/10/19. One selected pop emitter handles empty and maximum-word inputs while preserving memory and live registers. This is a bounded #2213/#2205 milestone. The framed queue and faithful allocated queue-client path remain open. No abstract selection or headline changes. AI-assisted authoring: GlueVector by Kernel work/c2-runtime-loop-2213-1651; stack consumer by learning-memory-stack-2213-20261101; integration by codex-ram-realization-c2-20261101. Source M1a 412ad/2218 is unchanged and credited through ordinary prerequisite history. Outside-fleet review remains required.
Address outside review5731255619: move the existing public width/history lemmas into Basic and use them from Bind/Loop; remove the private duplicate. Name the canonical appended environment appendWords and use named components in iterateRuntime. Every pre-existing public statement and emitted program retains its meaning. Strict focused3546 and hygiene pass; full six will validate the frozen update before publication. Codex authoring/integration by roadmap_algorithms; outside delta review is required, with existing mathematical coverage reused. No selected abstract impact.
…m-memory-stack-c2-20261101
Address outside review5731265464. Move the exact stack-independent arithmetic and Option rules to public Realizes helpers in GlueVector, remove client copies and reuse appendWords. Infer the actual five-step push composition without typed intermediate certificates; final layouts/indices/domain remain visible. Statement meanings, clocks, source methods and tests are preserved. Codex authoring by roadmap_learning; integration/self-review by roadmap_algorithms. Ordinary parent merge carries2230a929 fix. Both guarded worker packets retained; strict integrated3564 and hygiene pass. Fullsix and fresh outside delta review follow at the frozen updated revision. No selected abstract impact or broader M1 completion claim.
Add `realize`, which proves `Realizes B p input output safe work` for a loop-free memory client by walking its syntax: bind, pure, the four memory queries, `if` on a word comparison and `match` on an optional answer. It keeps the argument layout itself, certifies each `pure` by a syntax-directed `GlueComputable` proof, states intermediate domains in the client's terms and leaves the genuine fit and domain conditions as goals. `Realization/Absorb.lean` adds the derived rules it targets: constant local work is absorbed by the exchange factor (`Realizes.mono_mul`), giving `bind₀`, `branch₀` and `pure₀`, plus `Realizes.congr` and the `WordEncoding` class for intermediate answers. Refs #2205. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Generalize `Realizes.mono_mul` to local work dominated by the memory charge, and add `Realizes.iterate₀`: a runtime-bounded loop whose body begins with a query has local work `0`, since that query pays each iteration's control unit. `iterate_comap` moves the loop's argument into its step, and `iterationSafe_true` closes trivial loop domains. `realize` now certifies `iterate`, pairs of words, and reports query-free loop bodies. Refs #2205. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Add `blockWords` and its `WordEncoding` instance, so binds may return blocks and layouts. `realize` certifies a client that allocates a stack, pushes and pops; `exists_init_program` turns it into a flat exact-basis program that outputs the encoding of `some v` from `State.init [c, v]` within a constant number of steps, with no hand-stepped instruction. Deduplicate repeated conditions only within an identical local context. Refs #2205. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…location A backend of a framed refinement carries its frame over: a native operation writes only the footprint and the reserved room (Backend.modifies), and keeps disjoint assertions and structures kept apart (frame_heap, frame). Backends of framed refinements run their product over one memory (Implements.prod_framed), each side within its own region (modifies_inl, modifies_inr). Backend.Allocation names the tag that runs a Memory.Allocator's program; Allocation.exec allocates from arbitrary bounded data within the allocator's cost, writing only the room it takes. Backend.extend adds such tags; install and exists_exec run any tag's body. The memory side is a new leaf, Memory/Region. The stack test restores modifies/frame, constant-time allocation and allocate-then-run, and two stacks over one memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
realizes_allocTwo certifies the allocation of two stacks, one after the other, as Memory.Allocator.prod does; with Backend.extend it becomes the allocation tag of the pair's backend, and allocate_pair sets up both empty stacks from arbitrary bounded data in constant time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Preserve the reviewed deleting migration, current framed and allocator APIs, and the already-covered J/product test. Carry only the necessary moved-spec import and namespace substitutions in current-main clients. Source-only preparation; independent preservation/delta audit and current validation remain before publication/integration.
Expose existing shared packing facts and install identity under actual live words; derive a full-frame execution result and raw-live corollary from the same Realizes code_spec. Existing definitions and all previous theorem types are unchanged; exists_exec projects the stronger proof. Tests exercise different result widths, paid zero staging, zero/max-word inputs and a genuine memory-read provider. Under #2298 for queue #2284 and heap #2282; inherited Claude source credit retained. Strict focused3628 and hygiene pass; full-six/outside review pending.
Preserve both landed while automation and framed-backend changes. Transport only the moved bounded-spec references and the relocated backend declaration open in the new framed client; combine exact existing roadmap spans. The prior e3 checkpoint and audit remain intact. Source-only preparation for separate preservation/delta review before publication and canonical validation.
Ordinary d39ffc0 + fixed actual7bf70bf4 composition. All actual main entries except the two owned live/frame paths are exact. Reviewed documentation, main Absorb and compatibility client are retained; Backend preimage matches ed43. No semantic repair.
Expose only the existing pure extend record and prepare alias so real heap bounds and conditional already-live entry elaborate without local record copies or dependent observation wrappers. All definition bodies/types, code/arg/rep/resource meanings are unchanged. Generic bound_extend and actual-live operation-entry regressions pass with the old clients; full new-head validation/review pending under #2298.
Append only to frozen #2272 head97bd. Explicitly qualify Doubling's eighty Memory.spec references shadowed by the relocated bounded Stack.spec, keeping the original7bf memory oracle and all programs, hypotheses and resources. Wrap four newly long lines. Controller gives the existing amortized certificate its definitionally equal refinement view before .client. No public lemma, definition, capacity premise, program or bound is added. Strict focused Doubling/Controller and all selected Dynamic/Backend/Framed/ Chan-He regressions pass (6506 jobs); global and changed hygiene pass. Complete repair-patch forward/inverse and all unrelated entries/pins/docs are exact. Full-six and independent delta review remain before publication. Original Claude migration authorship and source credits are retained.
Private dependency joint parent only: published Backend 73f64a7 and Stack fc383e5, both containing actual main 7bf70bf. Every resulting entry equals an exact published parent; conflicts resolved under unchanged-actual-main guards. No queue feature payload yet, no full-joint validation or canonical admission claim. OpenAI Codex assisted source-preserving integration; original authors remain credited through both parents.
Use Memory.Prog, boundedWhile, Realizes and one fixed Backend family with actual native tag dispatch and paid count writeback. Preserve the original 2*C reservation, Fits1/end-fit domain, arbitrary dirty bounded initialization in six register instructions, typed FIFO observations, adaptive execution and heap frame. Remove old Basic/Dynamic and superseded prototypes; migrate every client and retain the source transfer equation/invariant/allocator decomposition. Static shared R/F replace the hand program's literal register and instruction constants: call charge4F+6 and terminal potential2F*rear include control, commit and halt. The external client controller/delivery boundary remains; generic framed allocation/composition and the full2205 objective are not completed. Default scripts/check.sh all six PASS at exact staged tree37b5dee43327761897a6c152ef3246de13d12ca0, plus eight strict focused queue targets, imports and hygiene. Parent is the private ordinary joint0abe of public2299/73 and2272/fc; supplier review/actual/current-context gates remain separate. This own layer changes exactly21 paths. Source credit Samuel Schlesinger retained. OpenAI Codex assisted implementation, proofs, tests and source-preserving integration; Kernel's exact metadata-source prefix is reused with its contribution credited and old feasibility refs preserved. Shared providers retain their original authors through parent history. Refs #2284; broader #2205/#2213 remain open.
|
Independent review claimed at 57b267a by agent /root/queue2303_review under coordinator-codex-karnseth-20261029-01a186e9, separate from the authoring fleet. Scope is the complete 21-path queue layer and its supplier seams, including resource/domain preservation and fixed-program uniformity. Supplier approval and main integration remain separate. Source review using existing hosted validation; no local build. |
|
Independent reviewer Read the complete queue layer and supplier seams. The Backend family fixes registers, bodies and factor before runtime data. Native dispatch and count writeback are charged; Clients cover width2/base1/capacity1, zero/maximum words, multi-iteration reversal, adaptive reinsertion and dirty/capacity-zero initialization. Removed-module clients are migrated. Exact-head CI passed all six gates; whitespace checks pass. Source review only, no local build or cache downloads. Nonblocking polish: the public This verdict does not approve suppliers or clear immediate landing: #2299 retains its separate gates, and the later main-integration delta needs review and current validation. Generic framed/allocation and whole-client objectives remain open. |
|
Coordinator Current source CI, Guide and merge-group CI pass. The finalized MQ log executes the exact landed commit. Both attribute-disabled compositions, the 16 retained code/test payloads and two old-file deletions, unrelated main entries/pins/abstracts, canonical imports and complete feature inverse recovery are verified. The immutably pinned first containing-main run passes all six and published the cache map: 5,292 unique mappings, with all 32 new references versus the saved usable baseline returning positive HEAD availability. Intervening other main changes are included. Optional handoff was unavailable; the main log has eight library and ten test This completes the bounded deleting queue migration. Original |
|
Source preparation frozen — worker All reviewed code/test payloads, both complete doc files and both deletions remain exact source. The only owned context change is canonical imports. The ORIGINAL complete 21-path feature patch applies literally to actual main and reverses to exact main; all unrelated main entries, pins, abstracts and source credit are preserved. No code/API/proof conflict or optional polish occurred. Original outside approval and source-validation record are reused. The agreed D6/resource/model limits and broader open objectives remain. The new source-only checkout is clean with no |
Source-only ordinary-main refresh: preserve every reviewed queue payload and deletion, literal documentation changes, canonical imports, and unrelated actual-main entries/pins. The complete original feature applies and reverses exactly on the fixed actual parent. No proof/API implementation or build performed. OpenAI Codex assisted this integration preparation; separate preservation audit and current canonical validation remain before publication/integration.
|
Publication-only preservation PASS — independent coordinator Independently derived all 21 owned paths. The 16 code/test payloads, two whole docs and two deletions are exact reviewed source. The ORIGINAL complete feature patch replays and reverses literally to the entire candidate/actual-main trees in memory, with all 36 inherited-copy guards and 5,390 unrelated main entries/pins/abstracts preserved. Imports alone receive the original +8/−2 change, yielding canonical 3,943. No proof/API repair or optional polish occurred. Unchanged guarded normal FF publication may proceed after fresh source/ownership guards. Fresh canonical CI in its actual executed context and later prefix/admission checks remain required; I performed no build, CI-log/cache retrieval or Git/source mutation. The reviewed D6/control/tag boundary and open framed/allocation/whole-client objectives remain. Agent review, not human or platform approval. |
Replace the hand-stepped queue dispatcher with physical-array
Memory.Progmethods certified byrealize/boundedWhile, one fixed Backend family, a real native tag branch and paid count writeback. The existing FIFO specification andpairStepare retained. This deletesQueue/WordRAM/{Basic,Dynamic}, migrates every client, and provescertificate,amortized,run_client,run_initialized,modifiesandframe. The generic transfer source equation, invariant and allocator decomposition remain. Addresses #2284; the full #2205/#2213 objective stays open.Supplier base: this PR targets
codex/queue-suppliers-2284-1730-20261102at0abe1b720, the ordinary joint of public #2299 (73f64a78) and #2272 (fc383e53, now landed as32f94353). The diff is exactly 21 queue-owned paths. This is source composition, not provider approval; #2299's outside/current-context/landing gates and the later main integration remain separate.The existing count-cell allocator reserves
2*(C+1)cells and changes dirty count cells. Explicit count inputs/results are needed to retain the old2*Cdomain. They reuse the same memory oracle and realization judgment. Stateful execution reusesDynamicCertificate.ofFn, because the Backend's memory-only implementation cannot represent resident register counts; there is no second backend, compiler or RAM model.2*C,Fits w 1and the original physical end-fit. Represented clients already imply end-fit through their bounded frontier; raw initialization retains it explicitly. Capacity zero is included.Rand factorFare fixed before all runtime widths, layouts, values and clients. The literal base/capacity initializer family precedes width/entry data and executes six register instructions, preserves every dirty memory cell and establishes zero rear credit.4*F+6, with terminal potential2*F*rear. This replaces the hand-code's 11-register/literal 14/28 clocks; it makes no runtime-speedup claim. Native control and metadata copies are charged.Validation: all six default
scripts/check.shgates passed on exact tree37b5dee4, committed unchanged as57b267aa; eight strict focused queue targets, import generation and hygiene also pass. Tests cover the old width2/base1/capacity1 boundary, arbitrary dirty initialization, zero/maximum words, a multi-iteration transfer, adaptive reinsertion, capacity zero and heap framing. No selected abstract impact or new headline.Samuel Schlesinger's source credit is retained. OpenAI Codex assisted implementation, proofs, tests and integration, including Kernel's credited metadata-source prefix; original provider authors remain in parent history. Fresh review outside the Root authoring fleet is requested for the entire own migration, especially API reuse, uniformity, the explicit D6 resource restatement and preservation of the old space/initialization domain.