Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/issues/ecb39290b10cf3dd # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # [OSH][P0] AIENOS-NATIVE-PIPE-1: capability-controlled bounded native byte pipes Closed · #428 · open 2026-10-18 21:54 UTC · closed 2026-10-31 02:21 UTC (reason completed) Imported from GitHub aien-dev/aienux#428, by drakestapleton drakestapleton wrote on 2026-10-18 21:54 UTC ## Goal Make pipes a native AIENOS execution primitive, not merely OSH syntax: two independently scheduled operations can exchange ordered bytes without intermediate files. This issue owns the bounded stream primitive only; task execution and shell dispatch are separate child issues. Scope: OSH workstream architecture #158 ; P0 proposed within that finite workstream, NOT A MASTER PLAN or a change to `CURRENT_EXECUTION_PLAN.md`. ## Verified source baseline (2026-10-18) - `native/kernel/core/ipc.h` and `ipc.c` implement fixed-size 56-byte typed IPC messages and a bounded ring (`CK_CHAN_CAP=8`), not an ordered byte pipe with stream semantics. - `native/kernel/core/sched.h` provides a host-tested queue scheduler; scheduling wake/sleep integration is not demonstrated by that header. - `native/kernel/core/osh_op.h` is TEST-ONLY; it must not be mistaken for a production pipeline service. - OSH Platform ABI §8.1, §8.5, §9 already defines stream operations, capacity and per-effect authority checks. ## Work - Reuse capability-table/IPC ownership and generation checks; introduce a distinct pipe/byte-stream abstraction (do not silently reinterpret `ck_msg` queues as byte pipes). - Expose `PIPE_CREATE`, bounded `STREAM_READ/WRITE`, `STREAM_CLOSE`, and necessary endpoint transfer/duplication through versioned platform ops; distinguish read versus write capabilities. - Define stream epoch, reader/writer reference lifetimes, capability attenuation and revocation, and wakeups on close/revoke/cancel. Validate authority at point of effect, not only at parse/connection time. - Implement FIFO byte ordering, partial I/O, a finite buffer and observable backpressure (`WOULD_BLOCK` or blocking with scheduler progress); last-writer-close => eventual EOF, no readers => `BROKEN_PIPE`. Never allocate unbounded memory. - Handle races: both ends closed, writer blocked at capacity, reader blocked with no data, revoke while waiting, stalled consumer, handle reuse after close, and interrupted I/O. - Include host tests, QEMU negative tests, and testable metrics (max resident bytes, wakeups, waits, cancellations). No hardware or production-completion claims from host-only tests. ## Definition of done - Producer -> consumer transfers a binary payload (including NUL) byte-for-byte without a temporary file. - Actual concurrent producer/consumer with bounded memory; slow consumer backpressures producer. - EOF, BROKEN_PIPE, cancellation, revocation, and exhaustion are demonstrated with deterministic tests; no data emitted after revocation. - All capability and stream handles are released across both success and failure paths. - Exact source SHA, harness/compiler version, QEMU result and signed Spark judge evidence linked. ## Follow-on dependencies - Native task lifecycle/parallel stages, native OSH adapter, and durability/qualification need this stream primitive. - Preserve kernel recovery path independent of OSH. Follow active architectural and execution authorities. No code changes are included in this issue. No comments. Sign in to comment