Skip to content

Define and implement Whale lowering for Wave integers wider than 128 bits #884

Open

Description

@LunaStev

Motivation

At fd07427f4a976de05e38eff3ee1760db97fbb761 on Linux amd64 with Rust 1.89 and locked Whale 020d2a4, lexing, parsing and TypedProgram lowering succeed, but calling whale::emit_ir on this source returns Whale backend does not yet support type Uint(256):

fun identity(x: u256) -> u256 { return x; }

Scope

Decide a Wave-to-Whale representation for existing 256–1024-bit integers, then implement operations/conversions without narrowing to 128 bits. Inspect upstream types and coordinate required capabilities; use Utils and compiler-owned freestanding arithmetic where appropriate. Full-value constant shift checks in #860 are not wider runtime support.

Difficulty: very hard.

Completion criteria

  • Record the representation and backend capability contract.
  • Preserve wrapping, conversions, comparisons and checked shift semantics.
  • Provide boundary tests and explicit diagnostics for remaining operations.

Please mention @LunaStev to discuss the design before starting implementation.

Activity

  1. added
    enhancementA request for a new feature or improvement.
    help wantedThe issue requires extra attention or help from others.
    discussionIssues that require a technical or community discussion.
    on Oct 7, 2026
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

    discussionIssues that require a technical or community discussion.enhancementA request for a new feature or improvement.help wantedThe issue requires extra attention or help from others.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions