Official Codebase of 3DCodeVerse
Python
bench: the A/B rig scored four of seven languages 0.0 for delivering the file they deliver
gaoypeng99c897ab23b5
diff --git a/harness/bench/compare_backends.py b/harness/bench/compare_backends.pyindex 7343121b..dff8e9a3 100644--- a/harness/bench/compare_backends.py+++ b/harness/bench/compare_backends.py@@ -81,6 +81,7 @@ from bench.run_bench import ( # noqa: E402)from codeverse.config import get_settings # noqa: E402from codeverse.contracts.artifacts import RenderSet # noqa: E402+from codeverse.contracts.common import ENTRY_FILE # noqa: E402from codeverse.contracts.run import RunRecord # noqa: E402from codeverse.contracts.spec import Spec # noqa: E402from codeverse.cost import run_ledger # noqa: E402@@ -211,6 +212,20 @@ def _generate_oneshot(arm: Arm, spec: Spec, cell: Path, eval_ws: Workspace, optsprompt = repair_prompt(spec, (eval_ws.root / MODEL_FILE).read_text(), build, lint, attempt + 1)+def entry_of(spec: Spec) -> str:+ """The file THIS spec's language delivers its code in.++ ``_oneshot.MODEL_FILE`` is ``src/model.py`` because the one-shot arms are a+ blender-only comparison (their contract prompt is literally python). The HARNESS arm+ is not: a glsl run delivers ``src/shader.frag``, three.js ``src/object.js``, a scene+ ``src/scene.js``, moderngl ``src/program.py``. Gating the harness arm on the one-shot+ constant made every cell in those four languages ``no_code`` / **0.0** while the run+ itself came back ``passed`` — a rig failure wearing a capability result's clothes, and+ invisible in the summary. ``ENTRY_FILE`` is the canonical table; consult it.+ """+ return ENTRY_FILE[spec.language]++def _run_harness(spec: Spec, cell: Path, eval_ws: Workspace, deps: CompareDeps, res: CellResult) -> None:run_ws = Workspace(cell / "run")resume = run_ws.exists()@@ -225,8 +240,8 @@ def _run_harness(spec: Spec, cell: Path, eval_ws: Workspace, deps: CompareDeps,res.gen_cost_usd = rec.total_usage.cost_usdres.tool_calls = rec.total_usage.tool_callsres.harness_status, res.harness_rounds, res.harness_loop_score = rec.status.value, len(rec.rounds), rec.final_score- if not (run_ws.root / MODEL_FILE).is_file():- res.error = f"harness run produced no {MODEL_FILE} (status {rec.status.value}: {rec.error})"+ if not (run_ws.root / entry_of(spec)).is_file():+ res.error = f"harness run produced no {entry_of(spec)} (status {rec.status.value}: {rec.error})"return# the whole src/ tree: agents may split helpers into src/parts/*.py (the build wrapper puts src/ on sys.path)shutil.copytree(run_ws.src, eval_ws.src, dirs_exist_ok=True, ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))@@ -250,7 +265,7 @@ def run_cell(battery: Battery, item: BenchPrompt, arm: Arm, out: Path, opts: Com_run_harness(spec, cell, eval_ws, deps, res)else:_generate_oneshot(arm, spec, cell, eval_ws, opts, deps, res)- if (eval_ws.root / MODEL_FILE).is_file():+ if (eval_ws.root / entry_of(spec)).is_file():outcome = deps.evaluator.evaluate(eval_ws, spec)eval_ws.write_json(eval_ws.root / "eval.json", outcome)_fill_from_outcome(res, outcome)diff --git a/harness/tests/compare_bench/test_bench_shared.py b/harness/tests/compare_bench/test_bench_shared.pyindex c5d31c38..60e8ea8c 100644--- a/harness/tests/compare_bench/test_bench_shared.py+++ b/harness/tests/compare_bench/test_bench_shared.py@@ -2,6 +2,8 @@from __future__ import annotations+from types import SimpleNamespace+import bench.compare_backends as cbimport bench.run_bench as rbfrom bench.run_bench import Battery, BenchOptions, build_spec, select_prompts, spec_for@@ -50,3 +52,36 @@ def test_spec_for_routes_through_settings_backends():# unset roles fall through to the settings defaults, not the Backends() literalsassert spec.backends.planner == s.default_planner and spec.backends.judge == s.default_judgeassert spec.backends.captioner == s.default_captioner+++# ------------------------------------------------------- the harness arm is not blender-only+def test_the_harness_arm_looks_for_each_languages_own_entry_file():+ """``bench/_oneshot.MODEL_FILE`` is ``src/model.py`` because the ONE-SHOT arms are a+ blender-only comparison. The harness arm is not, and gating it on that constant made+ every glsl / three.js / scene / moderngl cell ``no_code`` **0.0** while the run itself+ came back ``passed`` — measured 2026-08-25 on a glsl_shader A/A whose control wrote+ ``src/shader.frag`` and was scored zero for it.++ Four of the seven languages were affected, which is why no graphics or three.js bundle+ has ever had a readable A/B: both arms scored 0.0 and the rig called that "no effect".+ """+ from bench.compare_backends import entry_of+ from codeverse.contracts.common import ENTRY_FILE, Language++ for language, entry in ENTRY_FILE.items():+ spec = SimpleNamespace(language=language)+ assert entry_of(spec) == entry, f"{language.value} delivers {entry}"++ # the four that the hardcoded constant got wrong, named so the regression is legible+ assert {lang.value for lang, e in ENTRY_FILE.items() if e != "src/model.py"} == {+ "threejs", "scene_threejs", "glsl_shader", "opengl_python"}+ assert entry_of(SimpleNamespace(language=Language.GLSL_SHADER)) == "src/shader.frag"+++def test_every_language_in_the_enum_has_an_entry_file():+ """``entry_of`` indexes ``ENTRY_FILE`` directly, so a new language without a row would+ raise KeyError deep inside a paid cell instead of failing here."""+ from codeverse.contracts.common import ENTRY_FILE, Language++ missing = [lang.value for lang in Language if lang not in ENTRY_FILE]+ assert not missing, f"no ENTRY_FILE row for {missing}"