✓
Passing This code compiles and runs correctly.
Code
// PINS O10.iv's HANDLE-SAFETY FLOOR (690_STORE/DESIGN.md), write half: a
// `stored` write through the handle of a row that was TAKEN traps, naming the
// store. The generational check is one compare per access; without it this
// exact program was 690_092's silent corruption — the write landed past len
// but inside capacity and nothing said a word.
//
// `a` is taken, so `nodes[a]` no longer addresses anything. The row that DID
// move into a's old dense position (200) must not receive the write — position
// is not identity (O10.iii), and a dead handle answers loudly, not by proxy.
import std/io
import std/store
std/store:new(nodes, capacity: 8) { val: i64 }
std/store:insert(nodes) { val: 100 }
| row a |> std/store:insert(nodes) { val: 200 }
| row b |> std/store:take(nodes[a])
| item gone |> std/io:print.ln("took {{ gone.val:d }}")
|> std/store:stored { nodes[a].val: 999 }
Actual
took 100
thread 173561753 panic: std/store: stale row handle into store 'nodes' - the row it addressed was removed (stale-handle trap pinned at 690_115)
???:?:?: 0x10470cc17 in _main (???)
???:?:?: 0x18eec7dff in ??? (???)
???:?:?: 0x0 in ??? (???)
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: nodes, capacity: 8, source: val: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: nodes, source: val: 100)
Test Configuration
MUST_RUN