Skip to content

Benchmark a typed interpreter-call protocol against the current code-block loop #72

Description

@shanev

Problem

The current loop combines several protocol decisions:

  • extract generated Python from model text;
  • execute it and feed output back into refinement;
  • detect completion through the answer["content"] / answer["ready"] convention;
  • repair malformed answers and use a bounded extract fallback after exhaustion.

Each mechanism is individually useful, but together they create formatting and recovery surface area. A narrower protocol in which the root model emits a typed interpreter call and later returns a typed final result may remove glue without changing Droste's core method: the model still writes programs over data and delegates bounded semantic work.

This issue is an evidence-gathering experiment, not authorization for a rewrite.

Experiment

Add a benchmark arm that holds model, task, data, prompt content, and compute budget constant while varying only the execution protocol:

  1. Current protocol: generated code block + refinement loop + answer dictionary + repair/extract fallback.
  2. Typed interpreter call: a structured python.eval request with typed execution results, followed by either another interpreter request or a typed final answer.
  3. Optional hybrid: current code generation with a typed completion/result envelope, to isolate code extraction from answer signaling.

The interpreter remains behind the Capability/Broker ABI (#9). This experiment must not introduce a second sandbox or bypass policy, budget, and trace enforcement.

Measurements

Record per task and in aggregate:

  • answer accuracy and task completion;
  • malformed model-output rate;
  • code-extraction and tool-argument parse failures;
  • repair attempts, extract fallbacks, and unrecovered failures;
  • iterations and capability/subcall counts;
  • root and subcall tokens separately;
  • latency and cost;
  • terminal status correctness, including successful output that begins with ERROR: (Trajectory records need structured execution status #58).

Include factual, semantic, aggregation, and adversarial protocol fixtures. Preserve failed and timed-out attempts as typed benchmark artifacts rather than dropping them.

Decision rule

  • If the typed arm matches or improves quality while materially reducing repair/fallback frequency or protocol code, open a separate design issue for the smallest migration.
  • If it does not, retain the current protocol and fold any isolated improvements into prompt packs or result typing.
  • Do not change the public run/trace contract until the benchmark report identifies which behavior is load-bearing.

Deliverables

  • Reproducible benchmark manifest and immutable per-task artifacts.
  • A report comparing the protocol arms with confidence intervals across repeated runs.
  • A short inventory of engine code that each arm makes necessary or removable.
  • A recommendation that explicitly separates measured results from implementation preference.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Roadmap core: sequenced work that unblocks the architecturearchitectureStructural work from the Bitter-Lesson convergence plan (principles.md)benchmarkBenchmark suite and evaluation artifactscross-repoRequires coordinated changes across tensor-systems repositoriesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions