Skip to content

Implement the portable Wave async task runtime and executor #444

Open

Description

@LunaStev

Parent: #439
Depends on: #440 and #443.

Summary

Provide the minimal portable runtime contracts needed to poll, wake, schedule, cancel, and complete Wave async computations.

Scope

  • Define the stable in-language Poll, future, task, and waker representations used by lowered code.
  • Provide a single-threaded baseline executor before optional multithreaded scheduling.
  • Define task allocation, queue ownership, wake coalescing, cancellation, shutdown, and result retrieval.
  • Avoid mandatory libc dependencies in freestanding builds; hosted and freestanding availability must be explicit.
  • Keep runtime interfaces backend-neutral and compatible with a future Whale toolchain.
  • Define the private async fun main() adapter only after executor ownership is clear.
  • Add deterministic tests that do not depend on wall-clock races.

Completion criteria

  • A task that returns immediately, yields once, and wakes multiple times completes correctly.
  • Duplicate wakes do not corrupt the run queue.
  • Cancellation and executor shutdown release frame/runtime resources according to the semantic contract.
  • Hosted Linux, macOS, and Windows runtime smoke tests pass.
  • Unsupported freestanding use produces a clear compile/driver diagnostic.
  • Runtime APIs include short Wave comments and examples.

Implementation audit — 2026-09-23

The executor and fixtures for lazy/nested tasks, control flow, timer fairness and TCP round trips pass locally. Native executor restart regressions are also present. Keep the broader duplicate-wake, shutdown/cancellation and unsupported-target acceptance work open; #532/#533/#535 track concrete remaining runtime concerns.

Activity

  1. added
    enhancement
    feature request
    cross-platform
    on Aug 30, 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

    cross-platformenhancementfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions