Skip to content

veri: term signature instantiations in ISLE#82

Merged
mmcloughlin merged 20 commits intoverify-mainfrom
mbm/term-signatures
Nov 29, 2023
Merged

veri: term signature instantiations in ISLE#82
mmcloughlin merged 20 commits intoverify-mainfrom
mbm/term-signatures

Conversation

@mmcloughlin
Copy link
Copy Markdown
Collaborator

@mmcloughlin mmcloughlin commented Nov 10, 2023

This PR replaces isle_inst_types hardcoded type signatures in widths.rs
with ISLE syntax for term instantiations.

Signatures may now be specified with the instantiate definition, for
example:

(instantiate operand_size
    ((args Int) (ret Int) (canon (bv 8)))
    ((args Int) (ret Int) (canon (bv 16)))
    ((args Int) (ret Int) (canon (bv 32)))
    ((args Int) (ret Int) (canon (bv 64)))
)

Common sets of signatures can be specified with a form definition and
reused by name, for example:

(form
  bv_unary_8_to_64
  ((args (bv  8)) (ret (bv  8)) (canon (bv  8)))
  ((args (bv 16)) (ret (bv 16)) (canon (bv 16)))
  ((args (bv 32)) (ret (bv 32)) (canon (bv 32)))
  ((args (bv 64)) (ret (bv 64)) (canon (bv 64)))
)

(instantiate ineg bv_unary_8_to_64)

@mmcloughlin mmcloughlin changed the base branch from verify-main to test-result-expect November 27, 2023 23:13
@mmcloughlin mmcloughlin changed the title WIP: term type instantiations in ISLE veri: term signature instantiations in ISLE Nov 28, 2023
@mmcloughlin mmcloughlin marked this pull request as ready for review November 28, 2023 01:00
@mmcloughlin mmcloughlin requested a review from avanhatt November 28, 2023 01:00
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

YAY

Copy link
Copy Markdown
Owner

@avanhatt avanhatt left a comment

Choose a reason for hiding this comment

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

This new syntax is much nicer!

mmcloughlin added a commit that referenced this pull request Nov 29, 2023
This PR replaces the `TestResult::MultiType` variant with a callback that
computes the expected `VerificationResult` for a provided `TermSignature`.

The `MultiType` variant was only used in a single test, where it was used to
provide a list of expectations derived from `isle_inst_types()`.

https://github.com/avanhatt/wasmtime/blob/575c137da4f90601f6542775ed40420d6524f5d0/cranelift/isle/veri/veri_engine/tests/veri.rs#L1102-L1126

The motivation for this change is that this approach will no longer work
if we provide ISLE term signatures in the source code instead, as implemented
in #82. The term signatures will only be known later, at which point we can
use the `TestResult::Expect` callback to derive the expectation.
@mmcloughlin mmcloughlin changed the base branch from mbm/test-result-expect to verify-main November 29, 2023 16:09
@mmcloughlin mmcloughlin merged commit 12df145 into verify-main Nov 29, 2023
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Oct 9, 2024
Trigger ASLp CI workflow on PRs that change `isaspec` crate.
avanhatt pushed a commit that referenced this pull request Jan 11, 2026
Re-export Wasmtime crate to allow easier use with Wizer API.
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.

2 participants