Skip to content

Codex history pass re-reads session_meta of every unchanged rollout #2787

Description

@ScriptedAlchemy

Every history pass still does O(sources) reads on a corpus of more than 1,000 Codex rollouts; this is what remains after #2786.

What happens

  • Each pass re-reads the session_meta head of every unchanged rollout. Meta is needed for the source identity, and the cursor lookup and the unchanged-generation lookup both depend on that identity.
  • The meta cache (CodexMetaFillClaim::publish) holds only shared_jsonl_preparation_capacity() entries, which is the CPU width, so it thrashes on any real corpus.
  • UNCHANGED_GENERATION_CACHE_CAP (4096) would thrash the same way past 4096 transcripts.

Measurement

Isolated daemon on an 8× store (about 60.6k messages, 800 rollouts), after #2786:

  • raw reads are 3.11 MB per message, against 2.05 MB at the base store (about 7.6k messages);
  • while settled, idle reads are 253 KB/s.

Fix direction

Skip sources whose (path, file identity, length, mtime) are unchanged at discovery, before deriving meta or identity, rather than raising either cache cap.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions