[FEATURE] Own native IPC requests, results and completion custody #11

Open
opened 2026-09-14 13:56:58 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Realm bootstrap and compatibility operations need native ownership of requests, results and capability transfers while a peer is running or unavailable. Intake acceptance, application completion, result collection, alias revocation and provider cleanup are different events. The accepted local lifetime primitive in #7 accounts for a deposited SEND lineage; it does not supply this operation-completion contract.

Define the native substrate before implementing the capability-bearing Posixd provisioning and configuration handshakes. This proposal specifies desired behavior, not an implemented interface or a report of an existing vulnerability.

Proposed behavior and scope

Introduce an explicitly owned invocation protocol in Kernel and lib-ipc, then adopt it coherently in the realm producers and mediator. The proposed client lifecycle is begin, status/poll, collect, acknowledge and abandon; the serving process receives a distinct authenticated delivery identity and completes that exact invocation. These are semantic operations, not assigned opcode values or finalized wire layouts.

Ingress copies and validates request bytes and transfer intent while the caller's supplied storage is available. After successful admission, native ownership covers every retained byte and capability until an explicit transition disposes or transfers it. An invocation selector is bound to the actual caller TCB and nonwrapping stage/invocation generations; it is not a foreign-process selector or a new general capability.

Status reads descriptive state without installing capabilities. Collection supplies fresh writable storage and exact admitted destination slots, validates all remaining authority, and installs each carried grant at most once. Repeated byte collection cannot mint another alias. Acknowledgment releases retained metadata after collection. Abandonment relinquishes result interest and enters accounted draining; it is not proof of application cancellation or rollback.

Capability-bearing requests and replies are in scope. Source slots and receipts cannot substitute for owned live object bindings, rights, move-only custody and revocation lineage. Application objects, children and provider leases need their own producer disposition rules; the transport must report ownership transitions without claiming it can undo arbitrary application effects.

Authority, security and reliability

Admit work only through the caller's actual endpoint authority and bind delivery to the exact serving native process/generation and receiver context. A late completion must target its original delivery identity after receiver retirement or endpoint reuse; an endpoint number alone cannot select a later invocation.

Reserve request, result, receipt, capability-custody and rollback capacity before externally visible acceptance. Admission failures preserve original caller ownership. Rejected collection preserves native result custody and installs nothing. Transfer validation preserves exact move-only rules and attenuated rights; revocation must not recreate a removed alias. Kernel-owned escrow must expose no root CSpace, CNode handle, general object selector or fallback authority.

Caller and server exit, cancellation, partial delivery, failed result copy and uncertain cleanup retain a named native owner and first error. Ordinary success and reusable identities require their own completed transition. Existing application cancellation/lease protocols remain separate. Process and invocation identities must not wrap onto retained state. Security and reliability gates precede allocation or throughput optimization.

Acceptance criteria

  • Document the complete client/server state machine, native object ownership, error precedence, transfer disposition and producer migration before assigning ABI numbers.
  • Prove actual native request delivery and result collection with two distinct caller processes and a real serving process; inspect exact bytes, actual process generations and capability receipts.
  • Prove caller storage can cease to be the request/result backing after successful ingress; later peer work uses native-owned storage and collection uses a freshly admitted buffer.
  • Test wrong caller/server/generation, foreign selectors, premature or repeated collection/acknowledgment, replayed completion and endpoint reuse. No extra grant may appear.
  • Test copy and move-only transfers, attenuation, revoked escrow, occupied/out-of-window destinations, allocation refusal before admission, failed collection and cleanup after both peers' terminal transitions.
  • Distinguish transport draining from application cancellation and provider/child cleanup using real producer receipts. A payload-only model does not establish capability-bearing acceptance.
  • Run formatting, strict Clippy, warning-denied host/target builds, unit/doc tests and new VM coverage with original pinned sources. Preserve existing VM and unit regression gates during migration.
  • Profile admitted invocation allocation, copy volume and collection cost under declared budgets. Avoid repeated full capability scans and redundant payload copies when correctness permits; do not replace policy budgets with an incidental fixed table size.

Alternatives and tradeoffs

Retaining caller buffers until a peer finishes complicates independent scheduling and native lifetime ownership. A userspace-only result table cannot itself establish the kernel's transfer, delivery-identity and terminal guarantees. A request/result record containing only numeric former source slots cannot own a moved capability.

A private per-invocation CSpace and a dedicated native capability-location abstraction are implementation candidates. The former can reuse existing transfer machinery but consumes existing CSpace/slot identity resources and needs exact teardown; the latter changes object-binding and revocation accounting more broadly. Select only after source-grounded ownership and resource experiments. Neither is adopted by this issue. Preserve narrow completion authority without turning a delivery token into a new general receive or process-control route.

The next design step must enumerate those contracts and define the full caller/server state machine before selecting a capability-location representation or ABI. The actual allocator rejection control fails the original signed library with next ID 5 instead of 4; the corrected test covers repeated failed growth, initialization failure and allocation-free reuse.

Endpoint construction checkpoint — 14 September 2026: The focused owned-invocation design defines actual caller/server generations, exact receiver registration, retained SEND carrier lineage, request/result byte and capability custody, fresh collection, exactly-once grants, invalidated deliveries, draining and terminal cleanup. Copy, attenuated copy and move reject unbound endpoint metadata before destination installation; the original control materializes an endpoint and fails the new invariant. Explicit construction then preserves exact object identity and SEND-only rights.

Preparation failure changes no capability inventory or unique-grant custody. Commit and pre-delivery rollback require no allocation under existing BSP serialization. Five actual-object controls cover a 62-capability mixed batch, real allocator rejection, exact backing and grant scope, nested revocation and same-CSpace transfer. Its private records cannot survive userspace scheduling and own no retained source authority.

