V0.2.6 on Crates.io

The
Cancel-Correct
Async Runtime.

Structured concurrency with first-class cancellation for Rust. Three-phase cancel protocol, linear obligations, capability security, and deterministic testing — all enforced by the runtime.

RsCxCx
ASUPERSYNC RUNTIMERoot RegionServer RegionWorker RegionCancel Protocoltasks (active)THREE-LANE SCHEDULERCancel LaneTimed LaneReady LaneRequest → Drain → FinalizeCx (capabilities)
Runtime_Architecture
Cancel Protocol
Cancel Phases
3

Request → Drain → Finalize

Built-in Protocols
8+

Cancel-correct by design

Formal Proofs
12

Verified safety guarantees

Test Seeds

Deterministic Lab runtime

Why Asupersync

Built Different

Not another Tokio wrapper. Asupersync is a ground-up async runtime with cancel-correctness guarantees, structured concurrency, and algorithms borrowed from formal verification.

Structured Concurrency

Every task lives inside a Region. When a Region closes, all tasks within it are cancelled, awaited, and cleaned up — automatically. No orphaned futures, no leaked goroutines.

Concurrency Model

Cancel-Correct Protocol

Three-phase cancellation: Request → Drain → Finalize. Tasks get budgeted time to clean up connections, flush buffers, and release resources. Never a silent drop again.

Core Runtime Protocol

Linear Obligations

Permits must be explicitly consumed — sent, completed, or aborted. The type system prevents you from forgetting to handle them. Compile-time resource leak prevention.

Type System Guarantee

Capability Security

Tasks receive a Cx (capability context) that controls what they can do. Spawn, I/O, timers — all gated by capabilities. Principle of least authority, enforced by the runtime.

Security Model

Lab Runtime

Deterministic testing with seed-controlled execution order. Replay any interleaving. Integrated DPOR (Dynamic Partial Order Reduction) finds concurrency bugs systematically.

Testing Infrastructure

Three-Lane Scheduler

Cancel lane (highest priority), Timed lane (deadlines), Ready lane (normal work). Cancellation always wins the race, ensuring prompt cleanup even under load.

Scheduler Design

Built-in Ecosystem

Cancel-correct TCP, HTTP, channels, mutexes, and supervisors out of the box. Every protocol respects the cancel contract. No need to wrap Tokio primitives.

Protocol Ecosystem
How It Compares

Runtime Comparison

Asupersync bakes correctness guarantees into the runtime layer. Features that require manual discipline in other runtimes are enforced by the architecture.

Feature
Asupersync
Tokioasync-stdsmol
Structured Concurrency
First-classManualManualManual
Cancel Protocol
3-phaseSilent dropSilent dropSilent drop
Linear Obligations
EnforcedNoNoNo
Capability Security
Built-inNoNoNo
Deterministic Testing
Lab RuntimeNoNoNo
Resource Leak Prevention
Compile-timeManualManualManual
Scheduler Priority
3-laneWork-stealingWork-stealingWork-stealing
Cancellation Priority
GuaranteedBest-effortBest-effortBest-effort
Built-in Protocols
8+Separate cratesPartialMinimal
Formal Verification
12 proofsLoom testsNoNo
The Code

Clean API, Cancel-Safe

A cancel-correct server in under 25 lines. Regions scope task lifetimes, Cx controls capabilities, and Permits enforce resource cleanup.

examples/server.rs
01
use
asupersync::{Region, Cx, Outcome, Budget};
02
use
std::time::Duration;
03 04#[asupersync::main]05
async
fn
main(cx: &Cx) -> Outcome<()> {
06 // Open a region — all tasks scoped here07 Region::open(cx, "server",
async
|cx| {
08 // Spawn a listener with cancel capability09
let
permit = cx.spawn("listener",
async
|cx| {
10
let
listener = cx.tcp_bind("0.0.0.0:8080").
await
?;
11
loop
{
12
let
(stream, _) = listener.accept(cx).
await
?;
13 cx.spawn("conn", handle_connection(stream));14 }15 });16 17 // Wait for shutdown signal18 cx.shutdown_signal().
await
;
19 20 // Cancel with budget — tasks get 5s to drain21 permit.cancel(Budget::timeout(Duration::from_secs(5)));22 }).
await
23}
Syntax_Validation_Active
UTF-8_ENCODED
Development Timeline

From Theory to crates.io

Built on formal foundations. Every phase documented, every guarantee proven.

Phase 1

Core Runtime & Region Model

  • Designed the Region tree model with parent-child lifetime scoping

  • Implemented the three-phase cancel protocol (Request → Drain → Finalize)

  • Built the Cx capability context with spawn/IO/timer gates

  • Formal proofs for cancel-safety and region closure guarantees

Runtime Log v0.2
Phase 2

Linear Obligations & Permits

  • Designed the Permit/Lease linear type system

  • Implemented compile-time must-use enforcement

  • Built the three consumption paths: Send, Complete, Abort

  • Added Spork (spawn + fork) for structured task hierarchies

Runtime Log v0.2
Phase 3

Three-Lane Scheduler

  • Implemented Cancel/Timed/Ready lane architecture

  • Built priority inversion prevention for cancel propagation

  • Designed quiescence detection for region closure

  • Benchmarked against Tokio's work-stealing scheduler

Runtime Log v0.2

Ready to Build?

Add Asupersync to your Rust project with a single command. Ship async systems with cancel-correctness guarantees from day one.

terminal
$cargo add asupersync
MIT License · Free & Open Source
Get Started
Origin_Protocol

Crafted by
Jeffrey Emanuel.

Built using the AI Flywheel — an interactive ecosystem of specialized autonomous agents for high-velocity Rust development.