From 04ea29fad142dcebe50600e99ba4a3f1bf43d7d0 Mon Sep 17 00:00:00 2001 From: jeqcho Date: Tue, 14 Jul 2026 10:39:03 -0700 Subject: [PATCH] test: sweep blueprints at runtime seeds; make task versions explicit Post-merge cleanups from the #24 review: - test_sim_blueprint's sweep paired scenes with derive_seed(0, index, epoch), seeds that no longer occur at runtime now that init_seed is crc32-derived. Sweep with derive_seed(0, scene.init_seed, epoch) instead. Pinned tests keep their fixed seed literals (they check blueprint/realization consistency at a seed, any seed); the one comment claiming those literals were real epochs is reworded. - TaskSpec.version's default was bumped to "2" in #24, which would mint future new tasks at version 2. Restore the default to "1" and set version="2" explicitly on the nine existing tasks (scoop_pasta already pins "3"). Realized version stamps are unchanged. Co-Authored-By: Claude Fable 5 --- src/kitchenbench/specs.py | 11 ++++++++++- tests/test_sim_blueprint.py | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/kitchenbench/specs.py b/src/kitchenbench/specs.py index 2b1cf37..afbacca 100644 --- a/src/kitchenbench/specs.py +++ b/src/kitchenbench/specs.py @@ -34,7 +34,7 @@ class TaskSpec: bimanual: bool max_steps: int instances: tuple[TaskInstance, ...] - version: str = "2" + version: str = "1" description: str = "" @@ -1341,6 +1341,7 @@ def _sort_fixtures( bimanual=False, max_steps=60, instances=_PLACE_CUTLERY, + version="2", description="Pick a single piece of cutlery and place it on a target surface.", ), TaskSpec( @@ -1350,6 +1351,7 @@ def _sort_fixtures( bimanual=False, max_steps=80, instances=_STACK, + version="2", description="Stack multiple like items into a single neat stack.", ), TaskSpec( @@ -1359,6 +1361,7 @@ def _sort_fixtures( bimanual=False, max_steps=80, instances=_PLACE_IN_RACK, + version="2", description="Drop a dish into the correct slot of a dish rack.", ), TaskSpec( @@ -1368,6 +1371,7 @@ def _sort_fixtures( bimanual=True, max_steps=100, instances=_POUR_PASTA, + version="2", description="Pour dry pasta into a receiving vessel; one arm steadies, the other pours.", ), TaskSpec( @@ -1377,6 +1381,7 @@ def _sort_fixtures( bimanual=True, max_steps=120, instances=_OPEN_CONTAINER, + version="2", description="Remove or unscrew a lid — one arm braces while the other twists or pries.", ), TaskSpec( @@ -1386,6 +1391,7 @@ def _sort_fixtures( bimanual=True, max_steps=120, instances=_FOLD_CLOTH, + version="2", description="Deformable manipulation: grasp opposite corners and manage slack.", ), TaskSpec( @@ -1395,6 +1401,7 @@ def _sort_fixtures( bimanual=True, max_steps=120, instances=_SEAL_CONTAINER, + version="2", description="Align and press-or-twist a matching lid onto a base while one arm holds it.", ), TaskSpec( @@ -1404,6 +1411,7 @@ def _sort_fixtures( bimanual=True, max_steps=80, instances=_HANDOFF, + version="2", description="A pure handover that a single arm cannot do — the must-use-both-arms anchor.", ), TaskSpec( @@ -1413,6 +1421,7 @@ def _sort_fixtures( bimanual=False, max_steps=200, instances=_SORT_CUTLERY, + version="2", description="Sort a mixed pile into spoon/fork/knife compartments — multi-instance.", ), TaskSpec( diff --git a/tests/test_sim_blueprint.py b/tests/test_sim_blueprint.py index e0f2f59..b1856f5 100644 --- a/tests/test_sim_blueprint.py +++ b/tests/test_sim_blueprint.py @@ -44,7 +44,9 @@ def _all_scene_seed_pairs() -> list[tuple[str, object, int]]: for spec in SPEC_BY_KEY.values(): for index, scene in enumerate(build_scenes(spec)): for epoch in range(3): - pairs.append((f"{spec.key}[{index}]e{epoch}", scene, derive_seed(0, index, epoch))) + pairs.append( + (f"{spec.key}[{index}]e{epoch}", scene, derive_seed(0, scene.init_seed, epoch)) + ) return pairs @@ -208,7 +210,7 @@ def test_pinned_handoff_receiving_arms() -> None: def test_pinned_size_order_mixed_sizes_both_orders() -> None: scene = _scene("stack", 3) # mixed-sizes: size_order sampled - # Epoch 0 samples "largest_first", epoch 1 samples "shuffled" (pinned). + # These fixed seeds sample "largest_first" and "shuffled" (pinned). seed_first = derive_seed(0, 3, 0) values_first = realize_scene(scene, seed_first).values # type: ignore[arg-type] assert values_first["size_order"] == "largest_first"