Skip to content

Karkain v1.2.0 — Native Independence

Latest

Choose a tag to compare

@ajit-ai ajit-ai released this 14 Nov 04:24
· 194 commits to main since this release
77d7069

Karkain 1.2.0 (Stable) — Release Notes

Status: Stable release line. Theme: Sovereignty I — Off C, Off Go.

Release provenance (read first)

The 13 release archives attached to this release were built locally on a
Windows host from the existing tagged commit
(v1.2.0, tag object
e900c91e485fc316f52b664228f6c35f25416436, peeled commit
77d70693e1e3134dac312a303bffafa7d50fa988), using Go 1.21.13 — the Go
version the CI workflow pins — with CGO_ENABLED=0, GOARM=7 for
linux/arm, and the CI build flags (-ldflags="-s -w"). Checksums were
independently verified against the published checksums.txt.

GitHub Actions could not execute the release matrix: the account was
subject to a billing/payment restriction, so the tag-triggered workflow
(run 43374786565, 2026-11-14) had its Build jobs rejected before they
started and did not complete successfully. This is a locally built and
published release. It is NOT a CI-green release.

Karkain 1.2.0 is the release in which the C-free native targets are
produced by the self-hosted compiler — by the compiler Karkain itself is
written in — with no C compiler and no Go toolchain on PATH:

karkain build --target native-x86_64-linux   main.kark   # a Linux ELF
karkain build --target native-x86_64-windows main.kark   # a Windows PE
karkain build --target native-x86_64-macos   main.kark   # a Mach-O PIE

All three targets are owned by the same whole-program driver, so the three
containers cannot disagree about a program's frame, its rodata interning or
its refusals. Nothing refuses with error[K116] any more.

What changed since 1.1.0

  • The native VALUE MODEL in the self-hosted engine — arrays, the heap
    arena, string operations (concatenation, records, maps), push, and
    float64. Every construct outside the qualified subset is refused by
    name
    , with no image.
  • The self-hosted engine's own machine-code ENCODER and the ELF, PE and
    Mach-O container writers, plus the whole-program driver that emits a
    linked image without a C compiler.
  • The native milestones, each with its own gate: NAT-CALL (user
    functions), NAT-IF (branches), NAT-QUAL (the qualification), NAT-LOOP
    (loops, break/continue), NAT-IDX (array indexing and the bounds
    diagnostic), NAT-FRAME (the frame layout against the Go oracle's),
    NAT-STR-STAGE (the string staging area), NAT-RODATA (the reporter's
    read-only data) and NAT-REG (register allocation).
  • Register allocation (NAT-REG) — int locals can live in callee-saved
    registers instead of frame slots. A port of the oracle's Phase-150C
    allocator, not a new design. The switch is KARKAIN_NATIVE_REGALLOC=1
    and the default is the stack-based path, which is the qualified
    implementation; the register path becomes the default only after it has
    passed the complete qualification suite.
  • Bitwise operators (&, |, ^, <<, >>) on both engines, with
    defined behaviour at every edge instead of inheriting C's undefined
    behaviour (151P0 — a soundness fix in the shipped 1.1.0 line).
  • The runtime-error model on the native target: the array-bounds
    failure reports runtime error: array index out of range at <file>:<line>
    instead of an Int3 trap (152-B0).
  • The version identity is unified at 1.2.0 across VERSION, both Go
    banners, the three kcc banners, the six generated headers, the LSP server
    and the installation scripts.

Compatibility

Every 1.1.0 program builds and runs identically. The surface change is
strictly additive. The one behavioural change is that the C-free native
targets are now produced by the self-hosted engine.

Known limitations (honest, and each one is refused by name)

  • No Mach-O image has been executed. This repository has no macOS
    runner and no Intel-Mac host in its history, so every Mach-O claim is
    structural — a real PIE with MH_PIE, a writable __DATA arena and a
    decodable rebase stream, validated but not run.
  • The PE is not byte-identical to the Go oracle's. The two engines have
    separate Windows bootstrap implementations, which is why the byte-identity
    differential compares the Linux ELF.
  • Two byte-layout differences remain: the reporter's read-only data
    differs by 39 bytes in one fixture, and the field-assignment code by 25
    bytes, because the oracle stages the pair through the string staging area
    and the self-hosted driver does not. Neither changes what a program
    prints.
  • Refused by name in the native driver: float64 statements, parameters
    and returns; for ... in; map literals; string equality and slicing; a
    string literal inside a branch or a loop body; a string in a callee;
    non-integer array elements.
  • The arena bound is compile-time, so an allocation inside a loop is
    refused rather than silently exhausting the arena.
  • The self-hosted compiler's three-stage self-bootstrap closure is not
    re-proven in this release.
    Closure conditions 5 (stage2 == stage3) and
    6 (no Go toolchain for that closure) were carried to v1.3.0 as UNMET by an
    owner-authorized amendment (2026-10-29); closure conditions 2
    (stdlib_v2 no-C) and 3 (std.net no-C) likewise (2026-10-10). The
    condition text is unchanged and the effective v1.2.0 gate is conditions
    1, 4, 7 and 8.
  • Register allocation is opt-in and no performance improvement is
    claimed
    for it: the measured sizes are recorded and they are mixed.
  • Not claimed: end-to-end self-hosting/bootstrap closure; native
    stdlib_v2 call support; native std.net socket support; Mach-O
    execution qualification; full native/Go oracle byte parity; register
    allocation performance improvements.

Verifying the release

Download the archive for your platform, verify SHA-256 against the published
checksums.txt (these checksums were produced by the publisher and identify
the locally built archives listed above), then run:

karkain --version   # Karkain Compiler v1.2.0 (..., Stable Build)

The installation guide is docs/source/getting-started/installation.rst;
the authoritative qualification report with the full evidence is
docs/audit/KARKAIN-V1.2.0-GA-QUALIFICATION.md; the release notes are
docs/release/KARKAIN-1.2-RELEASE-NOTES.md.