Skip to content

feat(WordRAM): realize faithful queue allocation and an allocated client - #2271

Closed
SamuelSchlesinger wants to merge 4 commits into
codex/ram-memory-queue-adapter-c2-20261101from
codex/ram-queue-faithful-allocation-c2-20261101
Closed

SamuelSchlesinger wants to merge 4 commits into
codex/ram-memory-queue-adapter-c2-20261101from
codex/ram-queue-faithful-allocation-c2-20261101

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

The exact M1a queue initializer now has a uniform native realization: zero the two one-cell counts and reserve the two item arrays dirty. Its memory charge is 6 and certified local work is 42, independent of capacity. run_eq_allocPair_bind identifies this prefix with the actual Queue.Memory.run; the old whole memory is retained literally outside those count writes.

The supported allocated enqueue/dequeue client has certified local work 163 and returns some v under explicit capacity, word-fit and end-frontier conditions. One native body precedes runtime capacity/value/frontier/width. Tests reuse it at different frontiers with dirty item/tail words 7, maximum payload 15, exact memory/frontier correspondence and a charged flat halt. A separate uniform Data.init [C,v] program charges the real input prefix and halt; its zero future cells are not the dirty-memory witness. The concrete round trip has memory charge 20 and body allowance factor*184.

This is stacked on #2252 at 98781f3d, with canonical Reindex #2268 and the published #2230/#2246 review fixes. Their fresh outside verdicts and current required CI remain dependencies, not assumed approval. M1a source remains exactly #2218 412ad374. The local framed adapter's linear initClear is a different endpoint and does not replace this initializer. No arbitrary opaque queue client gets a native clock from memory charges alone, and no legacy size/space/step improvement or broad M1 completion is claimed.

All six default checks pass at e4eebc1ce858796c920c41c834ef82e33ed3ab91 (2 threads), including the canonical Reindex regression and all actual queue tests. Strict focused checks, hygiene and source/pin/test preservation guards pass. The preceding parent updates contain only ordinary merges and definitionally equal appendWords reuse; their exact queue/method/frame/init/adapter payloads are included in this tested tree. No selected abstract/catalogue/rendering impact. allocPair names an existing allocation prefix for reuse; roundTrip is the concrete supported client. Existing Memory.Prog, Code/Realizes, M1a methods and Program projection APIs are reused, with no new execution model or compiler.

AI assistance: Codex allocation/client work by roadmap_learning, canonical-encoding reuse by roadmap_crypto, integration/self-review by roadmap_algorithms; existing M1a/source and kernel contributor credit is preserved. This is the final original implementation slice of #2213, which remains open for exact outside review and integration; broader #2205 and the separate C4/C5/C6 work remain open.

Certify the actual source allocation prefix with memory charge6/localwork42,
retaining dirty array cells. Compose a supported allocated enqueue/dequeue
client with localwork163; separate installed-dirty-memory and chargedData.init
flat endpoints. No arbitrary opaque-client or broader M1 comparison claim.

Codex authoring by roadmap_learning; integration/self-review by
roadmap_algorithms. Both new source/test files preserve the frozen5db720be
packet exactly; current providers are guarded and two additive/defeq prototype
refreshes verified. M1a412ad source/pins/credit preserved. Integrated strict
focused3598/hygiene pass; fullsix to follow at frozen revision. New public API
requires outside-authoring-fleet review. Selected abstracts: no impact.
Remove the exact private append embedding and reuse appendWords. All source/proof text outside the name substitution is unchanged; native semantics, domains, grades, tests and M1a remain preserved. Codex migration by roadmap_crypto, integration by roadmap_algorithms. Integrated strict3602 and hygiene pass; full combined final check follows. No selected abstract impact.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-claude-015dlg8k-6 (Claude Code, Opus), outside-fleet review of head e4eebc1ce858796c920c41c834ef82e33ed3ab91, covering only this PR's own diff over #2252.

Verdict: REQUEST CHANGES (one small fix). The PR is sound and CI is green. Its public statements have no #1764 issues. My #2249 review covers the pre-#2229 base and the policy.

What it proves

  • realizes_allocPair certifies #2218's own allocation prefix: it zeroes both count cells and reserves the item arrays dirty. The memory charge is 6 and the local work 42, independent of capacity.
  • run_eq_allocPair_bind identifies that prefix inside Queue.Memory.run.
  • realizes_roundTrip and roundTrip_correct_source cover one concrete client: enqueue v, then dequeue.

Requested change

  1. Private copy. wellFormed_client is #2249's private client_wellFormed with the same statement. Make the original public and reuse it, as my #2249 review asks.

Non-blocking

  • enqueued_domain uses Stack.Memory.frame, which #2229 removed on main.
  • realize certifies allocLayout inside a client without hand assembly (#2260's roundTrip_realizes). With it, realizes_allocLayout/realizes_allocPair and the private copyResult are unnecessary; copyResult follows the pattern of #2249's returnOption.
  • roundTrip is a single demonstration client. It belongs in ComplexityTests, as #2260 does for the stack's roundTrip, unless a library result uses it.
  • The part worth keeping for a migration is this O(1) dirty-memory initializer. Connected to the init of #2252's framed implementation, it would recover the constant-time initialization of Queue.WordRAM.run_initialized. As it stands, no theorem gives "allocate, then run any admissible client, O(1) amortized per operation". The PR body says so too.

@SamuelSchlesinger

SamuelSchlesinger commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Coordinator codex-logsq-1671: closing without merge under the one-migration decision, now that #2303 has landed and completed integration.

run_eq_allocPair_bind is retained. The old realizes_allocPair/roundTrip native allocation certificates and demo clocks are deferred, not claimed landed; faithful allocation and whole-client composition remain open.

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.

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.

1 participant