Skip to content

Comments

saw-central: Compare Tys in TypeShapes using checkCompatibleTys, not Eq #3059

Merged
RyanGlScott merged 2 commits intomasterfrom
T3055-TestEquality-TypeShape-checkCompatibleTys
Feb 20, 2026
Merged

saw-central: Compare Tys in TypeShapes using checkCompatibleTys, not Eq #3059
RyanGlScott merged 2 commits intomasterfrom
T3055-TestEquality-TypeShape-checkCompatibleTys

Conversation

@RyanGlScott
Copy link
Contributor

The Eq class compares MIR types for syntactic equality, but for the reasons described in #1976, this is too fine-grained a notion of equality to be suitable for SAW purposes. Instead, we now use checkCompatibleTys, which intentionally equates types such as i32 and u32.

The upshot to this is that SAW will now no longer spuriously reject mir_array_values that use a signed integer type (e.g., mir_i32) as the element type. This is because these elements will be converted to SAW Terms with the Cryptol type [32], which would then be converted to MIR values of type u32. The checkCompatibleTys function ensures that i32 and u32 are then treated as compatible types.

Fixes #3055.

The `Eq` class compares MIR types for syntactic equality, but for the reasons
described in #1976, this is too fine-grained a notion of equality to be
suitable for SAW purposes. Instead, we now use `checkCompatibleTys`, which
intentionally equates types such as `i32` and `u32`.

The upshot to this is that SAW will now no longer spuriously reject
`mir_array_value`s that use a signed integer type (e.g., `mir_i32`) as the
element type. This is because these elements will be converted to SAW `Term`s
with the Cryptol type `[32]`, which would then be converted to MIR values of
type `u32`. The `checkCompatibleTys` function ensures that `i32` and `u32` are
then treated as compatible types.

Fixes #3055.
@RyanGlScott RyanGlScott self-assigned this Feb 20, 2026
@RyanGlScott RyanGlScott added the subsystem: crucible-mir Issues related to Rust verification with crucible-mir and/or mir-json label Feb 20, 2026
Copy link
Collaborator

@qsctr qsctr left a comment

Choose a reason for hiding this comment

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

Thanks!

@RyanGlScott RyanGlScott merged commit d0d33ce into master Feb 20, 2026
112 of 115 checks passed
@RyanGlScott RyanGlScott deleted the T3055-TestEquality-TypeShape-checkCompatibleTys branch February 20, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

subsystem: crucible-mir Issues related to Rust verification with crucible-mir and/or mir-json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MIR: mir_array_value doesn't work with signed integers

2 participants