Skip to content

0.12 — the unit a caller cannot name, and where a permission would have gone - #27

Merged
Sunrisepeak merged 2 commits into
mainfrom
a-unit-a-caller-cannot-name
Aug 31, 2026
Merged

0.12 — the unit a caller cannot name, and where a permission would have gone#27
Sunrisepeak merged 2 commits into
mainfrom
a-unit-a-caller-cannot-name

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Two things a reader had to discover by writing code, and one module that was
generated for two versions without ever being imported.

Clause 11 entry 9 now names what it costs. It already said handles do not
cross an address space; it did not say what follows for units. A unit is
established by whoever starts a program, at the moment of starting it, so a
program cannot name a unit a COPY of itself went on to form — the copy's handle
is built from an index into the copy's own table (clause 6.7) and nothing
conveys it back. ⚠️ The failure this produces is not a refusal: an
implementation that meets the dead end is invited to reach for the nearest unit
it can name, which is its own. openkal-musl 0.12.0 did exactly that, and every
negative identifier that matched no child named the caller's own unit — an
enquiry about a unit that did not exist was answered yes, and a signal aimed at
one ended the caller together with everything it led. The entry records it so
the next implementation meets it here instead.

kal_fs_open and kal_fs_mkdir now point at entry 6. The cross-reference
existed at KAL_INFO_IDENTITY and kal_fs_lock — not at the two operations
that CREATE, which is where somebody wanting a private file looks. It is a
position and not a gap, and the position is WASI's: fs_rights_base attaches
to a handle and not to a file, and the analogue here is the flag word open
already takes.

openkal.macros had the defect it was added to prevent. It exists
because a macro does not cross a module boundary, and CI regenerates it and
diffs it — which asserts the file is up to date and never asserted that anybody
can use it. Nothing in this ecosystem had ever imported it. macros_reach.cpp
is the first consumer; it runs nothing and fails the build both when a name
does not resolve and when a value is wrong.

…ve gone

Two things a reader had to discover by writing code, and one module that was
generated for two versions without ever being imported.

**Clause 11 entry 9 now names what it costs.** It already said handles do not
cross an address space; it did not say what follows for units. A unit is
established by whoever starts a program, at the moment of starting it, so a
program cannot name a unit a COPY of itself went on to form — the copy's handle
is built from an index into the copy's own table (clause 6.7) and nothing
conveys it back. ⚠️ The failure this produces is not a refusal: an
implementation that meets the dead end is invited to reach for the nearest unit
it can name, which is its own. openkal-musl 0.12.0 did exactly that, and every
negative identifier that matched no child named the caller's own unit — an
enquiry about a unit that did not exist was answered yes, and a signal aimed at
one ended the caller together with everything it led. The entry records it so
the next implementation meets it here instead.

**`kal_fs_open` and `kal_fs_mkdir` now point at entry 6.** The cross-reference
existed at `KAL_INFO_IDENTITY` and `kal_fs_lock` — not at the two operations
that CREATE, which is where somebody wanting a private file looks. It is a
position and not a gap, and the position is WASI's: `fs_rights_base` attaches
to a handle and not to a file, and the analogue here is the flag word `open`
already takes.

**⭐ `openkal.macros` had the defect it was added to prevent.** It exists
because a macro does not cross a module boundary, and CI regenerates it and
diffs it — which asserts the file is up to date and never asserted that anybody
can use it. Nothing in this ecosystem had ever imported it. `macros_reach.cpp`
is the first consumer; it runs nothing and fails the build both when a name
does not resolve and when a value is wrong.
⚠️⚠️ A FALSE RED, AND THE WORST SHAPE A CHECK CAN HAVE: it fired once and
passed on a re-run with nothing changed between them. openkal-macos was told
`exported name is not in the specification: kal_stdin` --- the twenty-seventh
line of SURFACE.txt.

`grep -q` exits at the FIRST match, closing the pipe under a `printf` that is
still writing. The printf dies of SIGPIPE, and `pipefail` at the top of the file
turns that into a failed pipeline, which the `!` inverts into a report that the
name is absent. Whether it fires depends on whether the list drains into the
pipe buffer before grep exits, so an EARLY match --- the case with the most left
to write --- is the likely one. Reproduced deterministically by lengthening the
list.

Both occurrences become here-strings. The second is in the --complete path,
where the same SIGPIPE would UNDER-COUNT what is exported and report a whole
interface as half of one --- which is the check that exists to catch exactly
that, reporting it about a conforming implementation.
@Sunrisepeak
Sunrisepeak merged commit 26e32ec into main Aug 31, 2026
12 checks passed
@Sunrisepeak
Sunrisepeak deleted the a-unit-a-caller-cannot-name branch August 31, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant