Files
aji/docs/evaluation/b1-heldout-plan.md
T

14 KiB
Raw Blame History

B1: the first held-out benchmark after Phase 5 (pre-registration)

Status: Accepted (owner, 2026-10-06). D1–D5 were decided as recorded at the end; D4 carries the no-tuning rule. Frozen at ajieval freeze. After that nothing in this document changes until the last run. Decision context: owner, 2026-10-06. Phase 5 is closed. Phases 7 and 8 are on hold until B1 is analyzed.

Phase 5 exit → B1 (this document) → analysis H1/H2/H4/H5 → decision: Phase 7 or Phase 8

1. Questions

  1. Does Aji/source raise verified success over Rust and Zig on systems tasks that load ownership, concurrency and atomics (H1)?
  2. Does it reduce repair work (H2)?
  3. How does success degrade from the strongest to the weakest agent stack in each language? The question is whether the degradation curve is flatter for Aji: the shape of degradation, not only the end points. B1 measures this as a stack-level capability compression signal, not as evidence for H4 (D1).
  4. What does a correct solution cost in tokens and time? Proxies only: H5 is not tested in B1 (D5).

2. Design

Variable Values
Language (condition) Rust, Zig, Aji/source. Aji/AIR is excluded (D2); a later diagnostic AIR experiment would not be part of B1.
Agent stack (Track B, native agents) N1 Codex + gpt-6.1-sol (high), N2 Claude Code + claude-opus-5-5 (high), N3 OpenCode + zai-coding-plan/glm-5.3-flash, configured as in P6A-9
Task 6 private held-out tasks, 2 per family (§3)
Repetition 3 independent runs per cell

Matrix: 6 tasks × 3 languages × 3 agents × 3 runs = 162 runs.

Procedure (as for P6A-9):

  • The cells run one at a time, in an order shuffled once at freeze time. Each run gets a fresh workspace and HOME.
  • Nothing changes between ajieval freeze and the last run: Aji, the bundles, the harness, the agent configurations, the tasks and the evaluators.
  • No commit is made to this repository during that time.
  • Observations go only to ajieval journal.
  • An HTTP 429 is journaled and waited out. A completed run is never re-run.
  • An infrastructure failure that invalidates a run stops the matrix and is reported before anything else.

Expected wall time is about 40 hours of sequential runs.

Toolchain: the tag b1-frozen, built with zig build -Doptimize=ReleaseSafe. ReleaseSafe changes no Aji semantics: traps are explicit and the Zig safety checks stay on. It runs the interpreter about 5× faster than the Debug build used in P6A-9, so a correct Aji program is not failed by the hang guard for interpreter speed alone. The binary hash and both bundle hashes are recorded. The references, the pilots and the 162 runs all use this one build.

Harness parity for aji_source, settled before the reference gate (no task content involved):

  • Allocation authority. Rust and Zig have an ambient heap. In Aji, allocation needs the mem.alloc capability, which channel.make, island.create and the other allocation operations take. The aji_source entry point therefore also receives heap: cap<mem.alloc>, with a budget equal to the task's stated memory limit, and the evaluator grants it.
  • The hang guard. It is the same wall-clock limit for every language, and it only catches non-terminating programs. After the reference gate, the operator measures the longest hidden-case run of each language's reference. If any reference needs more than a third of the guard, the guard is raised for all three languages before the first pilot.
  • Limitation, accepted as symmetric. The evaluators judge observable output (exact results, identical output for 1–8 workers and across repeated runs). A correct sequential program therefore also passes the concurrency families, in every language alike.

3. Task families

These are capability descriptions for the independent author. They name no construct of Aji or of any other language.

  • A: ownership, resources, bounded memory.
    • Data structures and streams whose memory must stay within a stated bound.
    • Resources (files, buffers) acquired and released on every path, including failure paths.
    • Malformed input handled without crashing.
    • Nothing may be used after release or released twice.
  • B: structured concurrency, cancellation, isolated object graphs.
    • Several workers exchange work and results.
    • Cancellation or early stop arrives in the middle of work.
    • Every worker must be accounted for at the end.
    • Linked or cyclic data built by one worker is handed to another or shared read-only.
  • C: atomic synchronization, publication, compare-and-swap.
    • Lock-free counters, flags or slots shared by several workers.
    • Data published by one worker and consumed by another.
    • Retry loops on a contended value.
    • Results must be exact under every interleaving the hidden tests force.

