Skip to content

Lower uninitialized local declarations with Whale initialization tracking #883

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 uninitialized locals:

fun main() -> i32 { var x: i32; x = 3; return x; }

Scope

Upstream #243 adds Uninit and initialized-read tracking. After the format-4 integration, lower supported local storage while resetting initialization at each declaration execution, including loop re-entry. Preserve the existing Wave language contract; do not replace uninitialized values with zero or Undef.

Difficulty: hard.

Completion criteria

  • Accept declaration followed by a valid assignment/read.
  • Preserve initialization/lifetime distinctions across loops and shadowing.
  • Verify IR and test available tracked-memory execution without inventing a new Wave policy.

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

Depends on #868.

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