Skip to content

feature: rename --run-cranelift/--cranelift to --jit (clean break)#392

Merged
danieljohnmorris merged 5 commits into
mainfrom
feature/rename-cranelift-to-jit
May 18, 2026
Merged

feature: rename --run-cranelift/--cranelift to --jit (clean break)#392
danieljohnmorris merged 5 commits into
mainfrom
feature/rename-cranelift-to-jit

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Renames the user-facing JIT opt-in flag from the implementation name (Cranelift) to the concept (JIT). The internal Engine::Cranelift variant and the jit_cranelift / compile_cranelift module names are unchanged - the rename is purely a CLI surface change.

Clean break, no back-compat aliases. --run-cranelift and --cranelift are removed entirely; they now fall through to the unknown-flag guard (#366) and are rejected with the standard error: unrecognised flag '<flag>' message plus exit 1. Agents who reach for the old names get an immediate clean signal instead of silent fallthrough or quiet positional consumption.

Rationale: shorter (1 token vs 4 token-pieces), industry-standard (every JIT runtime in the wild is just called "the JIT"), and doesn't lock the spelling to a specific backend - if we ever swap Cranelift for something else, the user surface stays stable.

Repro before/after

Before (#390 baseline):

$ ilo --cranelift 'main x:n>n;+x 1' main 5      # ok
$ ilo --run-cranelift 'main x:n>n;+x 1' main 5  # ok

After this PR:

$ ilo --jit 'main x:n>n;+x 1' main 5            # ok -> 6
$ ilo --run-cranelift ...                       # error: unrecognised flag '--run-cranelift'
$ ilo --cranelift ...                           # error: unrecognised flag '--cranelift'

What is in the diff

  • cli: rename --run-cranelift/--cranelift to --jit (clean break) - clap arg + dispatcher + help text + struct field (run_cranelift -> jit). 5 files in src/.
  • tests, examples: sweep --run-cranelift/--cranelift to --jit - mechanical sed pass across all tests/ and examples/ (~470 sites). One test in regression_default_engine_is_vm.rs was rewritten because the original (alias parity check) became a no-op after the sweep.
  • docs: sync SPEC + ai.txt + SKILL.md for --jit rename - SPEC.md by hand; ai.txt + SKILL.md auto-gen block via build.rs.
  • test: pin --jit canonical, old spellings rejected - new tests/regression_jit_flag_canonical.rs with three cases: --jit runs; --run-cranelift rejected; --cranelift rejected.

Test plan

  • cargo build --features cranelift passes
  • cargo clippy --features cranelift --all-targets -- -D warnings passes
  • cargo fmt clean
  • cargo test --release --features cranelift - full suite green (every prior test that used --run-cranelift / --cranelift got swept to --jit)
  • New regression test passes (3/3 cases)
  • No --run-cranelift or --cranelift strings remain in src/, tests/, examples/, SPEC.md, README.md, ai.txt, or skills/ilo/SKILL.md (only tests/regression_jit_flag_canonical.rs references them as test fixtures asserting rejection)

Follow-ups

  • site repo has its own changes for docs/reference/cli.md + docs/reference/benchmarks.md, committed separately (no CI on the site).

The user-facing JIT opt-in flag now names the concept (JIT) rather than the
implementation (Cranelift). Internal Engine::Cranelift variant and the
jit_cranelift / compile_cranelift module names are unchanged - the rename is
purely a CLI surface change.

No back-compat aliases: the old spellings fall through to the unknown-flag
guard (#366) and are rejected with the standard 'unrecognised flag' error
plus exit code 1. Agents that reach for the old names get a clean signal
instead of silent fallthrough.
Mechanical sed sweep across all test files and example programs.

regression_default_engine_is_vm.rs: replaced the now-meaningless
'cranelift_alias_matches_run_cranelift' parity check (which compared
two identical --jit invocations after the sweep) with a smaller
'jit_flag_runs_numeric' smoke test for the new flag spelling.
SPEC.md updated by hand. ai.txt and the AI-SPEC block in skills/ilo/SKILL.md
regenerated by build.rs from SPEC.md on the next cargo build. The manual
CLI-example block in SKILL.md (outside the auto-gen markers) was updated
separately.
Three-case regression covering the clean-break contract:

  1. --jit runs a numeric program through the JIT path and produces the
     expected output.
  2. --run-cranelift is rejected by the unknown-flag guard with exit 1.
  3. --cranelift is rejected the same way.

Without this, a future revert could silently re-introduce the old names
and the unknown-flag guard would happily pass them as known clap args
rather than rejecting them as the contract requires.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 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 89e2cdb into main May 18, 2026
4 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/rename-cranelift-to-jit branch May 18, 2026 18:33
danieljohnmorris added a commit that referenced this pull request May 18, 2026
The --run-cranelift flag was removed in #392 (rename-cranelift-to-jit)
but this test file wasn't updated, leaving all 21 cases failing on main.
Picking it up here because it blocks Phase 0's CI-green goal; the actual
fix is a one-token rename in the engine list.

This is the only stale --run-cranelift reference in the test suite that
isn't intentionally exercising the unknown-flag guard.
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