Skip to content

Official Codebase of 3DCodeVerse

Python

fewer_turns (3/3): bench/prompts/turns_v1.yaml + docs/COST.md §26 "Fewer turns (in measurement)"

gaoypengd694e79df468
diff --git a/harness/bench/prompts/turns_v1.yaml b/harness/bench/prompts/turns_v1.yaml
new file mode 100644
index 00000000..42da7d9a
--- /dev/null
+++ b/harness/bench/prompts/turns_v1.yaml
@@ -0,0 +1,131 @@
+# turns_v1 — the fewer-turns A/B slice (docs/COST.md §26). Six blender static objects copied
+# VERBATIM from static_objects_v2.yaml (2 medium controls + 4 hard), chosen because each has a
+# completed 3-round run in bench/out/static_v2_flash/runs/<id> — so a wall-clock, turns-per-
+# session and calls-per-run baseline exists for the paired read-out. static_v2_flash minutes /
+# final score: dining_chair 15.3 / 0.60 · hand_drill 15.4 / 0.92 · coffee_grinder 11.8 / 0.60 ·
+# machinist_vise 11.4 / 0.60 · spiral_stair 20.6 / 0.60 · drafting_table 30.2 / 0.60.
+# Run with:
+# python bench/ab_plan.py --prompts bench/prompts/turns_v1.yaml --out bench/out/turns_v1 \
+# --pin-plan --variant-env CV3D_FEWER_TURNS=1 \
+# --generator api-agent:gemini:gemini-3.7-flash --judge gemini:gemini-3.1-pro-preview \
+# --rounds 3 --max-minutes 120 --max-in-flight 8 --allow-siblings
+name: turns_v1
+track: static_object
+language: blender
+description: >
+ fewer-turns A/B slice: 6 static_objects_v2 blender prompts (2 medium controls, 4 hard) with
+ static_v2_flash baselines, run paired with --pin-plan and --variant-env CV3D_FEWER_TURNS=1.
+prompts:
+ - id: ctrl_med_dining_chair
+ tier: medium
+ category: furniture
+ tags: [control, "axis:decomposition"]
+ prompt: a mid-century wooden dining chair with a slatted backrest and tapered legs
+ must_have:
+ - "four tapered legs, each thinner at the floor than at the seat"
+ - "seat slab about 0.42 m wide"
+ - "seat surface about 0.45 m above the floor"
+ - "backrest with at least 3 vertical slats"
+ - "back legs continue up into the backrest posts"
+ - "backrest top rail between 0.80 m and 0.95 m above the floor"
+ - "all four feet touch the ground plane"
+ - "no leg or slat intersects the seat slab"
+ dimensions_m: {width: 0.45, depth: 0.50, height: 0.90}
+ - id: ctrl_med_hand_drill
+ tier: medium
+ category: tools
+ tags: [control, "axis:decomposition"]
+ prompt: a cordless power drill with a pistol grip, trigger, battery pack in the base of the grip and a keyless chuck holding a drill bit
+ must_have:
+ - "pistol-grip body with the grip angled back from vertical"
+ - "trigger recessed at the top of the grip"
+ - "battery block under the grip, wider than the grip"
+ - "chuck at the front, about 0.04 m diameter"
+ - "drill bit protruding about 0.08 m from the chuck"
+ - "side vents on the motor housing"
+ - "overall length about 0.22 m from chuck tip to body rear"
+ - "overall height about 0.24 m from battery base to body top"
+ dimensions_m: {length: 0.22, height: 0.24}
+ - id: mech_hard_coffee_grinder
+ tier: hard
+ category: mechanisms
+ tags: ["axis:decomposition"]
+ prompt: >
+ a hand-crank coffee grinder: square wooden box body with a small front drawer,
+ cast-iron dome top with an open hopper funnel, a conical burr visible inside
+ the funnel throat, and a top crank arm with a wooden knob
+ must_have:
+ - "square wooden box body about 0.14 m wide and 0.12 m tall"
+ - "front drawer about 0.05 m tall with a round knob, in the lower half of the box"
+ - "drawer front sits flush in its opening with a visible seam"
+ - "metal dome top mounted on the box"
+ - "open hopper funnel about 0.08 m across at the rim"
+ - "conical burr visible inside the funnel throat"
+ - "central spindle about 0.01 m thick rising from the burr through the dome"
+ - "crank arm about 0.11 m long attached to the spindle top"
+ - "wooden knob on a short vertical pin at the crank's free end"
+ - "adjustment nut on the spindle above the crank hub"
+ dimensions_m: {width: 0.14, depth: 0.14, height: 0.30}
+ - id: mech_hard_machinist_vise
+ tier: hard
+ category: tools
+ tags: ["axis:decomposition", "axis:thin_features"]
+ prompt: >
+ a machinist bench vise with an acme lead screw showing its thread helix, twin
+ cylindrical guide rails, a swivel base with two lock handles, serrated jaw
+ plates and a sliding tommy-bar handle
+ must_have:
+ - "fixed jaw and sliding jaw with a 0.05 m open gap between them"
+ - "flat jaw plates about 0.10 m wide with serration grooves"
+ - "lead screw between the jaws with at least 6 visible thread turns"
+ - "2 cylindrical guide rails flanking the screw"
+ - "sliding jaw rides on the rails and the screw"
+ - "tommy bar about 0.16 m long through the screw head, with ball ends"
+ - "swivel base disc under the vise body"
+ - "2 lock handles on the swivel base rim"
+ - "mounting flange with 3 bolt holes"
+ - "overall body length about 0.30 m"
+ dimensions_m: {length: 0.30, width: 0.14, height: 0.18}
+ - id: arch_hard_spiral_stair
+ tier: hard
+ category: buildings
+ tags: ["axis:arch_detail", "axis:thin_features"]
+ prompt: >
+ a cast-iron spiral staircase: central column, wedge treads winding a full
+ turn, a baluster at each tread's outer edge, a continuous helical handrail
+ and a railed top landing
+ must_have:
+ - "central column about 0.10 m diameter"
+ - "at least 12 wedge-shaped treads attached to the column"
+ - "treads climb evenly through at least 360 degrees total rotation"
+ - "open risers: visible gaps between consecutive treads"
+ - "1 baluster at the outer edge of each tread"
+ - "continuous helical handrail on top of the balusters"
+ - "top landing platform with its own railing"
+ - "base plate at the bottom of the column"
+ - "each tread about 0.70 m from column to outer edge"
+ - "overall height about 2.7 m"
+ dimensions_m: {height: 2.7, width: 1.6}
+ - id: comp_hard_drafting_table
+ tier: hard
+ category: furniture
+ tags: ["axis:multi_material", "axis:decomposition"]
+ prompt: >
+ a drafting table setup: tilted drawing board on a trestle frame with quadrant
+ tilt brackets, a parallel ruler riding on side rails, a pen tray, a sheet of
+ paper held by two corner clips, a clamp-on two-arm lamp aimed at the board,
+ and a stool with a footring
+ must_have:
+ - "drawing board about 1.0 m by 0.7 m tilted about 20 degrees"
+ - "parallel ruler bar spanning the board width"
+ - "ruler rides on a rail or wire at each side edge"
+ - "pen tray along the bottom edge of the board"
+ - "trestle legs with a cross stretcher"
+ - "quadrant tilt bracket with a knob at each of the board's 2 sides"
+ - "sheet of paper on the board held by clips at 2 corners"
+ - "lamp clamped to a top corner of the board"
+ - "lamp has 2 arm segments and a shade aimed down at the board"
+ - "stool with a round seat about 0.65 m high"
+ - "stool footring between its legs"
+ - "board top edge about 1.1 m above the floor"
+ dimensions_m: {width: 1.1, depth: 0.9, height: 1.2}
diff --git a/harness/docs/ARCHITECTURE.md b/harness/docs/ARCHITECTURE.md
index b50d668f..aafc83da 100644
--- a/harness/docs/ARCHITECTURE.md
+++ b/harness/docs/ARCHITECTURE.md
@@ -106,7 +106,8 @@ codeverse/
trajectory naming, files_changed attribution), watchdog.py, transcript.py, registry.py
languages/ LanguageRuntime; blender/ (multi-file: layout.py, model.py + parts/*.py) cadquery/
threejs/ (+ templates.py) urdf/ scene_threejs/ glsl_shader/ (wrap.py header+line-map)
- opengl_python/ (wrappers/run_gl.py) — each runtime.py, lint.py, skeleton.py, wrappers/
+ opengl_python/ (wrappers/run_gl.py) — each runtime.py, lint.py, skeleton.py, wrappers/;
+ file_lint.py (one just-written file → syntax/lint verdict for write_file, COST.md §26)
spatial/ node.py, render.py, tool_common.py (shared tool plumbing), cookbook_tool.py
(read_cookbook), render_scene.py (judge view subset, content-fitted orbit),
frame_metrics.py (scene_frames gate), frame_motion.py (measured inter-frame motion),
diff --git a/harness/docs/COST.md b/harness/docs/COST.md
index 23b6a138..6c0213a1 100644
--- a/harness/docs/COST.md
+++ b/harness/docs/COST.md
@@ -1252,3 +1252,21 @@ remaining session / round budget (~1 430 s/run) — (2) hedge a 503 retry across
the ceiling inside a round (837 s sooner on killed runs) — (7) flash as the loop judge (~60 s
baseline) — (8) 30 s render cap (≤ 100 s). (1)–(3) and the key/attempt ledger fields are in
progress on branch `retry-budget`.
+
+## 26. Fewer turns (in measurement) — `CV3D_FEWER_TURNS`, branch `fewer-turns`
+
+static_v2_flash (20 blender object runs, healthy provider, api-agent gemini-3.7-flash): wall median
+1 047 s, of which 823 s (79 %) is model time = **196 flash calls per run** at 4.2 s mean (p50 2.8 s;
+latency scales with prompt size — 1.3 s below 20 k tokens, 4.1 s at 80 k; prompt p50 35 k, output
+p50 **20 tokens**). Most turns are one tiny tool call carrying a 35–70 k context; prefix caching
+already covers 84 % of input tokens, so the cost is round trips, not tokens. The BASELINE session
+hits the 60-turn cap in every run (write_file 22.5, build 8, read_file 7.5, check_connectivity 4.6,
+check_contract 4.1 per session); REFINE sessions (5.3/run, 24 turns median) read_file 5.2, build 5.1,
+write_file 4.6, check_connectivity 3.8, check_contract 2.8. Capping turns is NOT the lever (§17).
+So, behind one switch, default OFF: (1) `build` folds check_connectivity + check_contract into its
+observation (~44 turns/run); (2) write_file / edit_file return `(N lines) · syntax OK` or the first
+3 lint errors instead of being read back (~35 turns/run); (3) a scoped refine task ≤ 3 files /
+≤ 12 k chars gets its files inlined; (4) the baseline prompt asks for every file in turn one.
+Run: `python bench/ab_plan.py --prompts bench/prompts/turns_v1.yaml --out bench/out/turns_v1 --pin-plan --variant-env CV3D_FEWER_TURNS=1 --generator api-agent:gemini:gemini-3.7-flash --judge gemini:gemini-3.1-pro-preview --rounds 3 --max-minutes 120 --max-in-flight 8 --allow-siblings`
+Read out, paired per prompt: wall (s), turns per session (baseline / refine), model calls per run,
+score (control vs variant, sign count) — and whether the baseline session still hits the cap.