They derive actual TCB/stage/CSpace identity, retain real request/result bytes and capabilities in a private CSpace, and keep a SEND-only carrier alias in its original revocation lineage. Twelve actual-object controls cover caller/receiver scope, source-buffer mutation, duplicate destinations, moved unique grants and reused source slots, actual admission allocation rejection, six native object types, revocation, process death, replay and FIFO after registry vacancy reuse. Reachable backend disposal-failure coverage, sustained invocation-workload profiling, realm producer adoption, whole-codebase authority/private-rustdoc closure and both complete EriX-in-EriX build generations remain open. No new syscall number or wire record is assigned; the existing CALL/RECV/REPLY ABI is unchanged.

Delivery-origin contract — 15 September 2026: each successful native request claim will return the submitting process ID and its exact staged generation from the invocation's retained kernel actor. These use the same identity domain as CREATE_STAGED_PROCESS and the existing pending-caller observation, and contain neither a CSpace identifier nor a selectable capability. The kernel derives both fields at submission; payload bytes, receiving-process identity and equal numeric source slots cannot replace them. This is an attestation of the submitted request's origin, not a promise of later process liveness or authorization for a subsequent operation. Services must correlate it with their exact retained process/realm ownership and revalidate after blocking effects. The delivery selector remains independently bound to the serving process and receiver registration. Distinct actual submitters sharing a carrier must yield distinct correct origin pairs even when their payloads impersonate one another. No syscall number or wire layout is assigned by this native-field change.

The process ID and staged generation come from the retained submitting actor in the native CREATE_STAGED_PROCESS identity domain; payload fields, receiving identity and equal numeric carrier slots cannot replace them. The pair exposes no private CSpace, grants no authority and promises no later liveness. Services must correlate it with exact retained process/realm ownership and revalidate after blocking effects. A two-submitter control sends mutually impersonating payloads through the same real carrier and validates both actual origins plus independent caller-local selector refusal. Sustained invocation-workload profiling, syscall wire and fresh-buffer/fault/overlap validation, actual owned CPL3 peers, reachable backend disposal-failure coverage, realm producer adoption, whole authority/private-rustdoc closure and both complete EriX-in-EriX build generations remain open.

Native invocation workload profile contract — 15 September 2026: add a maintained host workload using actual kernel process, CSpace, endpoint and revocation objects plus public owned-invocation entry points. Measure queued-request progress, collected-result progress, repeated collection and full request cycles against explicitly selected retained populations. Separate setup, operation and cleanup durations; retain exact source/binary identity, parameters, actual completed-operation counts and independent caller-origin, FIFO, byte, capability, foreign-selector and final-disposal checks. Each sample uses one owned process and explicit inputs, deadlines and output budgets; no VM, network, signing credential or unrelated-process authority is required for measurement. Integration must retain complete process status and raw evidence, reject incomplete or mismatched samples, and report comparisons only for equivalent source/workload contexts. Build once per source into distinct targets and run uncontended before/after samples. Host measurements do not establish guest or self-host-build throughput. The current global registry and endpoint-binding scans are hypotheses until measured; any optimization must preserve exact identity, allocation-safe publication and accounted revocation/terminal cleanup. Ordinary functional tests gain no timing-ratio assertion.

Every sample checks exact bytes and SEND capability bindings, authenticated origin, foreign selection, duplicate completion refusal, FIFO position reuse, one-time collection and final invocation disposal. The next bounded change will retain only non-authoritative numeric search positions: every fast path must still check current capability type/rights, endpoint identity/in-use state and exact CSpace/slot binding, with complete lookup on a stale hint. Original workload bytes and sample policy must remain unchanged for comparison. Native syscall adapters, actual owned CPL3 peers, reachable backend disposal-failure coverage, realm adoption, full authority/private-documentation closure and both complete EriX-in-EriX build generations remain open.

Measured native invocation lookup refinement — 15 September 2026: Signed Kernel 8349d68636382cc7e25a3347f5f1df216554203a retains only numeric carrier-search positions. No successful authorization, capability or reference is cached. These are host operation wall times, not guest startup/build acceptance or a statistical guarantee. Current full-suite CI remains required; stopped cohorts are not polled again. Owned syscall wire adapters, actual owned CPL3 peers, fresh-buffer validation, reachable backend disposal-failure coverage, realm adoption, full authority/private-documentation closure and both complete EriX-in-EriX build generations remain open.

Detailed scope and contracts

Owned invocation wire contract — 15 September 2026

This v1 contract connects the Kernel's native request/result custody to explicit
userspace peers. It is tracked in kernel #11 and lib-ipc #1.
Shared codecs alone do not establish native execution or realm acceptance.

Registers and ownership

All numbers and packet fields are unsigned. Packet integers are little endian
and require no alignment. RAX selects the syscall; arguments are RDI, RSI, RDX,
R10, R8 and R9 in that order. Unlisted arguments must be zero. Return RAX is an
ordinary IPC result code; RDX carries the operation-specific value below and
R8 is zero. A rejected operation returns zero RDX unless SUBMIT explicitly
reports a retained draining owner. Calls do not retain any userspace pointer.

Number Operation Arguments Successful RDX
0x4C REGISTER local RECV slot zero
0x4D SUBMIT local SEND slot, input pointer, input length invocation ID
0x4E CLAIM local RECV slot, receive pointer, receive length delivery ID
0x4F COMPLETE local RECV slot, delivery ID, input pointer, input length zero
0x50 COLLECT invocation ID, receive pointer, receive length zero
0x51 PROGRESS invocation ID packed progress
0x52 RELEASE invocation ID packed transition
0x53 RELINQUISH delivery ID packed transition

