Skip to content

Remove custom ARM64 JIT backend#158

Merged
danieljohnmorris merged 4 commits into
mainfrom
feature/remove-custom-jit
May 11, 2026
Merged

Remove custom ARM64 JIT backend#158
danieljohnmorris merged 4 commits into
mainfrom
feature/remove-custom-jit

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Removes the custom ARM64 JIT (--run-jit) from ilo-lang. Keeps Cranelift JIT (--run-cranelift), register VM (--run-vm), and tree-walker (--run-tree).

The custom JIT was Apple-Silicon-only, hand-rolled AArch64 codegen, supported only ~12 numeric opcodes, had no CI coverage, and every dispatch fix (PRs #150 and #154 both) had to be mirrored into it separately. Through the manifesto lens it was pure maintenance burden with no agent-token benefit: it doesn't reduce tokens for any agent program (Cranelift handles the same opcodes and more, faster), it just multiplies our surface area for future fixes.

~1,148 net lines removed across 8 files, with no functional regression for any program ilo can run.

What's in the diff

  1. vm: remove custom ARM64 JIT backend — deletes src/vm/jit_arm64.rs (627 lines) and the pub mod declaration; strips --run-jit from the CLI surface (Cli::args, Engine::Jit, dispatch arm, manual arg parser, help text); removes the arm64 bench code paths in run_bench; drops 13 run_jit: false defaults from unit-test struct literals. Gates jit_args/all_numeric behind #[cfg(feature = "llvm")] since LLVM is their only remaining consumer.

  2. tests: drop ARM64 JIT-specific cases — removes the 19 run_jit_arm64_* tests in tests/eval_inline.rs and 2 run_jit_* tests in tests/cli_integration.rs. Their arithmetic-correctness coverage is already provided by the parallel Cranelift and VM test variants in the same files.

  3. examples + test harness: remove engine-skip jit references — drops -- engine-skip: jit directives from 11 example files (now silent no-ops since the jit engine name is no longer iterated) and removes the unreachable engine.name == "jit" branch from tests/examples_engines.rs.

  4. docs: relabel ilo JIT row to Cranelift in perf table — the row's string/record/file/api columns held real numbers the custom JIT cannot produce, so the figures were Cranelift's, mislabeled. Relabel rather than remove so the row continues to carry the JIT-tier perf comparison readers expect.

Breaking change

--run-jit is no longer a known flag. Acceptable for a 0.x language. Users wanting JIT compilation should use --run-cranelift (the default JIT engine), which is faster and supports the full opcode set.

Test plan

  • cargo test --release --features cranelift — full suite green
  • cargo fmt --all -- --check clean
  • cargo clippy --all-targets -- -D warnings clean (default features)
  • cargo clippy --all-targets --features cranelift -- -D warnings clean
  • CLI spot-check: --run-tree, --run-vm, --run-cranelift all return correct output for f x:n>n;*x 2 with arg 5
  • --run-jit is no longer accepted (returns arity error via trailing-var-arg, same behaviour as any unknown flag in that position)
  • Code-reviewed by subagent; should-fix findings addressed (all_numeric cfg-gating, stale engine-skip cleanup)

Why now

Two recent PRs (#150 slc/mset, #154 friendly errors) each had to mirror dispatch changes into three engines: VM, Cranelift, and the custom ARM64 JIT. The custom JIT was the highest-friction surface and the lowest-leverage backend. Removing it makes every future ilo-lang fix smaller.

The custom JIT was Apple-Silicon-only, hand-rolled AArch64 codegen,
supported only ~12 numeric opcodes, had no CI coverage, and every
dispatch fix (PRs #150 and #154) had to be mirrored into it
separately. Through the manifesto lens it was pure maintenance
burden with no agent-token benefit. Cranelift JIT covers everything
the arm64 backend did and more, faster.

Removes the src/vm/jit_arm64.rs module (627 lines), the pub mod
declaration, the --run-jit CLI flag, the Engine::Jit enum variant,
the run_jit_engine dispatch arm, the manual --run-jit arg parser
entry, the help-text line, the arm64 bench code paths in run_bench
including the "Custom JIT (arm64)" comparison output, and 13
run_jit: false defaults from struct literals in unit tests.

Gates jit_args and all_numeric in run_bench behind
#[cfg(feature = "llvm")] since LLVM is now their only consumer.

Breaking change: --run-jit is no longer a known flag. Acceptable
for a 0.x language; users wanting JIT compilation should use
--run-cranelift (the default JIT) which is faster and supports
the full opcode set.
Removes the 19 run_jit_arm64_* tests in eval_inline.rs that
exercised the now-deleted custom JIT path, plus the two
run_jit_* tests in cli_integration.rs that asserted on the
flag's error behaviour. The cases that tested arithmetic
correctness are already covered by the Cranelift and VM
engines via the parallel test variants in the same files.

Also simplifies two bench helpers that pattern-matched on
"Custom JIT" output, leaving them checking only "Cranelift JIT".
The jit engine is no longer iterated in the example harness, so the
-- engine-skip: jit directives in 11 example files were silent
no-ops. Removed them (deleting the line entirely where jit was the
only entry, narrowing where vm was also listed).

Also dropped the unreachable engine.name == "jit" branch in
tests/examples_engines.rs that handled the "not eligible" error
the custom JIT used to emit.
The row's string, record, file, and api columns held real numbers
which the custom ARM64 JIT physically cannot produce (it supported
only numeric opcodes). The figures were Cranelift's, mislabeled.
Relabel rather than remove so the row continues to carry the
JIT-tier perf comparison readers expect.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 79bae4b into main May 11, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/remove-custom-jit branch May 11, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant