Skip to content

memory_pipeline re-spells the heavy phase: the #149 anti-drift fix covered only the selection half #232

Description

@nikolay-e

memory_pipeline::build_diff_context_in_memory lines 86-160 (75 lines, 48% of
the body)
are a step-for-step parallel of pipeline.rs compute_scored_state
(:553-587) plus run_selection (:756-772): token counts,
identify_core_fragments, core excerpts, signature variants,
compute_seed_weights, score_and_filter, needs_from_diff — same operations,
same order, second spelling.

pipeline.rs:649-653 documents #149, where exactly this drift meant "the
harness measured a system nobody runs."
The fix then introduced
select_and_postpass and closed the selection half. The heavy half was left
forked, so the same failure mode is still live in the same file that
memorialises it.

memory_pipeline.rs has one caller (test_harness.rs, the diffctx-test
example binary the YAML corpus drives), which is what makes the drift dangerous
rather than merely redundant: if it diverges, the corpus gate stops measuring
the shipped pipeline and nothing says so.

Fix: extract pipeline::score_from_fragments and have both paths call it.
Ship the −25 shared-prologue version first, the fuller −120 consolidation as a
second commit.

Naming note while in here: "memory" in memory_pipeline.rs means in-memory
input
, not RAM — the RAM module is peak_rss.rs. in_memory_harness.rs would
stop that collision, but that rename is cheap only once the duplication is gone.

Gate: bitcheck (24 cells) + full corpus. The corpus is the meaningful one here,
since it is the consumer.

Protocol: ANALYSIS_code_cleanliness_refactoring.md §6 M1, R2.2 row 35.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions