Skip to content

Async roadmap T-001 + T-003: structured suspend detection and pipeline smoke CI - #4

Merged
kevindadi merged 1 commit into
mainfrom
async/combinators-and-robustness
Oct 20, 2026
Merged

kevindadi merged 1 commit into
mainfrom
async/combinators-and-robustness

Conversation

@kevindadi

Copy link
Copy Markdown
Owner

Summary

Focused, verifiable slice of the async roadmap (todolist.md): completes T-003 (version-robust suspend detection) and T-001 (CI regression testing), with no changes to sync code paths.

T-003 — structured suspend detection

block_sets_poll_pending no longer relies on the debug-string rendering of _0 = Poll::Pending (which only worked because DefId's Debug output embeds the path). It now:

  1. locates the Pending variant of the body's return type structurally (a Poll-shaped enum: has both Ready and Pending variants by name);
  2. matches every _0-writing statement in the block against that variant index:
    • SetDiscriminant { _0, v }
    • _0 = Aggregate(Adt(.., v, ..))
    • _0 = const — unevaluated consts matched by variant DefId, evaluated consts matched by discriminant bit pattern against adt_def.discriminants;
  3. lets the last recognized _0 write decide.

Still gated by tcx.is_coroutine, so sync bodies never enter this path (verified: intra and condvar-closure counts identical to main).

T-001 — CI regression / smoke tests

  • scripts/smoke.sh: builds pn, analyzes benchmark crates, asserts the deadlock report Bug count and (for async cases) the [lockgroup-detail] lock-group count.
  • .github/workflows/smoke.yml: runs the script on push / pull_request to main (toolchain pinned by rust-toolchain.toml). The async assertions double as the toolchain-upgrade compatibility test required by T-003.
  • New false-positive guard bench bench/deadlock/async-no-deadlock (two tasks sharing one mutex across .await): asserts 0 bugs / 1 lock group, complementing async-deadlock (1 bug / 2 lock groups).
  • Sync regression baselines (intra/inter/conflict-inter/lock-closure/static-ref/condvar-closure = 4/4/1/1/1/6) are asserted in the same script, matching the "counts unchanged" engineering constraint.
  • Remaining corpus entries (select!, tokio::sync::Mutex, timeout variants) are intentionally deferred to T-002/T-006 — asserting on unmodeled paths today would produce a false green signal.

Housekeeping

  • All remaining Chinese comments/docs translated to English (todolist.md rewritten fully in English; src/memory/pta/builder.rs comments).
  • tmp/ added to .gitignore (analysis artifacts from detect.sh/smoke.sh).

Verification

  • cargo build clean; cargo test 55/55 pass.
  • ./scripts/smoke.sh: all 8 cases PASS locally (async-deadlock 1/2, async-no-deadlock 0/1, six sync baselines).
  • Structured suspend path confirmed active via debug log ([async] structured suspend detection matched …) during async-deadlock analysis.

T-003: replace the debug-string `Poll::Pending` heuristic with structured
checks (SetDiscriminant / Aggregate(Adt) / constant variant DefId and
discriminant bits matched against the Poll ADT), still gated by
tcx.is_coroutine so sync code paths are untouched.

T-001: add scripts/smoke.sh, which builds pn, analyzes the benchmark
crates, and asserts deadlock bug counts plus async lock-group counts
(async-deadlock: 1 bug / 2 groups; new async-no-deadlock false-positive
guard: 0 bugs / 1 group; six sync regression baselines). The script runs
in CI via .github/workflows/smoke.yml.

Also translate the remaining Chinese comments and docs to English
(todolist.md, src/memory/pta/builder.rs).
@kevindadi
kevindadi merged commit 4404dec into main Oct 20, 2026
5 checks passed
@kevindadi
kevindadi deleted the async/combinators-and-robustness branch October 20, 2026 14:46
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