plan §4: mailbox ring reuses by construction; per-message arena watermark reset PROPOSED for MA3 (owner-flagged growth concern) #53

Manually merged
hkowalski merged 3 commits from feat/053-plan-4-mailbox-ring-reuses-by-construction-per into master 2026-03-06 08:00:00 +01:00
Owner

plan §4: mailbox ring reuses by construction; per-message arena watermark reset PROPOSED for MA3 (owner-flagged growth concern)

Along the way:

  • decisions(scheduler): per-dispatch arena reset LOCKED — cursor to post-state watermark at dispatch end; awaited conversations defer the reset
  • MA1.5b: Meta.ck special forms rewritten as CkLang — row 14a FULLY COMPLETE

Touches 8 files: current-state.md, decisions-scheduler-model.md, plan.md, src/rust/crates/ck_driver/src/compile/testfloor.rs, src/rust/crates/ck_driver/tests/floor_isa.rs, src/rust/crates/ck_lower/src/lower/test_facts.rs and 2 more.

plan §4: mailbox ring reuses by construction; per-message arena watermark reset PROPOSED for MA3 (owner-flagged growth concern) Along the way: - decisions(scheduler): per-dispatch arena reset LOCKED — cursor to post-state watermark at dispatch end; awaited conversations defer the reset - MA1.5b: Meta.ck special forms rewritten as CkLang — row 14a FULLY COMPLETE Touches 8 files: `current-state.md`, `decisions-scheduler-model.md`, `plan.md`, `src/rust/crates/ck_driver/src/compile/testfloor.rs`, `src/rust/crates/ck_driver/tests/floor_isa.rs`, `src/rust/crates/ck_lower/src/lower/test_facts.rs` and 2 more.
lnguyen approved these changes 2026-03-06 02:30:00 +01:00
lnguyen left a comment

Happy with this. I ran the suite against the branch and it is green, src/rust/crates/ck_driver/tests/floor_isa.rs included.

Happy with this. I ran the suite against the branch and it is green, `src/rust/crates/ck_driver/tests/floor_isa.rs` included.
@ -0,0 +83,4 @@
}
/// The `mod Name` header of one stdlib unit.
fn module_name(src: &str, path: &std::path::Path) -> String {
Owner

module_name reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?

`module_name` reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?
@ -69,3 +61,2 @@
#[must_use]
pub fn armed(meta: (FnId, FnId), cell: (FnId, FnId, FnId, FnId)) -> Self {
let (append_str, str_len) = meta;
pub fn armed(cell: (FnId, FnId, FnId, FnId)) -> Self {
Owner

armed is public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise, at src/rust/crates/ck_lower/src/lower/test_facts.rs:62.

`armed` is public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise, at src/rust/crates/ck_lower/src/lower/test_facts.rs:62.
mdoorn approved these changes 2026-03-06 07:55:00 +01:00
mdoorn left a comment

Read it too. No objection to src/rust/crates/ck_driver/tests/floor_isa.rs.

Read it too. No objection to `src/rust/crates/ck_driver/tests/floor_isa.rs`.
Author
Owner

Split. The decision in module_name is a pure function now, with its own tests in src/rust/crates/ck_driver/tests/floor_isa.rs.

Split. The decision in `module_name` is a pure function now, with its own tests in `src/rust/crates/ck_driver/tests/floor_isa.rs`.
Author
Owner

Nothing outside calls armed. It is pub(crate) in src/rust/crates/ck_lower/src/lower/test_facts.rs now, at src/rust/crates/ck_lower/src/lower/test_facts.rs:62.

Nothing outside calls `armed`. It is pub(crate) in `src/rust/crates/ck_lower/src/lower/test_facts.rs` now, at src/rust/crates/ck_lower/src/lower/test_facts.rs:62.
Owner 2026-07-03: messages are payload variants; mailbox pre-allocation
must stay deterministic and bump allocation must not bite long-lived
actors. Recorded: (a) the ring answers mailbox reuse (N x max-of-cases
slots, recycled); (b) handler-transient growth across run-to-completion
dispatches is the real bite — dispatch-boundary watermark reset proposed,
justified by no-state-across-suspension; awaiting owner lock in MA3's
design row.
Owner 2026-07-03: the reset signal is the end of the logical function,
exactly the defer rule (defer runs when the function ends — why the
keyword mattered). An awaited-conversation dispatch (tagged pointers
awaiting cleanup) pins the watermark until the continuation completes.
Implementable as the dispatch wrapper's defer. MA3 scope; plan §4 bullet
upgraded PROPOSED -> LOCKED.
The row's point, delivered: Meta.ck's `str_len` / `append_str` are now REAL
CkLang — `str_len` delegates to the `Bytes::str_len` ABI-word leaf,
`append_str` is `Bytes::copy(Bytes::of_str(s), region, offset,
Bytes::str_len(s))` — and the pass special forms are REMOVED, not
deprecated: the ("Meta", …) entries left the E0309 registry, TestFacts
shrank to the four test-cell forms (armed signature narrowed), and
test_lower's LC4 byte-copy / StrPair desugar arms are deleted. The rewritten
fns are ordinary cross-module callees the existing fixpoint discovers;
Bytes::copy's while<65536> rides the armed LoopFacts on every path.

THE CRITICAL GATE HELD: every meta-stream golden is BYTE-IDENTICAL after
the rewrite — fs8_default_run (helloWorld 5-event golden shape-diff),
freestanding_actor_events_run (5-event + crash twin),
freestanding_test_run (soft_asserts stream event-identical INCLUDING the
TestFailed failed-entry list whose predicate/hint text flows through the
rewritten append_str; greeter test ok), soft_assert_run, greeter_test_run
— all passing unchanged, zero re-blessing.

The enumerability claim, pinned (row 14a's closing acceptance): the only
names the compiler desugars below CkLang are the live stdlib's 20
registered `= intrinsic` leaves — the Memory machine-op tier (6), the Sys
syscall leaves (4), the cells + dispatch + raise_word (Supervisor 4, Test
4), and the Bytes ABI-word pair (2). Pinned twice: the new error-level
gate ck_driver/tests/floor_isa.rs (scrapes the stdlib source; a new leaf
fails the build until deliberately added) and stdlib.md §2's new floor-ISA
table (per-leaf tier + lowering, the registry-reserved no-source names
listed separately, the retired-form ledger recorded).

Docs, same commit: plan.md row 14a item (4) ✅ and the row marked FULLY
COMPLETE (items 1–4, 2026-07-03); stdlib.md §2 floor-ISA table; lowering
ledger note (plan §2's FS-test row annotated with the rewrite);
current-state.md §3; Meta.ck/Meta.ckh prose rewritten to the real-CkLang
state; test_facts/test_lower module docs reconciled.

Gates (from src/rust): cargo fmt --check clean; cargo clippy --all-targets
-- -D warnings 0 warnings; cargo test --workspace exit 0 (architecture,
conformance, floor_isa, the full container e2e corpus incl. every golden
gate); cargo build clean. 0 warnings, 0 errors. bytes_roundtrip exit 42;
helloWorld unchanged.
hkowalski manually merged commit 62a9d5da77 into master 2026-03-06 08:00:00 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
northgale/cklang-bootstrap!53
No description provided.