SPADA: A Verifiable Test-Driven Agent for Controllable Parametric CAD Assembly Generation
Abstract
Parametric CAD is widely used in mechanical and product engineering, but current generative models still have difficulty producing assemblies that are both editable at the parameter level and consistent with inter-part constraints. Methods that generate meshes or history-free B-rep can represent multi-part shape, but they often lack the program structure and constraint logic needed for reliable downstream edits; in contrast, code-based CAD generation offers direct parametric control, yet most published settings and evaluations focus on single-part solids rather than constrained assemblies. We introduce SPADA (Self-testing Parametric Assembly Design Agent), a test-driven agent that synthesizes assembly code together with deterministic verification tests, and uses these tests as an executable contract for controllable generation. SPADA runs an iterative compile-test-repair loop with multimodal feedback, checking both specification logic and physical feasibility through programmatic constraints. To support evaluation, we release SPADA-Bench-Verified, a human-validated benchmark of real-world code-centric assemblies paired with deterministic tests and engineering-style constraints. Experiments show that SPADA could produces complex assemblies while maintaining geometric fidelity, supporting test-driven agents as a concrete path toward reliable, controllable CAD generation.
Lay Summary
Engineers use computer-aided design software to create precise 3D parts and assemblies, but turning a text description into an editable design is still difficult. Current AI tools can often produce shapes that look plausible, yet the pieces may not fit, move, or satisfy the measurements that real engineering work requires. We built SPADA, a system that writes design code and checks its work with automatic tests, much like a programmer runs tests to find bugs. When a design fails a test, SPADA uses the error message and visual feedback to revise the code until the design better matches the requested constraints. We also built SPADA-Bench-Verified, a collection of design tasks with human-checked examples and automatic tests. This helps researchers measure whether AI systems make designs that are not only visually similar, but also editable and mechanically consistent.