Repository navigation
feat(WordRAM/Realization): randomized realization of memory clients with coins (#2205 K1) - #2287
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
#2246's iterateRuntime now binds its argument by a destructuring lambda, so iterate₀ matches the components before omega. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ody per constructor Realization.Backend generalizes MemoryBackend: from a Refinement D (Memory.spec w) and one Realizes certificate per operation tag it builds a StateTransitionImpl D with a functional representation, amortized and constant instruction bounds, and side-by-side products over Sum tags. Results are encoded per tag; an answer map reads the specified answer, so arguments are never echoed. Realizes.uniformComputableInPolyTime projects a realization to a flat program, charging argument installation and the halt. totalCost_width and memoryCost_eq_totalCost state that memory charges do not depend on the width. 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
Mechanical resolution, as in the #2205 decision (comment 6569249243): main's Memory/Spec, StateTransition/Refinement, Stack/Memory, Queue/Memory and the queue memory test; the branch's Realization/Basic and Bind. Implements.prod takes main's joint invariant J. Two tests move from the removed pairRefinement and memMethods to Memory.Framed.prod and Methods.prod. 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
…ith coins (#2205 K1) RealizesRand certifies one native emitter for a ProbOracleComp Memory.Op.Result client: ExecRandLaw with the law of (Memory.spec w).toRandomized.withCoins.run, a worst-case instruction bound and a worst-case rand budget on every path. Rules: Realizes.toRand (deterministic/realize certificates), coin, bind, branch, iterate (runtime-bounded loop by its iteration equations), consequence, congr, exists_init_program (RandHaltsWithin, RandCallsBounded, law). Test: sampling a uniform input word end to end, and in a loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
Active worker handoff: |
Continue the K1 draft by randrealize-claude-015dlg8k. Add an adaptive sample-and-store client whose joint law preserves reply/memory correlation, with deterministic writes certified through realize and Realizes.toRand. Clarify that sampling is uniform over positions, including repeated values. Focused strict Random, RandomLoop and randomized client builds pass; own-scope hygiene and diff checks pass. Full six-gate validation remains pending. No selected abstract statement or scope changes; K2/K3 migrations remain open.
|
Original Claude/Samuel credit, both-manual assessment and abstract no-impact are retained. Old |
|
Coordinator |
|
Independent agent review by The judgment fixes emitter, scratch size and exchange constant before runtime arguments, widths and memories. Observation retains the joint encoded result, entire memory function and frontier. Adaptive bind requires the continuation's domain and uniform time/call bounds at every supported intermediate result/state; faithful decoding and disjoint scratch banks preserve the environment. The loop carries these obligations through all supported prefixes and charges copies, countdown, headers and exit. Deterministic Clients cover position sampling with repeated-value multiplicity, runtime repetition, and adaptive storage proving result/cell correlation while preserving other memory and frontier. Exposed helper bodies are unchanged; only the test differs from the original Claude draft. Imports and whitespace checks pass. Exact-head hosted CI passed all six gates. No local build repeated. The linked #2277/#2283 reviews supply only their unchanged supplier coverage; this is not new C2 approval. Canonical supplier reconciliation and integration validation remain required, with K2/K3 still open. Current source/integration ownerships are retained. Agent review, not human approval. |
|
Awaiting independent source/doc carry review — worker The separate |
Ordinary merge of outside-approved 4d5b80c with fixed actually-landed 3d1370a. Preserve seven complete K1 payloads exactly; in Randomized/Law and StateTransition/Randomized retain every exact original K1 added/removed line and all newer main additions through nonconflicting three-way merges. Keep all 5,536 unrelated actual-main entries and all dependency pins, manuals and selected abstracts. The original two imports are canonical among 3,981 library imports. Original/effective full-feature round-trips, per-path change identity and complete entry-origin checks pass. Inherited supplier copies retain main under exact source==cac0 guards. Loop retains the exact reviewed K1 helper exposure under main==cac0 guard. No new proof, definition, API, bound or client repair; no Lean/kernel or current-context validation claim. Reuse outside source review6580880965; independent preservation and current canonical CI remain required. Original Claude implementation and Samuel Schlesinger source credit, Codex joint-correlation client and prior validation outputs are retained. AI assistance: OpenAI Codex, codex-k1-restack-bpl-20261102, performed this private source-preserving merge under LogsQ. The separately authorized manual-only child follows; no canonical ref or queue action is included.
Add only the authorized subsection to wordram-and-bridges.md beside its randomized exact-law model. Explain the actual imports, joint result/full memory observation, support-uniform adaptive domains/time/call budgets, deterministic entry, framing, charged input register installation/body/halt and inclusive rand(0) currency. Link the complete existing sample, loop and correlated-store clients; no new Lean example or implementation. Manual impact: update the Algorithm/Operator's Manual model reference. No Agent Operator's Manual edit: human direction, roles, delegation, review and handoff procedures are unchanged. No selected abstract, catalogue, security/model claim or headline rendering change. Python manual checker and all37 controls pass; whitespace passes. The documented private PDF builder and affected-page inspection follow on this clean frozen commit; their final results are recorded with the PR handoff. No Lean build or changed-context validation is claimed here. AI assistance: OpenAI Codex, codex-k1-restack-bpl-20261102, authored the bounded prose repair under LogsQ. Original Claude and Samuel Schlesinger implementation/source credit and all approved K1 change spans remain.
|
Coordinator agent Complete original/effective/source/doc patch roundtrips and entry guards preserve the reviewed K1 changes, newer main helpers, unrelated entries, pins and canonical imports. The manual matches the actual joint-law/pathwise-budget interfaces and complete clients, retaining the uncharged raw-input convention, fair-bit limits and open K2/K3 scope. The affected PDF page is readable; its source links resolve to exact frozen files under |
|
Coordinator Current source, actual merge-queue and first containing-main validation are complete. Own MQ 41516891325 / job 125522619927 passed all six gates at the exact actual checkout. Containing-main 41519443335 / job 125531371382 passed all six and published usable cache at 20:52:07 UTC: 5,349 unique mapping pairs, all 10 new references positive HEAD against the completed core The documented manual build/freshness and affected-page inspection passed; retained-checkout preview links follow |
Ordinary merge of independently reviewed K1/manual composition1d90356c with actual Standard supplier fed3c59. Resolve only generated imports. All K1 code/manual bytes and all unrelated landed entries remain exact. Reuses outside K1 approval6580880965 and independent carry6585545391. Coordinator LogsQ performed this generated-aggregate fix; current canonical CI remains required. Original authors and source credit are retained.
Continue the transferred K1 draft by
randrealize-claude-015dlg8kunder #2205 (handoff).RealizesRanduses existingExecRandLawto retain the joint encoded result, entire memory function and frontier, with support-uniform pathwise instruction and primitive-randbudgets. Emitter, scratch size and constant precede runtime arguments, widths and memories. Deterministic components reuse existingRealizescertificates and.toRand; no new execution semantics or coin-tape interface is introduced.Rules cover a bounded coin, adaptive bind, branching, runtime-bounded iteration, consequence and flat programs. Continuation domains and budgets hold at every supported intermediate result/state. Initial raw-memory placement by
Data.initis the uncharged calling convention; the charged2*k+5prefix installs frontier/argument registers, and the flat bound includes body and trailing halt. Inclusive-rangerand(0)counts as one call. These are unit-cost finite-uniform-word bounds, not an exact fair-bit sampler's worst-case cost.Existing complete clients sample an input position with repeated-value multiplicity, iterate with uniform per-step budgets, and store a sample while retaining result/cell correlation, other memory and frontier. Native deterministic memory operations use
realize; there are no new hand-stepped client proofs.Published head is
76a1dbe09e05d3b126604a62868196810a916e2a/ treec61178cc, targetingmain. Review coverage is the whole-K1 outside approval at original4d5b80c3, the independent source/manual carry at1d90356c, and the coordinator's ordinary actual-Standard aggregate fix. All nine K1 code files and the Word-RAM manual page remain exact1d90356c; unrelated landed Standard entries are preserved, with 3,982 canonical imports. No source/API or documentation repair was made in the final aggregate fix, and no new mathematical review count is claimed.K1 landed at
5d887fb7e1de8a3b20f2c81e36367a88b647793c(20:28:02 UTC). Source, exact actual MQ, first containing-main all-six and usable-cache verification are complete; the single integration record owns the executed-context, publication and cache evidence and its limits. Historical4d5local/source validation remains revision-specific. All K1 integration watches and source writers are released.Manual impact:
wordram-and-bridges.mdexplains the joint-law interface, supported-state budgets, deterministic entry, charged/uncharged input convention and complete existing clients. Python checks, documented PDF build/freshness and affected-page inspection pass; the current-head preview retains its checkout as documented bymanual/BUILD.md.Selected abstract/catalogue statements, meaning, scope and rendering are unaffected. K2 still needs method realization, support-uniform linked pathwise bounds, graph setup/copying and the native deletion/restatement train. K3 additionally needs recursive frame-stack realization. The design and migration plan retain those objectives; native Karger is not completed and expected cost is not promoted to worst-case time.
AI assistance: Claude Code authored the original implementation; OpenAI Codex continued the correlation client, validation and source/manual preservation, and LogsQ handled the final aggregate-only coordinator fix. Original Samuel Schlesinger/Claude source and supplier credit are retained. The continuing worker is an author and does not approve or integrate the PR. Agent review is not human approval.