✓
Passing This code compiles and runs correctly.
Code
// PINS: the serialize workload hand-rolled at ecs_bench_suite scale — 1,000
// rows dumped to ONE text artifact and parsed back into a second store, the
// values crossing as TEXT, not as projections. Serialize: per row,
// std/string:from-int renders each i64, append builds the dump in an
// owned-string buffer row ("id hp id hp ..."). Deserialize: ONE flat split
// (a nested field split trips 690_191), each token re-parsed with
// from-page + parse-int, a staging singleton pairs alternating tokens into
// insert(dst) rows — the pending id crosses through an echo tor because an
// insert literal cannot read a cell path (690_192).
//
// The oracle: dump byte length (8890 = 2890 id digits + 4000 hp digits +
// 2000 separators — digit-exact), then row count, sum(id), sum(hp), and the
// pairing sum sum(id*hp) over the REBUILT store, so a value that failed to
// survive the text, a dropped row, or a repaired pairing all break it.
//
// There is no whole-store save/load verb (the gauntlet-2 hole); this program
// is the floor a verb must beat — 40 lines of hand-rolled envelope for two
// i64 columns, and no float column can cross at all (std/string has
// parse-int/from-int only; no float mirror).
import std/io
import std/string
import std/store
tor echo { v: i64 } -> i64
echo -> v
std/store:new(src, capacity: 1000) { id: i64, hp: i64 }
std/store:new(dst, capacity: 1000) { id: i64, hp: i64 }
std/store:new(buf, capacity: 2) { text: *std/string:String<instance!> }
std/store:new(pstate) { have: 0[i64], pid: 0[i64] }
std/store:new(check) { rows: 0[i64], ids: 0[i64], hps: 0[i64], pair: 0[i64] }
for(0..1000)
! each i |> std/store:insert(src) { id: @as(i64, @intCast(i)), hp: 1000 + @as(i64, @intCast(i)) }
std/string:from-page(text: "")
| ok s |> std/string:take(s): m |> std/store:insert(buf) { text: m }
| row _ |> _
| err _ |> _
std/store:query(src)
! query r |> std/store:query(buf)
! query b |> std/string:from-int(n: r.id)
| ok t1 |> std/string:read(s: t1): x1 |> std/string:append(s: b.text, text: x1)
| ok |> std/string:append(s: b.text, text: " ")
| ok |> std/string:from-int(n: r.hp)
| ok t2 |> std/string:read(s: t2): x2 |> std/string:append(s: b.text, text: x2)
| ok |> std/string:append(s: b.text, text: " ")
| ok |> _
| err _ |> _
| err _ |> _
| err _ |> _
| err _ |> _
| err _ |> _
| err _ |> _
std/store:query(buf)
! query b |> std/string:len(s: b.text): n |> std/io:print.ln("dump bytes {{ n:d }}")
std/store:query(buf)
! query b |> std/string:read(s: b.text): dump |> std/string:split(s: dump, sep: " ")
! piece tok |> std/string:from-page(text: tok)
| ok h |> std/string:parse-int(s: h)
| ok n |> if(pstate.have == 0)
| then |> std/store:stored { pstate.pid: n, pstate.have: 1 }
| else |> echo(v: pstate.pid): pv |> std/store:insert(dst) { id: pv, hp: n }
| row _ |> std/store:stored { pstate.have: 0 }
| err _ |> _
| err _ |> _
| done _ |> _
std/store:query(dst)
! query d |> std/store:stored { check.rows: check.rows + 1, check.ids: check.ids + d.id, check.hps: check.hps + d.hp, check.pair: check.pair + d.id * d.hp }
if(check.rows > 0)
| then |> std/io:print.ln("rows {{ check.rows:d }} ids {{ check.ids:d }} hps {{ check.hps:d }} pair {{ check.pair:d }}")
| else |> _
Actual
dump bytes 8890
rows 1000 ids 499500 hps 1499500 pair 832333500
Expected output
dump bytes 8890
rows 1000 ids 499500 hps 1499500 pair 832333500
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: src, capacity: 1000, source: id: i64, hp: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: dst, capacity: 1000, source: id: i64, hp: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: buf, capacity: 2, source: text: *std/string:String<instance!>)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: pstate, source: have: 0[i64], pid: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: check, source: rows: 0[i64], ids: 0[i64], hps: 0[i64], pair: 0[i64])
flow ~for click a branch to expand · @labels scroll to their anchor
for (0..1000)
flow ~from-page click a branch to expand · @labels scroll to their anchor
from-page (text: "")
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: src)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: buf)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: buf)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: dst)
flow ~if click a branch to expand · @labels scroll to their anchor
if (check.rows > 0)
Test Configuration
MUST_RUN