The Dataset Viewer has been disabled on this dataset.

CAD-1000-DPO: 1k Ground-Truth Physics & Code Execution Traces

CAD-1000-DPO Hero Banner Figure 1: Ground-truth CadQuery execution pair showing stress failure (SF 0.62) vs. auto-corrected geometry passing CalculiX FEA solver criteria (SF 1.90).

Overview

CAD-1000-DPO is an open preference dataset containing 1,000 paired execution sweeps designed for DPO (Direct Preference Optimization), RLHF, and CAD code post-training.

Instead of validating syntactical correctness alone, CAD-1000-DPO evaluates parametric Python code (CadQuery) against a deterministic finite element solver (CalculiX ccx). Each record pairs broken code (code_bad) with physical solver failure diagnostics (where_it_fails, failure_class) and verified passing geometry (code_good, fix).

Dataset Architecture Flowchart Figure 2: Deterministic data factory harness intercepting non-converging meshes and stress singularities to construct DPO preference pairs.


Dataset Distribution & Geometry Coverage

Dataset Distribution Chart Figure 3: Breakdown across the 1,000 physical execution pairs by geometry family, load conditions, and part parameters.

Geometry Family Sweeps Key Geometry Dimensions (mm) Load (N) Primary Failure Modes Tested
u_channel 272 83 × 35 × 36, T = 3.2 500 N Flange bending yield / Web buckling
rib_bracket 265 56 × 47 × 48, T = 4.3 1500 N Gusset transition stress concentration
plate_holes 232 101 × 53 × 3.6, Ø6 holes 800 N Thin-wall yield at fixed bolt holes
l_bracket 231 56 × 50 × 51, T = 3.8 1200 N 90° corner stress singularities

Data Schema Example

{
  "id": 0,
  "family": "plate_holes",
  "params": {"L": 101.4, "W": 52.8, "T": 3.6, "fix_extra": 4.0, "holes": 2, "hole_d": 6},
  "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"},
  "prompt": "Design a plate holes that survives 800 N (cantilever load)...",
  "system_prompt": "You are an expert CAD engineer writing CadQuery (Python)...",
  "code_good": "<cadquery script>",
  "code_bad": "<cadquery script>",
  "where_it_fails": "stress concentrates at the bolt holes near the fixed end...",
  "failure_class": "thin-wall-yield",
  "fix": "thicken the plate",
  "fea_engine": "CalculiX ccx 2.22",
  "solver_status": "converged",
  "bad": {"vm_mpa": 402.9, "safety_factor": 0.62, "max_disp_mm": 2.05, "volume_mm3": 19070},
  "good": {"vm_mpa": 131.5, "safety_factor": 1.90, "max_disp_mm": 0.54, "volume_mm3": 40260},
  "pass_margin": 1.28
}

## Usage & Quickstart

Load directly via Hugging Face datasets:

```python
from datasets import load_dataset

dataset = load_dataset("tryforge/cad-1000-dpo")
print(dataset['train'][0]['code_good'])

Citation & Licensing

If you use this dataset or execution harness for fine-tuning or evaluation, please cite:

@misc{cad_1000_dpo_2026,
  author = {TryForge},
  title = {CAD-1000-DPO: Paired Execution Traces & Ground-Truth Physics for Code RLHF},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/tryforge/cad-1000-dpo}}
}

License: CC-BY-SA-4.0

Downloads last month
88