Each task must be solvable in Rust, Zig and Aji/source. More than one implementation strategy must be valid, and the statement is language-neutral (benchmark-authoring.md).

4. Difficulty

Level Target
easy the frontier stacks nearly always pass
medium the weakest stack understands the task and writes a program, but systems errors (ownership, races, orderings, resource paths) are common in at least one language
hard beyond the weakest stack

The stack-level signal is measured on the medium level. A task on which the weakest stack spends its whole budget reasoning and writes no program measures nothing about the language; task C in P6A-9 showed this.

Distribution (D3).

  • 6 tasks, 2 per family: A × 2, B × 2, C × 2.
  • 1 easy, 4 medium and 1 hard.
  • Every family has at least one medium task, so the easy and the hard task are never in the same family.
  • The author assigns each task its target band before any pilot.

Calibration (D4). Every candidate task gets one pilot run per agent stack in each of the three languages: 9 runs per task, 54 for six tasks. A task is kept only if its pilot fits its target band under these language-symmetric rules, fixed now. "Strong" means N1 and N2, "weak" means N3, and "succeeds" means the evaluator accepts.

Band Rule
EASY the strong stacks pass in ≥ 5 of their 6 language cells, AND the weak stack succeeds in ≥ 2 of 3 languages
MEDIUM each strong stack succeeds in ≥ 2 of 3 languages, AND the weak stack succeeds in 1 or 2 of 3 languages, AND the weak stack produces code in all three languages
HARD each strong stack succeeds in ≥ 2 of 3 languages, AND the weak stack succeeds in 0 of 3, AND in every language it produced a substantive implementation: a source file, and at least one compiler, verifier or test invocation on it

No tuning. After a task's first pilot run the task is never edited. That covers its statement, tests, limits and evaluator. The only outcomes are:

task fits its target band      → kept unchanged
task does not fit its band     → discarded completely; the author writes a new task; the new task gets a fresh pilot

Looking at where a pilot failed and adjusting the same task is forbidden.

  • Before the first pilot, a reference writer may still report a real ambiguity, and the author may correct the task, as benchmark-authoring.md says.
  • Pilot runs are never part of B1's statistics and are never reported as results of a language, not even to the language developer.
  • Only the number of candidates discarded by calibration may be published, with no performance by language.

Execution rules (owner, 2026-10-06)

  • Solvability is a validity gate, not calibration. Before any pilot, reference writers establish that each task is solvable in Rust, Zig and Aji/source. A task replaced because one language cannot express it, or because its reference does not pass, is counted separately and reported as a selection effect (number and language, no task content).
  • Ambiguity found by a reference writer before the pilot. The task may be corrected. It then gets a new version, and the reference gate is repeated in all three languages.
  • After the pilot: a task outside its band is only discarded. Nothing about it changes: not its text, limits, public tests or evaluator.
  • After the first of the 162 runs nothing changes, harness instrumentation included, even if a metric turns out inconvenient. Problems go only to the journal and to post-run analysis.
  • Gates: the six tasks are returned; then all three references pass for every task; then calibration (54 runs) proceeds without a further owner decision.

5. Metrics

Per run, from the run record (protocol §13–§16, §27):

  • verified success: the evaluator accepts the final repository;
  • first-attempt success;
  • repair cycles;
  • tool calls;
  • uncached provider input;
  • output tokens;
  • wall time;
  • failure class and where the failure was caught (compiler or verifier, runtime, test).

New in B1 (implemented in ajieval, §8):

  • Pre-test statically caught safety errors. Safety diagnostics the compiler or verifier reported during the run, before any test ran. The code sets are fixed before freeze, one per language:

    • Aji: ownership, borrow, resource, island, concurrency, atomic and unsafe codes;
    • Rust: borrow-checker, move, lifetime and Send/Sync codes;
    • Zig: none (its safety checks are dynamic).

    This metric is not symmetric across languages. It is used only to analyze the mechanism within Aji and Rust: where defects are stopped. A cross-language claim about safety ("Aji caught more, so Aji is safer") must not be made from it. Cross-language conclusions about safety come only from the hidden, fuzz and runtime gates of the evaluator.

  • Cost proxies (D5). For each agent stack × language, the totals over all runs, failures included, divided by the accepted runs:

    • uncached_input_per_accepted;
    • output_tokens_per_accepted;
    • wall_seconds_per_accepted.

    Next to them: the median tokens, wall time and tool calls per run. An unreliable but cheap stack therefore does not look artificially cheap.

  • Race and atomic-ordering failures. Failed runs classified CONCURRENCY, DEADLOCK or ATOMIC_ORDERING.

  • Unsafe usage. A static count in the final program:

    • Aji: functions declaring unsafe, ref unchecked, assume;
    • Rust: unsafe blocks and functions;
    • Zig: a fixed list of unchecked builtins and pointer casts.
  • Atomic error kind. For failed runs of family C: memory_model (a wrong ordering or publication) or algorithmic (a wrong protocol under sequential consistency). The classifier decides from the evaluator's failing gate and the final program. The language developer never sees the program.

