✓
Passing This code compiles and runs correctly.
Code
// Pins profiler + comptime event taps (310_006): tap(hello -> *) must still
// fire when [profile]import std/profiler + --profile are active — opaque
// profiler instrumentation must not hide transitions from user-authored taps.
const std = @import("std");
~import std/taps
~import std/io
~[profile]import std/profiler
~tor hello {} -> string
~proc hello|zig {
std.debug.print("Main flow executed\n", .{});
return "go";
}
~tor tap-action {}
~proc tap-action|zig {
std.debug.print("TAP observed!\n", .{});
}
~tap(hello -> *): v |> tap-action()
~hello() |> std/io:print.ln("profiled tap run complete")
Actual
Main flow executed
TAP observed!
profiled tap run complete
Expected output
Main flow executed
TAP observed!
profiled tap run complete
Flows
flow ~tap click a branch to expand · @labels scroll to their anchor
tap (hello -> *)
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN
Compiler Flags:
--profilePost-validation Script:
#!/bin/bash
# Validates Chrome trace: user tap + profiler both 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:hello"' "$PROFILE_FILE"; then
echo "ERROR: input:hello 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