localharness 0.78.0

Agents that own themselves: one Rust crate that's both an agent SDK (streaming, tools, hooks, policies, triggers, MCP) and a wallet-owning, self-sovereign agent that runs in the browser.
Documentation
1
2
3
4
5
6
7
8
9
10
11
{
  "id": "265",
  "prompt": "Grow a bell curve live: every other frame flip 8 coins by taking 8 bits from an LCG, count the heads with a popcount helper fn, and increment that bin - a Galton board without animating the ball. Nine bin counts and the total live in state slots; when a bin hits the ceiling halve everything so the histogram keeps its shape but stays on screen. Draw the nine labeled bars (digits under each) and the running ball count, and binomial(8, 1/2) should emerge within seconds.",
  "solution_rl": "fn bits8(v: i32) -> i32 {\n    let mut n: i32 = 0;\n    let mut x: i32 = v & 255;\n    let mut i: i32 = 0;\n    while i < 8 {\n        n = n + (x & 1);\n        x = x >> 1;\n        i = i + 1;\n    }\n    n\n}\n\nfn frame(t: i32) {\n    let w: i32 = host::display::width();\n    let h: i32 = host::display::height();\n    if host::display::state_get(0) == 0 {\n        host::display::state_set(0, 1);\n        host::display::state_set(2, 20260730);\n    }\n    if t % 2 == 0 {\n        let seed: i32 = host::display::state_get(2) * 1103515245 + 12345;\n        host::display::state_set(2, seed);\n        let b: i32 = bits8(seed >> 12);\n        let cnt: i32 = host::display::state_get(8 + b) + 1;\n        host::display::state_set(8 + b, cnt);\n        host::display::state_set(3, host::display::state_get(3) + 1);\n        if cnt > 360 {\n            let mut i: i32 = 0;\n            while i < 9 {\n                host::display::state_set(8 + i, host::display::state_get(8 + i) / 2);\n                i = i + 1;\n            }\n            host::display::state_set(3, host::display::state_get(3) / 2);\n        }\n    }\n    host::display::clear(0x0c0c0e);\n    let bw: i32 = 44;\n    let x0: i32 = (w - bw * 9) / 2;\n    let base: i32 = h - 60;\n    let mut i: i32 = 0;\n    while i < 9 {\n        let c: i32 = host::display::state_get(8 + i);\n        let mut bh: i32 = c;\n        if bh > 360 { bh = 360; }\n        host::display::fill_rect(x0 + i * bw, base - bh, bw - 3, bh, 0x60a0d0);\n        host::display::draw_number(x0 + i * bw + 14, base + 10, i, 0x808080, 1);\n        i = i + 1;\n    }\n    host::display::draw_string(x0, 20, \"HEADS IN 8 FLIPS\", 0x808080, 1);\n    host::display::draw_string(x0, 36, \"BALLS\", 0x606060, 1);\n    host::display::draw_number(x0 + 60, 36, host::display::state_get(3), 0xffffff, 1);\n    host::display::present();\n}\n",
  "tags": [
    "simulation",
    "probability",
    "prng",
    "state"
  ]
}