Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    CastError
Message:      Couldn't cast
engine: string
engine_version: string
experiment: string
material_density_kg_m3: double
torque_z_N_m: double
duration_s: double
time_step_s: double
gravity_m_s2: list<item: double>
  child 0, item: double
contacts: bool
initial_angular_velocity_rad_s: list<item: double>
  child 0, item: double
required_relative_angular_speed_gain: double
maximum_relative_mass_change: double
maximum_outer_diameter_change_mm: double
maximum_relative_analytic_error: double
schema_version: int64
models: list<item: struct<name: string, model_id: string, score: struct<passed: int64, total: int64, pass_ra (... 11005 chars omitted)
  child 0, item: struct<name: string, model_id: string, score: struct<passed: int64, total: int64, pass_rate: double> (... 10993 chars omitted)
      child 0, name: string
      child 1, model_id: string
      child 2, score: struct<passed: int64, total: int64, pass_rate: double>
          child 0, passed: int64
          child 1, total: int64
          child 2, pass_rate: double
      child 3, request_config: struct<max_tokens: int64, reasoning_effort: string, max_completion_tokens: int64>
          child 0, max_tokens: int64
          child 1, reasoning_effort: string
          child 2, max_completion_tokens: int64
      child 4, stages: struct<graded: int64, physics: int64, render: int64, provider: int64>
          child 0, graded: int64
          child 1, physics: int64
          child 2, render: int64
          child 3, provider: int64
      child 5, by_engine: struct
...
ild 2, prompt_sha256: string
  child 42, 043: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 43, 044: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 44, 045: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 45, 046: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 46, 047: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 47, 048: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 48, 049: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
  child 49, 050: struct<experiment: string, engine: string, prompt_sha256: string>
      child 0, experiment: string
      child 1, engine: string
      child 2, prompt_sha256: string
to
{'schema_version': Value('int64'), 'benchmark': {'name': Value('string'), 'version': Value('string'), 'dataset_sha256': Value('string'), 'task_count': Value('int64'), 'attempts_per_task': Value('int64'), 'ranking': Value('string')}, 'tasks': {'001': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '002': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '003': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '004': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '005': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '006': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '007': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '008': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '009': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '010': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '011': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '012': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '013': {'experiment': Value('string'), 'engin
...
bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '046': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '047': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '048': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '049': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '050': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}}, 'source_report_sha256': Value('string'), 'rank': Value('int64')})}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 544, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3052, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2559, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2584, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 558, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 440, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 361, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2381, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2309, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              engine: string
              engine_version: string
              experiment: string
              material_density_kg_m3: double
              torque_z_N_m: double
              duration_s: double
              time_step_s: double
              gravity_m_s2: list<item: double>
                child 0, item: double
              contacts: bool
              initial_angular_velocity_rad_s: list<item: double>
                child 0, item: double
              required_relative_angular_speed_gain: double
              maximum_relative_mass_change: double
              maximum_outer_diameter_change_mm: double
              maximum_relative_analytic_error: double
              schema_version: int64
              models: list<item: struct<name: string, model_id: string, score: struct<passed: int64, total: int64, pass_ra (... 11005 chars omitted)
                child 0, item: struct<name: string, model_id: string, score: struct<passed: int64, total: int64, pass_rate: double> (... 10993 chars omitted)
                    child 0, name: string
                    child 1, model_id: string
                    child 2, score: struct<passed: int64, total: int64, pass_rate: double>
                        child 0, passed: int64
                        child 1, total: int64
                        child 2, pass_rate: double
                    child 3, request_config: struct<max_tokens: int64, reasoning_effort: string, max_completion_tokens: int64>
                        child 0, max_tokens: int64
                        child 1, reasoning_effort: string
                        child 2, max_completion_tokens: int64
                    child 4, stages: struct<graded: int64, physics: int64, render: int64, provider: int64>
                        child 0, graded: int64
                        child 1, physics: int64
                        child 2, render: int64
                        child 3, provider: int64
                    child 5, by_engine: struct
              ...
              ild 2, prompt_sha256: string
                child 42, 043: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 43, 044: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 44, 045: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 45, 046: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 46, 047: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 47, 048: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 48, 049: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
                child 49, 050: struct<experiment: string, engine: string, prompt_sha256: string>
                    child 0, experiment: string
                    child 1, engine: string
                    child 2, prompt_sha256: string
              to
              {'schema_version': Value('int64'), 'benchmark': {'name': Value('string'), 'version': Value('string'), 'dataset_sha256': Value('string'), 'task_count': Value('int64'), 'attempts_per_task': Value('int64'), 'ranking': Value('string')}, 'tasks': {'001': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '002': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '003': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '004': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '005': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '006': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '007': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '008': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '009': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '010': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '011': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '012': {'experiment': Value('string'), 'engine': Value('string'), 'prompt_sha256': Value('string')}, '013': {'experiment': Value('string'), 'engin
              ...
              bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '046': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '047': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '048': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '049': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}, '050': {'passed': Value('bool'), 'stage': Value('string'), 'failed_checks': List(Value('string')), 'usage': {'prompt_tokens': Value('int64'), 'completion_tokens': Value('int64'), 'total_tokens': Value('int64'), 'cost_usd': Value('float64')}}}, 'source_report_sha256': Value('string'), 'rank': Value('int64')})}
              because column names don't match

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

PhyCAD-Bench

PhyCAD-Bench banner with cyan pixel clouds

Evaluating model physics reasoning through mechanical CAD edits.

CadQuery input · STEP export · PyChrono grading

Task example · Recorded results · Quick start · Package files

What is PhyCAD-Bench?

PhyCAD-Bench asks a model to change a mechanical part to meet a physical goal. The model receives an instruction, an experiment setup, a starting CadQuery script, and a STEP solid. It returns a complete CadQuery script defining one solid named result in millimeters. The grader exports that solid to STEP, runs the task's PyChrono experiment, and checks the goal and fixed constraints.

The benchmark contains 50 runnable tasks across rigid-body motion, contact, joints, finite elements, thermal and electrostatic fields, terrain, vehicle fixtures, and robot fixtures. The first four come from Orla's CAD physics sample. Some tasks use a declared reduced-order physics model. Task 046 maps STEP nose sections to a compliant insertion contact law; task 049 maps STEP wheel pickups to a two-wheel rocker on fixed terrain. Each task's setup.json and simulate.py state its exact mapping.

A task in context

In task 001, the model edits a flywheel so it reaches at least 30% more angular speed after two seconds under the same torque. The outer diameter, material, and mass must stay fixed. The grader tests free rotation about the centered Z axis with a fixed torque in PyChrono.

File Role
instruction.txt Physical objective and constraints
setup.json Experiment parameters and thresholds
start.py Editable CadQuery starting point
start.step Starting solid
simulate.py Physics experiment and grading checks

The model sees the first four files. The grader uses simulate.py. The model's response must define result as one solid. A pass requires the speed gain and all fixed constraints to hold.

Recorded results

The leaderboard records one attempt per model and task. A pass requires a valid STEP export and all task-specific goal and constraint checks. API costs are provider-reported totals and exclude local CAD and simulation compute. Model request settings differ; see leaderboard.json for configurations and task-level outcomes.

Model Pass rate Passed Reported API cost
Claude Opus 5.5 72% 36/50 $6.03
GPT-6.1 Sol 70% 35/50 $2.00
GPT-6 Astra 68% 34/50 $9.89
Claude Opus 5 62% 31/50 $9.38
Muse Wonder 62% 31/50 $7.03
Gemini 4 Argon 60% 30/50 $2.24
Grok 4.7 60% 30/50 $6.12
Claude Fable 5.1 56% 28/50 $17.59
Kimi K3.1 Pro 48% 24/50 $2.21
GLM-5.3 22% 11/50 $0.75
Qwen3.8 Max 20% 10/50 $4.12
DeepSeek V4.1 Flash 16% 8/50 $0.36

Quick start

Download the benchmark files with the Hugging Face CLI:

hf download OrlaLabs/PhyCAD-Bench --repo-type dataset --local-dir PhyCAD-Bench
cd PhyCAD-Bench
python3 benchmark.py export-prompts --output output/prompts.jsonl

This exports the fixed model prompts without requiring CadQuery or PyChrono. The sections below cover model execution and grading.

Package files

Path Contents
leaderboard.json Model scores, request settings, usage, and task outcomes
benchmark.py Prompt export, model runs, CAD export, and grading
models.py OpenAI-compatible model adapter
tasks/ Instructions, starting solids, experiments, and checks
Dockerfile Pinned Linux grading environment

A response may import only cadquery or math and may not read or write files. If it includes Python code fences, the benchmark extracts the longest block.

How a run works

task files -> fixed prompt -> model adapter -> CadQuery script -> STEP -> physics checks -> score

benchmark.py run calls an OpenAI-compatible Chat Completions endpoint. Only the model call is provider-specific; the prompts, code extraction, CAD export, physics checks, and report are shared. Ollama, LM Studio, vLLM, and OpenRouter document compatible endpoints. Their optional request fields may differ, so start with the defaults and only add settings your endpoint supports.

Every run needs CadQuery 2.6.1 and official Project Chrono PyChrono 9.0.1. Tasks 027 to 038 and 048 also need Gmsh 4.14.1 in the CadQuery interpreter to tetrahedralize submitted STEP solids at two pinned mesh sizes. Task 033 needs SciPy 1.14.1 in the PyChrono interpreter for its sparse eigenvalue solve. They can be in separate Python environments. The PyPI package named pychrono is unrelated to Project Chrono. Set the interpreter paths once:

export CAD_PYTHON=/absolute/path/to/cadquery-python
export PHYSICS_PYTHON=/absolute/path/to/pychrono-python

