hi-eval: per-turn context-growth harness + long interp task#77
Merged
Conversation
The Pi-efficiency gap lives in long multi-turn sessions where context accumulates, but the eval was blind to that regime: the multi-turn drive (HI_EVAL_GOAL=1 HI_EVAL_TURNS=N) overwrote the report each turn, so only the last turn's tokens survived — no growth curve. Instrument it. A new `TurnMetric` captures, after every session-continuing turn, the context (input) tokens sent, total tokens, tool calls, and goal progress (done/total, read from the report's goal summary block). It's threaded Candidate -> RunResult -> RunArtifact (into the trial JSON and runs.jsonl) and printed as a per-turn growth curve. `input_tokens` per turn is now a first-class signal — the "how fast does context accumulate vs. how far does the goal get" axis the curation/compaction levers move. Also add bench/long/interp: a ~10-requirement expression interpreter (tokenizer + recursive-descent parser — precedence, right-assoc **, unary, variables, comparisons, min/max/abs, typed errors) with a 30-assertion offline verify and a tested reference. Joins the existing multi-file CLI builds (kanban-cli, library-cli) in bench/long. Verified live (pipe/glm-5.2-fast, goal-driven multi-turn): ctx 9450 (t1, 0/8) -> 28407 (t2, 8/8), PASS — context accumulation and goal progress both captured and displayed. Tests: new read_turn_metric unit test (real report shape + fail-open on a missing report); fmt/clippy clean; 14 hi-eval tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Pi-efficiency edge (send less context, hold/raise pass rate) lives in long multi-turn sessions where context accumulates — the exact regime the single-turn bench can't see. The eval already drives multi-turn (
HI_EVAL_GOAL=1 HI_EVAL_TURNS=N, session persisted via--session-file), but it overwrote the report each turn, so only the last turn's tokens survived. No growth curve → the regime stayed unmeasured. This adds the missing instrumentation.What
Per-turn growth capture. A new
TurnMetricis recorded after every session-continuing turn — context (input_tokens) sent, total tokens, tool calls, and goal progress (done/total, read from the report'sgoalsummary block). ThreadedCandidate → RunResult → RunArtifact(serialized into each trial JSON +runs.jsonl) and printed as a per-turn curve:input_tokens/turn is now a first-class signal — the "how fast does context accumulate vs. how far does the goal get" axis. Watch for ctx climbing whiledonestalls: that's the bloat the curation/compaction levers should flatten.A long task —
bench/long/interp: a ~10-requirement expression interpreter (tokenizer + recursive-descent parser: precedence, right-assoc**, unary, variables, comparisons,min/max/abs, typed errors) with a 30-assertion offline verify and a tested reference. Joins the existing multi-file CLI builds (kanban-cli,library-cli).Verified live (
pipe/glm-5.2-fast, goal-driven multi-turn)HI_EVAL_GOAL=1 HI_EVAL_TURNS=8 HI_EVAL_TURN_STEPS=3:TURN_STEPS=8) independently showed 38,424 → 54,713 across two turns.Honest caveat:
interpis a single-file task, so a capable model writes it in one big edit and completes in ~1–2 turns — it demonstrates the curve but won't produce a many-turn one. The natural long-curve demonstrators are the multi-filekanban-cli/library-clitasks; running those multi-turn (and then A/B-ing curation/elision/compaction levers against the curve) is the follow-up, gated on stable pipenetwork capacity.How to run
Test
read_turn_metricunit test (real reportgoal.done/goal.totalshape + fail-open on a missing report).cargo fmt --all --check✓ ·cargo clippy -p hi-eval -D warnings✓ · 14hi-evaltests pass.interppasses--validate(fail-before / pass-after); data-only task files, no CI surface.🤖 Generated with Claude Code