Skip to content

[Stack Switching] Align switch/resume_throw result typing with spec #71

Description

@byeongjee

Align switch/resume_throw result typing with stack-switching spec

Problem

Current wasmstack op surface models switch and resume_throw as producing no normal results. This blocks representation of valid typed result-flow forms described by the official typing rules.

Why this matters

Spec-conformant programs requiring result propagation through switch/resume_throw cannot be represented or validated in the current IR.

Repro

  • Test: test/wasmstack/spec-gap-switch-resume-throw-results.mlir (currently XFAIL)
  • Parser/op model rejects SSA-result forms.

Expected behavior

switch and resume_throw should support typed results where permitted by continuation/tag typing rules.

Suggested implementation direction

  1. Update ODS for wasmstack.switch and wasmstack.resume_throw result modeling.
  2. Update verifier stack-effect rules and typing checks.
  3. Update emitter stack assumptions and binary encoding logic.
  4. Add conversion coverage from WAMI forms.

Acceptance criteria

  • test/wasmstack/spec-gap-switch-resume-throw-results.mlir flipped from XFAIL to passing.
  • No regressions in existing stack-switching verify/emission suites.

Activity

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