Skip to content

refactor(runtime): replace asupersync with Tokio - #4865

Open
ScriptedAlchemy wants to merge 14 commits into
masterfrom
refactor/replace-asupersync
Open

ScriptedAlchemy wants to merge 14 commits into
masterfrom
refactor/replace-asupersync

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

TraceDecay used Asupersync alongside Tokio for storage and daemon execution. This PR moves those services onto the existing Tokio stack and removes Asupersync, its macros, source patches, Bazel annotations, obsolete runtime arguments, and cross-runtime transport adapters.

Accepted writes and retained tasks keep the runtime that admitted them. Dropping a request's waiter does not abandon settlement. Storage timers use their owning driver, synchronous waits use the marked blocking pool, and block_on hands scheduling to another worker on a multithreaded runtime while refusing a current-thread runtime. Queued observation preparation checks cancellation before starting. The CLI installs one runtime for its services.

The production runtime disables Tokio's LIFO slot through its documented builder option to retain bounded wake behavior. Runtime performance has not been benchmarked. Work that can hold a worker belongs on the blocking pool; regressions exercise socket wake progress through that boundary.

Native macOS Bazel verification on the final source diff committed as 9fdc01b502:

  • SQLite runtime unit suite: 443 passed, including busy-retry timers, single-worker progress, and current-thread refusal.
  • API unit suite: 62 passed, including real router dispatch and nested blocking execution without a public test probe.
  • Sessions unit suite: 667 passed. The Codex unsettled-clock regression now uses native metadata with an explicit clock witness, so scheduling delays cannot select the wrong branch.
  • Strict Clippy on the SQLite runtime, runtime-core, API, and sessions unit targets: passed.
  • Formatting checks for all four crates, commitlint, and git diff --check: passed.

The migration also has regressions for accepted blocking settlement after waiter cancellation, retained runtime identity, stopped timer drivers, task panic/cancellation, TLS deadlines and draining, and Unix peer-close handling. Hosted checks for the new head remain pending; native Windows execution is not established by the macOS results. The Devin review reports a hidden flag whose details are unavailable through the PR feedback tool, so no claim is made that this unseen finding was reviewed.

@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b17702e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review November 11, 2026 01:18

@devin-ai-integration devin-ai-integration Bot left a comment

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.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Remove obsolete execution-context arguments from storage writers and
attachments, and update watch, mpsc, runtime handle and builder callers
to the current Tokio contracts. Pin watch change futures while retaining
the all-waiter wake and closed-channel assertions.

Keep queue batching checks exact and current-thread assertions local to
the active runtime. Retained automation settlement uses the existing
scoped blocking helper so synchronous storage remains admitted after
the caller stops observing its result.

Validation: all 11 owning Bazel rustfmt targets and git diff --check pass.
Compilation, Clippy and runtime tests remain for hosted CI.
Yield while GC, shutdown and context-scout tasks settle on current-thread
runtimes. Assert the selected Tokio runtime and scoped blocking execution.
Isolate process-global storage-wait measurements from parallel fixtures,
retaining all deadlines and zero-wait assertions.

Cover missing SSE timers and loopback runtime ownership. Validation of the
full runtime and storage suites remains delegated to CI.
@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) November 11, 2026 21:47
Run storage-pool timers on the pool driver so synchronous waits and inline deferred returns no longer panic without an ambient Tokio runtime. Let block_on move a multi-thread worker task to a blocking thread instead of refusing, and expose the storage blocking-pool marker for boundary tests. Arm Notify futures before checking state in settlement and memory-graph waits so notify_waiters cannot be lost. Observe cancellation before queued observation preparation starts, and drop the unused registry runtime-unavailable variant. Update the Git catalog and remote enrollment tests to exercise the supported blocking boundaries.
Use a native metadata-derived unvouched witness so scheduling delays
cannot change the clock branch under test. Keep production acquisition
intact and check both unchanged and changed native identities against
the same real directory entry fingerprint.
Exercise nested blocking work through the runtime instead of exporting its pool marker. Keep the generation-based Notify waits guaranteed by Tokio. Bound failure in the single-worker progress regression and cover current-thread refusal.
Release admission owners and join exact registered runtime retirement before inspecting or reopening each sampled store. Preserve the cancellation poll sweep and all rollback and reopen assertions.

This branch has not been deployed

No deployments
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