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
el-retired/docs/v1/experiments/evidence/cycles/07-invocation-is-not-composable/thunk07.sh
T
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

60 lines
2.8 KiB
Bash

#!/usr/bin/env bash
# thunk07.sh — does the recorded PROCESS FAILURE ("build failed with 'undeclared
# identifier __thunk_noargs'") correspond to any COMMITTED state?
cd /tmp/rerun-v1-07 || exit 1
echo "== 1. does the literal string __thunk_noargs appear in any committed source, anywhere in the range? =="
found=0
for c in $(git rev-list 5718943^..c04d68f); do
if git grep -q -- "__thunk_noargs" "$c" 2>/dev/null; then
echo " HIT $(git rev-parse --short=9 "$c")"; found=1
fi
done
[ "$found" = 0 ] && echo " NONE — the literal never appears in any committed file in 5718943^..c04d68f"
echo
echo "== 2. __thunk_noargs is a NAME THE COMPILER GENERATES, not source text. Where does it come from? =="
git grep -n '"__thunk_" ' bc2f26d -- lang/el-compiler/src/codegen.el
git grep -n '__thunk_' bc2f26d -- lang/el-compiler/src/codegen.el
echo
echo "== 3. in the C emitted at bc2f26d for a zero-param fn, is __thunk_noargs DECLARED before use? =="
W=$(mktemp -d)
printf 'fn noargs() -> Int {\n return 3\n}\nfn main() {\n println(int_to_str(noargs()))\n}\n' > "$W/n07.el"
/tmp/elc07b "$W/n07.el" > "$W/n07.c"
grep -n "__thunk_noargs" "$W/n07.c"
echo
echo "-- compile that C standalone, strict C11, no GNU extensions --"
cd /tmp/rerun-v1-07/lang || exit 1
SRCS=$(../scripts/el-runtime-sources.sh runtime)
CF="-std=c11 -O2 -I runtime"; LF=""
for d in /opt/homebrew/opt/openssl@3 /usr/local/opt/openssl@3; do
[ -d "$d" ] && CF="$CF -I $d/include" && LF="-L $d/lib"
done
LF="$LF -lcurl -lssl -lcrypto -lpthread -lm"
cc $CF -o "$W/n07" "$W/n07.c" $SRCS $LF 2>&1 | grep -i "thunk\|error" || echo " (no error mentioning thunk)"
"$W/n07"; echo " program exit=$? (printed value above)"
echo
echo "-- and the same emitted C under -pedantic-errors, which rejects the GNU empty-struct extension --"
cc -pedantic-errors $CF -fsyntax-only "$W/n07.c" 2>&1 | head -20 || true
echo " syntax-only rc above (empty output = clean)"
rm -rf "$W"
echo
echo "== 4. does tests/integration/seam_caller.sh exist at ANY commit in the range? =="
found=0
for c in $(git rev-list 5718943^..c04d68f); do
if git ls-tree -r --name-only "$c" -- lang/tests/integration/ 2>/dev/null | grep -q seam_caller; then
echo " HIT $(git rev-parse --short=9 "$c")"; found=1
fi
done
[ "$found" = 0 ] && echo " NONE — seam_caller.sh does not exist at any commit in 5718943^..c04d68f"
echo
echo " integration harnesses present at bc2f26d:"
git ls-tree -r --name-only bc2f26d -- lang/tests/integration/
echo
echo "== 5. does any committed file anywhere in the range assert 21 or 111 for the wrap seam? =="
git grep -n -- "thrice" bc2f26d || echo " (thrice appears nowhere at bc2f26d... )"
echo " --- grep for '21' / '111' as expected values in seam_binding.sh at bc2f26d ---"
git show bc2f26d:lang/tests/integration/seam_binding.sh | grep -n '"21"\|"111"\|21$\|111$' || echo " NONE — no assertion on 21 or 111"