IDs are nonzero opaque numbers, scoped to the actual current process, generation
and CSpace. They never choose a process or grant capability authority. REGISTER
requires an existing generic endpoint. SUBMIT requires SEND and additionally
GRANT for capability inputs. CLAIM and COMPLETE require the exact registered
receiver and actual RECV; capability completion additionally requires GRANT.
RELINQUISH acknowledges only an invalidated delivery owned by that serving
process; it does not require a surviving receiver capability. RELEASE abandons
future collection and starts native retirement, without undoing provider effects.

SUBMIT may return a nonzero failure code AND a nonzero invocation ID: ingress
could not be completed but native disposal remains accounted to that owner.
It cannot subsequently be delivered. The caller must retain that ID for progress
and release. A nonzero code with zero ID is an ordinary rejected submission.
CLAIM/COLLECT return RAX zero after a committed delivery even if subsequent
native disposal is draining; the receive header carries that distinction.
Their rejection leaves the receive packet and destination inventory unchanged.
COMPLETE accepts its result exactly once. Repeated COLLECT is descriptive: no
second capability transfer, and the destination list must be empty.

Packed transition uses bit 0 for draining and bits 32–63 for its nonzero native
code; all other bits are zero. Complete is exactly zero. Packed progress uses
bits 0, 1, 2 and 3 for request delivered, completion accepted, result collected
and draining; bit 4 says a first error is present, with that nonzero code in bits
32–63. All other bits are zero. Draining may have no first error when release
awaits server bookkeeping. Progress flags report history, not new authority.

Input packet

The fixed header is 40 bytes, followed by capability inputs and then payload.
The exact packet size is 40 + 8 * capability_count + payload_bytes.

Offset Width Meaning
0 4 ASCII OIV1
4 2 version, exactly 1
6 2 header size, exactly 40
8 8 payload byte count
16 8 capability count
24 8 maximum result bytes reserved by SUBMIT
32 8 maximum result capabilities reserved by SUBMIT

Each capability input is a four-byte current source slot and four-byte requested
rights. COMPLETE requires both result budgets to be zero. The kernel copies
input bytes and retains actual admitted native bindings before returning; caller
mutation or unmapping after return cannot change the accepted request/result.
Possession, type, attenuation, provenance and lifetime checks remain native.

Receive packet

The fixed header is 64 bytes, then four-byte destination slots, then twelve-byte
receipt capacity, then byte capacity. Its exact size is
64 + 4 * destination_count + 12 * receipt_capacity + byte_capacity.

Offset Width Meaning
0 4 ASCII OIR1
4 2 version, exactly 1
6 2 header size, exactly 64
8 8 byte capacity
16 8 destination count
24 8 receipt capacity
32 8 returned byte count, initially zero
40 8 returned receipt count, initially zero
48 4 attested caller process, initially zero
52 4 attested caller generation, initially zero
56 4 draining code, initially zero
60 4 transition flags, initially zero; only bit 0 is defined

Destination and receipt capacities are distinct to support repeat collection.
First delivery requires enough destinations and receipts for all actual inputs;
only the used destination prefix is validated or populated. Spare destinations
and unused receipt/payload capacity remain unchanged, acquire no authority and
are not returned as evidence. A receipt is destination slot, native capability
type and admitted rights, each four bytes. It describes a committed transfer,
not a transferable capability. CLAIM supplies the retained caller's process and
generation. COLLECT leaves those two fields zero. No caller-supplied identity is
accepted. Output counts must fit capacities; draining requires a nonzero code.

Validation and lifetime

Overflow, size mismatch, noncanonical headers, unsupported versions, nonzero
initial output fields and reserved register inputs reject before native custody
changes. There is no inherited 32 KiB CALL limit. Actual addressability, native
CSpace limits, caller budgets and fallible allocation still constrain admission.
The entire input span must be freshly readable; the entire receive span must be
freshly readable and writable in the current process's actual VSpace. Kernel,
noncanonical, stale, overflowed and partly inaccessible spans reject.

Mapping validation, packet admission, native effects and output publication share
one existing process-lifecycle exclusion interval. All allocation and fallible
output checks precede native delivery. Destination input is snapshotted before
outputs are written. No userspace pointer, borrowed descriptor, receiver-selected
CSpace or ambient allocator/provider authority enters retained custody. Hosted
raw-pointer dispatch is refused; safe codec/object tests and actual CPL3 tests
provide distinct evidence. Existing CALL/REPLY semantics remain unchanged.

Acceptance and rollout

Literal packet fixtures, arithmetic/malformed negatives, complete and draining
returns, spare destinations, repeated collection, exact-owner refusal, revoked
bindings, fresh mapping checks and real CPL3 request/capability round trips must
pass. Existing unit and VM regressions remain mandatory. Producers and consumers
select original signed commit pins after strict validation. Realm lifecycle and
complete in-guest builds remain separate gates. A peek/sizing syscall is avoided
by admitting capacity; numeric identities never bypass native ownership checks.

Owned invocation wire and native acceptance — 15 September 2026: Signed Kernel 5f497adaefa526108a0439e0e071717dddb85334, shared IPC de968da19898bef532ddb3b5974bb9562f51dee5, capability ABI a001a26f0eb3aebec3f5fd02a28d98f1bc23f8a0 and Integration 9030b217c490db6ad3ec60a799cb025eccbfcdb1 implement and exercise the immediate owned invocation boundary. Destination capacity and descriptive receipt capacity are independent; spare capacity acquires no authority and repeated collection cannot duplicate transfers. The real three-process CPL3 scenario passes all eight operations, full-span pointer/rights/overflow/reserved-field rejection, actual returned selectors, payload/capability/origin checks, collection after server exit and repeated receipts. A second request rejects premature relinquishment, enters draining on caller release and retires only after the exact server acknowledgment. All 162 maintained Integration helper commands pass; three prior correct concurrent-run lock refusals are retained and their sequential checks pass on unchanged executable inputs. Current full-suite acceptance remains open, as does the intermittent quota cause in Integration issue 18. Reachable backend disposal-failure coverage, broader revocation/generation-reuse scenarios, producer adoption, realm runtime, complete authority/inline-documentation audits and both full EriX-in-EriX build generations remain open.

