linkedstate

command
v0.7.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command linkedstate measures what happens when retained E5RT state flows through a pipeline-style link: two separately compiled functions encoded in one stream whose state inout ports share one buffer object.

e5rt.Pipeline links an earlier stage's output buffer to a later stage's input by binding both ports to the same buffer object. Nothing exercises the same sharing for state ports, and the state is exactly where a silent corruption hides: examples/ane/statecache found that each channel of a bound state starts on a 64-byte boundary, so two functions declaring different shapes can share a buffer while addressing different offsets for the same element. The ordinary link path shares buffers by construction, which means neither the Go side nor a size check sees the disagreement — only the engine's addresses matter.

This command binds the shared buffer by hand, the way the pipeline would, and measures three things.

Arms

  • Baseline. An accumulate-state function and a separately compiled reader of the same shape share the state buffer inside one stream. Each synchronous execution advances the state by one update and the reader reports it; the sequence must follow a float64 recurrence exactly, in fp16-exact arithmetic, checked after every step. This establishes that the composition itself behaves before anything leans on it.

  • Layout oracle. With the shared buffer filled with self-indexing marks, a reader reports which host slot each element came from. The result must equal the e5rt.StateLayout prediction — the documented layout has to hold for a link-shared binding, not only for a singly-bound one.

  • Mismatch control. An accumulator of shape [1, 2, 1, 8] and a reader of shape [1, 4, 1, 4] share the buffer. Both layouts predict the same physical addresses for every element position where their views overlap: channel c starts at byte c*64 in either shape, so the reader should see the writer's first two channels laid out flat across four of its own, and zeros wherever the writer never wrote. If the runtime instead normalized, padded, or reordered the shared state, the observed values would diverge from that prediction and the command fails — silently corrupting is the failure mode this whole program exists to rule out.

What is claimed and what is not

Measured here: fp16 states on macOS on this machine, rank-4 shapes with a leading extent of 1, and sharing implemented as two operations in one stream. Element types other than fp16, other ranks, and any behavior across separate streams are outside the claim. The poison tail on every shared buffer keeps any past-the-end engine write observable even where a check above does not name it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL