Skip to content

Felt speed 9/10: qualify moving echo sync off the final reply path #16

Open

Description

@n0rpan

Parent: oxstack/oxa#43, owner O-383. Milestone v0.2.2, label after-0.2.1. No implementation or merge in v0.2.1. This is a self-contained task for an assigned DeepSeek-on-Go helper; first read AGENTS.md and recheck current main. Verification below is source-only at 69a81515ad3ce39dbf048112fd0cfad476f4b73f: no build, benchmark, provider call or hardware run was performed. Claimed gains remain hypotheses unless a separate immutable measurement receipt is supplied.

Verified on main

engine/crates/server/src/echo.rs:463 append_line still calls sync_data. record_deferred releases the EchoStore mutex before PendingAppend::write, but engine/crates/server/src/service.rs:486 echo_record calls p.write synchronously in the same function. The streaming completion path calls echo_record before final frames at2348–2365. This is not already asynchronous merely because the method says deferred. Existing #11 and unfinished oxstack/ox-llm#614 remain the canonical context; do not create a competing implementation. The5–20ms gain is unmeasured.

Bounded spec and ownership

Review/reuse oxstack/ox-llm#614’s actual state, then propose a bounded write-offload design that preserves in-memory splice visibility, per-session ordering, clear/wipe/eviction epochs, shutdown behavior and explicit crash-loss semantics. No unbounded queue, per-token thread, new daemon or weakened privacy cleanup. Engine/durability owner must release implementation before engine behavior changes; this issue alone is not that release.

Acceptance

A synthetic injected blocked fsync must not block final SSE/JSON delivery once an approved offload exists, while actual durable writes complete under the documented shutdown contract. Tests cover clear/evict while pending, restart, failure, cancellation and no resurrection after wipe, retaining existing tests_echo and state_store assertions. Measure last-token-to-Done/body latency and next-turn splice latency, queue bound, RSS and threads with controlled disk delay. No timing-limit weakening or filesystem bypass to get a green result.

Execution boundary: keep the patch small and consumed by existing callers; no new daemon/framework, credentials, real provider/sign-in calls, security/test weakening or force-push. Tests/builds run in GitHub CI with synthetic loopback fixtures and isolated HOME/XDG, CARGO_BUILD_JOBS=3. No local builds/tests. Preserve required checks; draft until own checks pass. Hardware work requires the owner’s explicit handoff. Do not merge. Report exact source, test result, before/after measurement and limitations.

Activity

  1. n0rpan commented on Nov 19, 2026

    @n0rpan
    ContributorAuthor

    Triage 2026-11-19: this issue is now tracked in #28 (Cluster: Engine performance and hardware, priority P2), planned PR 1: "Hot path". It will be fixed there together with its related issues, not one by one.

  2. transferred this issue fromon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions