✓
Passing This code compiles and runs correctly.
Code
// Pins profiler + plural std/store:new: universal * -> * taps splice void-branch
// continuations onto terminal store declarations; store transforms must skip
// those when collecting interceptors (KORU161 on branch '').
//
// Store:new/insert lower to direct handler calls at runtime — the pin also
// runs a ordinary flow so the trace proves profiling stayed live.
[profile]import std/profiler
import std/store
import std/io
std/store:new(items, capacity: 4) { data: f64 }
std/store:insert(items) { data: 1.0 }
tor ping {}
proc ping|zig {
const std = @import("std");
std.debug.print("store profile ok\n", .{});
}
ping() |> std/io:print.ln("profiled store run complete")
Actual
store profile ok
profiled store run complete
Expected output
store profile ok
profiled store run complete
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (items, capacity: 4, source: data: f64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (items, source: data: 1.0)
flow ~ping click a branch to expand · @labels scroll to their anchor
ping
Test Configuration
MUST_RUN
Compiler Flags:
--profilePost-validation Script:
#!/bin/bash
# Validates Chrome trace: runtime flows are captured and the profiler stays
# invisible to itself. Store:new/insert compile through without KORU161.
if [ -f "koru_profile.snapshot.json" ]; then
PROFILE_FILE="koru_profile.snapshot.json"
else
PROFILE_FILE="/tmp/koru_profile.json"
fi
if [ ! -f "$PROFILE_FILE" ]; then
echo "ERROR: no trace at $PROFILE_FILE"
exit 1
fi
if ! grep -q '"traceEvents"' "$PROFILE_FILE"; then
echo "ERROR: missing traceEvents"
cat "$PROFILE_FILE"
exit 1
fi
if ! grep -q '"input:ping"' "$PROFILE_FILE"; then
echo "ERROR: input:ping transition missing"
cat "$PROFILE_FILE"
exit 1
fi
if ! grep -q '"std.io:print.ln"' "$PROFILE_FILE"; then
echo "ERROR: std.io:print.ln transition missing"
cat "$PROFILE_FILE"
exit 1
fi
if ! grep -q '^]}$' "$PROFILE_FILE"; then
echo "ERROR: JSON not closed"
cat "$PROFILE_FILE"
exit 1
fi
if grep -qE 'write-event|write-header|write-footer' "$PROFILE_FILE"; then
echo "ERROR: profiler observed itself"
cat "$PROFILE_FILE"
exit 1
fi
echo "✓ trace valid"
exit 0