Skip to content

[lynx-perf-live 3] Backpressure-driven pacing with zero-command settlement #45

Closed as not planned

Description

@Huxpro

Classification

High-risk Lynx transport performance investigation: burst backpressure, zero-command settlement, and acknowledgement completion.

Evidence

Evidence: live-upstream residual audit.

Hypothesis

The useful Hux behavior is not a fixed frame throttle or a row-count threshold. Main-thread apply/ack timing already supplies the information needed to recognize real backpressure. A burst policy should remain absent on idle/ordinary commits, coalesce only while measured main work exceeds the available frame budget, and settle zero-command follow-ups without a round trip. Compact ACK can carry completion without restoring Hux protocol-v2's derived-handle topology mirror.

Investigation

  1. Add exact counters for render ticks, non-empty/empty prepared batches, dispatched/applied/presented commits, ACK/apply duration, queue depth, frame deadline, messages, commands, and final delivered state.
  2. Split the experiment into rollback commits: compact-ACK merged completion; zero-command local settlement with correct version/watermark semantics; then real-signal backpressure pacing.
  3. Derive eligibility from observed in-flight/apply/frame pressure, never root size or benchmark identity.
  4. Exercise engine-delivered events after locally settled versions, adoption, attachments, calls, faults, dispose, hidden/stalled frames, and older peers.

Acceptance

  • first commit after idle remains immediate and ordinary create/update/select adds zero control messages and no extra frame wait;
  • updateStorm@30k improves at least 8% in both forward and reverse expanded runs;
  • selectStorm@1k/10k/30k, clear, create, ordinary CRUD, startup/FCP, heap, and bundle have no >5% adverse decision cell;
  • every comparison publishes presented commit count and final semantic checksum; no win may rely on an undisclosed reduction of presentation states;
  • zero-command batches cross zero bytes after activation, and common compact acknowledgement completes in one reply;
  • safety/fallback tests cover stalled frame sources, watermark divergence, event delivery, attachments, worklets, rejection, and disposal.

Non-goals

Provenance

  • An agent authored this issue (agent-authored).

Activity

  1. Huxpro commented on Aug 11, 2026

    @Huxpro
    OwnerAuthor

    Final result: falsified on fresh upstream main

    I re-ran the proposal from exact upstream 9b147781c9b4ec4df053a059633978ddc0ed922a and kept the three mechanisms separable:

    1. negotiated ACK + completion merging;
    2. negotiated zero-command local settlement with distinct background/main acceptance watermarks;
    3. demand-only pacing armed by measured main-thread prepare/apply/ACK work, with a 16 ms burst window and 64 ms stalled-frame fallback.

    The demand path emitted no frame request for isolated work: main only marked a normal ACK as pressured after measured host work crossed the budget, and background requested a frame only if adjacent non-empty work actually reached that gate. There was no host-count heuristic and no unconditional frame pulse.

    Deterministic evidence

    At 1k / 10k / 30k, create, update10th, select, updateStorm, and selectStorm retained exactly the same command and row-render counts as base. The common ACK merge reduced cross-thread storm traffic by one third:

    workload base messages merged candidate change
    updateStorm (50 commits) 150 100 -33.3%
    selectStorm (30 commits) 90 60 -33.3%

    The focused safety suite passed: 5 files / 107 tests, covering negotiation, exact message validation, rejection, stalled frames, native events across divergent watermarks, and engine-delivered taps after local settlement.

    Real Lynx-for-Web, 30k rows

    Same host, production bundles, medians of n=5.

    variant create update10th select updateStorm selectStorm
    base, forward 3193 469 157 1969 338
    measured-pressure candidate 3243 460 163 2046 3016
    settlement + zero-elision, pacing disabled 3166 459 165 1964 3098
    ACK-merge only 3200 474 179 1990 355
    base, reverse (run immediately after ACK-merge) 3253 462 162 1681 339

    Interpretation:

    • measured backpressure did not improve updateStorm (1969 -> 2046, +3.9%) and catastrophically paced selectStorm;
    • zero-command settlement was the source of the 3-second selectStorm behavior, even with pacing disabled;
    • ACK merging alone reliably reduced messages but did not produce the required wall-clock result: forward 1969 -> 1990 (+1.1%), reverse candidate 1990 versus base 1681 (candidate +18.4%);
    • the first-screen bundle stayed within the 5% guard (about +0.9%), but the primary bidirectional >=8% acceptance criterion failed.

    This also agrees with the earlier isolation already recorded in this issue: pacing-only was -6.3% forward and +0.2% reverse, while demand/large-root gating washed out the updateStorm gain. Across unconditional, demand, host-count, and measured-pressure eligibility, no pacing formulation reached the bidirectional threshold without harming point updates.

    Conclusion: do not send this upstream. The protocol message reduction is real, but on the current octanejs#693/octanejs#700 transport it is not a wall-clock bottleneck, and zero-command/pacing variants trade away select latency. Closing this optimization hypothesis as falsified rather than publishing a non-mergeable performance PR.

  2. Huxpro commented on Aug 11, 2026

    @Huxpro
    OwnerAuthor

    Closing as falsified by the fresh-upstream bidirectional benchmark matrix above; no upstream PR was opened because the required acceptance threshold was not met.

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

    agent-authoredenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions