✓
Passing This code compiles and runs correctly.
Code
// Pins profiler + multiline conditional import gate: a vertical annotation
// block with `- profile` must keep std/profiler when --profile is passed,
// and runtime profiling must emit a valid Chrome trace (510 pins inline form;
// 310_104 pins the gate with a tap module but not std/profiler trace).
~import std/io
~[
- profile
Tracing is opt-in; std/profiler rides along only when asked for.
]import std/profiler
~tor ping {}
~proc ping|zig {
const std = @import("std");
std.debug.print("multiline profile ok\n", .{});
}
~ping() |> std/io:print.ln("multiline profiler run complete")
Actual
multiline profile ok
multiline profiler run complete
Expected output
multiline profile ok
multiline profiler run complete
Flows
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: multiline [profile]import kept std/profiler live.
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