Official reference implementation of the three-stage M³ pipeline.
Paper: M³: Reframing Training Measures for Discretized Physical Simulations
arXiv: 2605.08843 · pdf
M³ constructs a training measure for discretized physical simulations via:
- Partition — variation-aware Morton octree
- Grouping — multi-scale strata
- Sampling — inter-level budget + water-filling + within-cell sampling
pip install numpy
export PYTHONPATH=$PWD # from repo rootpython examples/toy_example.pyfrom m3 import run_m3
out = run_m3(
points_xyz=xyz, # (N, 3)
phi_scalar=pressure, # (N,)
psi_vec3=wss, # (N, 3) or None
budget=8192,
file_type="boundary", # or "volume"
seed=42,
rho_fill_ratio=0.3,
)
# out.sampled_indices → indices into the original point arrayHyperparameters: hyperparameters.yaml.
M3/
├── hyperparameters.yaml
├── m3/
│ ├── pipeline.py
│ ├── step1_partitioning.py
│ ├── step2_grouping.py
│ └── step3_sampling.py
└── examples/toy_example.py
@article{mei2026m3,
title={M$^3$: Reframing Training Measures for Discretized Physical Simulations},
author={Mei, Yuan and Song, Xiaowen and Song, Xingjian and Takeishi, Naoya},
journal={arXiv preprint arXiv:2605.08843},
year={2026}
}MIT (see LICENSE).