Skip to content

Releases: nightwarelabz/krell

Krell v2.2

Choose a tag to compare

@nightwarelabz nightwarelabz released this 04 Nov 01:51
Immutable release. Only release title and notes can be modified.

Krell v2.2: correctness and performance release from the v2.0
development line.

Correctness

Nine bug classes present in the v2.0 and v2.1 releases are fixed:

  • the x86_64 early-return specialization skipped materializing
    entry constants and compared narrow parameters at full ABI
    width (a recursive i32 fib driven from C crashed on negative
    inputs)
  • the vector unsigned-divide path fell through to multiply when
    its operands were register-resident
  • the scalarized vector path read slot offsets of
    register-resident operands
  • extracting an f32 vector lane above 0 read the extraction
    scratch register instead of the source
  • AArch64 and RISC-V addressed single-unit vectors through
    slot offset 0 (the shared allocator register-allocates them;
    those backends treat them as memory-resident), their emitters
    lacked the dead-value filter, and an AArch64 lane load used
    the value register as the address base
  • the shared allocator's liveness recorded folded instructions'
    operand uses at the folded instruction instead of the
    consuming instruction, so a value defined in between could
    take the operand's register (the root cause of the
    long-standing fuzz seed 1 crash and seed 2 memory
    mismatches); liveness now expands folded uses recursively

With these fixes the AArch64 and RISC-V differential
batteries execute under emulation and pass 4,546 cases with
0 failures (previous releases verified code generation for
those targets but the batteries did not run to completion),
and the fuzzer is clean on all four backends.

Performance

KRELLPROOF record of 2026-11-03 (twelve kernels, timings
recorded only on checksum agreement, C is gcc 13.3 -O2):
x86_64 native geomean S 4.21x across all twelve kernels,
1.66x excluding fib; LLVM lane 4.59x / 1.58x.

Compiler work since v2.1: a Belady register allocator with
wrap-aware next-use distances and a rematerializable-victim
preference, back-edge coalescing for values whose uses are a
terminator's argument lists, loop rotation for the canonical
counted loop, an i64 gate for the two-stream reduction class,
and folded-consumption liveness in the shared allocator.

The full record -- kernels, C references, methodology,
per-run results and charts -- lives in the krellproof
repository.

Krell v2.1

Choose a tag to compare

@nightwarelabz nightwarelabz released this 03 Nov 21:38
Immutable release. Only release title and notes can be modified.

Krell v2.1 — the optimization release.

Thirteen optimization work packages over the v2.0 compiler: a parse hot loop with zero stack traffic, recurrence lowering, back-edge phi coalescing in the register allocator, and a loop vectorizer with map, copy, dot-product and widening-reduction classes (the widening reduction in scalar, word-at-a-time SWAR form). No language changes; the differential battery passes 4,546 cases with 0 failures on each lane (x86_64 native, AArch64, RISC-V, LLVM).

Performance against C (gcc 13.3, -O2) on the twelve KRELLPROOF kernels — geometric mean of per-kernel speedups, timings recorded only where checksums agree across every implementation (recorded run, 2026-11-03, AMD EPYC 9D25):

  • x86_64 native: 1.58x excluding fib (58% faster than C), 4.20x across all twelve
  • LLVM lane: 1.59x excluding fib (59% faster than C), 4.56x across all twelve

fib is quoted both ways: its recurrence lowering runs it in 25.3 ns native / 10.0 ns LLVM against 4,901,152 ns for C -O2.

Full record, kernels, C references and methodology: https://github.com/nightwarelabz/krellproof

Krell v2.0

Choose a tag to compare

@nightwarelabz nightwarelabz released this 03 Nov 04:12
Immutable release. Only release title and notes can be modified.

Krell v2.0 is the performance release: seven work packages (WP1-WP7) that take Krell's generated code from a quarter of C's speed to ahead of C -O2, plus a faster reference interpreter.

