Skip to content

[spectec] Wasm 1.0: Limits_sub missing cases involving an absent maximum #2220

Closed

Description

@lzy0505

The Wasm 1.0 Limits_sub relation only matches limits for which both sides have an explicit maximum.

Current spectec rule

rule Limits_sub:
  |- `[n_11 .. n_12] <: `[n_21 .. n_22]
  -- if n_11 >= n_21
  -- if n_12 <= n_22

The WebAssembly Specification, Release 1.0 PDF Section 4.5.2 allows the maximum to be absent:

n₁ ≥ n₂
────────────────────────────────────────────────────
⊢ {min n₁, max m₁?} ≤ {min n₂, max ε}

The fix should follow Wasm 3.0:

rule Limits_sub/max:
  |- `[n_11 .. n_12] <: `[n_21 .. n_22?]
  -- if n_11 >= n_21
  -- (if n_12 <= n_22)?

rule Limits_sub/eps:
  |- `[n_11 .. eps] <: `[n_21 .. eps]
  -- if n_11 >= n_21

Activity

  1. rossberg commented on Sep 1, 2026

    @rossberg
    Member

    Right, PTAL at #2238.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions