B1: pre-registration of the first held-out benchmark after Phase 5 (Proposed); harness metrics

docs/evaluation/b1-heldout-plan.md: Rust, Zig, Aji/source x 3 native agents
x 6 tasks (families A/B/C, capability descriptions only) x 3 runs = 162;
metrics, analysis plan, decision rules; owner decisions D1-D5 requested.
Phases 7 and 8 on hold. ajieval: statically prevented safety diagnostics,
unsafe usage, atomic error kind in classify, vsr table with Wilson intervals.
This commit is contained in:
dev committed 2026-10-06 08:39:55 +03:00
1 parent 7bbbe34b94
commit 035ea19834
7 files changed
+319 -2

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ Non-normative. Empirical validation of the Aji hypothesis stated in [spec 14](..
| Document | Purpose |
|---|---|
| [b1-heldout-plan.md](b1-heldout-plan.md) | B1 pre-registration: the first held-out benchmark after Phase 5 (Rust, Zig, Aji/source × 3 native agents × 6 tasks × 3 runs); design, metrics, analysis plan, decisions D1–D5 |
| [benchmark-authoring.md](benchmark-authoring.md) | Separation of roles for E0-2 and E-G: benchmark author and reference writers in clean contexts; brief; gate checklist |
| [results/](results/) | Recorded experiment outcomes (shareable numbers only; private tasks under aliases) |
| [harness.md](harness.md) | Agent scaffold and run recorder (E0-3): task format, evaluator contract, run record, commands |
+146
View File
@@ -0,0 +1,146 @@
# B1: the first held-out benchmark after Phase 5 (pre-registration)
Status: **Proposed.** Accepted by the owner before the benchmark author starts. 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.
```text
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 (H4).
4. What does a correct solution cost in tokens and time (H5 proxies; see D5)?
## 2. Design
| Variable | Values |
|---|---|
| Language (condition) | Rust, Zig, Aji/source. Aji/AIR is not in the main matrix (D2). |
| 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:** a tag cut after the B1 harness changes (`b1-frozen`). Both the AIR and the source bundle hashes are recorded.
## 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 |
**H4 is tested 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: 1 easy, 4 medium, 1 hard, with at least one medium task per family (D3). Calibration: D4.
## 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):
- **Statically prevented safety failures.** 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 says *where* a defect was stopped. It is not a success measure.
- **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. **H4 (descriptive, D1):** 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.
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 requested from the owner
- **D1. Track B and H4.** Protocol §39a says Track B results are never evidence for H4, because they measure model and agent stack together.
- Proposal: B1 reports H4 as *stack-level capability compression* (descriptive, labeled H4-B).
- Confirmatory H4 stays with Track A: one scaffold, direct APIs, 4 capability levels. That is the follow-up experiment.
- The alternative is to amend §39a.
- **D2. Aji/AIR.** Not in the main matrix.
- Proposal: leave it out entirely. AIR has served its research role (P6A-9), and every AIR run costs as much as a main run.
- The option: 1 run per cell as a diagnostic control (+54 runs).
- **D3. Difficulty distribution.** Proposal: 1 easy, 4 medium, 1 hard, with at least one medium per family.
- **D4. Calibration without selection bias.** If tasks are tuned until Rust/Zig fail often on the same agents, and then Aji is measured on those agents, the comparison is biased toward Aji: a selection effect. Proposal:
- calibration is **language-symmetric**: the operator makes one pilot run per stack in **each** of the three languages (54 runs);
- the criteria use only language-blind aggregates. For example, medium means N3 writes a compiling or verified program in ≥ 2 of the 3 languages, and N1/N2 pass in ≥ 2 of 3;
- pilot runs are discarded, never reported to the language developer, and never reused as B1 runs.
The cheaper alternative is the author's judgment plus the reference writers' cycle counts, with no pilots.
- **D5. H5.** On subscriptions there is no honest cost per solution (protocol §39a). Proposal: B1 reports output tokens, uncached input and wall time per *accepted* run as proxies. Cost in dollars waits for Track A.
+5
View File
@@ -255,6 +255,10 @@ Lines are compared after removing line-number prefixes (`12→`, `12:`) and grep
- `docs`: unique tokens read per group, `files_opened`, `coverage_by_section`;
- `diagnostics`: `E0001-E0006`, `E5001`, `E5002`, `E1001`, `E7005`, `other_E7xxx`, then `ownership`, `borrow` (including `memory.*`), `resource`, `concurrency`, `runtime_traps` by the code's kind in `reference/error-codes.md`, and `other` for every remaining code (effects, capabilities, unsafe…), so nothing is dropped; `ir_form_total` is the sum of the first three;
- `program`: source bytes, and for `aji_source` the lowered AIR bytes and both `mechanical_air_eliminated` metrics.
- B1 fields ([`b1-heldout-plan.md`](b1-heldout-plan.md) §5):
- `statically_prevented_safety`: safety diagnostics reported during the run. For Aji these are codes of kind ownership, borrow, init, memory, island, resource, concurrency, atomic, task, sync or unsafe. For Rust: E0382, E0499, E0502, E0505, E0506, E0507, E0596, E0597, E0716, E0373, plus the `Send`/`Sync` messages. For Zig it is 0, since its safety checks are dynamic.
- `unsafe_usage`: a static count in the final workspace. For Aji: `effects [unsafe]`, `ref unchecked` and `assume`. For Rust: `unsafe`. For Zig: `@ptrCast`, `@ptrFromInt`, `@intFromPtr`, `@alignCast`, `@constCast`, `@volatileCast` and `@setRuntimeSafety(false)`.
- `failure_class`, `caught_by` and `atomic_error` come from `ajieval classify`. `--atomic-error memory_model|algorithmic` applies to failed runs of the atomic family.
A field the record did not collect is `n/a`, never reconstructed. For an older `aji_air` run with the single-file bundle, `air_docs_unique` is the recorded `unique_reference_tokens` and `coverage_by_section` is the recorded `reference_coverage`; the source groups are `n/a`. Diagnostic codes come from the stored command outputs, as for `profile`. The lowered sizes use the current `zig-out/bin/aji`, so take them while the frontend is the one the runs used.
@@ -270,6 +274,7 @@ python3 -m ajieval matrix PLAN.json # verifies the freeze, runs cells seque
python3 -m ajieval journal PLAN.json "observation" [--run RUN_ID]
python3 -m ajieval summary RUNS_DIR # shareable: PASS/FAIL matrix, per-cell metrics, aggregates
python3 -m ajieval checkpoint RUNS_DIR... [--json] # M checkpoint / P6A-9 rows (below)
python3 -m ajieval vsr RUNS_DIR... [--tasks T1,T2] [--json] # B1 §6.1: VSR per agent × language, 95 % Wilson intervals
python3 -m ajieval profile RUNS_DIR # shareable: termination, output tokens, tool calls, solution size, lowered AIR size (aji_source), docs files read, IR-form and type-mismatch diagnostic counts, diagnostic-code occurrences
```
+2 -1
View File
@@ -157,4 +157,5 @@ Targets for Phase 6A, measured on dev tasks:
| P6A | done (exit review in `phase-6-source-language.md`; P6A-9 [results](../evaluation/results/2026-10-05-p6a-9.md)): the agent-facing source language over AIR is the architecture |
| P4 | done (exit review in the phase file) |
| P5 | done (exit review in the phase file): atomics through every layer; litmus 20/20 exact against the independent oracle; race detector on every run test |
| P7, P8 | not started |
| B1 | the first held-out benchmark after Phase 5 (owner decision, 2026-10-06): pre-registration [`b1-heldout-plan.md`](../evaluation/b1-heldout-plan.md) is Proposed; the independent author starts after its acceptance |
| P7, P8 | on hold until B1 is analyzed (owner decision, 2026-10-06) |