6. Analysis plan (fixed before the runs)

  1. The main table: verified success rate (VSR) per agent stack × language, each cell n = 18 (6 tasks × 3 runs), with 95 % Wilson intervals. Separately for the medium tasks and for each family.

  2. Degradation shape: for each language, VSR along N1/N2 → N3, and the difference to the best baseline per agent stack. A flatter Aji curve is the signal. With three stacks this is three points, not a capability curve (D1).

  3. H1 (protocol §35): for the weakest stack, Aji VSR ≥ the best Rust/Zig VSR + 15 percentage points on families A and B. B1 reports this as preliminary: n = 18 per cell is too small for confirmation.

  4. H2: median repair cycles among accepted runs, Aji ≤ 70 % of the best baseline.

  5. Stack-level capability compression signal (D1, not H4). N3 + Aji is compared with N1/N2 + Rust/Zig, non-inferior within 5 percentage points. The strongest form is N3 + Aji ≈ N1/N2 + Rust/Zig. It is reported as a preliminary practical signal: the stacks differ in more than the model. Strict H4 is only the follow-up controlled experiment (same scaffold, direct APIs, 4 capability levels, Rust / Zig / Aji). 5a. Two figures carry the analysis:

    • stack strength against VSR, one line per language;
    • task difficulty band (easy, medium, hard) against VSR per language.

    The signal of interest is the weak stack keeping its success on Aji longer than on Rust/Zig across the four medium tasks, while the strong stacks stay at about the same level.

  6. Variance: the spread across the three runs of each cell is reported. A cell whose three runs disagree is shown as such.

  7. Failures: every failed run is classified (§27 category, where caught, §38 cause) before the summary is shared. No language change is decided from B1 before this classification.

  8. Negative results are kept and reported (protocol §37).

7. Decision rules after B1 (owner's text)

  • If H1 and H4 give a strong signal, go to Phase 7: the next question is whether verified semantics compile to real native code without killing performance.
  • If the bottleneck is agent and tool interaction rather than the runtime, Phase 8 may come first.
  • If H4 does not show, do not invest in the backend yet. First understand why the verifier and the source language do not compensate for the capability gap.

A positive B1 is followed by a full confirmatory experiment: 8–12 tasks × 3 languages × 4 capability levels (one stack between N2 and N3, or below N3) × at least 6 runs.

8. Roles and integrity

As benchmark-authoring.md:

  • Independent benchmark author: a clean context in the private repository, briefed from §3–§4 only.
  • Reference writers: one clean context per language (Rust, Zig, Aji/source), each seeing only the statement, the starter workspace and that language's frozen documentation.
  • Clean operator: freeze, matrix, classification.

The language developer receives only numbers, codes, gate names, hashes and file names. B1's tasks become dev material once their results are used for a design decision (protocol §7).

Decisions (owner, 2026-10-06)

Decision
D1 Accepted. B1 is not evidence for H4: the stacks differ in more than the model. It reports a stack-level capability compression signal. Strict H4 needs the controlled follow-up. Protocol §39a stays unchanged.
D2 Accepted. Aji/AIR is excluded completely.
D3 Accepted. 1 easy, 4 medium, 1 hard; 2 tasks per family; at least one medium per family (§4).
D4 Accepted, with the no-tuning rule (§4): symmetric calibration, 54 pilot runs, explicit band rules, and no edits after the first pilot. A misfitting task is discarded and replaced by a new one with a fresh pilot. Pilots are excluded from statistics and never reported by language.
D5 Accepted. H5 is not tested; dollar cost is N/A. Cost proxies are counted over all runs per accepted run, next to the per-run medians (§5).