This repository has been archived on 2026-08-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
will d3495476f4
El SDK Release / build-and-release (push) Failing after 13m0s
kill: purge old-paradigm dist/platform binaries from tree
The generated C, amalgams, vendored runtime pins, and compiled binaries
from the Claude Code era are removed from the worktree. The El sources
survive; this tree is now source-only for the first-principles rebuild.

Per Principal direction 2026-08-19.
2026-08-19 19:46:15 -05:00

71 lines
2.7 KiB
Bash

#!/usr/bin/env bash
# probe07.sh — RECONSTRUCTED probe for cycle 07 P1 ("body x3 -> 21, never invoked -> 111").
#
# This file is an INPUT, not evidence. No probe asserting 21 or 111 exists in the
# tree at bc2f26d. It is modelled line-for-line on lang/tests/integration/seam_binding.sh
# as it stands at bc2f26d:
# - same prog.el (fn work() -> Int { return 7 }; main prints work())
# - same targets.c wrap target `thrice` (verbatim, incl. its comment)
# - same EL_CONSTRUCTS binding-file format: "<fn> <construct> <phase> <target>"
# - phase name "wrap" is read from el_runtime.c's el_seam_load at bc2f26d
# The only thing NOT recoverable from the tree is the "never invoked" target; the
# record names no such symbol. `never` below is invented to match the stated
# semantics (return 111 without calling the body).
#
# usage: probe07.sh <elc-binary> <lang-dir>
set -uo pipefail
ELC="${1:?usage: probe07.sh <elc-binary> <lang-dir>}"
LANG_DIR="${2:?usage: probe07.sh <elc-binary> <lang-dir>}"
WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT
SRCS=$("$LANG_DIR/../scripts/el-runtime-sources.sh" "$LANG_DIR/runtime")
CFLAGS="-std=c11 -O2 -rdynamic -I $LANG_DIR/runtime"
for d in /opt/homebrew/opt/openssl@3 /usr/local/opt/openssl@3; do
[ -d "$d" ] && CFLAGS="$CFLAGS -I $d/include" && LDFLAGS="-L $d/lib"
done
LDFLAGS="${LDFLAGS:-} -lcurl -lssl -lcrypto -lpthread -lm"
cat > "$WORK/targets.c" <<'EOF'
#include <stdio.h>
#include <stdint.h>
typedef int64_t el_val_t;
/* verbatim from seam_binding.sh at bc2f26d */
el_val_t thrice(el_val_t fn, el_val_t con, el_val_t (*b)(void*), void* e){
(void)fn; (void)con; return b(e) + b(e) + b(e); /* wrap: invoke N times */
}
/* NOT in the tree — reconstructed to match "never invoked -> 111" */
el_val_t never(el_val_t fn, el_val_t con, el_val_t (*b)(void*), void* e){
(void)fn; (void)con; (void)b; (void)e; return 111;
}
EOF
# verbatim from seam_binding.sh at bc2f26d
cat > "$WORK/prog.el" <<'EOF'
fn work() -> Int {
return 7
}
fn main() {
println(int_to_str(work()))
}
EOF
"$ELC" "$WORK/prog.el" > "$WORK/prog.c" 2>/dev/null
cc $CFLAGS -o "$WORK/prog" "$WORK/prog.c" "$WORK/targets.c" $SRCS $LDFLAGS 2>/dev/null \
|| { echo "PROBE DID NOT BUILD"; exit 1; }
echo "== baseline, no binding (work() returns 7) =="
(cd "$WORK" && ./prog 2>&1)
echo "== wrap binding -> thrice (body invoked 3x; expect 21) =="
printf 'work tripler wrap thrice\n' > "$WORK/x3.txt"
(cd "$WORK" && EL_CONSTRUCTS=x3.txt ./prog 2>&1)
echo "== wrap binding -> never (body never invoked; expect 111) =="
printf 'work skipper wrap never\n' > "$WORK/never.txt"
(cd "$WORK" && EL_CONSTRUCTS=never.txt ./prog 2>&1)
echo "== binding file contents used =="
echo "--- x3.txt"; cat "$WORK/x3.txt"
echo "--- never.txt"; cat "$WORK/never.txt"