Skip to content

hi-eval: per-turn context-growth harness + long interp task#77

Merged
davidrhodus merged 1 commit into
mainfrom
feat/long-task-growth-harness
Jul 10, 2026
Merged

hi-eval: per-turn context-growth harness + long interp task#77
davidrhodus merged 1 commit into
mainfrom
feat/long-task-growth-harness

Conversation

@davidrhodus

Copy link
Copy Markdown
Contributor

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 TurnMetric is recorded after every session-continuing turn — context (input_tokens) sent, total tokens, tool calls, and goal progress (done/total, read from the report's goal summary block). Threaded Candidate → RunResult → RunArtifact (serialized into each trial JSON + runs.jsonl) and printed as a per-turn curve:

growth (ctx tok · tools · sub-goals done):
  t1  ctx=    9450 tools=  3 goal=0/8
  t2  ctx=   28407 tools=  2 goal=8/8

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 while done stalls: that's the bloat the curation/compaction levers should flatten.

A long taskbench/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:

  • ctx 9,450 (t1, goal 0/8) → 28,407 (t2, goal 8/8), PASS — context accumulation and goal progress both captured and displayed.
  • A second run (TURN_STEPS=8) independently showed 38,424 → 54,713 across two turns.

Honest caveat: interp is 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-file kanban-cli/library-cli tasks; 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

HI_API_KEY=… HI_BIN=…/target/debug/hi \
  HI_EVAL_GOAL=1 HI_EVAL_TURNS=8 HI_EVAL_TURN_STEPS=3 HI_PLANNER_MODEL=pipe/glm-5.2-fast \
  cargo run -p hi-eval -- --profile=pipenetwork --models=pipe/glm-5.2-fast --configs=baseline --trials=1 bench/long

Test

  • New read_turn_metric unit test (real report goal.done/goal.total shape + fail-open on a missing report).
  • cargo fmt --all --check ✓ · cargo clippy -p hi-eval -D warnings ✓ · 14 hi-eval tests pass.
  • interp passes --validate (fail-before / pass-after); data-only task files, no CI surface.

🤖 Generated with Claude Code

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>
@davidrhodus
davidrhodus merged commit 2b189b7 into main Jul 10, 2026
1 of 3 checks passed
@davidrhodus
davidrhodus deleted the feat/long-task-growth-harness branch July 10, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant