Skip to content

P3 async: error and backpressure conventions for pulseengine:async ABI (sub-#94) #121

@avrabe

Description

@avrabe

Sub-issue of #94. The host-intrinsic ABI shipped in meld_core::p3_async defines stream/future read/write return values informally:

  • stream_write returns bytes accepted; accepted < requested = backpressure, retry later.
  • stream_read returns 0 = EOF, negative = error code.
  • future_read returns 1 = resolved, 0 = pending, negative = error.

This issue tracks formalising these conventions so meld and downstream runtimes (kiln, wasmtime reference impl) agree:

Tasks

  1. Define a closed enum of error codes (ABI_ERR_CLOSED, ABI_ERR_INVALID_HANDLE, ABI_ERR_OOM, ABI_ERR_CANCELLED, …) with stable numeric values.
  2. Document the semantics of partial writes (must the producer always retry? does the runtime queue?) and EOF distinguishability from "0 bytes available right now".
  3. Specify how the ABI interacts with the existing [waitable-set-wait] builtin: does a pending stream read register a waitable, and how is the return value retrieved?
  4. Companion docs in kiln (the runtime reference) and a wasmtime reference implementation.
  5. A tests/p3_async_lowering.rs integration test that exercises each error path.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions