Skip to main content

Mosaic

Mosaic

Mosaic benchmarks differentiable physics solvers on accuracy, gradient quality and cost, in compute and in development effort.

Results Run Use Contribute Stable docs Paper License

Overview of Mosaic: diverse solvers are wrapped behind a uniform containerized interface (Tesseract), enabling cross-solver comparison on shared benchmark tasks across different physical domains.

What Mosaic measures

If you optimize or train through a simulation, the solver has to return a correct forward prediction and a usable gradient (the vector–Jacobian product, VJP). Mosaic checks both. For every solver and setup, it reports:

  • Forward accuracy
    • error against analytic solutions, literature values and converged high-resolution runs, across resolution and viscosity
    • physical laws such as a divergence-free velocity field
    • agreement with the other solvers
  • Gradient quality
    • agreement with finite differences, in direction and magnitude, and with analytic gradients where they exist
    • how accuracy holds up as the rollout lengthens, and through a chain of solver calls
    • the conditioning of the Jacobian, from its singular values
    • whether a gradient-based optimizer makes progress through the solver, and how many iterations it needs
  • Compute cost
    • wall-clock time of the forward and VJP calls, across problem size and rollout length
    • peak memory
    • how large a problem or how long a rollout a solver handles before it runs out of memory or time
  • Development cost
    • the effort it took to make the solver run each setup, from L0 (nothing beyond expected tweaks) to L3 (changing the solver itself)
    • the reason and evidence for every intervention
    • deviations, where a solver runs a substitute for part of the prescribed setup, and their effect on the results

Each solver is packaged as a Tesseract container with a uniform apply / vjp interface, so a single harness can compare solvers across languages and AD frameworks (JAX, PyTorch, Julia, hand-written C++ adjoints). The solver reference lists every solver with its numerics and its intervention record.

📊 Results

Browse the benchmark results →

The results overview, refreshed on each release, shows the checks, cost, effort and deviations of every solver on every setup. Each setup has its own page with every plot. For findings drawn from these results, see the paper.

📖 Documentation

Two versions are published. You most likely want stable, which tracks the latest release and shows results from a single run of all solvers. Latest tracks the main branch and may combine results from different runs.


Run the benchmark

Mosaic needs Python ≥ 3.11 and Docker. To run every solver, you need Linux with Docker Engine, an NVIDIA GPU and the NVIDIA Container Toolkit. Without a GPU, --gpus none restricts a run to the CPU-only solvers. macOS and Windows are not supported (why).

git clone https://github.com/pasteurlabs/mosaic && cd mosaic
uv sync && source .venv/bin/activate   # or: pip install -e .
mosaic run -p thermal-mesh --suites forward --gpus none --debug

The last command builds the CPU-only heat-transfer solvers and runs a reduced forward check, which works without a GPU. Run the benchmark covers the full run, choosing what runs, resuming, reading the output and troubleshooting.

Use solvers in your own code

Every solver is a standalone Tesseract that you can call from your own JAX or PyTorch code without the benchmark harness. Build the image once, then differentiate through it with tesseract-jax:

pip install -e mosaic/mosaic_shared tesseract-jax
tesseract build mosaic/tesseracts/navier-stokes-grid/exponax
import jax
import jax.numpy as jnp
from tesseract_core import Tesseract
from tesseract_jax import apply_tesseract
from mosaic_shared.problems.navier_stokes_grid.schemas import make_vortex_ic

inputs = {"v0": make_vortex_ic(N=64, seed=42), "viscosity": jnp.array([0.01]), "steps": 50}

with Tesseract.from_image("exponax_navier_stokes_grid:latest") as t:
    def loss(v0):
        return jnp.mean(apply_tesseract(t, {**inputs, "v0": v0})["result"] ** 2)

    grad_v0 = jax.grad(loss)(inputs["v0"])

Use a solver in your code covers the inputs and outputs, PyTorch, running without Docker, mesh solvers and GPUs.

