Repository navigation
Add host, Miri, and bare-metal tests plus CI - #17
Merged
Merged
Conversation
Pin spin 0.9.9 (no lock_api) and lazily build the queues so the declared MSRV, Rust 1.63, can compile the library. Drain the woken queue before polling so a wake during poll cannot deadlock a non-reentrant spin mutex, and drop tasks in the update that finishes them. Host tests cover completion, is_done, nested spawn, wake and wake_by_ref, cross-thread wakes, and drops. nostd-test runs the same ideas on thumbv7m under QEMU with a bump allocator and no std. Co-authored-by: richardanaya2_2048b.Q6_K_M.gguf <richardanaya@users.noreply.github.com>
Drain the input queue with while-let so clippy -D warnings passes on the current stable toolchain, and switch Actions checkout to v5 so jobs are not pinned to Node.js 20. Co-authored-by: richardanaya2_2048b.Q6_K_M.gguf <richardanaya@users.noreply.github.com>
richardanaya
marked this pull request as ready for review
October 7, 2026 20:06
richardanaya
changed the base branch from
cursor/replace-woke-with-alloc-wake-fec3
to
master
October 7, 2026 20:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #16 (
cursor/replace-woke-with-alloc-wake-fec3), which is not merged yet. This PR is only the test suite, CI, and the small library adjustments those checks need. Retarget the base tomasterafter #16 lands.What the suite proves
Host tests in
tests/behavior.rs(15, also run under Miri):is_doneis false while work is queued or a finished task is still listed, and true afterupdatedrops itwake_by_refand consumingwake, including from another thread, complete throughupdate_wokenthenupdateupdate_wokendoes not poll tasks that were not wokenadd_asyncduring poll does not deadlockReadyOutputtypes other than()(u32,String, andCell<u32>, which isSendbut notSync)updateremoves itno_std
nostd-testis a#![no_std]#![no_main]binary with a 16 KiB bump allocator. QEMU (lm3s6965evb, Cortex-M3, semihosting) runs it and exits 0. The harness checks, with nostdlinked:is_donestarts trueadd_asyncfrom inside a tasku32outputCI also
cargo checks the library forwasm32-unknown-unknownandthumbv7m-none-eabi.thumbv6m-none-eabi(Cortex-M0) is not supported. That target has no pointer-width atomics (target_has_atomic="ptr"is absent), soalloc::sync::Arcis not available andspin::Mutexcannot CAS. The same class of failure happens onmain(wokefails to importalloc::sync::Arc). Not a regression. Noted in the README.CI
.github/workflows/ci.ymlon pull requests and pushes tomaster:cargo clippy --all-targets -- -D warnings(and the harness for thumbv7m)cargo test,cargo doc --no-deps, and the four host examplescargo build --libplus the two no_stdcargo checksnostd-testcargo miri testThe 1.63 job does not run
cargo test. Currentasync-stdreleases pull crates that need a newer compiler. The library itself builds on 1.63.Checkout uses
actions/checkout@v5(Node.js 24).v4still targets Node.js 20, which GitHub Actions now warns about.Library adjustments in this PR
These are here so the checks above are honest, not in #16:
spinis pinned to 0.9.9 withoutlock_api.spin = "0"now resolves to 0.12, whoselock_apineeds Rust 1.71, so a fresh 1.63 build could not meet the declared MSRV.spin::Lazy, becauseVecDeque::newis not const on 1.63. Same queues, built on first use.update_wokendrains the woken queue and drops the guard before polling.spin::Mutexis not reentrant; holding it acrosspolldeadlocked a wake from inside that poll. Wakes during poll are queued for the nextupdate_woken.updatedrops a task in the same pass that sees it finish, and does not poll a woken task that is already done.while letinstead oflen() > 0. Stable clippy 1.99 deniesclippy::len_zerounder-D warnings.examples/timerdoes not build: the externalwebcrate's glob import now clashes with this crate's name, andset_inner_htmlis gone. Left unchanged.