asupersync

repository·main·Indexed 42 days ago

https://github.com/dicklesworthstone/asupersync

A spec-first, cancel-correct, and capability-secure asynchronous runtime for Rust (v0.5.0) focusing on structured concurrency, explicit cancellation protocols, and two-phase effects to prevent data loss. The project includes asupersync-macros for concurrency ergonomics, asupersync-conformance for runtime validation, and comprehensive testing suites for QUIC and HTTP/2 protocol conformance.

Tokens
945.1K
Snippets
1.4K
Records
3.7K
Agent score
52%

What's inside asupersync

  1. Overview of postgres_parameter_messages fuzz target

    main

    The postgres_parameter_messages fuzz target tests the parsing robustness of PostgreSQL protocol parameter messages. It focuses on two primary message types:

    • ParameterDescription (parse_parameter_description in src/database/postgres.rs):

      • Format: i16 parameter count followed by an array of i32 OID values.
      • Tests: Negative counts, oversized arrays, and invalid OIDs.
    • ParameterStatus (handle_parameter_status in src/database/postgres.rs):

      • Format: Null-terminated parameter name followed by a null-terminated value.
      • Tests: Embedded nulls, encoding corruption, and oversized strings.

    The fuzzer uses structure-aware generation to create test cases including standard PostgreSQL types (e.g., TEXT(25), INT4(23), BOOL(16), UUID(2950)), common runtime parameters (e.g., application_name, client_encoding, TimeZone), and various corruption patterns like truncated messages or invalid UTF-8.

  2. Overview of the ATP vs rsync benchmark matrix harness

    main

    The ATP vs rsync benchmark matrix is a rigorous harness used to compare the performance and integrity of atp against rsync. It consists of four primary components:

    1. matrix_bench.sh (Planner/Resume Layer): Enumerates all combinations of (workload, regime, tier, method, rep), generates a resumable plan in JSONL format, and skips cells that have already been completed.
    2. run_matrix_cell.sh (Per-cell Runner): Executes a single transfer within a hermetic network namespace (netns), virtual ethernet pair (veth), and network emulation (netem). It measures wall time, peak/average RSS, CPU usage, and feedback rounds, then performs SHA-256 verification.
    3. gen_tree.py (Tree Generator): A deterministic, seeded power-law tree generator (supporting tree_small and tree_big) that also produces per-file manifests.
    4. score_matrix.py (Scorer): Processes the JSONL results to produce a markdown scorecard containing medians, coefficients of variation (cv), and ATP/rsync ratios for wall time and RSS.
  3. What is Asupersync?

    main

    Asupersync is a spec-first, cancel-correct, and capability-secure async runtime for Rust. It is designed as a broad replacement for Tokio stacks rather than a simple wrapper, providing stronger guarantees through several core design principles:

    • Structured Concurrency: Every task is owned by a specific region; closing a region ensures quiescence (no live children and all finalizers are complete).
    • Cancel-Correctness: Cancellation follows a strict protocol: request -> drain -> finalize. It is not a silent drop; races must cancel and fully drain 'losers'.
    • Two-Phase Effects: Uses reservation/commit APIs to protect channel and effect boundaries from data loss during cancellation windows.
    • Capability Security: Effects are gated by held Cx authority. While ambient lookup can mirror an installed context, it cannot mint new authority.
    • Deterministic Testing: Provides LabRuntime with virtual time, DPOR, oracles, and chaos injection.
    • Obligation Tracking: Permits, acks, and leases must resolve by either a commit or an abort.

    Supported Capabilities:

    • Networking: TCP, HTTP/1.1, HTTP/2, WebSocket, TLS, gRPC, DNS, and feature-gated native QUIC/H3.
    • Databases: SQLite, PostgreSQL (wire protocol), and MySQL (wire protocol).
    • Supervision: OTP-style actors, GenServer, supervision trees, AppSpec, and Spork.
  4. Overview of the Asupersync WASM Browser Adaptation Plan

    main

    The Asupersync WASM program aims to build a browser-native runtime that preserves core semantic guarantees—such as structured concurrency and explicit cancellation—while providing an ergonomic TypeScript/React/Next.js developer experience.

    Key Goals:

    • Compile a useful Asupersync subset to the wasm32-unknown-unknown target.
    • Maintain first-class cancellation and structured concurrency semantics.
    • Provide a production-ready JS/TS API.
    • Enable deterministic replay and diagnostics as a flagship capability.
    • Ensure straightforward integration with React and Next.js.
  5. Overview of Domain-Specific Migration Cookbooks

    main

    This document provides end-to-end migration cookbooks for replacing tokio and related ecosystem crates (like axum, tonic, quinn, h3) with asupersync equivalents. The migration is organized into 6 tracks based on capability domains. Each cookbook provides recipes, code transformations (before/after), anti-patterns, failure modes, and rollback criteria.

    Migration Tracks

    TrackDomainPrerequisite Docs
    T2Async I/O + Codectokio_io_parity_audit, e2e logging
    T3fs/process/signaltokio_fs_process_signal_migration_playbook
    T4QUIC/H3 + networkingquic_h3_forensic_log_schema
    T5Web/gRPC/middlewaretokio_web_grpc_migration_runbook
    T6Database/messagingtokio_db_messaging_migration_packs
    T7Interop adapterstokio_interop_support_matrix

    Prerequisites

    • asupersync-2oh2u.10.13 (golden log corpus)
    • asupersync-2oh2u.2.10 (I/O e2e logging)
    • asupersync-2oh2u.11.1 (migration strategy framework)
  6. Overview of Database and Messaging Migration Packs

    main

    Asupersync provides migration packs to help developers translate usage patterns from common tokio-ecosystem crates (like sqlx, tokio-postgres, redis, nats, etc.) to equivalent Asupersync patterns. Each pack covers connection setup, query execution, transactions, and error handling.

    Supported Migrations

    Source CrateAsupersync TargetMigration Pack ID
    sqlx (PostgreSQL)database::postgresMIG-PG
    tokio-postgresdatabase::postgresMIG-PG-TOKIO
    sqlx (MySQL)database::mysqlMIG-MY
    mysql_asyncdatabase::mysqlMIG-MY-TOKIO
    sqlx (SQLite)database::sqliteMIG-SQ
    bb8 / deadpooldatabase::poolMIG-POOL
    redis (crate)messaging::redisMIG-RD
    async-natsmessaging::nats + messaging::jetstreamMIG-NT
    rdkafkamessaging::kafka + messaging::kafka_consumerMIG-KF
  7. Overview of asupersync CLI binaries

    main

    The asupersync project provides several primary CLI binaries, each with distinct feature requirements and command structures:

    • asupersync: The main entry point. Includes command families for atp, trace, conformance, lab, and doctor. When the remote-service feature and Unix platform are enabled, it also exposes remote serve and remote probe commands.
    • atp: A standalone transfer binary used for data movement. It features commands like send, recv, serve, and various bond-* commands.
    • atpd: The daemon binary. Manages the lifecycle of the service with commands like start, stop, status, reload, init, diagnostics, and identity (which includes show, generate, import, and export).
    • offline_tuner: A utility for optimization. Commands include optimize, candidates, emit-profile, validate, and scheduler-recommend. Requires cli and simd-intrinsics features.
  8. Overview of the Scheduler Hot-Path Performance Benchmarking Surface

    main

    The performance benchmarking system uses a single registry, artifacts/baseline.json, to store gated p50 (median) performance rows. Each benchmark binary is responsible for a specific disjoint operation prefix. The gate mechanism ensures that a binary only compares its own results against its own registered rows, preventing cross-binary failures.

    Benchmark Binary Mapping:

    Bench binaryPrefix ownedLever it instruments
    methodology_baselinesmethodology/Phase 6 core-op baselines
    spawn_throughput(not yet tracked)spawn/join admission
    injector_throughputsched/injector/LCRQ-style injector upgrade
    task_state_hot_readssched/task_state/historical non-equivalent task-state microbench rows
    channel_contendedsched/channel_contended/flat-combining MPSC
    io_token_dedup(comparator-only)I/O-driver dedup plus worker seen-token table

    Important Notes:

    • io_token_dedup is ungated because its absolute costs are highly sensitive to host noise; it is intended for relative strategy comparison only.
    • sched/task_state/ rows are historical and should not be used as production hot-read baselines. Use the sched/hotread/v2/ replacement operations instead.
    • New semantic paths must use new operation IDs rather than overwriting existing ones.
  9. Review the Tokio Capability Evidence Matrix

    main

    The tokio_capability_evidence_map.md provides a comprehensive mapping of how asupersync implements or replaces various Tokio capabilities. It serves as a technical audit and reference for developers to understand the coverage, source locations, testing strategies, and feature flags for different functional areas (e.g., Runtime, I/O, Networking, Observability).

    Each entry in the matrix (labeled F01 through F28) details:

    • Src: The source files implementing the capability.
    • Features: The Cargo features required to enable the capability.
    • Tests: The types of testing used (inline, integration, conformance) to ensure correctness.
    • Deps: External dependencies used for that specific capability.
  10. Understand the Database and Messaging Replacement Gap Baseline

    main
    This document outlines the current implementation gaps in asupersync compared to the mature Tokio ecosystem (e.g., sqlx, bb8, deadpool). It serves as a roadmap for developers to understand what features are missing in database drivers (PostgreSQL, MySQL, SQLite, Redis) and messaging protocols (NATS, Kafka) and the reliability/performance requirements needed for production use.
  11. Understand the ATP Native QUIC Protocol Conformance structure

    main

    The conformance/quic/ directory provides the specification scaffolding and reference data required to validate ATP's native QUIC protocol implementation. It is organized into four main functional areas:

    • frame_specs/: Contains tests for QUIC frame specifications.
    • packet_specs/: Contains tests for QUIC packet formats.
    • reference_vectors/: Provides test vectors used for protocol validation.
    • interop_tests/: Contains test cases for interoperability.

    Note on Status: This material is currently considered specification scaffolding. It is used by the conformance tests in tests/atp/quic/conformance.rs to validate correctness, but it should not be treated as live production pass evidence until the ATP-N2 dependency chain is implemented.

  12. Understand the RABS (Asupersync-Native RCH Accelerated Build Sidecar) Roadmap

    main

    The RABS project is a multi-phase master plan to implement a native, accelerated build sidecar for Asupersync. The development is organized into Milestones (M0 through M9) that transition from local record/replay capabilities to a fully distributed, ATP-native (Asupersync Transport Protocol) remote execution system.

    Key architectural phases include:

    • M0-M1: Foundation: Establishing rabs-protocol, local request/event schemas, and a canonical Cargo-driver using Linux mount namespaces for isolation.
    • M2-M3: Runtime & Storage: Implementing the Asupersync runtime island, process ownership, and a durable object store (rabs-cas) with atomic publication.
    • M4-M5: Dependency Caching: Implementing immutable dependency action-family caching and native toolchain/linker (CC/CXX/AR) wrappers.
    • M6-M9: Distributed Coordination & ATP: Moving to an authoritative coordinator (rabs-coord), a native ATP control plane, and whole-command remote execution over ATP.