Typed realm bootstrap installation design — 15 September 2026: The next bootstrap producer step requires validating the actual moved install grant against the intended child before any installation. Add Kernel-control operation 52, INSTALL_WITH_GRANT_FOR_PROCESS, using the existing fixed request/reply envelope: flags and arg3 are zero; arg0 packs grant slot in bits 0..31 and source slot in bits 32..63; arg1 packs child destination slot and exact requested rights; arg2 packs nonzero process ID and nonzero staged generation. Both response values remain zero. The operation is admitted only where grant installation is already allowed (process-control and child-population endpoints, with existing bootstrap control policy preserved). The held unique grant remains the authority; the supplied process/generation pair is an additional equality constraint, never a target-selection grant. Revalidate exact native grant binding, GRANT possession, child/staged identity and current staged liveness, slot and type/rights ceilings, actual source binding and empty destination before transfer. Unlike legacy zero-means-inherit installation, this operation always uses the exact supplied rights, including zero. Reject nonzero reserved input and zero identities deterministically; mismatched target identity must produce no installed alias or new revocation lineage. Keep old producer semantics unchanged until explicitly migrated. Share the native installation implementation and split the existing near-1000-line control dispatcher by responsibility. Tests must use actual moved install grants for distinct staged children, wrong/stale generations, occupied destinations, explicit zero rights, invalid fields, denied endpoint policy, preserved source/grant custody and native lifetime/revocation behavior. Connect the new checked operation to typed Procd bootstrap provisioning; a standalone scalar codec or host-only table is not realm runtime acceptance. Complete receiver readiness, setup-authority disposal, fair terminal/provider scheduling, two-realm byte I/O and both full guest builds remain required.

Process-bound native acceptance — 15 September 2026: Signed Kernel 60da5858d7198185efd103f0e91e5ac2e0b63e67 implements control operation 52, checking the actual moved install grant against expected process/generation with exact rights, including zero, under existing endpoint policies. Signed Procd f1105706cc19ed024a6cca79a29abc57c90c6661 uses this operation in its actual ordinary launch-description producer while retaining the narrow SEND receipt, pending state and exact failure cleanup. All 162 Integration helpers pass after updating the exact policy assertion to require the new marker; its initial mismatch remains recorded. Typed realm bootstrap, mediator startup/readiness/configuration/seal, complete consumer image adoption, fair terminal/provider retirement, broader native disposal failures and both full EriX-in-EriX build generations remain open. The new inventory covers 76 repositories, 2,950 code files below 1,000 lines and 158 direct missing_docs crate-root gates; complete inline documentation and whole-codebase authority closure remain open.

Owned receiver request-budget contract — 18 September 2026: Extend register-only REGISTER (0x4C) to take the actual local RECV slot, maximum request payload bytes and maximum request capability count in arguments 0–2; arguments 3–5 remain zero and successful RDX is zero. Both budget values are explicit receiver declarations. Zero/zero admits only empty requests. The byte/slot/receipt receive layout must be addressable and capability capacity must fit native private CSpace storage. The actual Running generation and held generic RECV endpoint remain the registration authority. Exact repeated registration is idempotent only with the same budget; a different budget or owner conflicts without modifying the original registration. Replacement follows the existing actual receiver-binding removal and exact native retirement rules. SUBMIT compares actual payload length and capability count against that exact registration before request allocation, private-space reservation, native transfer or invocation serial acceptance. Oversized requests return ordinary INVALID_ARGUMENT with zero owner ID and unchanged source custody. The packet decoder passes its checked capability iterator directly to native preparation, removing its redundant temporary vector. Accepted invocation, result-budget, delivery, draining and retirement contracts remain explicit. Migrate every producer and fixture to the new signature without a deprecated unbounded fallback. These budgets describe service-owned receiving storage; they add no global CALL-size ceiling, user-pointer retention, foreign selector or capability grant. Literal malformed/zero/exact registration controls, rejected-inventory checks, actual CPL3 calls and existing VM oracles are required. Then connect the owned Procd/Launchd bootstrap path through its held private route, actual claimed caller identity, server-chosen grant receipt and local relocation, retaining each committed/draining owner through exhaustive cleanup. Actual consumer VMs, complete fair realm progress and both full guest builds remain open acceptance requirements.

Tracking and rollout

Related: #1, #2, lifetime design #7, Posixd design issue 1, Kernel PR 3 and Integration PR 12.

Sequence the ownership design, native mechanism, full request/reply capability tests, producer/consumer migration and real two-realm byte I/O. Keep ordinary source graphs coherent and never reinterpret existing reserved registers or startup fields. Remove superseded transport paths only after all owning consumers and regression gates migrate. The full build and second-generation build inside EriX remain separate phase acceptance gates.

