Skip to content

[codex] implement WASI poll_oneoff fd polling for moonrun - #1690

Open
peter-jerry-ye wants to merge 1 commit into
mainfrom
codex/moonrun-wasi-poll-oneoff
Open

[codex] implement WASI poll_oneoff fd polling for moonrun#1690
peter-jerry-ye wants to merge 1 commit into
mainfrom
codex/moonrun-wasi-poll-oneoff

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Contributor

Summary

Implement focused WASI poll_oneoff support in moonrun for fd read/write readiness.

  • Register poll_oneoff in the WASI imports.
  • Reject clock subscriptions with NOTSUP to keep this implementation scoped.
  • Add fd read/write readiness events, including stdin hangup flags and stdout/stderr write readiness.
  • Use rustix for Unix stdin polling and byte availability.
  • Handle Windows stdin readiness directly with windows-sys for console and pipe HANDLE semantics that Rustix does not cover.
  • Preserve nonblocking stdin behavior by mapping WouldBlock through WASI AGAIN.

Validation

  • cargo test --locked -p moonrun --test test test_moonrun_wasi_poll_oneoff -- --nocapture
  • cargo test -p moonrun
  • cargo clippy -p moonrun --all-targets
  • cargo fmt --check
  • cargo check -p moonrun --target x86_64-pc-windows-msvc
  • git diff --check

@semanticdiff-com

semanticdiff-com Bot commented May 19, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/moonrun/src/wasi_api.rs  7% smaller
  Cargo.lock Unsupported file format
  crates/moonrun/Cargo.toml Unsupported file format
  crates/moonrun/tests/test.rs  0% smaller

@peter-jerry-ye
peter-jerry-ye marked this pull request as ready for review May 19, 2026 07:48
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