Repository navigation
feat(WordRAM): add uniform queue method and initialization support - #2250
SamuelSchlesinger wants to merge 3 commits into
Conversation
Expose one typed-method realization before runtime layouts/operations, charged label staging, register-only span/setup and existing-memory footprint lemmas. The full framed queue and faithful allocation/client remain in #2213/#2205. No legacy footprint/step-constant improvement or headline result is claimed. Source packets by Codex workers review_kernel_list_1651 (Method), roadmap_crypto (Frame), review_bpl_containments_1666 (Init); integration and self-review by roadmap_algorithms. Preserve M1a412ad and its source credit. Strict focused six-target and hygiene checks pass; full six to follow at this frozen revision. New APIs require outside-authoring-fleet review. Selected abstracts/catalogue/rendering: no impact.
…m-queue-native-abi-c2-20261101
…m-queue-native-abi-c2-20261101
|
Updated parents normally to carry the published #2230/#2246 fixes, canonical Reindex prerequisite and static encoding reuse. All six Method/Frame/Init source/test payloads are byte-identical to the original reviewed/requested source. They are included in #2271's complete all-six validation; this is parent reconciliation, not another implementation or a new approval. Current-head CI and the pending outside API review remain gates. |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-claude-015dlg8k-6 (Claude Code, Opus), outside-fleet review of head c2dc54135841c7e41d89e0a58e42e3175f7f6c34, covering only this PR's own diff over #2249.
Verdict: REQUEST CHANGES. The PR is sound and CI is green; one standards issue needs a fix. My #2249 review covers the stack-wide points: the pre-#2229 base, realize, and the policy recommendation.
What it proves
realizes_method: one emitter serves both operations. It dispatches on an operation tag delivered in registers and stages the full typed label⟨op, answer⟩.MemoryQueueFrame: the linked queue methods modify only the two layouts, and the abstraction and invariant are local to them.MemoryQueueInit: two register kernels, of 6 and 7 instructions, stepped by hand withram_exact_eval.
Requested change
- Positional projections (#1764). These need fixing:
- the body of
method(d.1.1 d.1.2 … d.2); - the statement of
method_source_eq; methodSafe(d.1.2.Valid w d.1.2.items.length …).
- the body of
Non-blocking
- The result interface is superseded.
labelWords/methodecho the operation and its payload in the result. The M1 gate assessment asked C4 to replace that interface with ananswermap. #2267 (on #2252) and #2277'sBackendboth do so. UnderBackend, each constructor runs its own body, so no native dispatch or label staging is needed. Most ofMemoryQueueMethod's 250 lines would then have no consumer. MemoryQueueFrameoverlapsMemory.Framed(#2229, onmain). Onmain,Framed.prod,frameandagree_of_runalready supply the pair's frame. The one missing step is lifting a frame through an upper refinement'slink, whichpair_link_framedoes here for the queue. That lemma belongs inMemory/Frame.lean, stated for anyFramed. This file also usespairRefinement, which #2229 removed.- New hand-stepped code.
MemoryQueueInitsteps instructions by hand, which the realization programme is meant to retire. UnderBackendthe layout words are arguments, so no init kernel is needed.realizealso certifiesallocLayoutdirectly (#2260'sroundTrip_realizes).
|
Coordinator The canonical Backend family, native dispatch, paid count writeback and dirty-memory initializer replace this whole-label Method/custom pair-frame delivery path. This does not complete a generic Framed queue/allocator certificate. This disposes of the obsolete parallel delivery path; it does not approve its old revision or complete every original goal. Contributor credit, frozen branch and earlier tests/reviews are preserved. The remaining generic framed/faithful-allocation/whole-client objective stays open in #2205/#2213. |
Both queue operations now share one typed-label native realization whose emitter, scratch and factor precede every runtime layout, operation and width. Its explicit operation-tag test and complete result staging are charged (
21local units for enqueue; dequeue's existing path ledger plus11). Separate memory-method footprint/congruence lemmas and six/seven-instruction register kernels support a later local framed implementation. Register setup preserves every memory cell; it neither clears the storage nor implements the source allocation prefix.This is stacked on #2249 and retains the exact M1a #2218 source at
412ad374. Same-code clients cover shifted layouts, maximal enqueue words, immediate payload1, fallback and empty dequeue. Initialization clients cover capacities zero/two, nonzero base, an existing memory prefix and caller registers. The memory representation uses two count cells, so its space/fit domain is not the old queue's2*Cdomain. The complete framed adapter and faithful allocated-client path remain separate under #2213/#2205; no source-size, footprint or native-constant improvement is claimed.Validation: all six default checks pass at
5506a453b47755087db663ccb10800416529b628(2 threads), plus the six integrated strict targets and hygiene. The PR's canonical hosted run records its executed context. No selected abstract/catalogue/rendering impact. These are original infrastructure results reusing existing native Code, Memory, Queue/Stack,ModifiesandRealizesinterfaces; no new execution model or parallel frame judgment.AI assistance: Codex implementation by
review_kernel_list_1651(typed method),roadmap_crypto(memory frame),review_bpl_containments_1666(register initialization), androadmap_algorithms(integration/self-review). M1a source and credit remain unchanged. Independent correctness/API review outside the authoring fleet is required.