Benchmarks: KRELLPROOF twelve-kernel suite, AMD EPYC, gcc 13.3 -O2 as the opponent, geometric mean of S = T_C / T_Krell across all twelve kernels (recorded run, krellproof v2.0 branch):

  • Native backend: S = 1.117 — 11.7% faster than C -O2 (original six kernels: 1.229)
  • LLVM lane: S = 1.349 — 34.9% faster than C -O2 (original six kernels: 1.196)

What changed:

  • WP1: vector lowering for streaming loops (fill32, sumsq at the memory roofline)
  • WP2: backend code generation (register allocation, instruction selection)
  • WP3: bounded fragment superoptimization
  • WP4: call, loop, and chain overhead polish (fib and fnv1a to parity or better)
  • WP5: six new domain kernels in KRELLPROOF (dot, saxpy, copy, bytesum, parse, mix); the saxpy map shape added to the loop vectorizer and a range-check idiom in the optimizer closed the two trailing kernels
  • WP6: the LLVM lane under the same bench protocol, checksums verified
  • WP7: the reference interpreter allocates one flat arena per frame instead of one buffer per value — about 1.2x faster by paired A/B on the bench's timing drivers (fib 2.0x, sumsq 5.0x); native and LLVM code generation byte-identical to WP6

Verification: differential battery 4,546 cases, 0 failures on the x86_64 and LLVM lanes; make tests green; all bench checksums agree across every implementation. Generated code remains byte-identical across machines and backends, and the semantics remain total — no undefined behavior, by construction.

Full record: https://github.com/nightwarelabz/krellproof (v2.0 branch)

Krell v1.1

Choose a tag to compare

@nightwarelabz nightwarelabz released this 02 Nov 05:30
Immutable release. Only release title and notes can be modified.
005b907

Krell v1.1

Compiler changes since v1:

  • Surface language: forward function references resolve; function table capacity raised from 256 to 1024; block-argument capacity raised from 32 to 64, with a parse error instead of silent truncation when exceeded.
  • LLVM lane: extern functions are declared in the emitted IR, and main is emitted with the C calling convention (other functions keep the internal convention).
  • macOS: the build is clean under clang -Werror, and the strict C11 build defines the Darwin feature-test macro it needs.
  • krellc run: the interpreter now registers the standard host externs — write, read, malloc, free, atoi, sin, cos, sqrt, usleep, and kc_winsize — so programs that use externs, including the fullscreen examples, run under the interpreter.

Examples added since v1: bigbang, gyre, epicycle, krell_core, nightware_labz.

The v1 release is unchanged.

Krell v1

Choose a tag to compare

@nightwarelabz nightwarelabz released this 01 Nov 09:59
Immutable release. Only release title and notes can be modified.
1a669fb

Krell v1. A machine facing portable assembly: a typed SSA intermediate representation with a canonical binary encoding, total semantics, and a complete toolchain in C.

What is in v1:

  • Specification of the core semantics: no undefined behavior, no poison. Division by zero yields zero, overflow wraps, shifts are masked, float to int conversion saturates.
  • Canonical binary module format with explicit value ids and a SHA 256 module identity.
  • Verifier: structure, types, SSA dominance, and a per target permissibility gate driven by shipped cost tables.
  • Backends: native code generators for x86_64, AArch64, and RISC V 64, plus an LLVM lowering lane.
  • Optimizer, cost oracle, superoptimizer, fuzzer, and a reference interpreter.
  • Surface syntax for authoring modules as text.
  • Examples: sumsq, the Nebulabrot, and the Mark (the Krell symbol rendered in Krell).

Differential testing: a 4,546 case battery with zero failures across every backend, optimized and unoptimized. The LLVM lane reaches parity with or better than C -O2 on the measured kernels (fill ratio 0.31, span ratio 0.97).

License: Apache 2.0. Programs encoded in the Krell representation carry no obligations from the Krell license (the Krell Encoding Exception; see NOTICE).

This release is immutable. Development continues on the v1.1 line.