Related records and contracts
Repository Links
kernel issue 13
## Problem and motivation Realm bootstrap and compatibility operations need native ownership of requests, results and capability transfers while a peer is running or unavailable. Intake acceptance, application completion, result collection, alias revocation and provider cleanup are different events. The accepted local lifetime primitive in #7 accounts for a deposited SEND lineage; it does not supply this operation-completion contract. Define the native substrate before implementing the capability-bearing Posixd provisioning and configuration handshakes. This proposal specifies desired behavior, not an implemented interface or a report of an existing vulnerability. ## Proposed behavior and scope Introduce an explicitly owned invocation protocol in Kernel and lib-ipc, then adopt it coherently in the realm producers and mediator. The proposed client lifecycle is begin, status/poll, collect, acknowledge and abandon; the serving process receives a distinct authenticated delivery identity and completes that exact invocation. These are semantic operations, not assigned opcode values or finalized wire layouts. Ingress copies and validates request bytes and transfer intent while the caller's supplied storage is available. After successful admission, native ownership covers every retained byte and capability until an explicit transition disposes or transfers it. An invocation selector is bound to the actual caller TCB and nonwrapping stage/invocation generations; it is not a foreign-process selector or a new general capability. Status reads descriptive state without installing capabilities. Collection supplies fresh writable storage and exact admitted destination slots, validates all remaining authority, and installs each carried grant at most once. Repeated byte collection cannot mint another alias. Acknowledgment releases retained metadata after collection. Abandonment relinquishes result interest and enters accounted draining; it is not proof of application cancellation or rollback. Capability-bearing requests and replies are in scope. Source slots and receipts cannot substitute for owned live object bindings, rights, move-only custody and revocation lineage. Application objects, children and provider leases need their own producer disposition rules; the transport must report ownership transitions without claiming it can undo arbitrary application effects. ## Authority, security and reliability Admit work only through the caller's actual endpoint authority and bind delivery to the exact serving native process/generation and receiver context. A late completion must target its original delivery identity after receiver retirement or endpoint reuse; an endpoint number alone cannot select a later invocation. Reserve request, result, receipt, capability-custody and rollback capacity before externally visible acceptance. Admission failures preserve original caller ownership. Rejected collection preserves native result custody and installs nothing. Transfer validation preserves exact move-only rules and attenuated rights; revocation must not recreate a removed alias. Kernel-owned escrow must expose no root CSpace, CNode handle, general object selector or fallback authority. Caller and server exit, cancellation, partial delivery, failed result copy and uncertain cleanup retain a named native owner and first error. Ordinary success and reusable identities require their own completed transition. Existing application cancellation/lease protocols remain separate. Process and invocation identities must not wrap onto retained state. Security and reliability gates precede allocation or throughput optimization. ## Acceptance criteria - Document the complete client/server state machine, native object ownership, error precedence, transfer disposition and producer migration before assigning ABI numbers. - Prove actual native request delivery and result collection with two distinct caller processes and a real serving process; inspect exact bytes, actual process generations and capability receipts. - Prove caller storage can cease to be the request/result backing after successful ingress; later peer work uses native-owned storage and collection uses a freshly admitted buffer. - Test wrong caller/server/generation, foreign selectors, premature or repeated collection/acknowledgment, replayed completion and endpoint reuse. No extra grant may appear. - Test copy and move-only transfers, attenuation, revoked escrow, occupied/out-of-window destinations, allocation refusal before admission, failed collection and cleanup after both peers' terminal transitions. - Distinguish transport draining from application cancellation and provider/child cleanup using real producer receipts. A payload-only model does not establish capability-bearing acceptance. - Run formatting, strict Clippy, warning-denied host/target builds, unit/doc tests and new VM coverage with original pinned sources. Preserve existing VM and unit regression gates during migration. - Profile admitted invocation allocation, copy volume and collection cost under declared budgets. Avoid repeated full capability scans and redundant payload copies when correctness permits; do not replace policy budgets with an incidental fixed table size. ## Alternatives and tradeoffs Retaining caller buffers until a peer finishes complicates independent scheduling and native lifetime ownership. A userspace-only result table cannot itself establish the kernel's transfer, delivery-identity and terminal guarantees. A request/result record containing only numeric former source slots cannot own a moved capability. A private per-invocation CSpace and a dedicated native capability-location abstraction are implementation candidates. The former can reuse existing transfer machinery but consumes existing CSpace/slot identity resources and needs exact teardown; the latter changes object-binding and revocation accounting more broadly. Select only after source-grounded ownership and resource experiments. Neither is adopted by this issue. Preserve narrow completion authority without turning a delivery token into a new general receive or process-control route. The next design step must enumerate those contracts and define the full caller/server state machine before selecting a capability-location representation or ABI. The actual allocator rejection control fails the original signed library with next ID 5 instead of 4; the corrected test covers repeated failed growth, initialization failure and allocation-free reuse. Endpoint construction checkpoint — 14 September 2026: The focused [owned-invocation design](https://git.erikinkinen.fi/erix/kernel/src/commit/f6489ff3f8fea88a26dad232cc45d0deb33fa30e/docs/owned-invocations.md) defines actual caller/server generations, exact receiver registration, retained SEND carrier lineage, request/result byte and capability custody, fresh collection, exactly-once grants, invalidated deliveries, draining and terminal cleanup. Copy, attenuated copy and move reject unbound endpoint metadata before destination installation; the original control materializes an endpoint and fails the new invariant. Explicit construction then preserves exact object identity and SEND-only rights. Preparation failure changes no capability inventory or unique-grant custody. Commit and pre-delivery rollback require no allocation under existing BSP serialization. Five actual-object controls cover a 62-capability mixed batch, real allocator rejection, exact backing and grant scope, nested revocation and same-CSpace transfer. Its private records cannot survive userspace scheduling and own no retained source authority. They derive actual TCB/stage/CSpace identity, retain real request/result bytes and capabilities in a private CSpace, and keep a SEND-only carrier alias in its original revocation lineage. Twelve actual-object controls cover caller/receiver scope, source-buffer mutation, duplicate destinations, moved unique grants and reused source slots, actual admission allocation rejection, six native object types, revocation, process death, replay and FIFO after registry vacancy reuse. Reachable backend disposal-failure coverage, sustained invocation-workload profiling, realm producer adoption, whole-codebase authority/private-rustdoc closure and both complete EriX-in-EriX build generations remain open. No new syscall number or wire record is assigned; the existing CALL/RECV/REPLY ABI is unchanged. Delivery-origin contract — 15 September 2026: each successful native request claim will return the submitting process ID and its exact staged generation from the invocation's retained kernel actor. These use the same identity domain as CREATE_STAGED_PROCESS and the existing pending-caller observation, and contain neither a CSpace identifier nor a selectable capability. The kernel derives both fields at submission; payload bytes, receiving-process identity and equal numeric source slots cannot replace them. This is an attestation of the submitted request's origin, not a promise of later process liveness or authorization for a subsequent operation. Services must correlate it with their exact retained process/realm ownership and revalidate after blocking effects. The delivery selector remains independently bound to the serving process and receiver registration. Distinct actual submitters sharing a carrier must yield distinct correct origin pairs even when their payloads impersonate one another. No syscall number or wire layout is assigned by this native-field change. The process ID and staged generation come from the retained submitting actor in the native CREATE_STAGED_PROCESS identity domain; payload fields, receiving identity and equal numeric carrier slots cannot replace them. The pair exposes no private CSpace, grants no authority and promises no later liveness. Services must correlate it with exact retained process/realm ownership and revalidate after blocking effects. A two-submitter control sends mutually impersonating payloads through the same real carrier and validates both actual origins plus independent caller-local selector refusal. Sustained invocation-workload profiling, syscall wire and fresh-buffer/fault/overlap validation, actual owned CPL3 peers, reachable backend disposal-failure coverage, realm producer adoption, whole authority/private-rustdoc closure and both complete EriX-in-EriX build generations remain open. Native invocation workload profile contract — 15 September 2026: add a maintained host workload using actual kernel process, CSpace, endpoint and revocation objects plus public owned-invocation entry points. Measure queued-request progress, collected-result progress, repeated collection and full request cycles against explicitly selected retained populations. Separate setup, operation and cleanup durations; retain exact source/binary identity, parameters, actual completed-operation counts and independent caller-origin, FIFO, byte, capability, foreign-selector and final-disposal checks. Each sample uses one owned process and explicit inputs, deadlines and output budgets; no VM, network, signing credential or unrelated-process authority is required for measurement. Integration must retain complete process status and raw evidence, reject incomplete or mismatched samples, and report comparisons only for equivalent source/workload contexts. Build once per source into distinct targets and run uncontended before/after samples. Host measurements do not establish guest or self-host-build throughput. The current global registry and endpoint-binding scans are hypotheses until measured; any optimization must preserve exact identity, allocation-safe publication and accounted revocation/terminal cleanup. Ordinary functional tests gain no timing-ratio assertion. Every sample checks exact bytes and SEND capability bindings, authenticated origin, foreign selection, duplicate completion refusal, FIFO position reuse, one-time collection and final invocation disposal. The next bounded change will retain only non-authoritative numeric search positions: every fast path must still check current capability type/rights, endpoint identity/in-use state and exact CSpace/slot binding, with complete lookup on a stale hint. Original workload bytes and sample policy must remain unchanged for comparison. Native syscall adapters, actual owned CPL3 peers, reachable backend disposal-failure coverage, realm adoption, full authority/private-documentation closure and both complete EriX-in-EriX build generations remain open. Measured native invocation lookup refinement — 15 September 2026: Signed Kernel `8349d68636382cc7e25a3347f5f1df216554203a` retains only numeric carrier-search positions. No successful authorization, capability or reference is cached. These are host operation wall times, not guest startup/build acceptance or a statistical guarantee. Current full-suite CI remains required; stopped cohorts are not polled again. Owned syscall wire adapters, actual owned CPL3 peers, fresh-buffer validation, reachable backend disposal-failure coverage, realm adoption, full authority/private-documentation closure and both complete EriX-in-EriX build generations remain open. <details> <summary>Detailed scope and contracts</summary> ### Owned invocation wire contract — 15 September 2026 This v1 contract connects the Kernel's native request/result custody to explicit userspace peers. It is tracked in [kernel #11][kernel] and [lib-ipc #1][ipc]. Shared codecs alone do not establish native execution or realm acceptance. ### Registers and ownership All numbers and packet fields are unsigned. Packet integers are little endian and require no alignment. RAX selects the syscall; arguments are RDI, RSI, RDX, R10, R8 and R9 in that order. Unlisted arguments must be zero. Return RAX is an ordinary IPC result code; RDX carries the operation-specific value below and R8 is zero. A rejected operation returns zero RDX unless SUBMIT explicitly reports a retained draining owner. Calls do not retain any userspace pointer. | Number | Operation | Arguments | Successful RDX | | --- | --- | --- | --- | | 0x4C | REGISTER | local RECV slot | zero | | 0x4D | SUBMIT | local SEND slot, input pointer, input length | invocation ID | | 0x4E | CLAIM | local RECV slot, receive pointer, receive length | delivery ID | | 0x4F | COMPLETE | local RECV slot, delivery ID, input pointer, input length | zero | | 0x50 | COLLECT | invocation ID, receive pointer, receive length | zero | | 0x51 | PROGRESS | invocation ID | packed progress | | 0x52 | RELEASE | invocation ID | packed transition | | 0x53 | RELINQUISH | delivery ID | packed transition | IDs are nonzero opaque numbers, scoped to the actual current process, generation and CSpace. They never choose a process or grant capability authority. REGISTER requires an existing generic endpoint. SUBMIT requires SEND and additionally GRANT for capability inputs. CLAIM and COMPLETE require the exact registered receiver and actual RECV; capability completion additionally requires GRANT. RELINQUISH acknowledges only an invalidated delivery owned by that serving process; it does not require a surviving receiver capability. RELEASE abandons future collection and starts native retirement, without undoing provider effects. SUBMIT may return a nonzero failure code AND a nonzero invocation ID: ingress could not be completed but native disposal remains accounted to that owner. It cannot subsequently be delivered. The caller must retain that ID for progress and release. A nonzero code with zero ID is an ordinary rejected submission. CLAIM/COLLECT return RAX zero after a committed delivery even if subsequent native disposal is draining; the receive header carries that distinction. Their rejection leaves the receive packet and destination inventory unchanged. COMPLETE accepts its result exactly once. Repeated COLLECT is descriptive: no second capability transfer, and the destination list must be empty. Packed transition uses bit 0 for draining and bits 32–63 for its nonzero native code; all other bits are zero. Complete is exactly zero. Packed progress uses bits 0, 1, 2 and 3 for request delivered, completion accepted, result collected and draining; bit 4 says a first error is present, with that nonzero code in bits 32–63. All other bits are zero. Draining may have no first error when release awaits server bookkeeping. Progress flags report history, not new authority. ### Input packet The fixed header is 40 bytes, followed by capability inputs and then payload. The exact packet size is `40 + 8 * capability_count + payload_bytes`. | Offset | Width | Meaning | | --- | --- | --- | | 0 | 4 | ASCII `OIV1` | | 4 | 2 | version, exactly 1 | | 6 | 2 | header size, exactly 40 | | 8 | 8 | payload byte count | | 16 | 8 | capability count | | 24 | 8 | maximum result bytes reserved by SUBMIT | | 32 | 8 | maximum result capabilities reserved by SUBMIT | Each capability input is a four-byte current source slot and four-byte requested rights. COMPLETE requires both result budgets to be zero. The kernel copies input bytes and retains actual admitted native bindings before returning; caller mutation or unmapping after return cannot change the accepted request/result. Possession, type, attenuation, provenance and lifetime checks remain native. ### Receive packet The fixed header is 64 bytes, then four-byte destination slots, then twelve-byte receipt capacity, then byte capacity. Its exact size is `64 + 4 * destination_count + 12 * receipt_capacity + byte_capacity`. | Offset | Width | Meaning | | --- | --- | --- | | 0 | 4 | ASCII `OIR1` | | 4 | 2 | version, exactly 1 | | 6 | 2 | header size, exactly 64 | | 8 | 8 | byte capacity | | 16 | 8 | destination count | | 24 | 8 | receipt capacity | | 32 | 8 | returned byte count, initially zero | | 40 | 8 | returned receipt count, initially zero | | 48 | 4 | attested caller process, initially zero | | 52 | 4 | attested caller generation, initially zero | | 56 | 4 | draining code, initially zero | | 60 | 4 | transition flags, initially zero; only bit 0 is defined | Destination and receipt capacities are distinct to support repeat collection. First delivery requires enough destinations and receipts for all actual inputs; only the used destination prefix is validated or populated. Spare destinations and unused receipt/payload capacity remain unchanged, acquire no authority and are not returned as evidence. A receipt is destination slot, native capability type and admitted rights, each four bytes. It describes a committed transfer, not a transferable capability. CLAIM supplies the retained caller's process and generation. COLLECT leaves those two fields zero. No caller-supplied identity is accepted. Output counts must fit capacities; draining requires a nonzero code. ### Validation and lifetime Overflow, size mismatch, noncanonical headers, unsupported versions, nonzero initial output fields and reserved register inputs reject before native custody changes. There is no inherited 32 KiB CALL limit. Actual addressability, native CSpace limits, caller budgets and fallible allocation still constrain admission. The entire input span must be freshly readable; the entire receive span must be freshly readable and writable in the current process's actual VSpace. Kernel, noncanonical, stale, overflowed and partly inaccessible spans reject. Mapping validation, packet admission, native effects and output publication share one existing process-lifecycle exclusion interval. All allocation and fallible output checks precede native delivery. Destination input is snapshotted before outputs are written. No userspace pointer, borrowed descriptor, receiver-selected CSpace or ambient allocator/provider authority enters retained custody. Hosted raw-pointer dispatch is refused; safe codec/object tests and actual CPL3 tests provide distinct evidence. Existing CALL/REPLY semantics remain unchanged. ### Acceptance and rollout Literal packet fixtures, arithmetic/malformed negatives, complete and draining returns, spare destinations, repeated collection, exact-owner refusal, revoked bindings, fresh mapping checks and real CPL3 request/capability round trips must pass. Existing unit and VM regressions remain mandatory. Producers and consumers select original signed commit pins after strict validation. Realm lifecycle and complete in-guest builds remain separate gates. A peek/sizing syscall is avoided by admitting capacity; numeric identities never bypass native ownership checks. [kernel]: https://git.erikinkinen.fi/erix/kernel/issues/11 [ipc]: https://git.erikinkinen.fi/erix/lib-ipc/issues/1 Owned invocation wire and native acceptance — 15 September 2026: Signed Kernel `5f497adaefa526108a0439e0e071717dddb85334`, shared IPC `de968da19898bef532ddb3b5974bb9562f51dee5`, capability ABI `a001a26f0eb3aebec3f5fd02a28d98f1bc23f8a0` and Integration `9030b217c490db6ad3ec60a799cb025eccbfcdb1` implement and exercise the immediate owned invocation boundary. Destination capacity and descriptive receipt capacity are independent; spare capacity acquires no authority and repeated collection cannot duplicate transfers. The real three-process CPL3 scenario passes all eight operations, full-span pointer/rights/overflow/reserved-field rejection, actual returned selectors, payload/capability/origin checks, collection after server exit and repeated receipts. A second request rejects premature relinquishment, enters draining on caller release and retires only after the exact server acknowledgment. All 162 maintained Integration helper commands pass; three prior correct concurrent-run lock refusals are retained and their sequential checks pass on unchanged executable inputs. Current full-suite acceptance remains open, as does the intermittent quota cause in Integration issue 18. Reachable backend disposal-failure coverage, broader revocation/generation-reuse scenarios, producer adoption, realm runtime, complete authority/inline-documentation audits and both full EriX-in-EriX build generations remain open. Typed realm bootstrap installation design — 15 September 2026: The next bootstrap producer step requires validating the actual moved install grant against the intended child before any installation. Add Kernel-control operation 52, INSTALL_WITH_GRANT_FOR_PROCESS, using the existing fixed request/reply envelope: flags and arg3 are zero; arg0 packs grant slot in bits 0..31 and source slot in bits 32..63; arg1 packs child destination slot and exact requested rights; arg2 packs nonzero process ID and nonzero staged generation. Both response values remain zero. The operation is admitted only where grant installation is already allowed (process-control and child-population endpoints, with existing bootstrap control policy preserved). The held unique grant remains the authority; the supplied process/generation pair is an additional equality constraint, never a target-selection grant. Revalidate exact native grant binding, GRANT possession, child/staged identity and current staged liveness, slot and type/rights ceilings, actual source binding and empty destination before transfer. Unlike legacy zero-means-inherit installation, this operation always uses the exact supplied rights, including zero. Reject nonzero reserved input and zero identities deterministically; mismatched target identity must produce no installed alias or new revocation lineage. Keep old producer semantics unchanged until explicitly migrated. Share the native installation implementation and split the existing near-1000-line control dispatcher by responsibility. Tests must use actual moved install grants for distinct staged children, wrong/stale generations, occupied destinations, explicit zero rights, invalid fields, denied endpoint policy, preserved source/grant custody and native lifetime/revocation behavior. Connect the new checked operation to typed Procd bootstrap provisioning; a standalone scalar codec or host-only table is not realm runtime acceptance. Complete receiver readiness, setup-authority disposal, fair terminal/provider scheduling, two-realm byte I/O and both full guest builds remain required. Process-bound native acceptance — 15 September 2026: Signed Kernel `60da5858d7198185efd103f0e91e5ac2e0b63e67` implements control operation 52, checking the actual moved install grant against expected process/generation with exact rights, including zero, under existing endpoint policies. Signed Procd `f1105706cc19ed024a6cca79a29abc57c90c6661` uses this operation in its actual ordinary launch-description producer while retaining the narrow SEND receipt, pending state and exact failure cleanup. All 162 Integration helpers pass after updating the exact policy assertion to require the new marker; its initial mismatch remains recorded. Typed realm bootstrap, mediator startup/readiness/configuration/seal, complete consumer image adoption, fair terminal/provider retirement, broader native disposal failures and both full EriX-in-EriX build generations remain open. The new inventory covers 76 repositories, 2,950 code files below 1,000 lines and 158 direct missing_docs crate-root gates; complete inline documentation and whole-codebase authority closure remain open. Owned receiver request-budget contract — 18 September 2026: Extend register-only REGISTER (0x4C) to take the actual local RECV slot, maximum request payload bytes and maximum request capability count in arguments 0–2; arguments 3–5 remain zero and successful RDX is zero. Both budget values are explicit receiver declarations. Zero/zero admits only empty requests. The byte/slot/receipt receive layout must be addressable and capability capacity must fit native private CSpace storage. The actual Running generation and held generic RECV endpoint remain the registration authority. Exact repeated registration is idempotent only with the same budget; a different budget or owner conflicts without modifying the original registration. Replacement follows the existing actual receiver-binding removal and exact native retirement rules. SUBMIT compares actual payload length and capability count against that exact registration before request allocation, private-space reservation, native transfer or invocation serial acceptance. Oversized requests return ordinary INVALID_ARGUMENT with zero owner ID and unchanged source custody. The packet decoder passes its checked capability iterator directly to native preparation, removing its redundant temporary vector. Accepted invocation, result-budget, delivery, draining and retirement contracts remain explicit. Migrate every producer and fixture to the new signature without a deprecated unbounded fallback. These budgets describe service-owned receiving storage; they add no global CALL-size ceiling, user-pointer retention, foreign selector or capability grant. Literal malformed/zero/exact registration controls, rejected-inventory checks, actual CPL3 calls and existing VM oracles are required. Then connect the owned Procd/Launchd bootstrap path through its held private route, actual claimed caller identity, server-chosen grant receipt and local relocation, retaining each committed/draining owner through exhaustive cleanup. Actual consumer VMs, complete fair realm progress and both full guest builds remain open acceptance requirements. </details> ## Tracking and rollout Related: #1, #2, lifetime design #7, [Posixd design issue 1](https://git.erikinkinen.fi/erix/posixd/issues/1), [Kernel PR 3](https://git.erikinkinen.fi/erix/kernel/pulls/3) and [Integration PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12). Sequence the ownership design, native mechanism, full request/reply capability tests, producer/consumer migration and real two-realm byte I/O. Keep ordinary source graphs coherent and never reinterpret existing reserved registers or startup fields. Remove superseded transport paths only after all owning consumers and regression gates migrate. The full build and second-generation build inside EriX remain separate phase acceptance gates. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | kernel | [issue 13](https://git.erikinkinen.fi/erix/kernel/issues/13) | </details>
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:25 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
erix/kernel#11
No description provided.