✓
Passing This code compiles and runs correctly.
Code
// Probe: kernel:init nested under a continuation, WITH step/pairwise/self
// fusion + a | computed branch — same shape as top-level 390_090 but the
// init is not the top-level invocation. Determines whether the non-top-level
// fusion path reproduces the dead-branch duplicate.
~import std/kernel
~import std/io
~std/kernel:shape(Body) {
v: f64,
acc: f64,
}
~event get-count {}
| n u32
~proc get-count|zig {
return .{ .n = 3 };
}
~get-count()
| n _ |> std/kernel:init(Body) {
{ v: 1, acc: 0 },
{ v: 2, acc: 0 },
{ v: 3, acc: 0 },
}
| kernel k |> std/kernel:step(0..2)
| step |> std/kernel:pairwise {
const s = k.v + k.other.v;
k.acc += s;
k.other.acc += s;
} |> std/kernel:self {
k.v += k.acc;
}
| computed c |> std/io:print.blk {
v0={{ c[0].v:f }}
}
Actual
v0=53
Expected output
v0=53
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# Structural pin for the NESTED kernel-fusion path (init under a continuation).
# Mirrors 390_090's top-level pin: after fusion folds into `.computed`, the
# consumed `| kernel` continuation must not survive as a dead `.kernel =>` arm
# holding a duplicate of the fused loops.
set -u
fail=0
copies=$(grep -c 'const s = ' output_emitted.zig)
if [ "$copies" -ne 1 ]; then
echo "FAIL: fused pairwise body emitted ${copies}x (expected 1) — nested fusion left a dead duplicate"
fail=1
fi
if grep -q '\.kernel =>' output_emitted.zig; then
echo "FAIL: dead '.kernel =>' arm present — nested path didn't drop the consumed kernel continuation"
fail=1
fi
exit $fail