Skip to content

Commit 94a6b51

Browse files
committed
the sandbox verification gains the two sections this release adds
G reads an object file, because a code-generation property is in no `-dM` dump — which is why the token it asserts was a silent no-op for the whole of its first life. On 2026.9.21.2 the aarch64-macos link fails outright, so a failed build there is the negative reading rather than an absent one. H asserts `--no-run`; before this release the flag does not exist. Dry-run on the host against both engines: both sections pass on this one and fail on the previous, which is the property a CHANGE section has to have.
1 parent 2786463 commit 94a6b51

1 file changed

Lines changed: 93 additions & 0 deletions

File tree

.agents/docs/2026-09-21-macros-and-withdrawal-verify.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,99 @@ else
297297
skip "openkal-llvm-runtime 0.14.0 did not resolve from the index"
298298
fi
299299

300+
# ── CHANGE. `builtins = "iso"` withdraws the Apple pattern fill ─────────────
301+
section "G. builtins = \"iso\" emits -fno-builtin (CHANGE)"
302+
# A CODE-GENERATION PROPERTY, so the reading is an object file rather than a
303+
# `-dM` dump — which is exactly why the token this asserts was a silent no-op
304+
# for the whole of its first life. `2026.9.21.2` and earlier emit
305+
# `-fno-builtin-memset_pattern16`; clang matches `-fno-builtin-<fn>` against
306+
# its builtin table, `memset_pattern16` is an LLVM TargetLibraryInfo libfunc
307+
# and not in it, so the flag is accepted in silence and the call survives. On
308+
# those versions the aarch64-macos link fails with
309+
#
310+
# ld64.lld: error: undefined symbol: memset_pattern16
311+
#
312+
# so a failed build here IS the negative reading rather than an absent one.
313+
g="$root/g"; rm -rf "$g"; mkdir -p "$g/src"
314+
cat > "$g/src/main.cpp" <<'EOF'
315+
extern "C" void fill(int* a, long n) {
316+
for (long i = 0; i < n; ++i) a[i] = 0x01020304;
317+
}
318+
int main() { static int buf[64]; fill(buf, 64); return buf[0] == 0x01020304 ? 0 : 1; }
319+
EOF
320+
# `-O2` per package rather than --release: the idiom pass does not run at the
321+
# dev profile's -O0, and a release build would compile the runtime a second
322+
# time in a second profile for no reading.
323+
cat > "$g/mcpp.toml" <<'EOF'
324+
[package]
325+
name = "builtins-probe"
326+
version = "0.1.0"
327+
328+
[build]
329+
cxxflags = ["-O2"]
330+
331+
[dependencies]
332+
openkal-llvm-runtime = "0.15.0"
333+
334+
[toolchain]
335+
default = "llvm@22.1.8"
336+
EOF
337+
gnm=$(ls "$HOME"/.xlings/data/xpkgs/xim-x-llvm/22.1.8/bin/llvm-nm 2>/dev/null | head -1)
338+
if [ -z "$gnm" ]; then
339+
skip "G: no llvm-nm in the payload to read the object with"
340+
elif (cd "$g" && "$STORE" build --target aarch64-macos >/dev/null 2>&1); then
341+
gobj=$(find "$g/target" -name 'main.o' 2>/dev/null | head -1)
342+
if [ -z "$gobj" ]; then
343+
fail "G: the build reported success and produced no object"
344+
elif [ "$("$gnm" -u "$gobj" 2>/dev/null | grep -c memset_pattern16)" = 0 ]; then
345+
ok "builtins = \"iso\" leaves no memset_pattern16 in the object"
346+
else
347+
fail "builtins = \"iso\" did not withdraw memset_pattern16"
348+
fi
349+
else
350+
fail "G: the aarch64-macos build did not complete (the old token's signature)"
351+
fi
352+
353+
# ── CHANGE. `mcpp test --no-run` ────────────────────────────────────────────
354+
section "H. mcpp test --no-run builds the tests and says so (CHANGE)"
355+
# Before this release the flag does not exist and the command exits non-zero
356+
# with "unknown option: --no-run". The runner named here is a program that
357+
# does not exist, which produces "tests built, nothing run" on every host for
358+
# the native target with nothing installed.
359+
h="$root/h"; rm -rf "$h"; mkdir -p "$h/tests"
360+
printf 'int main() { return 0; }\n' > "$h/tests/alpha.cpp"
361+
printf 'int main() { return 0; }\n' > "$h/tests/beta.cpp"
362+
printf '[package]\nname = "norun"\nversion = "0.1.0"\n' > "$h/mcpp.toml"
363+
hhost=$("$STORE" --print-target 2>/dev/null || true)
364+
if [ -z "$hhost" ]; then
365+
(cd "$h" && "$STORE" build >/dev/null 2>&1) || true
366+
hhost=$(ls "$h/target" 2>/dev/null | grep -v '^\.' | head -1)
367+
fi
368+
if [ -z "$hhost" ]; then
369+
skip "H: could not determine the host triple"
370+
else
371+
cat > "$h/mcpp.toml" <<EOF
372+
[package]
373+
name = "norun"
374+
version = "0.1.0"
375+
376+
[target.$hhost]
377+
runner = ["mcpp-no-such-runner-exists"]
378+
EOF
379+
hout=$( (cd "$h" && "$STORE" test --target "$hhost" --no-run 2>&1) )
380+
hrc=$?
381+
case "$hout" in
382+
*"2 built, not run"*)
383+
if [ "$hrc" = 0 ]; then
384+
ok "--no-run builds the tests and exits 0"
385+
else
386+
fail "--no-run reported the built tests and exited $hrc"
387+
fi ;;
388+
*) fail "--no-run did not report two tests as built" ;;
389+
esac
390+
fi
391+
392+
300393
printf '\n-- summary --\nfails=%d\nnot run:%s\n' "$fails" "${skipped:-
301394
(none)}"
302395
[ "$fails" -eq 0 ]

0 commit comments

Comments
 (0)