Commit Graph
3 Commits
Author SHA1 Message Date
waozi 98f22ce6f8 Delete unreferenced compiler procedures
Nothing in Ziran, its C hosts, Kryon or the packages calls these: the
ARM unsigned-field helper and its range test, three process-runner
helpers, six LIR slice and push helpers and a source-type lookup in the
ZIR lowering, and the native cache's hit-or-miss wrapper around the
checked decoder. The generated bootstrap matches.
2026-11-15 21:19:37 -03:00
waozi 7ac6643d04 Enforce named trust-boundary validation 2026-11-15 18:27:45 -03:00
waoziandClaude Opus 5.5 40212fc992 Cache compiled native code on disk across runs
The native loader compiled every bundle once per process. It now keeps the
compiled image in $XDG_CACHE_HOME/ziran/native (or ~/.cache/ziran/native),
so a later run in another process maps it instead of compiling again.

cmd/compiler_native_cache.zi frames an image with its key (format, image
version, runtime ABI, target, CPU features, the GNU build ID of the object
holding the compiler, and the bundle's content digest), the payload
length and a SHA-256 of the payload. Decoding refuses any entry whose key,
length or digest differs, then runs MachineImageValidate. The loader writes
a private temporary file, syncs it and renames it over the entry. It removes
a damaged entry and compiles again, keeps at most 64 entries and 512 MiB,
and clears temporary files writers abandoned. Code read from disk has no
machine program, so a trap compiles once to name its site.
ZIRAN_NATIVE_CACHE=DIR moves the cache and ZIRAN_NATIVE_CACHE=off turns it
off.

native_disk_cache_cases.zi, run from the check plan, covers the cold store,
the warm hit, an abandoned writer, flipped and truncated entries refused and
replaced, the off switch, trap sites from cached code and four racing cold
runs, all matching the engine's output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 15:15:43 -03:00