PhySimCode-data-v4 / README.md
SourajaKundu123's picture
Add files using upload-large-folder tool
48d3669 verified
|
Raw History Blame Contribute Delete
6.74 kB
metadata
pretty_name: PhySimCode data v4
task_categories:
  - video-text-to-text
tags:
  - physics
  - simulation
  - code-generation
  - video
size_categories:
  - 100K<n<1M

PhySimCode data v4

Training and evaluation data for physics video → simulation code. The input is a short video of a physics simulation. The target has two parts:

  1. a chain of thought (CoT): the experiment name and the governing physical law;
  2. a self-contained Python program that re-renders the video.

The post-training code (SFT, evaluation, GRPO) is in the GitHub repo SourajaKundu/Physics-Simulation-Code-Generation, folder post_training/.

Folder Content Size
scipy_v4/ scipy engine, ready-made data_v4 splits for SFT, RL and evaluation 7.3 GB
kubric/ the complete kubric engine dataset, raw samples (not used for training) 4.2 GB

Quick start (recommended)

Clone the code repo and run its download script. It downloads into <repo>/data/, unpacks the tar shards, and rewrites the video paths. All training and evaluation scripts read from that location by default, so no paths need editing.

git clone https://github.com/SourajaKundu/Physics-Simulation-Code-Generation.git
cd Physics-Simulation-Code-Generation
pip install -U "huggingface_hub[cli]"
hf auth login                                     # a token from an account that has been granted access to this dataset
bash post_training/data/download_data.sh          # scipy_v4 only: everything SFT, eval and RL need (7.3 GB)
bash post_training/data/download_data.sh kubric   # optional: the kubric dataset (4.2 GB)

Then follow post_training/README.md for the environment setup, SFT, evaluation and GRPO.

Resulting layout:

Physics-Simulation-Code-Generation/
└── data/                                   # $DATA_ROOT
    ├── scipy_v4/                           # $PHYSIM_DATA
    │   ├── sft_train.jsonl  rl_train.jsonl  val_seen.jsonl  val_unseen.jsonl  rl_val.jsonl
    │   ├── split_manifest.csv  gt_video_meta.json
    │   ├── videos/scipy/<experiment>/<sample_id>.mp4       # model inputs
    │   └── ref_videos/scipy/<experiment>/<sample_id>.mp4   # original videos (RL reward, PSNR)
    └── kubric/                             # $PHYSIM_KUBRIC
        ├── manifest.csv
        └── dataset_kubric/<experiment>/<sample_id>/{video.mp4, params.json, cot.json, simulation_code.py}

To store the data somewhere else, set DATA_ROOT=/big/disk/physimcode before running the download script, and set it again before running any training script. post_training/env.sh reads it.

Manual download

hf download SourajaKundu123/PhySimCode-data-v4 --repo-type dataset --include "scipy_v4/*" --local-dir data
cd data/scipy_v4 && for t in *.tar; do tar -xf "$t" && rm "$t"; done && cd -
python post_training/data/relocate.py data/scipy_v4    # rewrite video paths to absolute (ms-swift needs this)

In the released jsonl files, video paths are relative to scipy_v4/, for example videos/scipy/<experiment>/<sample_id>.mp4. relocate.py turns them into absolute paths and reports any missing video. It is idempotent.

scipy_v4: the data_v4 split

Source. All 64,756 samples of the scipy engine, covering 87 experiments.

  • Every sample's params.json, cot.json, simulation_code.py and video were audited for consistency.
  • Running the stored code reproduces the stored video byte-for-byte.
  • The 1,305 scipy samples of the PhySimCode benchmark are excluded from every split.

Held-out experiments. 13 of the 87 experiments (15%) are held out of all training data, stratified by physics domain: block_belt_spring_stickslip, block_on_sphere_basin, cart_pendulum, colliding_blocks, complex_collision_plane, driven_string_ring, hemisphere_roll_off, ring_pendulum, stacked_balls_drop, string_block_wave, u_tube_fluid_oscillation, watt_straight_line_linkage, wedge_sphere.

File Rows Use
sft_train.jsonl 21,398 SFT (74 training experiments, up to 300 per experiment)
rl_train.jsonl 7,400 RL (same 74 experiments, 100 per experiment, disjoint from SFT)
val_seen.jsonl 370 5 per training experiment, never trained on
val_unseen.jsonl 390 30 per held-out experiment
rl_val.jsonl 87 1 per experiment (seen and unseen), cheap RL validation
split_manifest.csv 64,756 experiment, domain, sample_id, split for every scipy sample. Splits: sft, rl, val_seen, val_unseen, reserve (unused, seen experiments), holdout_reserve (unused, held-out experiments), benchmark
gt_video_meta.json 8,160 duration, fps and frame count of the original video, keyed <experiment>/<sample_id>, for every RL and val sample

Videos.

Folder Count Format Role
videos/ 29,558 360×180, 10 fps, first 8 s, H.264 CRF 23 Model input. Same pipeline as the benchmark: re-encoding benchmark samples gives byte-identical files.
ref_videos/ 8,160 original resolution (e.g. 1440×720), 30 fps, about 12 s The unmodified dataset videos of the RL and val samples. The GRPO reward and the diagnosis compare generated videos against these.

Both folders are shipped as tar shards (videos.tar, ref_videos-00..07.tar).

Row format (ms-swift messages):

{"messages": [{"role": "system", "content": "..."},
              {"role": "user", "content": "<video>\nWatch the video (scipy simulation) ..."},
              {"role": "assistant", "content": "@@COT_BEGIN@@\n{\"simulation\": ..., \"physical_law\": {...}}\n@@COT_END@@\n\n@@CODE_BEGIN@@\n...\n@@CODE_END@@"}],
 "videos": ["videos/scipy/<experiment>/<sample_id>.mp4"]}

Rows in rl_train.jsonl and rl_val.jsonl have no assistant turn. Instead they carry fields that are passed to the reward functions:

  • solution: the ground-truth code;
  • gt_cot: the ground-truth CoT, as JSON;
  • simulation;
  • engine.

kubric: the full kubric dataset

kubric/ holds the complete kubric engine dataset as one tar per experiment, unpacked under dataset_kubric/:

  • 75 experiments, 95,855 samples;
  • video 30 fps, e.g. 480×480.

Each sample folder contains video.mp4, params.json, cot.json and simulation_code.py. kubric/manifest.csv lists every sample and flags the 1,125 samples used in the PhySimCode benchmark (in_benchmark=1). Exclude those samples if you train on kubric and evaluate on the benchmark. The data_v4 experiments do not use kubric.

Access

The dataset is gated. Request access on this page, then authenticate with hf auth login or export HF_TOKEN=....