Skip to content

Anomalous abi symbol surface - #35

Merged
bytetroll merged 3 commits into
masterfrom
anomalous-abi-symbol-surface
Nov 9, 2026
Merged

bytetroll merged 3 commits into
masterfrom
anomalous-abi-symbol-surface

Conversation

@bytetroll

Copy link
Copy Markdown
Contributor

No description provided.

bytetroll and others added 3 commits November 9, 2026 00:39
Anomalous ADR 0049 records that "Ny has no red-zone-disabling CLI
option", and that its userspace red zone "remains intact because
interrupt entry uses the separately owned TSS privilege stack". That is
their design absorbing a missing option of ours, and it only holds while
interrupt entry switches stacks; kernel-reentrant code cannot rely on
it.

nilassembler --no-red-zone marks every generated definition noredzone.
It is deliberately independent of --freestanding rather than implied by
it, because the two answer different questions: where the entry is, and
whether the 128 bytes below the stack pointer are usable. Forcing it on
for every freestanding target would pessimise exactly the configuration
ADR 0049 describes as working.

The attribute does not survive into an object, so asserting it needed
somewhere to look. nilassembler --emit-llvm writes the generated IR,
which makes the guarantee checkable instead of asserted, and is useful
on its own for seeing what the backend produced. The contract test reads
the attribute groups the definitions actually reference rather than
grepping for the word, which would also pass if a single function
carried it, and it checks the negative case so the flag is shown to be
doing the work.

Linux: 573 registered, 0 failed, 3 environment skips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A freestanding object imports exactly five symbols, but the framework
shipped no implementation of them: the existing nilruntime is hosted, so
every freestanding consumer had to supply the boundary itself or satisfy
it with stubs that fail when reached. nilruntime_freestanding supplies
it instead.

It implements nyrt_abi_version, nyrt_context_begin, nyrt_context_end,
nyrt_profile_site and nyrt_fail without libc, a kernel or an allocator,
and the built archive imports nothing: only a weak __ny_host_fail, which
a host defines to observe a failure and which defaults to stopping the
caller rather than returning into a program whose invariants are already
broken. What it deliberately does not do is allocate, format, read a
clock or touch a device; those remain a host's.

nil.freestanding-runtime proves the boundary closes rather than merely
compiles. It links the emitted object and the archive with -nostdlib and
its own _start, so a hosted toolchain cannot satisfy a symbol by
accident -- if either side still needed libc the link fails instead of
succeeding quietly on the build host -- then runs the result and
requires the process exit status to be the value Ny returned. It also
links a program that replaces the weak reporter, since a hook that
cannot be overridden would be no use to a host.

Linux: 574 registered, 0 failed, 3 environment skips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Records what the Anomalous ABI is -- rite wire types plus a mailbox and
int 0xf3 gate, so struct layout and one interrupt rather than a calling
convention -- and why every blocker was NIL-side: ADR 0049 bridged the
generated entry with a shim against its observed shape, satisfied
unconditional libc imports with fatal trap stubs, and noted Ny has no
red-zone option.

Also records the boundary. Nothing here shows a vessel booting or
issuing a rite; that needs their kernel. What the branch removes is the
reason a shim and stubs were necessary. Allocation is named as the next
real decision, since a vessel that concatenates a string needs calloc
and the freestanding runtime deliberately has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bytetroll
bytetroll merged commit 4eaee89 into master Nov 9, 2026
2 of 6 checks passed
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