Contribute

Mosaic is designed to grow with its community. There are three main ways to contribute, roughly in order of scope:

  • Tune an existing solver and record what you changed in its intervention record. See tuning an existing solver.
  • Add a solver to an existing domain, with three files under mosaic/tesseracts/<domain>/<solver-name>/. See Add a solver.
  • Add a problem for new physics, scaffolded with mosaic new-domain <name> --from-template <template>. See Add a problem.

The contributing guide covers the development setup, the pull request workflow and the conventions. CONTRIBUTING.md has the contributor license agreement and the code of conduct. For questions, open an issue or visit the Tesseract Forum.

Project structure

mosaic/
  benchmarks/             # evaluation harness (Python package: mosaic.benchmarks)
    cli/                  # command-line interface, one module per subcommand
    core/                 # runner, config, hardware detection, solver discovery, intervention records
    problems/             # one package per problem (ns-grid, ns-3d-grid, structural-mesh, thermal-mesh)
      shared/             # suite kernels shared across problems (forward, gradient, cost, optimization, ics)
        plots/            # plotting infrastructure
  mosaic_shared/          # canonical schemas and shared types for the solvers (also pip-installable)
  templates/              # templates for scaffolding new domains
  tesseracts/             # solvers, one Tesseract per directory
    navier-stokes-grid/   # incompressible flow on grids, 2D and 3D
    structural-mesh/      # linear elasticity on hexahedral meshes
    thermal-mesh/         # steady heat conduction on hexahedral meshes
tests/                    # unit and integration tests (run with pytest)
docs/                     # Quarto documentation site (_quarto.yml)
  *.qmd                   # the pages: overview, guides, solver reference
  results/                # results overview and one page per setup
  figures/                # images shown on the pages
  assets/                 # theme and page scripts
  scripts/                # generators for the results pages and the solver reference, figure scripts
  Makefile                # builds the site (cd docs && make html)

Citation

If you use Mosaic in your research, please cite the paper (arXiv:2606.27895):

@inproceedings{rehmann2026mosaic,
  title     = {Mosaic: A Benchmark Suite for Differentiable Physics Solvers},
  author    = {Rehmann, Andrin and Zimmermann, Heiko and H{\"a}fner, Dion},
  booktitle = {Advances in Neural Information Processing Systems},
  note      = {Evaluations and Datasets Track},
  year      = {2026},
  eprint    = {2606.27895},
  archivePrefix = {arXiv},
  primaryClass  = {physics.comp-ph}
}

License

Apache 2.0. Individual solvers retain their upstream licenses, documented per solver in the repository.

Metadata

Release files for mosaic-bench 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mosaic-bench 0.3.0
File Size Uploaded Provenance Actions
mosaic_bench-0.3.0.tar.gz 1.8 MB With provenance Details for mosaic_bench-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mosaic-bench 0.3.0
File Interpreter ABI Platform Actions
mosaic_bench-0.3.0-py3-none-any.whl Python 3 none any Details for mosaic_bench-0.3.0-py3-none-any.whl

Total release size: 3.8 MB

Release files / mosaic_bench-0.3.0.tar.gz

Download URL mosaic_bench-0.3.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
ad5c3ef68cc41e2125de17fe5d56bec8c0b2ae1d52624bce12cfc38c7698f860
BLAKE2b-256 checksum
How to use checksums
b334b67694f2380f513b53aadca7f04be84da49dafce370ff7badd523bdf3ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / mosaic_bench-0.3.0-py3-none-any.whl

Download URL mosaic_bench-0.3.0-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7f08b2bb09db6468064a944622cb32b860cb73ca16ad9e7b258160294e4b8b55
BLAKE2b-256 checksum
How to use checksums
84de30a340a3810c0a2d41e16c9f515ed5f370227d3be15a4598d930cfff1e89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for mosaic-bench 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mosaic_bench-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page