Ring reset and attachment reclamation¶
Channel reset and buffer reclamation retire physical memory only after nucleus authority has made the old identity unusable. Ring generations and buffer generations follow separate lifecycles, but both use the same ordering rule: invalidate authority, settle retained work, release mappings, clear memory and then remove the old generation.
Terminal ordering¶
flowchart TB
AUTH{{"Nucleus invalidates the old authority"}}
SETTLE["Settle or classify retained attempts and readers"]
CLOSE["Close monitor mappings and descriptor ownership"]
CLEAR["Reset ring slots or zero attachment bytes"]
RETIRE[("Retired generation")]
AUTH --> SETTLE
SETTLE --> CLOSE
CLOSE --> CLEAR
CLEAR --> RETIRE
Nucleus invalidates the old authority prevents new work from entering the
generation. Settle or classify retained attempts and readers preserves the
terminal facts required by task and buffer authority. Physical cleanup begins
after Close monitor mappings and descriptor ownership removes every live
consumer.
Ring reset¶
A channel close or exact cell-epoch death invalidates both ring directions and wakes publication and capacity waiters. Nucleus authority classifies pending caller reservations and owner observations before the nucleus host drops the endpoint mappings. The old ring generation is then retired. A replay tombstone rejects an installation attempt that presents the retired channel identity.
Each new channel epoch receives a new mapping plan and ring generations. Slot sequence initialisation occurs only inside that new authority. Bytes from the retired mapping cannot become a frame in the new epoch.
Attachment reclamation¶
A sealed attachment records every authorised reader by cell id, cell epoch, handle slot and handle generation. Buffer authority reaches terminal release, then the nucleus host stops the reader process and removes that exact identity from the backing's live-reader set.
Reclamation requires an empty live-reader set. The nucleus host overwrites the complete dedicated backing through its retained mapping, calculates the digest of the zeroed extent and removes the generation. The zeroing receipt binds the buffer identity, generation and byte length to that digest.
Refusal and recovery¶
| Condition | Result |
|---|---|
| A ring still has nucleus-owned retained work | Reset waits for settlement or typed terminal classification |
| A backing still has an authorised reader | Reclamation returns MappingStillLive |
| Reader process shutdown fails | The backing and exact recovery intent stay retained; no live mapping is zeroed |
| The supervisor later proves that reader epoch exited | Exact-reader detach, zeroing and reclamation replay idempotently; the receipt remains until nucleus admission |
| A command presents a retired generation | Admission returns a stale-generation or invalid-mapping fault |
The retention cases preserve memory while another process may still hold a mapping. They also keep the authoritative identity available for recovery. See The memory model, Call completion ring and Bulk attachment lane.