Skip to content

[runtime/iouring/waker] add loom model#3711

Merged
patrick-ogrady merged 7 commits into
mainfrom
andre/iouring-waker-loom
May 5, 2026
Merged

[runtime/iouring/waker] add loom model#3711
patrick-ogrady merged 7 commits into
mainfrom
andre/iouring-waker-loom

Conversation

@andresilva
Copy link
Copy Markdown
Member

@andresilva andresilva commented May 4, 2026

This PR adds loom coverage for the runtime io_uring waker, which coordinates producer-side publishes and out-of-band wakes with loop-side eventfd/futex parking through a packed atomic state word. The tests model the production sequence and wait-bit state with loom atomics, replace kernel wake surfaces with loom-visible futex and eventfd models, and use a minimal queued-request model so missing release/acquire synchronization around request publication can be caught.

The models cover the main wakeup paths: publish publishing to pending, wake publishing to clear_wait, armed publish/wake races through the eventfd path, fully-idle futex parking, eventfd wake deduplication, sticky unarmed wakes, final-handle drop wakeups, sequence wraparound, and repeated loop drain cycles. They also include deterministic generated producer programs for producer-only, eventfd-loop, and futex-loop histories.

The goal is to make the waker's concurrency contract explicit: every published submission must be observed exactly once, pure wakes must not advance the submission sequence, wait targets must be cleared after wakeup, unarmed wakes must not queue eventfd readiness, eventfd readiness must be coalesced and acknowledged correctly, and queue writes made before publish/wake must be visible after the loop observes pending or resumes through clear_wait.

Depends on #3692.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp db06010 May 05 2026, 04:58 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 4, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: db06010
Status: ✅  Deploy successful!
Preview URL: https://d80e8056.monorepo-eu0.pages.dev
Branch Preview URL: https://andre-iouring-waker-loom.monorepo-eu0.pages.dev

View logs

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Benchmark results

Tip

PASSED: No benchmark exceeded the regression threshold.

Benchmark comparison table
Benchmark Baseline (main) Current Delta Threshold Status
qmdb::merkleize/variant=any::unordered::fixed::mmr keys=10000 ch=false sync=false 1.587 ms 1.575 ms -0.74% 10.00% ✅ PASS

Baseline commit(s): 99825a0a1ac8

@andresilva andresilva force-pushed the andre/iouring-waker-loom branch from d648d09 to 835399a Compare May 4, 2026 23:39
@andresilva andresilva moved this to Ready for Review in Tracker May 4, 2026
@andresilva andresilva requested a review from patrick-ogrady May 4, 2026 23:39
@andresilva andresilva marked this pull request as ready for review May 4, 2026 23:39
patrick-ogrady
patrick-ogrady previously approved these changes May 5, 2026
/// to model the producer/loop atomic protocol closely enough for loom to
/// explore memory orderings and wake races. It is not a model of kernel CQE
/// ordering, `io_uring_enter`, or wake-poll rearm behavior.
#[cfg(feature = "loom")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m tempted to suggest putting the real impl in a single block before the loom impl rather than interleaving but won’t block on it.

@patrick-ogrady patrick-ogrady merged commit 2e641a0 into main May 5, 2026
175 checks passed
@patrick-ogrady patrick-ogrady deleted the andre/iouring-waker-loom branch May 5, 2026 04:59
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Tracker May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.82%. Comparing base (c32f535) to head (db06010).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
runtime/src/iouring/waker.rs 98.11% 0 Missing and 1 partial ⚠️
@@           Coverage Diff           @@
##             main    #3711   +/-   ##
=======================================
  Coverage   95.82%   95.82%           
=======================================
  Files         458      458           
  Lines      180034   180073   +39     
  Branches     4208     4209    +1     
=======================================
+ Hits       172525   172563   +38     
+ Misses       6168     6167    -1     
- Partials     1341     1343    +2     
Files with missing lines Coverage Δ
runtime/src/iouring/waker.rs 96.62% <98.11%> (+0.08%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c32f535...db06010. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants