Skip to content

Complete native async task integration - #30

Merged
kleeedolinux merged 3 commits into
poplanguage:masterfrom
kleeedolinux:master
Jul 15, 2026
Merged

Complete native async task integration#30
kleeedolinux merged 3 commits into
poplanguage:masterfrom
kleeedolinux:master

Conversation

@kleeedolinux

Copy link
Copy Markdown
Collaborator

Summary

Complete coroutines, async functions, awaiting, cooperative cancellation, and
scoped async cleanup through one backend-neutral HIR/MIR contract.

This change:

  • adds typed cold tasks, await, async closures, async defer, structured task
    groups, explicit cancellation sources/tokens, and cancellation masking;
  • lowers coroutine state, suspension, cleanup, cancellation, panic, and task
    ownership into verified HIR and canonical MIR;
  • executes the same contract through the MIR interpreter and LLVM;
  • connects compiler-created task frames to the native scheduler;
  • publishes exact ready and suspended frame roots through the scheduler/collector
    lifecycle and restores relocated roots before polling;
  • adds native ABI 1.12 task-frame and cancellation operations without claiming
    ABI 2 production-GC support;
  • marks the corresponding async and scheduler/GC roadmap work complete.

Architecture traceability

  • Authorizing architecture section or ADR:
    • ADR 0068: Typed Async Tasks, Actors, and Distribution
    • ADR 0077: Scheduler Mutator and Task Root Binding
    • ADR 0078: Native ABI 2 Writable-Root Coexistence
    • ADR 0079: Native Task-Frame and Cancellation ABI
    • architecture/05-runtime-and-abi.md
  • New or changed public contract:
    • Task.cancellationSource(), Task.cancelToken(source), and
      Task.cancel(source)
    • typed Task.group and Task.start
    • cold Task<T> creation, prefix await, async functions/closures, and
      suspension-capable async defer
    • backend-neutral Synchronizes and Suspends effects
    • native ABI 1.12 compiler-frame, task, group, completion, and cancellation
      entries
  • Architecture documents, examples, or terminology updated:
    • added accepted ADR 0079;
    • synchronized the runtime/ABI architecture, ADR 0078, closed design
      decisions, foundational Task metadata, and API baseline;
    • completed both affected ROADMAP.md entries.

Verification

  • Tests were added or updated before implementation where behavior changed.
  • Positive behavior is covered.
  • Negative/rejection boundaries are covered.
  • Convention, consistency, and regression coverage is present where relevant.
  • Cross-backend or differential coverage is present where relevant.
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets
  • cargo test --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings

If a check was not run, explain why:

cargo test --workspace passed completely. The all-target command was also
started and passed the compiler, runtime, architecture, interpreter, LLVM, C,
and other test suites reached before it entered the long harness-free compiler
and scheduler benchmarks. It was manually interrupted while those benchmarks
were still succeeding, so the complete all-target command did not return a
final status.

Additional focused suites passed, including the full MIR, LLVM, native runtime,
native ABI, standard-library baseline, and architecture test suites.

Review notes

  • No dynamic typing, runtime string lookup, broad reflection, or universal-table behavior was introduced.
  • HIR/MIR remain backend-neutral.
  • No generated artifacts, dependency caches, credentials, or editor files are included.
  • This is ready for technical review.

Native ABI 1.12 deliberately retains stable managed-reference tokens. It does
not advertise ABI 2 or satisfy the production moving-GC profile. Production GC
integration remains gated on the complete ABI 2 writable-root composition.

The experimental C backend rejects coroutine runtime requirements before
emission and has no synchronous or dynamic fallback.

Implement the ADR 0079 compiler task-frame and cancellation ABI so cold typed tasks execute through the native scheduler with precise ready and suspended roots. Preserve structured ownership, cancellation masking, cleanup, and terminal outcomes across canonical MIR, the interpreter, and LLVM.\n\nAdvance the stable native descriptor to ABI 1.12, synchronize the standard Task surface and architecture, and close the corresponding roadmap work.
@kleeedolinux
kleeedolinux merged commit ad12763 into poplanguage:master Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant