Skip to content

[Draft] Update SMT-based ISLE verifier#13550

Draft
avanhatt wants to merge 36 commits into
bytecodealliance:mainfrom
avanhatt:upstream-06-02
Draft

[Draft] Update SMT-based ISLE verifier#13550
avanhatt wants to merge 36 commits into
bytecodealliance:mainfrom
avanhatt:upstream-06-02

Conversation

@avanhatt

@avanhatt avanhatt commented Jun 3, 2026

Copy link
Copy Markdown
Member

Update the core ISLE verifier for formal, SMT-based checking of instruction lowering rules. This brings the implementation up-to-date with our work described at OOPSLA 2025, rather than the prior ASPLOS 2024 implementation.

The core improvements are:

  1. Automatic rule chaining. Rather than requiring specifications on every ISLE term, terms can be marked veri chain to be automatically composed/inlined. This reduces the specification burden substantially. See the paper for details.
  2. For the aarch64 backend, most machine inst Minst specifications are automatically derived from the authoritative ARM ASL reference, with our work building on the ASLp project to derive more targeted specifications for this domain.
  3. Our state modeling now handles traps and other side effects more explicitly, see the paper for details.
  4. The specification language is more expressive, including structs and macros. See the language reference updates for details.

avanhatt and others added 6 commits June 3, 2026 15:04
Co-authored-by: Michael McLoughlin <mmcloughlin@gmail.com>
Co-authored-by: Michael McLoughlin <mmcloughlin@gmail.com>
Co-authored-by: Michael McLoughlin <mmcloughlin@gmail.com>
Co-authored-by: Michael McLoughlin <mmcloughlin@gmail.com>
Co-authored-by: Michael McLoughlin <mmcloughlin@gmail.com>
Comment thread cranelift/isle/veri/veri/log.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental commit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, thanks for spotting!

@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:meta Everything related to the meta-language. labels Jun 3, 2026

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This largely looks good! I skimmed over any spec/model/attr forms in the diffs of ISLE, and the cranelift/isle/veri tree in general; reviewed more carefully the bits that were touched in Cranelift and the ISLE compiler proper. Some logistical comments but nothing really substantial. Thanks for all the work in getting this in shape for upstreaming!

Comment thread cranelift/codegen/meta/src/gen_isle.rs
Comment thread cranelift/codegen/src/isa/aarch64/inst/imms.rs
Comment thread cranelift/codegen/src/isa/aarch64/inst/regs.rs Outdated
Comment thread cranelift/codegen/src/isa/aarch64/inst.isle
Comment thread cranelift/codegen/src/spec/state.isle
Comment thread cranelift/isle/veri/aslp/Cargo.toml Outdated
Comment thread cranelift/isle/veri/test-macros/Cargo.toml Outdated
Comment thread cranelift/isle/veri/veri/src/veri.rs Outdated
}

fn add_binding(&mut self, id: BindingId, binding: &Binding) -> Result<()> {
dbg_depth!("add_binding");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this debug code need to stay in-tree? (It looks like it's trying to help find very deeply nested invocations? In any case I'd rather not have the ad-hoc thread-local magic here if we don't need this check permanently)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, did not mean to include, removed!

@cfallin

cfallin commented Jun 8, 2026

Copy link
Copy Markdown
Member

Looks like things are pretty much addressed -- thanks again! One comment above; once that's addressed, as well as the current merge conflict with main, go ahead and flip this out of Draft mode (assuming it's ready and there aren't more TODOs you want to address?), and add a commit with prtest:all in the description; that'll run the full CI pipeline and we can see failures.

(One of those failures will be a cargo vet failure most likely; I can pull down the branch, do my vets locally, and push a new commit on top of your branch to address)

avanhatt and others added 13 commits June 8, 2026 17:52
Replace the personal mmcloughlin/aslp fork with the upstream UQ-PAC
packages: aslp 0.3.2 (symbolic-opcode support, merged via PR bytecodealliance#145) plus
the aslp_server_http server, which migrated to the aslp-rpc repo
(v0.1.4). The server is wire-compatible, so the Rust client and parser
are unchanged.

setup/install-aslp.sh installs both packages into a dedicated `aslp`
opam switch (OCaml >= 5.0, required by aslp_server_http's eio deps) via
opam pin, replacing the fork tarball + dune build. The installers (aslp,
cvc5, z3) move from veri/script/install/ to a shared setup/ dir at the
subtree root, matching wasmtime's flat install-<tool>.sh convention.
generate.sh and the aslp test-data script launch aslp_server_http / asli
via `opam exec --switch` (overridable with ASLP_SWITCH); no PATH setup.
README updated accordingly.

EXTR is temporarily disabled in the alu_rrr_shift sweep: upstream 0.3.2
cannot lift it (the symbolic lsb yields an unsimplified, non-constant
slice width that the RASL backend rejects), a regression vs the fork.
Tracked separately.
Temporarily pin asli to mmcloughlin/aslp#extr-fix (UQ-PAC/aslp PR bytecodealliance#152),
which fixes symbolic-EXTR lifting: is_pure_exp now treats bit-literals as
pure, so sym_sub_int folds EXTR's slice width to a constant instead of
leaving a non-constant expression the RASL check rejects. With that,
isaspec can lift EXTR again, so re-enable ALUOp::Extr in the
alu_rrr_shift sweep.

Regenerate the AArch64 ISA specs with upstream ASLp + the fix. EXTR
returns to alu_rrr_shift.isle; the rest of the churn is upstream's
equivalent reformulation -- loads keep the loaded value in a constdecl
(new RASL load invariant), conds use a branchless bitvector mux, SDIV
drops a redundant INT_MIN/-1 special-case, and loads/stores gain
`modifies` annotations.

Revert the asli pin to an upstream release once PR bytecodealliance#152 merges.
Drive hyper over a tokio TcpStream instead, removing reqwest's async/TLS tree
and the duplicate hyper/http/base64 versions it introduced. No new lockfile
crates; regenerated specs are byte-identical.
Parse attributes with syn::meta::parser and report errors via an `expand`
function returning syn::Result + into_compile_error, matching the convention in
the other wasmtime proc-macros. Removes the unmaintained proc-macro-error
(RUSTSEC-2024-0370) and the syn 1.0 duplicate it pulled in.
Make the ident/bits grammar rules compound-atomic so their quoted content
comes through as inner pairs, and read those directly instead of stripping
quotes with enquote. Regenerated specs are byte-identical.
Move pest/pest_derive (aslp) and num-bigint/num-traits/easy-smt (veri) out of
the workspace root and into the single crate that uses each, keeping the shared
workspace dependencies to crates with more than one consumer. Versions and lock
resolution are unchanged.
Bump pest/pest_derive to 2.8.6, num-bigint to 0.4.6, and num-traits to 0.2.19
(version-floor hygiene; lock unchanged), and easy-smt 0.2 -> 0.3.2, adjusting
for its ContextBuilder solver/solver_args split.
The symbolic-EXTR lift fix merged upstream (UQ-PAC/aslp#152), so asli no longer
needs the fork. Pin it to the upstream merge commit (not yet in a tagged
release). Regenerated specs are byte-identical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants