Skip to content

bench(chat-history): reproducible virtualization benchmark comparing naive / #4998 detach / MessageWindow eviction / hybrid #128

Description

@jdmanring

Purpose

Provide a reproducible, apples-to-apples comparison of chat-history rendering strategies so the architecture decision rests on measurement rather than assertion, and so an upstream maintainer can re-run it and get the same shape.

Tracks the work already present on develop (see Provenance below) and the upstream-candidate branch cut for it.

Scope

  • tests/bench/chat_history_bench.py — harness: deterministic corpus, four arms, CDP + psutil instrumentation, curve runner, JSON + markdown emitter.
  • tests/bench/vendor/chatVirtualizer_4998.js — upstream PR feat(ui): virtualize #chat-history to fix long-chat lag odysseus-dev/odysseus#4998 vendored verbatim with provenance, so the arm measures their real code and not a reimplementation.
  • tests/bench/vendor/hybrid_bench.js — the hybrid arm (warm-band detach over cold-tail eviction). Hypothesis, refuted. Kept as a recorded refutation.
  • tests/test_chat_history_hybrid_bench_js.py — five real-Chromium guards proving the hybrid arm detaches warm, evicts cold, and restores from both bands.
  • docs/dev/chat-history-benchmark.md — methodology, fairness protocol, instrument selection, and the probe failures that motivate each guard.

Outcome

The hybrid buys nothing over eviction alone at any history length that matters. The reason is structural, not a tuning failure: detach-preserve retains a superset of what eviction retains over the same window, and a live window already delivers instant recent scroll-back at zero work and zero network — which is odysseus-dev#4998's entire value proposition.

Full reasoning: docs/fork/chat-history-architecture-decision.md (fork-only). Numbers: tests/bench/results/bench.md (generated; never hand-written).

Findings this produced

Provenance / process note

This work was committed directly to develop (ab2392b0, 996643c7, ce6b7e2b, 8425c28d, 08cf0c4b) before this issue existed, contrary to the repo's issue-first / branch-second rule and the upstream-candidate branch-origin rule. develop's history is being left intact; the upstream-candidate branch is cut from upstream-mirror and the files reconstructed there as clean additions (they are all new files, so no conflicts). docs/fork/** correctly stays on develop only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-candidateBug or feature suitable for contributing to upstream

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions