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/blob/main/native/kernel/tests/fixtures/pipe/README.md # 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 branch `main` Branches Tags History `aienux / native / kernel / tests / fixtures / pipe / README.md` 34 lines ยท 2920 bytes Raw Blame History Source # Pipe primitive vectors (aienos-mv#428) Machine-checkable cases for the native pipe primitive (`native/kernel/core/pipe.c`), one file per case, read by `native/kernel/tests/test_pipe.c`. Contract: OSH_PLATFORM_ABI v1 DRAFT (aien-protocols-mv `specs/osh-platform/`, read at `fb5fca98e667`), sections 4.4, 8.1, 8.5, 8.6 and 9. Authored from that text and this kernel's choices; the choices the draft leaves open are marked UNVERIFIED in `core/pipe.h`. Plain text so the corpus can later move to `specs/osh-platform/vectors/` next to the shell-core vectors (same quoted-byte escapes as their `expected.txt`). ## File `pNNN_.vec` - `case ` and `kind positive|negative` are required. - `#` starts a comment. Tokens are separated by spaces. - `` is a double-quoted byte string: `\xHH` any byte, `\"` and `\\` themselves. NUL and bytes >= 0x80 are allowed. - Two capability tables exist, `A` and `B` (two principals), both empty at the start; the pool has 4 pipes of 65536 bytes. - Every step line is ` => [n=] [data=]`. `` is a section 8.6 name (`OK`, `DENIED`, `REVOKED`, `STALE`, `INVALID_ARG`, `LIMIT`, `INTERRUPTED`, `BROKEN_PIPE`, `NOT_SUPPORTED`, `WOULD_BLOCK`, ...). `n=` is the byte count moved (or, for `release`, the capabilities closed); `data=` the exact bytes read. command meaning `create ` PIPE_CREATE in table T; names the read and write end `write ` non-blocking STREAM_WRITE `fill ` non-blocking STREAM_WRITE of `count` copies of one byte `read ` non-blocking STREAM_READ `bread ` / `bwrite ` blocking read / write; the first time it parks, the peer runs `` (`none`, or one `write`, `read`, `close`, `revoke`, `cancel` command, which must return OK); a second park gives up INTERRUPTED (a stalled peer) `close ` STREAM_CLOSE `dup ` STREAM_DUP into table T; rights letters `r` READ, `w` WRITE, `m` MAP, `g` GRANT, `d` DERIVE, `v` REVOKE `revoke ` / `cancel ` revoke the pipe / interrupt that end `release ` close every pipe capability in table T (section 12 cleanup) `frame ...` raw platform call through the versioned op table; `` is `-` or ``; cells are hex, or `$` for a handle in register form; the peer table is the other one `check ...` `empty` (both tables and the pool hold nothing), or `=` over the pool totals: `bytes_written bytes_read writes reads max_resident would_block waits wakeups cancellations revocations broken_pipe eof refused`, and `pipes` (live pipes) A handle name keeps its value after `close`, so a later use of it tests a stale handle. Each case must end with every capability released: the runner fails a case whose tables or pool are not empty at the end of the file.