Stage 7 — CPU demos

Copy Markdown View Source

Verdict on this Mac: PASS. Linux: PENDING.

scripts/demo-cpu.sh prints the oracles in E24.

LineMeaning
oracle 42add(20, 22). Not a speed claim.
copy {:ok, <<1, 2, 3>>, 3}three payload bytes copied
borrow {:ok, 32, 1}one data pointer, seen twice
filledfour 0x07 bytes written into the binary OTP allocated
frozen <<4, 9>> token 1in-place poke, then a resource binary, same token
retainedbinary copied into an env, then read
dirty_burn_us 49568about 50 ms of dirty CPU, including the Elixir call
warm_add_us 4one warm add/1 pair. A single sample, not a distribution.

Cold compile time is whatever mix compile spent on mojo build when the fingerprint was stale. This run's demo itself did not recompile Mojo.

Diagnostic path when a call fails: the Elixir stub in lib/mojoler/, the wrapper in native/ or native/generated/, the user file in native/examples/ if it is a DSL entry, then mojo build --emit llvm on that file, then scripts/inspect-abi.sh for nm and otool or ldd. A trap belongs in scripts/probe-abort.sh, not in the test VM. Sanitizers were not run.