Skip to content

Warn when Kani runs under Rosetta 2 on Apple Silicon - #4789

Open
rbeauchamp wants to merge 1 commit into
model-checking:mainfrom
rbeauchamp:rosetta-arch-warning
Open

Warn when Kani runs under Rosetta 2 on Apple Silicon#4789
rbeauchamp wants to merge 1 commit into
model-checking:mainfrom
rbeauchamp:rosetta-arch-warning

Conversation

@rbeauchamp

Copy link
Copy Markdown

Description

kani --version --verbose now prints the host architecture on macOS and warns when the kani-driver process itself is running translated under Rosetta 2 (sysctl.proc_translated == 1).

Context

SAT solving under x86_64 translation carries a steep performance penalty on Apple Silicon, and an x86_64 kani-driver almost always ships with x86_64 solver binaries (CBMC, Kissat) — so a translated driver is a reliable proxy for a fully translated toolchain. Today nothing tells the user; verification just runs 30–50% slower. The warning is detect-only and never blocks verification.

Manual testing

  • kani --version --verbose on a native arm64 macOS host prints Host architecture: aarch64 and no warning.
  • The probe is split into a pure formatting function (rosetta_warning) and a thin sysctl probe (is_process_translated), so the warning logic is unit-tested (cargo test -p kani-driver version: 11/11, including probe-never-panics and warning-content tests).
  • Non-macOS builds compile the probe as a constant false; --quiet's zero-output contract is untouched (the new output lives in the verbose-only path, and version printing is already caller-gated on --quiet).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

kani --version --verbose now prints the host architecture and warns when
the kani-driver process is translated (sysctl.proc_translated == 1):
SAT solving under x86_64 translation carries a steep penalty and an
x86_64 driver almost always ships x86_64 solver binaries. Warn-only:
translation never blocks verification.
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