Skip to content

Official Codebase of 3DCodeVerse

Python

docs: present-tense statements match the tree after D77/D78

gaoypeng44722993c4a8
diff --git a/README.md b/README.md
index 5e6d3bd1..4aa2886b 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,9 @@ training corpora; and a finetuning study that trains open models on that data.
```
harness/ toolkits/ finetune/
API models write 3D code ─▶ curate + verify + package ─────▶ train & evaluate open models
- plan→generate→gate→render corpus → LLaMA-Factory sets LoRA / full SFT / DPO
- →judge→refine, per-run (real compilers & renderers 3DCodeBench + per-dialect
- flywheel records check every sample) executors
+ plan→generate→gate→render corpus → LLaMA-Factory sets LoRA / full SFT / DPO;
+ →judge→refine, per-run (real compilers & renderers scored by eval/llm/ (3DCodeBench
+ flywheel records check every sample) + per-dialect executors)
▲ │
└──────────── better generators / judges ◀───────────────────┘
```
@@ -22,7 +22,7 @@ Python dist `3dcodeverse` (import `codeverse3d`, CLI `3dcodeverse` / `3dcode`).
LLMs write raw 3D code across four tracks — `static_object` ·
`articulated_object` · `scene` · `graphics` — in seven languages; the harness
owns everything around the code: typed plans, deterministic gates
-(connectivity, contract, joint sweeps, frame metrics), a 19-tool spatial
+(connectivity, contract, joint sweeps, frame metrics), a 20-tool spatial
toolbox served to coding agents over MCP, labelled multi-view renders, a
rubric VLM judge with binary defect checklists and code-computed caps, an
optional text-to-image texture pass, and a git-versioned record of every round
@@ -65,9 +65,10 @@ the Hub. See [`toolkits/README.md`](toolkits/README.md).
## [`finetune/`](finetune/) — training open models on 3DCodeVerse
Reproducible finetuning recipes on **unpatched LLaMA-Factory** (LoRA and
-ZeRO-3 full-parameter SFT, execution- and geometry-feedback DPO) plus the
-execution-based evaluation stack: 3DCodeBench (generate → run in Blender →
-Chamfer / F-score against ground truth) and held-out per-dialect executors.
+ZeRO-3 full-parameter SFT, execution- and geometry-feedback DPO). The
+execution-based evaluation stack — 3DCodeBench (generate → run in Blender →
+Chamfer / F-score against ground truth) and held-out per-dialect executors — is
+[`eval/llm/`](eval/llm/).
Headline (Qwen3.5-9B, 3DCodeBench execution rate): zero-shot **0%** → LoRA on
5k Blender samples **75–82%** → + execution-feedback DPO **96.2%**; the full
270k-sample multi-dialect mix reaches **90.1%**, and Qwen3.5-27B v2 scores
diff --git a/finetune/README.md b/finetune/README.md
index 15a2a562..d062b5cf 100644
--- a/finetune/README.md
+++ b/finetune/README.md
@@ -15,7 +15,7 @@ API models; this folder trains and evaluates open models on that data.
|---|---|
| `scripts/` | data builders (`prep_data.py`, `build_multidialect*.py`, `build_md_big.py`, `build_md_xl.py`, `build_md_bal.py`, `build_boot_data.py`, `cache_ntok.py`), thin launchers around LLaMA-Factory (`lf_train.sh`, `lf_export.sh`, `make_lora_cfg.py`), experiment pipelines train→merge→eval (`run_exp.sh`, `run_md_exp.sh`, `run_full_ft*.sh`, `*_ckpt_sweep.sh`), execution-feedback / geometry-feedback DPO rounds (`run_dpo_exec.sh`, `dpo_round2.sh`, `md_dpo_round.sh`, `md_big_dpo_round.sh`, `md_xl_dpo_round.sh`, `geo_dpo_build.sh`), bootstrapping (`self_train_round*.sh`), report tooling (`build_report_html.py`, `contact_sheet_3dcodebench.py`) |
| `configs/lf/` | one LLaMA-Factory YAML per experiment: LoRA SFT (`lora_*.yaml`), full-parameter ZeRO-3 SFT (`qwen35_9b_full_sft*.yaml`, `full_md_bal.yaml`, `ds_z3_offload.json`), DPO (`dpo_*.yaml`), LoRA merge/export (`export_*.yaml`) |
-| `eval/` | vLLM generation (`generate_vllm.py`), 3DCodeBench runner (`run_bench.py`, `blender_runner.py`), geometry metrics Chamfer / F-score vs GT (`metrics.py`), pass@N / best-of-N (`best_of_n.sh`, `pass_at_n.py`), per-dialect executors (`dialect_runners.py`: CadQuery, OpenSCAD, glslangValidator; `threejs_runner.py`: Playwright headless Chromium), held-out dialect evals (`dialect_eval.py`, `blender_dialect_eval.py`, `threejs_eval.py`, `run_dialect_eval.sh`), renders for qualitative checks (`render_glb.py`) |
+| [`../eval/llm/`](../eval/llm/) | the execution-based evaluation (was `eval/` here): vLLM / API generation, 3DCodeBench execution in Blender, geometry metrics Chamfer / F-score vs GT, pass@k, per-dialect executors (CadQuery, OpenSCAD, GLSL, three.js), held-out dialect sets — see its README |
| `data_specs/dataset_info.json` | LLaMA-Factory dataset registry for every SFT/DPO set used (ShareGPT format; the JSON files themselves are rebuilt by `scripts/`) |
| `env/requirements-{llmft,lf,vllm}.txt` | pip freezes of the three conda envs (data/eval, LLaMA-Factory training, vLLM inference) |
| `env.sh` | shell env (caches, secrets file) used by all scripts |
@@ -38,10 +38,10 @@ The training data in LLaMA-Factory (ShareGPT) format is published as **[`ilabai/
1. Envs (see `docs/REPORT.md` §1 for the pitfalls): `lf` = LLaMA-Factory (editable, upstream, unpatched) + torch 2.8.0+cu128 + flash-attn 2.8.3 + flash-linear-attention 0.5.2 + **triton 3.7.1** (Qwen3.5 GDN kernels on Hopper) + deepspeed; `vllm` = vLLM 0.27; `llmft` = data/eval (trimesh, cadquery, playwright, …). Blender 5.0.1 headless and an OpenSCAD AppImage are called by path.
2. Data: only `metadata.parquet` of each 3DCodeVerse subset is needed. `scripts/build_multidialect.py` → `data/multidialect/<dialect>/{train,test}.jsonl`; `scripts/build_md_*.py` build the mixes (token-length filter ≤8192, cached by `scripts/cache_ntok.py`); `scripts/to_llamafactory.py` writes ShareGPT JSON + `dataset_info.json`.
3. Train: `GPUS=0,1,2,3 scripts/lf_train.sh configs/lf/lora_md_xl.yaml gradient_accumulation_steps=2` (LoRA r64, cutoff 8192, packing, FA2) → `scripts/lf_export.sh configs/lf/export_md_xl.yaml` to merge.
-4. Evaluate: `GPUS=0 eval/run_eval_vllm.sh <merged> eval/out/<name> --no_think --max_new_tokens 6144` (3DCodeBench: vLLM gen → Blender exec → Chamfer/F vs GT) and `GPUS=0 eval/run_dialect_eval.sh <merged> <name>` (held-out CadQuery/OpenSCAD/GLSL/Blender). Decode OpenSCAD/GLSL with sampling (T=0.7), not greedy.
+4. Evaluate with `../eval/llm/` (its README): from `../eval`, `python -m llm.run_eval --backend vllm --model <merged> --run <name> --suites headline heldout` (3DCodeBench: vLLM gen → Blender exec → Chamfer/F vs GT, plus the held-out dialect sets). Decode OpenSCAD/GLSL with sampling (T=0.7), not greedy.
5. Execution-feedback DPO on top of any SFT model: `scripts/md_xl_dpo_round.sh` (sample → run in each dialect's executor → (OK, FAIL) pairs → `stage: dpo`).
-Paths are absolute for the machine the study ran on (`/wekafs/ict/hx_624/...`); adapt `env.sh`, the `*_dir`/`model_name_or_path` keys in `configs/lf/*.yaml`, and the tool paths at the top of `eval/*runner*.py` / `scripts/*.sh` before running elsewhere.
+Paths are absolute for the machine the study ran on (`/wekafs/ict/hx_624/...`); adapt `env.sh`, the `*_dir`/`model_name_or_path` keys in `configs/lf/*.yaml`, and the tool paths at the top of `scripts/*.sh` before running elsewhere.
## Headline results (3DCodeBench, 212 tasks, execution rate / [email protected]; details in `docs/REPORT.md`)
diff --git a/harness/CLAUDE.md b/harness/CLAUDE.md
index c996b58e..966639bc 100644
--- a/harness/CLAUDE.md
+++ b/harness/CLAUDE.md
@@ -6,7 +6,7 @@ Blender bpy · CadQuery · Three.js · URDF · GLSL / OpenGL, across four tracks
(`static_object`, `articulated_object`, `scene`, `graphics`), with pluggable
backends. **The coding agent is always a VENDOR's** — gemini-cli / claude-code /
codex / antigravity — and the harness supplies the workspace, the prompt and the
-3D tools its track can use (over MCP; 19 in the registry, filtered per track — D48
+3D tools its track can use (over MCP; 20 in the registry, filtered per track — D48
review), then reads the result. The harness's OWN api use is planning,
judging, single-shot file generation and the texture pass (Gemini/Anthropic/OpenAI).
It does not implement an agent loop: the in-process `api-agent` was deleted
@@ -92,17 +92,17 @@ cd /home/yipeng/3dcodeverse/harness
3dcode resume <slug> · 3dcode status <slug> · 3dcode render <slug> [--mode wire] · 3dcode judge <slug> [--model ... --n 3]
3dcode texture pass <slug> [--no-judge] · 3dcode texture scene-pack <slug> · 3dcode texture show <slug>
3dcode tools list · 3dcode tools measure --workspace runs/<slug> · 3dcode mcp --workspace runs/<slug>
-3dcode cost <slug> · 3dcode cost --runs-dir eval/bench/out/<battery> · 3dcode cost cache <slug>
+3dcode cost <slug> · 3dcode cost --runs-dir ../eval/bench/out/<battery> · 3dcode cost cache <slug>
3dcode cost prices [--stale] · 3dcode cost profiles · 3dcode cost estimate gemini:gemini-3.1-pro-preview --in 12000
3dcode flywheel export runs/ dataset/ [--pack --drop-duplicates --captions-dir d/] · 3dcode flywheel pairs runs/ pairs.jsonl
3dcode flywheel caption <slug> [--out dir] # the gallery is `3dcode gallery build --embed`
3dcode gallery serve [ROOTS...] [--port 8765] [--reload] · 3dcode gallery build --out gallery.html [--embed]
-3dcode bench run eval/bench/prompts/static_objects_v1.yaml --generator ... --judge gemini:gemini-3.1-pro-preview
+3dcode bench run ../eval/bench/prompts/static_objects_v1.yaml --generator ... --judge gemini:gemini-3.1-pro-preview
python -m codeverse3d.addons.calibration runs/<slug>... --model gemini:gemini-3.1-pro-preview --n 3 --out out/
-python eval/bench/complexity_report.py eval/bench/out --recursive # score-vs-complexity + $/complexity point (eval/docs/COMPLEXITY.md)
-python eval/bench/compare_backends.py --prompts eval/bench/prompts/compare_v1.yaml --arms harness:gemini-cli:gemini-3.6-flash,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out eval/bench/out/compare_v1
+python ../eval/bench/complexity_report.py ../eval/bench/out --recursive # score-vs-complexity + $/complexity point (eval/docs/COMPLEXITY.md)
+python ../eval/bench/compare_backends.py --prompts ../eval/bench/prompts/compare_v1.yaml --arms harness:gemini-cli:gemini-3.6-flash,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out ../eval/bench/out/compare_v1
python -m pytest tests -q -m "not live" # 2 717 tests, ~65 s (real Blender + headless Chrome + CadQuery)
-python -m pytest tests -q -m "not live and not blender and not node" # pure python: 2 166 tests, ~40 s (the 224 bench tests: `cd eval && python -m pytest`)
+python -m pytest tests -q -m "not live and not blender and not node" # pure python: 2 166 tests, ~40 s (the 224 bench tests: `cd ../eval && python -m pytest`)
# (the counts drift every commit — `--collect-only` is the answer, not a number in this file)
# both run PARALLEL by default (pytest-xdist, -n auto --dist worksteal, in pyproject addopts).
# A nested pytest inside a test MUST pass -n0 or it forks another full set of workers.
diff --git a/harness/README.md b/harness/README.md
index 939aa49a..187cc118 100644
--- a/harness/README.md
+++ b/harness/README.md
@@ -17,12 +17,12 @@ renders, judges, refines, textures and records every run as data-flywheel materi
* **Judging:** rubric VLM judge (default `gemini-3.1-pro-preview`) on labelled 2×2
montages with binary defect checklists; code-computed scores, floors and caps from
deterministic gates; pairwise, ranking and reference judges; best-of-N candidates;
- a calibration harness (`judges/calibration.py`).
+ a calibration harness (`addons/calibration.py`).
* **Texturing:** optional text-to-image pass — VLM material plan → seamless tiles →
world-metre UVs → `object_textured.glb`, shipped only when a before/after judge
gate agrees; scene texture packs for prompts.
* **Flywheel:** git-versioned `src/` per round, `record.json`, sample export with
- quality tiers + dedupe (+ parquet, tar locators), preference/repair/trajectory
+ quality tiers + dedupe (+ parquet, tar locators), preference/repair/cross-backend
pairs, captions, sqlite index, HTML gallery.
* **Looking at results:** `3dcode gallery serve` — a local page over `runs/` +
`eval/bench/out/*/runs` with filters, a per-filter summary strip and a detail page per run;
@@ -63,7 +63,7 @@ codeverse3d/
gallery (the runs browser), dataset (export, tiers, preference/repair pairs,
captions, sqlite index), costreport (`3dcode cost`), calibration, skill_targets
cli/ the typer CLI · doctor.py the environment checks behind `3dcode doctor`
-eval/bench/ the evaluation harness around the harness: run_bench, compare_backends
+../eval/bench/ the evaluation harness around the harness: run_bench, compare_backends
(A/B matrix), ab_plan, infra-failure classification
runtime_js/ node side: [email protected] + headless-Chrome render/probe hosts
```
diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.md
index aeee451c..f59acc53 100644
--- a/harness/docs/ARCHITECTURE.md
+++ b/harness/docs/ARCHITECTURE.md
@@ -85,7 +85,7 @@ codeverse3d/
child's lifecycle: group kill on ANY exception, bounded pumps, stdin writer;
run_subprocess, tail, write_json_atomic, scrub_secrets) and the tolerant readers/writer
(read_json_or_none, iter_jsonl_lines, read_jsonl_lenient, append_jsonl_line) —
- shared by languages/spatial/cli/cost/flywheel/gallery/bench. RULE: any
+ shared by languages/spatial/cli/cost/record/addons and eval/bench. RULE: any
stdlib-only file / JSON / JSONL helper lives HERE; grep proc.py before writing a
try/except read (the 2026-08-26 review found the same tolerant read written
eight times because this module had not grown it). Also home, since
@@ -253,10 +253,10 @@ runtime_js/ export_glb.mjs (placement policy, instance baking, selfche
them) + a colour grade that is the identity unless the scene sets
`scene.userData.grade`. ON for scene renders, `C3D_POST=0` / `--no-post`
to disable; object renders never come through this driver.
-tests/ agents bench_prompts blender_cadquery compare_bench core cost flywheel_cli gallery graphics
+tests/ agents blender_cadquery core cost flywheel_cli gallery graphics
install judges languages models orchestrator_tracks prompts reference scene_gates
scene_prompts scene_runtime skills spatial_tools texturing threejs_render urdf_joints
- (24 dirs; 2 077 offline, 1 950 of them pure python)
+ (22 dirs; 2 077 offline, 1 950 of them pure python; the bench tests are ../eval/tests)
```
## 3. Workspace layout (one run, as observed)
@@ -348,10 +348,10 @@ summary:
`@tool(name, ArgsModel, description, *, tracks=(), languages=(), cost_hint)` registers
`fn(ctx, args) -> Observation` → (a) direct call from tracks, (b) the stdio MCP
server (name `3dcode`) for the vendor CLIs, (c) a native tool schema for any embedder
-(`ToolDef.schema()`), (d) a prompt card. The 19 tools: `build`, `measure`,
+(`ToolDef.schema()`), (d) a prompt card. The 20 tools: `build`, `measure`,
`render_views`, `render_sheet`, `isolate`, `cross_section`, `check_connectivity`,
`check_contract`, `check_placement`, `compare_silhouette`, `compare_reference`,
-`joint_sweep` (articulated), `shader_probe`, `scene_probe`, `scene_views` (scene),
+`joint_sweep` (articulated), `shader_probe`, `scene_probe`, `scene_views`, `effect_ablation` (scene),
`gl_probe`, `gl_frames` (graphics), `texture_pass`, `texture_preview` (object tracks).
An `Observation` carries two different answers: `ok` is the **verdict** and `failed`
@@ -409,7 +409,7 @@ image-conditioned specs.
Rubrics: `static_object_v1` (0.72), `articulated_v1` (requires pose sheet),
`scene_v1` (frame-gate caps), `asset_v1`, `reference_v1`, `shader_v1` (0.70).
-**Calibration (2026-08-23, `judges/calibration.py`, n=3 on the e2e rounds):**
+**Calibration (2026-08-23, `addons/calibration.py`, n=3 on the e2e rounds):**
flash `gemini-3.7-flash` mean overall std 0.083, pearson(gate errors, score) −0.33;
pro `gemini-3.1-pro-preview` std 0.030, pearson +0.63, and separation on a
crafted-vs-crude-vs-wrong triplet 0.60 / 0.00 / 0.25 (flash 0.91 / 0.00 / 0.20 —
@@ -561,7 +561,7 @@ turns those rows into training files; the harness writes the measurement, not th
trainer's format. `flywheel caption` adds
{detailed, instruction, factory} captions (image-grounded, brand-free, `--out` for
side-car mode); the gallery is `3dcode gallery build --embed`
-(the flywheel package has no renderer of its own).
+(the dataset addon has no renderer of its own).
`codeverse3d/addons/gallery/` is the **local** answer to the same question: `3dcode gallery
serve` indexes `runs/` + every `eval/bench/out/*/runs`, serves the page **and the run
@@ -570,5 +570,5 @@ in an orbit viewer built on the vendored three.js, `record.json`), and re-reads
run's record per request so a battery that is still writing shows up live. A run
with no record yet is a *pending* card, a half-written one a *broken* card. Two
gates keep it safe: a URL can only name a `(battery, slug)` the scanner found under
-a declared root, and `paths.safe_join` refuses anything that escapes that run
+a declared root, and `urls.safe_join` refuses anything that escapes that run
directory. `3dcode gallery build [--embed]` writes the same page as one file.
diff --git a/harness/docs/COST.md b/harness/docs/COST.md
index f1dba549..69c89638 100644
--- a/harness/docs/COST.md
+++ b/harness/docs/COST.md
@@ -391,12 +391,13 @@ rows from `record.json` + `events.jsonl` + `trajectories/**` — that is what th
audit runs on, and it reconciles to `record.total_usage` on every run (or says
why it does not, §6).
-Two helpers exist for the callers:
+One helper exists for the callers:
* `estimate_call(model_id, prompt=…, n_images=…, output_tokens=…)` →
- `CostEstimate` before the call; `CostGuard(budget_usd).check(est)` decides.
- An unpriceable model is **allowed but flagged** — refusing to run because we
- cannot price something would be worse than running it.
+ `CostEstimate` before the call (the `CostGuard` that decided on it had no caller and
+ was deleted 2026-08-28). An unpriceable model is **allowed but flagged**
+ (`price_source="unknown"`, $0) — refusing to run because we cannot price something
+ would be worse than running it.
## 11. Caveats
@@ -484,7 +485,7 @@ pricing failure logs and keeps the recorded dollar.
**Where it lands.** `<run>/telemetry/cost.jsonl` (the run-layout telemetry
bucket), with `<run>/cost_ledger.jsonl` left as a relative symlink so
-`flywheel.telemetry.live_ledger_path` and the `telemetry/usage.jsonl` alias keep
+`record.telemetry.live_ledger_path` and the `telemetry/usage.jsonl` alias keep
working — one physical copy. A call made with no run context (a `3dcode judge`
outside a run, a bench script, a notebook) goes to a per-process log under
`<cache_dir>/cost/`; `C3D_COST_LEDGER=off` disables writing entirely.
@@ -753,8 +754,9 @@ the window, `--unverified` keeps the old status filter. Today: 52 rows, 6 flagg
(`claude-haiku-4`, `o1-mini`, `gpt-5-codex`, `gpt-5.1-codex`, `gpt-5.2-codex`,
`gemini-2.5-flash-image`), none stale.
-Two tests hold the line: `test_every_recorded_model_id_resolves_to_a_price` (no
-silent $0 — a model that billed us in any recorded run must have a row) and
+Two tests hold the line: `test_supported_model_ids_resolve_to_a_price` (no
+silent $0 — every model id a default, route, CLI example or backend contract exposes
+must have a row) and
`test_every_price_row_was_checked_within_the_maintenance_window` (re-read the
providers' pages and bump `CHECKED`; never raise the threshold). Every ledger row
carries the provenance of the price it used, so a dollar can always be traced to a
@@ -1074,8 +1076,8 @@ plumbing through several layers and deserves its own measured change.
> idle box — zero `3dcode` processes running, the naive gate returned **3**, and even the
> bracket trick `pgrep -f '[b]in/3dcode make'` returned **2**, because the wrapper shell's
> argv also carries the string. Used in `while [ $(gate) -ge 3 ]; do sleep 60; done` that
-> blocks forever on nothing. `codeverse3d.models.health.sibling_processes()` reads `/proc`
-> and excludes its own pid; `pool_budget()` wraps it with the in-flight arithmetic:
+> blocks forever on nothing. `codeverse3d.models.health.pool_budget()` reads `/proc`,
+> excludes its own pid and does the in-flight arithmetic:
> ```
> python3 -c "from codeverse3d.models.health import pool_budget; print(pool_budget())"
> ```
@@ -1302,7 +1304,7 @@ defaulted so old rows load); `3dcode cost` adds a per-key table and a
## 28. Where the time goes — the 2026-08-26 audit
51 storm-day runs against 52 baseline runs, every stage and every model call, scripts in
-`eval/bench/time_audit/` (read-only over `eval/bench/out`). The numbers that decide what to build next:
+`bench/time_audit/` (read-only over `bench/out`; a one-off, deleted 2026-08-28). The numbers that decide what to build next:
* A blender object run is **1 811 s** median on a healthy provider and **4 726 s** under the storm;
build + gates + render together are 3–19 % of a baseline run and 1–4 % of a storm run. The
diff --git a/harness/docs/INSTALL.md b/harness/docs/INSTALL.md
index 9aeea0ad..f1465ba2 100644
--- a/harness/docs/INSTALL.md
+++ b/harness/docs/INSTALL.md
@@ -78,7 +78,7 @@ Moving to another Python later is the same four-line change (`requires-python`,
|---|---|---|---|
| **Python 3.13** | yes | 3.13.9 (`/home/yipeng/miniconda3/bin/python`) | nothing runs; `requires-python = ">=3.13"` (§2.1) |
| **pip + venv** | yes | pip 25.3, `python -m venv` | `setup.sh` cannot install the package. A stock Debian/Ubuntu `/usr/bin/python3` ships **without** pip and is PEP 668 `EXTERNALLY-MANAGED`, so `pip install -e harness` refuses even once pip is present: `sudo apt install python3-venv python3-pip`, then use a virtualenv |
-| **git** | yes | 2.53.0 | run workspaces are git repos (one commit per round); `Workspace.create()` and the flywheel trajectory/pair miners fail |
+| **git** | yes | 2.53.0 | run workspaces are git repos (one commit per round); `Workspace.create()` and the flywheel pair miners fail |
| **node ≥ 20.6** | yes, except for the `graphics` track | v24.14.0 (npm 11.9.0) | the `threejs` / `scene_threejs` languages disappear **and no object renders happen at all**: `spatial/render.py` renders *every* GLB (Blender-built and CadQuery-built included) with three.js in headless Chrome. Only `graphics` (moderngl) is node-free |
| **Blender 4.2+ / 5.x** | optional | 5.0.1 (`~/.local/bin/blender-5.0`) | `blender` and `urdf_blender` languages unavailable → the `static_object` default language and the whole `articulated_object` track cannot build (`BlenderNotFoundError`); scenes lose planner-chosen bpy GLB assets |
| **EGL-capable GPU stack** | optional | ANGLE / D3D12 / RTX 5090 Laptop | headless Chrome falls back to **SwiftShader** and moderngl to **llvmpipe** — everything still renders, just several times slower; no correctness change |
@@ -502,7 +502,7 @@ that the keys work end to end):
| `gemini pool` (`--live`) | WARN | a key is benched as dead | that key 401/403'd; rotate or remove it — the pool re-probes it after an hour. The row also shows in-flight, RPM/TPM headroom used and this process's 429/5xx counts |
| `storm gate` (`--live`) | WARN | a capacity storm is running | provider-side (`503 high demand`), not an install problem; the gate is off by default (docs/COST.md §21) and the row only appears when something enabled it |
| `skills switch` | WARN | skills are disabled | expected by default; set `C3D_SKILLS=on` only when you want skill routing |
-| `skills library` | WARN / FAIL | no bundles were found, or one or more bundles are invalid | use a full checkout and validate the named bundle under `codeverse3d/skills/library/` |
+| `skills library` | WARN / FAIL | no bundles were found, or one or more bundles are invalid | use a full checkout and validate the named bundle under `codeverse3d/skills/<name>/` |
| `skills routing` | WARN | a routed skill has no installed bundle | restore the missing bundle from the checkout or update the stale route |
| `skills discovery` | OK | always informational | shows the agent-native directories where bundles are materialised |
| `claude-code Skill tool` | FAIL | the Claude backend would deny native skill activation | update/reinstall the harness so `Skill` is present in Claude Code's allowed tools |
@@ -577,7 +577,7 @@ headless-Chrome endpoint file — do not delete it while renders are running).
**Your data is not in either cache.** `runs/`, `eval/bench/out/` and any exported
dataset are the flywheel output — delete them deliberately, never as part of a
-cleanup. On this machine `harness/bench/out/` is read-only reference material
+cleanup. On this machine `eval/bench/out/` is read-only reference material
(the early `e2e_*` reference runs were archived off-repo on 2026-08-29).
Uninstalling does not touch `~/.config/3dcodeverse/config.yaml`,
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index 57fef9a7..c1e8515f 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -1,7 +1,7 @@
# Cross-package interfaces (as built)
This file lists the signatures other packages may rely on. Types live in
-`codeverse3d/contracts/`; protocols in `models/base.py`, `agents/base.py`,
+`codeverse3d/contracts/`; protocols in `models/base.py`, `agents/registry.py`,
`languages/base.py`, `spatial/registry.py`, `tracks/__init__.py` (judges are
duck-typed `.judge(JudgeInput) -> Judgment`; `judges/base.py` defines no protocol).
Where the build deviated from the original plan the deviation is called out as
@@ -34,7 +34,7 @@ GateFinding.as_line(with_gate=False, with_severity=False, with_target=False, wit
RenderView.judge: bool | None # stamped True/False at render time; None = legacy round (every stored view is judged)
RenderSet.out_dir: str # directory the views (+ views.json/metrics.json) were written to ("" on old rounds)
from codeverse3d.config import get_settings, env_flag # env_flag(env, fallback) -> bool: on/off/1/0/true/false/yes/no;
- # unset/empty -> fallback; garbage -> warning + fallback (Settings value), never a silent switch
+ # unset/empty -> fallback; garbage -> warning + False (off, NOT the fallback), never a crash
get_settings().backends(planner=..., generator=..., judge=..., captioner=...) -> Backends
# settings defaults (default_planner/... mirror contracts Backends literals; + default_captioner);
# truthy keyword overrides win, None/"" falls through, unknown role -> TypeError
@@ -60,7 +60,7 @@ means the last OK build. `Workspace.restore_paths(commit, paths)` = per-path
from codeverse3d.models import get_chat_model # (model_id) -> ChatModel, lru-cached, thread-safe
resp = m.generate(ChatRequest(messages=[...], system=..., response_schema=..., temperature=..., thinking=..., label=..., max_wait_s=None))
# max_wait_s: the longest this ONE call may spend, retries included (None = models.retry.RETRY_DEADLINE_S = 900 s);
-# GeminiModel clips its retry deadline to it; api_agent 20-120 s per turn, VlmJudge 240 s per sample, planner 300 s
+# GeminiModel clips its retry deadline to it; VlmJudge 240 s per sample, planner 300 s
# resp.raw["key"] = "…ab12" (the key that answered), resp.raw["attempts"] = round-trips issued (hedged siblings included)
resp.parsed / resp.text / resp.usage # Usage always has cost_usd (models.pricing)
from codeverse3d.models.retry import KeyPool, KeyPoolExhausted
@@ -495,7 +495,7 @@ run_round(ctx, *, index, kind, tasks, pipeline, ..., previous_best=None) -> Roun
# pipeline's render; candidates pass quick_render) and geometry_views=False (skips the clay/normals views)
# emits cost.round {stages{}, judge_usd, total_usd, agent_turns, wasted, waste_reason}; on ANY exception it
# records what the round burned (rounds/aborted_rNN.json, ctx.extra["aborted_rounds"]) and re-raises
-from codeverse3d.tracks.planner import plan, ensure_acceptance # graphics uses tracks/graphics.plan_graphics
+from codeverse3d.tracks.planner import plan, ensure_acceptance # graphics too, through its hooks (GraphicsTrack.plan_template / plan_example)
```
`run_round` = generate → commit → `build_with_repair` → measure → gates → render →
post-render gates → judge → commit. Post-render gates: static `reference_silhouette`
@@ -524,7 +524,7 @@ from codeverse3d.texturing.plan import scene_texture_pack, texture_pack_prompt
# under public/textures/ for scene prompts (URL /public/textures/<name>.png)
```
-## flywheel/ + cli/
+## record/ + addons/ + cli/
```python
from codeverse3d.record.record import finalize_record, load_record, iter_runs, best_round_index, best_round_record
from codeverse3d.addons.gallery.index import hero_view # (ws, rec) -> (rel, label, n_views): the card image, rebased via ws
diff --git a/harness/docs/RUNBOOK.md b/harness/docs/RUNBOOK.md
index fcc34a0a..abe36350 100644
--- a/harness/docs/RUNBOOK.md
+++ b/harness/docs/RUNBOOK.md
@@ -115,8 +115,8 @@ events.
### Looking at results locally
```bash
-3dcode gallery serve # ./runs + every ./bench/out/*/runs → http://127.0.0.1:8765/
-3dcode gallery serve eval/bench/out/static_v2_flash/runs --port 9000 --reload --no-open
+3dcode gallery serve # ./runs + every eval/bench/out/*/runs → http://127.0.0.1:8765/
+3dcode gallery serve ../eval/bench/out/static_v2_flash/runs --port 9000 --reload --no-open
3dcode gallery build --out gallery.html [--embed] # one self-contained file (--embed inlines the sheets)
```
`serve` indexes the run roots (records only — ~85 runs in ~0.15 s) and serves the run
@@ -267,11 +267,11 @@ call the `texture_pass` / `texture_preview` tools mid-session.
## 7. Benchmarks
```bash
-3dcode bench run eval/bench/prompts/static_objects_v1.yaml --generator single-shot:gemini:gemini-3.7-flash \
- --judge gemini:gemini-3.1-pro-preview --rounds 2 --parallel 4 [--tier easy] [--id furn_easy_stool] [--limit 6] [--out eval/bench/out/x]
-3dcode bench report eval/bench/out/static_objects_v1 # report.md + self-contained report.html (gallery)
-python eval/bench/compare_backends.py --prompts eval/bench/prompts/compare_v1.yaml \
- --arms harness:gemini-cli:gemini-3.7-flash,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out eval/bench/out/compare_v1
+3dcode bench run ../eval/bench/prompts/static_objects_v1.yaml --generator single-shot:gemini:gemini-3.7-flash \
+ --judge gemini:gemini-3.1-pro-preview --rounds 2 --parallel 4 [--tier easy] [--id furn_easy_stool] [--limit 6] [--out ../eval/bench/out/x]
+3dcode bench report ../eval/bench/out/static_objects_v1 # report.md + self-contained report.html (gallery)
+python ../eval/bench/compare_backends.py --prompts ../eval/bench/prompts/compare_v1.yaml \
+ --arms harness:gemini-cli:gemini-3.7-flash,oneshot:claude-code --judge gemini:gemini-3.1-pro-preview --out ../eval/bench/out/compare_v1
```
Results stream to `results.jsonl` (resumable). Batteries: `static_objects_v1` (24),
`articulated_v1` (12), `scenes_v1` (12), `compare_v1` (8, harness-vs-one-shot).
diff --git a/harness/docs/RUN_LAYOUT.md b/harness/docs/RUN_LAYOUT.md
index 8b6882f8..92061b15 100644
--- a/harness/docs/RUN_LAYOUT.md
+++ b/harness/docs/RUN_LAYOUT.md
@@ -153,10 +153,10 @@ provenance — use the cost package's own command, `3dcode cost show <runs-dir>`
## Back-compatibility contract
* Old runs load unchanged — `load_record`, `3dcode status`, `3dcode judge`,
- `3dcode render`, `flywheel export/pairs/gallery/index` all work with no
+ `3dcode render`, `flywheel export/pairs/index`, `gallery` all work with no
`deliverable/` or `telemetry/` present.
* Consumers resolve artifacts through
- `flywheel.deliverable.deliverable_path(ws, name)`: `deliverable/<name>` first,
+ `record.deliverable.deliverable_path(ws, name)`: `deliverable/<name>` first,
`artifacts/<name>` second.
* `flywheel export` reads the packaged code snapshot only when git cannot answer
(`meta.code_source == "deliverable"`), and adds a compact `meta.telemetry`
diff --git a/harness/docs/SKILLS.md b/harness/docs/SKILLS.md
index f204eb34..ecdf6d82 100644
--- a/harness/docs/SKILLS.md
+++ b/harness/docs/SKILLS.md
@@ -11,8 +11,8 @@ names the cookbook section to fetch. Two libraries of truth would be worse than
`SKILL.md` is an open standard (agentskills.io, Dec 2025), which is why the format below is
not ours to bend: **claude-code, codex, gemini-cli and agy discover these bundles
themselves** — proven live, see §7. (The in-process `api-agent`, the one backend that
-needed harness-side injection, was deleted 2026-08-28, and its routed index and
-`read_skill` tool with it.)
+needed harness-side injection, was deleted 2026-08-28; bundles now reach a session only
+through its vendor's native skill loader.)
Everything is behind `C3D_SKILLS`. **It ships OFF**, because `api-agent` read 0 of 5
routed bundles in the measured A/B while the three subscription CLIs read all five.
@@ -25,7 +25,7 @@ routed bundles in the measured A/B while the three subscription CLIs read all fi
**One library, one policy, thin adapters.** The bundles under `codeverse3d/skills/<name>/`
are plain [agentskills.io](https://agentskills.io/specification) `SKILL.md` directories and
know nothing about any backend — anyone can `cp -r codeverse3d/skills/<name> ~/.claude/skills/`
-and use them without this harness at all. `router.py` picks the set from typed inputs.
+and use them without this harness at all. `registry.py` picks the set from typed inputs.
Everything that genuinely differs between coding agents is **one bit**, and it lives in
one file, `skills/prompting.py`:
@@ -35,14 +35,26 @@ one file, `skills/prompting.py`:
| `claude-code` | `.claude/skills` |
| `codex`, `gemini-cli`, `agy` | `.agents/skills` |
-It was read out of the shipped binaries, not assumed. All four have a native loader, so
-none is handed a second index (it would list the same skills twice): the body file gets one
-MANDATORY sentence.
+It was read out of the shipped binaries, not assumed. Bundles reach a session only
+through its vendor's native skill loader: the harness writes them under the discovery root and
+hands the agent no second index (the loader's own would list the same skills twice) and no tool;
+the body file gets one MANDATORY sentence.
**Adding a backend is one row in that table.** A test (`tests/skills/test_delivery.py`)
fails if per-backend knowledge leaks back out into the other modules, and another checks
that `prompting.py` agrees with the policy rather than re-deriving it.
+### Why only native loaders
+
+Measured 2026-08-25, same library, same workspace, same task: `codex`, `claude-code` and
+`agy` each read **5 of 5** routed bundles unprompted through their own loaders.
+`api-agent` read **0 of 5** — not from unwillingness (it made **52 `read_file` calls** that
+session, and called `read_cookbook` twice), but because the bundles sit in hidden
+directories its `list_files` deliberately skips, and the index was prose in a 2.3 kB system
+prompt competing with the contract and the rules. Prose is not an affordance. The
+`read_skill` tool built to fix that was deleted with `api-agent` on 2026-08-28; every backend
+left discovers the bundles through its own loader.
+
## 1. The model: progressive disclosure, and why it is also the measurement
@@ -62,7 +74,7 @@ bumps `atime`:
* `atime(references/*.md) > mtime` → **deep**: something opened the body's depth file.
A bundle with no `references/` reports `deep_measurable: false` rather than quietly
-scoring 0. `api-agent` owns its own `read_file`, so it logs exact reads with turn numbers.
+scoring 0. `api-agent` owned its own `read_file`, so it logged exact reads with turn numbers.
### The probe carries its own falsification, because it had to
@@ -92,7 +104,7 @@ This is the difference between a metric and a number that would have read 100% f
## 2. The library
-**Thirteen bundles.** `lines`/`tokens` are the body, against caps of 350 and 2,500.
+**Seventeen bundles.** `lines`/`tokens` are the body, against caps of 350 and 2,500.
| skill | track | language | evidence | lines | tokens | routes |
|---|---|---|---|---|---|---|
@@ -109,6 +121,10 @@ This is the difference between a metric and a number that would have read 100% f
| `c3d-opengl-pipeline` | graphics | opengl_python | mixed | 98 | 1,497 | R23, R24-opengl |
| `c3d-cadquery-forms` | any | cadquery | **inherited-unverified** | 82 | 1,482 | R10 |
| `c3d-threejs-forms` | static_object | threejs | **inherited-unverified** | 120 | 1,929 | R11 |
+| `c3d-scene-atmosphere` | scene | scene_threejs | **inherited-unverified** | 78 | 936 | R25 |
+| `c3d-scene-water` | scene | scene_threejs | **inherited-unverified** | 71 | 806 | R26 |
+| `c3d-scene-night` | scene | scene_threejs | **inherited-unverified** | 56 | 656 | R27 |
+| `c3d-scene-materials` | scene | scene_threejs | **inherited-unverified** | 78 | 832 | R28 |
**All seventeen ship OFF** (`C3D_SKILLS` unset). Zero have a measured effect; see
`docs/SKILLS_LEDGER.md` §5 for why that is the honest default and what flips one on.
@@ -119,7 +135,7 @@ routing, so `C3D_SKILLS=1 C3D_SKILLS_ONLY=<names>` is the vehicle when a bundle
| skill | cut | why |
|---|---|---|
-| `c3d-form-manifest` | 2026-08-25 | opened **2 of 19** times (11%, CI [3%, 31%]) — unread before *and* after its description was rewritten to lead with the trigger. The only bundle whose read-rate interval excluded every other's, and it cost ~1,917 tokens in 19 of the 27 sessions that could have read it. Text and full numbers: `docs/skills-attic/c3d-form-manifest/` |
+| `c3d-form-manifest` | 2026-08-25 | opened **2 of 19** times (11%, CI [3%, 31%]) — unread before *and* after its description was rewritten to lead with the trigger. The only bundle whose read-rate interval excluded every other's, and it cost ~1,917 tokens in 19 of the 27 sessions that could have read it. Text and full numbers: git history (`docs/skills-attic/` was removed 2026-09-21) |
An attic bundle is not loaded: `all_skills()` reads `codeverse3d/skills/*/SKILL.md` only, so it
costs no index line and no tokens. Its route id (**R5**) is retired and never reused — a run
@@ -242,7 +258,7 @@ the `live` cases drive a real CLI.
| `test_freshness.py` | every tool, gate kind, rubric criterion, constant, switch, sibling skill and cookbook section a bundle names still exists |
| `test_router.py` / `test_routing_property.py` | the four routing laws, by row and over the whole input space |
| `test_telemetry.py` | the read probe, **including the control that catches git reading the tree** |
-| `test_packaging.py` | **a built wheel contains all 13 `SKILL.md`, all 13 `references/`, all 9 `_claims`** |
+| `test_packaging.py` | **a built wheel contains all 17 `SKILL.md`, all 17 `references/`, all 9 `_claims`** |
| `test_live_discovery.py` | §7 — a real CLI actually finds and opens a bundle |
Two contradiction checks are worth separating, because they answer different questions:
@@ -333,7 +349,7 @@ The plan-loop wave hit the same thing hours earlier
(`eval/bench/out/plan_loop/C0/invalid_attempt1_maintree_import`) and worked around it with
`PYTHONPATH` in a launch script. It is fixed in the code now — bootstrap first, a guard
that refuses to start against a foreign `codeverse3d`, and
-`tests/compare_bench/test_worktree_import.py` — because a workaround protects whoever
+`eval/tests/test_worktree_import.py` — because a workaround protects whoever
remembers it, not the run.
### What this A/B actually measured
@@ -454,7 +470,7 @@ the read probe itself plus a magic word that only lives in `references/`.
All four discover the library natively, with no injection from us. Two things this settled
that had only been argued statically:
-* `Skill` was **absent** from `ALLOWED_TOOLS` in `agents/claude_code.py`, so claude-code
+* `Skill` was **absent** from `ALLOWED_TOOLS` in `agents/backends.py`, so claude-code
would have denied its own skill tool. Added; `3dcode doctor --skills` now checks it.
* gemini-cli's `activate_skill` consent prompt does not block us under
`--approval-mode yolo`. This was the one claim that could not be verified statically.
@@ -552,18 +568,17 @@ so; the rest are live.
pipeline step, so it reaches no `record.json`. `c3d-threejs-shader-traps` is therefore
**not instrumented**, which is a stronger statement than "always clean". Merge it into
`rounds[].gates` before spending anything on that bundle.
-* **`eval/bench/_fixed_eval.FixedEvaluator` is blender-only.** It pins `get_runtime(BLENDER)` and
- runs only lint and connectivity — never contract, joint_sweep, scene_frames or gl_frames.
- The *judged* column of any non-blender A/B is meaningless. The primary readout is safe:
- `eval/bench/skill_targets.py` reads each arm's own harness record.
+* ~~**`eval/bench/_fixed_eval.FixedEvaluator` is blender-only.**~~ Fixed 2026-08-26; the entry
+ lives in `docs/SKILLS_LEDGER.md` §4.
* **The atime probe is blind in any git workspace, and its control proves it.** The control
bundle came back "opened" in 27 of 33 sessions; the only 6 sessions where it stayed clean
were the 6 scene sessions, where nothing was delivered. So the shipped report is honest
- only where there was nothing to see. Use trajectory `read_skill` calls as ground truth.
-* **CLI backends' read rate is UNMEASURED — not 5/5.** `claude_code.py` uses
+ only where there was nothing to see. Trajectory `read_skill` calls were the ground truth;
+ that channel went with `api-agent` (2026-08-28).
+* **CLI backends' read rate is UNMEASURED — not 5/5.** `agents/backends.py` runs claude-code with
`--output-format json`, which returns only the final result and no tool stream; the logs
contain zero occurrences of any `c3d-` name. Switching to `--output-format stream-json`
- would give the CLI arm the same exact ground truth api-agent has. The earlier "5 of 5"
+ would give the CLI arm the same exact ground truth api-agent had. The earlier "5 of 5"
claim rested on the atime probe and should not be repeated.
* **`codex` can drop a round from the denominator.** It emitted `skills.attached` with no
`skills.read` and no `skills.jsonl` row, so an attached round can silently vanish from
diff --git a/harness/docs/SKILLS_LEDGER.md b/harness/docs/SKILLS_LEDGER.md
index 88314ff4..eeb5c999 100644
--- a/harness/docs/SKILLS_LEDGER.md
+++ b/harness/docs/SKILLS_LEDGER.md
@@ -255,11 +255,14 @@ it lands these four rows stay `mixed`, not `measured`.
have reported "no effect" for a switch it never tested. **Fixed** (`entry_of(spec)` reads
`contracts.common.ENTRY_FILE`). This is why no graphics or three.js bundle has ever had a
readable A/B.
-* **`eval/bench/_fixed_eval.FixedEvaluator` is blender-only.** It pins `get_runtime(BLENDER)` and
- runs only lint and connectivity — never contract, joint_sweep, scene_frames or gl_frames.
- Not fixed; it does not sink the primary readout, because `eval/bench/skill_targets.py` reads
- each arm's own harness record. Know that the *judged* column of any non-blender A/B is
- meaningless.
+* **`eval/bench/_fixed_eval.FixedEvaluator` was blender-only.** It pinned `get_runtime(BLENDER)`
+ and ran only lint and connectivity, so the *judged* column of any non-blender A/B was
+ meaningless. **Fixed** 2026-08-26: each cell builds with its own language's runtime
+ (`eval/tests/test_fixed_eval_language.py`); articulated cells add the joint sweep, graphics
+ cells their frame metrics, scene cells (2026-09-07) the `scene_frames` gate — contract still
+ never runs (it has no plan). It never sank the primary readout either:
+ `eval/bench/skill_targets.py` reads each arm's own harness record. (`docs/SKILLS.md` §9 points
+ here.)
* **`telemetry.record_exact_read` is wired to `read_file` only** (`agents/api_agent.py`), so
`read_skill` — api-agent's actual read channel — never reaches `skill_reads.jsonl`.
*(Moot since 2026-08-28: the api-agent and its `read_skill` channel were deleted with it;