Skip to content
BitNetComb / program gallery

Actual source. Actual compiler output.

A Haskell program,
drawn in ι.

One softmax function. Two views of its computation: named functions on the left, their Haskell definitions expanded on the right.

Research preview · 8 operations
Softmax shown as two iota H-trees: a compact tree with 164 iota leaves, and its full Haskell expansion with 14,150,407 iota leaves
Dots are ι. Squares are named leaves. Every branch is a function application.Inspect softmax and its leaves

Try a small example

The same source, six representations.

Follow (x + 1) * (x - 1) through the compiler outputs, then run its generated shader on your GPU. Change the input and read the result back.

scalar :: Float -> Float
scalar input = (input + 1) * (input - 1)

Compact ι keeps named functions and dictionaries. Expanded ι includes their bodies. Runtime primitives, foreign calls, and typed literals remain named.

GPU result —

Run the generated shader with this input.

Compiler outputs are built in advance. This page executes the exported WGSL; it does not compile source edits in your browser. This example downloads no model weights. WebGPU requires a supported browser and HTTPS or localhost.

How the pictures relate to the GPU

One source program. Two uses of its structure.

MicroHs compiles Haskell to combinators. We can draw that structure in iota, or lower supported combinators and array operations to GPU code.

Haskell → MicroHs combinators → ι trees

The images expose function application, dictionaries, array traversal, constructors, and recursive definitions.

Haskell → combinators → CCC / arrays → WGSL

The GPU executes generated WGSL. It does not reduce the iota pictures. The compiler supports a defined subset.

CCC means cartesian closed category: the intermediate form uses composition, products, and function application. The trit-contribution example uses the expression path; the other seven examples use direct combinator lowering.

The model behind the experiment

BitNet b1.58 2B4T

2.41B2,412,820,480 logical weight values
2.08B2,084,044,800 ternary values
30transformer layers
210ternary projection matrices

The counts come from the actual checkpoint header and packed tensor data. Ternary weights are −1, 0, or +1. They stay packed model data in the GPU implementation; this gallery draws the program functions.

Open the optional full-model experiment · explicit 1.18 GB download, plus tokenizer. The small example above needs none of this.

What is ready

A research demo you can inspect.

Checked

  • All eight expanded iota programs matched the original witness outputs byte for byte through the stock MicroHs evaluator.
  • The renderer visited every counted occurrence. Exact tree grammars and named-leaf inventories are included.
  • The small shader and five-prompt model showcase ran on a physical Apple M4 GPU in Chrome. The gallery remains readable without WebGPU.

Still experimental

  • The compiler handles a defined subset of Haskell and array operations.
  • The six-prompt full-model check matched 52/52 reference tokens. Its 1% numerical error target still fails.
  • Token agreement on this check is limited evidence. It does not establish full numerical equivalence or production readiness.

Checks recorded 28–29 October 2026. No cross-browser or cross-platform parity claim.

Keep the pictures. Inspect the source.

All images and compiler records are static files. The small live example runs locally or over HTTPS.

Compiled Haskell closure · Runnable shader · Run locally · Source revisions · Licenses and attribution