#594·archify

Proposal: offline benchmarks for repair rounds, late discovery, and token cost

Author: MomoyeyuCreated Sep 28, 2026Updated Sep 28, 2026

Problem and value

The authoring-cost study on labs/first-draft-cost-20260918 shows where generation time goes: machine stages take seconds, while time before the first draft and repair rounds take most of each run (roughly 150–260 s per author process, 160k–290k input tokens per run). That study depends on real author runs and human review, so it is expensive to rerun, and a regression can land between studies without anyone noticing.

I'd like to propose a small set of offline, deterministic benchmarks that measure the parts of speed and cost Archify controls directly, without model calls, human review, or image/VLM scoring. They would complement authoring-cost and ordinary-model-floor, not replace them, and could run in CI.

Evidence on current dev (5dda5c3, macOS, Node 22.23.3, local Chrome)

  • finalize --quality showcase on the five bundled examples takes 2.4–3.7 s each. That is well under 2% of an author run, which matches the study's conclusion that machine stages are not the bottleneck.
  • The files the fast path requires reading (SKILL.md, authoring-defaults, the mode's example, and the schemas for sequence/dataflow/lifecycle) total about 20–40 KB. That is far below the observed input-token volume, so most of the cost comes from repeated context and repair rounds.
  • Defects of different classes surface one round at a time. Starting from examples/web-app.architecture.json:
    • Two over-long labels on different components: one validate call reports both (layout/constraint ×2).
    • One over-long label plus one component moved to pos: [5000, 5000]: validate reports only the label. The composition/desktop-readability failure appears only after the label is fixed, which costs an extra author round.
    • That layout/constraint diagnostic has an empty evidence object, an empty supportedFixes list, and a subject without the component id. CONTRIBUTING asks for a precise subject, concrete evidence, and executable fixes.

This lines up with the P0 items in #175 ("return all violations in one receipt", "exact constraints", "structured issues").

Proposal

Add a benchmarks/repair-rounds/ suite with three measurements. It is benchmark code only and makes no product changes; any product fixes it motivates would go in separate PRs.

1. One-round repairability (the static-feedback-replay idea from ConvCodeBench, ICLR 2025)

  • A checked-in corpus of seeded candidates, built from the bundled examples, each carrying K independent defects from different classes (schema, layout constraint, composition, route, viewport).
  • A deterministic "oracle fixer" knows the seeded defects and repairs only those an emitted diagnostic points to.
  • Metrics:
    • validate rounds needed to pass;
    • defects reported per round;
    • share of defects never reported;
    • share of diagnostics with a precise subject id, non-empty evidence, and non-empty supportedFixes.

2. Late-discovery rate

  • For each seeded defect, record the earliest gate that catches it: validate, deliver, strict check, or browser-check.
  • Metric: the share of defects first seen at the browser stage, where each late discovery costs a full extra author round.

3. Context and feedback token cost (token accounting as in HAL, ICLR 2026, and TALE, ACL 2025 Findings)

  • Tokens in the fast-path mandatory read set for each diagram type, counted with a pinned tokenizer and also reported as bytes.
  • Tokens in finalize / validate stdout for passing and failing candidates.
  • Intended as a regression guard: a change that grows the mandatory context or receipt size shows up as a number.

Common rules:

  • Everything is deterministic and reproducible from tracked content.
  • Results are reported per diagram type, against a recorded base commit.
  • Nothing launches a model provider.
  • Chrome is needed only for measurement 2; without Chrome, that measurement is reported as skipped, never as passed.

Non-goals

  • No perceptual, human, VLM, or LLM-judge scoring. Visual quality stays with the existing review process.
  • No changes to renderers, validators, schema, Skill text, or quality thresholds in the benchmark PR.
  • No replacement for authoring-cost or ordinary-model-floor, and no claim of end-to-end speedup from these numbers alone.

Questions for you

  1. Is this direction useful to you, and does it avoid overlapping with what you're planning on the labs branch?
  2. Would you prefer the suite on dev under benchmarks/, or on the labs branch first?
  3. Any defect classes you want covered first? I'd start with the ones the #175 data showed as most expensive: viewport/readability overflow found after 9/9 validation, and label/geometry constraints.

If this looks right, I'm happy to implement it against dev.