On macOS, the CadQuery interpreter must be outside /Users because the candidate runner uses sandbox-exec. The Docker image provides both interpreters for offline grading on Linux amd64. See the Docker section below.

Local model server

Start your model server and get its model identifier. For example, a local Ollama server exposes an OpenAI-compatible API at http://localhost:11434/v1. Then run all tasks:

python3 benchmark.py run \
  --base-url http://localhost:11434/v1 \
  --model YOUR_LOCAL_MODEL_TAG \
  --output output/local.results.json

For LM Studio, use http://localhost:1234/v1 after starting its server. For vLLM, use the base URL of your running OpenAI-compatible server. No API key is needed unless your local server requires one.

Cloud model

For OpenRouter, set a key and point the same command at its endpoint:

export OPENROUTER_API_KEY=YOUR_KEY
python3 benchmark.py run \
  --base-url https://openrouter.ai/api/v1 \
  --api-key-env OPENROUTER_API_KEY \
  --model provider/model-slug \
  --output output/openrouter.results.json

--api-key-env names an environment variable. The key itself is never written to the report. run-openrouter remains as a shorter alias for this endpoint:

python3 benchmark.py run-openrouter \
  --model provider/model-slug \
  --output output/openrouter.results.json

The Gemini compatibility endpoint uses the same runner with a different base URL and key:

export GEMINI_API_KEY=YOUR_KEY
python3 benchmark.py run \
  --base-url https://generativelanguage.googleapis.com/v1beta/openai \
  --api-key-env GEMINI_API_KEY \
  --model YOUR_GEMINI_MODEL \
  --output output/gemini.results.json

For another compatible cloud API, change --base-url, --api-key-env, and --model. Use a separate output file for each model and configuration. The adapter sends a nonstreaming POST /chat/completions request with the fixed system and user messages. It reads the returned assistant text from choices[0].message.content.

The default request asks for up to 4096 output tokens using max_tokens. If an endpoint needs max_completion_tokens, use --token-field max_completion_tokens. You can also set --max-output-tokens, --reasoning-effort, --timeout, and --repeats (1 to 3). --parallel-requests sends up to that many model requests at once (default 1, maximum 16). Grading and report writes stay sequential. You can change this setting when resuming because it does not change the model prompt or request. run-openrouter defaults to max_completion_tokens. The report records the exact request settings. Do not compare scores from different prompt or generation settings as if they were the same experiment.

Results and resume

run writes one JSON report and a companion ZIP of returned scripts. The report contains the model requested and served, endpoint, request settings, dataset and prompt hashes, raw model text, extracted script, token usage and cost per task when provided, CAD STEP hash, physics checks, and pass or fail for every attempt. usage_totals sums reported input tokens, output tokens, total tokens, and cost. Its reported_trials counts show how many attempts supplied each field, so missing provider usage is visible. Its success_rate is passed attempts divided by all scheduled attempts. It is null until the run is complete.

The report is saved after each task. Repeating the exact command with the same output file resumes unfinished tasks. A model timeout is recorded as a failed attempt. HTTP errors and invalid endpoint responses stop new requests so a service outage does not become a model failure. Requests already in flight finish, and successful answers are saved. Completed tasks are not called again.

Offline path for any model

The model does not have to use our adapter. Export the exact prompts as JSONL:

python3 benchmark.py export-prompts --output output/prompts.jsonl

Each line has task_id, prompt_sha256, and messages. Send messages to your own model runner and save one plain Python script per task:

output/answers/
  001.py
  002.py
  003.py
  004.py

Then grade the whole folder without any model API key:

python3 benchmark.py grade-all \
  --submissions output/answers \
  --model my-model \
  --output output/my-model.results.json

Missing answer files count as failures. The report gives each task's physics checks and overall pass rate. Use a different answer folder for another model or attempt. You can also grade just one script:

python3 benchmark.py grade \
  --task 001 \
  --candidate output/answers/001.py \
  --output output/001.results.json

grade and grade-all need CAD_PYTHON and PHYSICS_PYTHON set as above, or the equivalent --cad-python and --physics-python flags. export-prompts does not need either environment.

Docker image

Dockerfile installs CadQuery and PyChrono in separate environments for Linux amd64. Build it with:

docker build --platform linux/amd64 -t phycad-bench .

Use the image for offline grading with networking disabled and only an output folder writable. For example, after putting 001.py through 004.py in output/answers/:

docker run --rm --platform linux/amd64 --network none --read-only \
  --tmpfs /tmp:rw,exec \
  --mount type=bind,src="$(pwd)/output",dst=/bench/output \
  phycad-bench grade-all \
  --submissions /bench/output/answers \
  --model my-model \
  --output /bench/output/my-model.results.json

The run command needs network access to reach a model endpoint. A network-enabled Docker run also exposes that network to generated candidate code. Use the macOS sandbox for connected runs until model calls and candidate execution are isolated in separate containers or processes.

Downloads last month
47