Skip to content

Reproduce the dataset benchmark

Check the environment with the 30 structures included in the repository. To reproduce one row of the published figure, prepare that dataset’s input database, run one method, and summarize the results. Frozen results · Scoring protocol · 简体中文

Prepare the benchmark environment

Run the commands on Linux from the MolGR repository root. Create the environment once and use the second command to activate it in each new shell. Dependencies and optional methods

bash scripts/benchmark_env.sh create
source .venv-benchmark/bin/activate

The frozen run used MolGR and benchmark scripts from commit 0714b6eac847eaacae8bff0fa66f97f73df87b70. Build and run from a clean checkout of this commit.

Check the workflow offline

These commands prepare the bundled BorylXAT inputs, reconstruct them with MolGR C++, and write a report under a temporary directory.

workdir=$(mktemp -d)
python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset borylxat-fixtures --source tests/data/borylxat --out "$workdir/cases.sqlite"
python -m benchmarks.dataset_xyz_benchmark.run \
  --cases "$workdir/cases.sqlite" --method molgr_cpp --workers 1 \
  --timeout 10 --comparison-timeout 5 --out "$workdir/run"
python -m benchmarks.dataset_xyz_benchmark.report \
  --cases "$workdir/cases.sqlite" --results "$workdir/run/molgr_cpp.sqlite" \
  --out "$workdir/run/summary.json"

Open $workdir/run/summary.json. Expect complete: true, 30 eligible_conformers, and 30 matched_conformers. The fixture report is marked pilot: true.

Prepare local data

Prepare one SQLite database per dataset and share it across methods. Expand a dataset below for the download and import commands. The two GEOM sets share a roughly 50 GB archive. Allow additional disk space for the databases.

Dataset Input database Eligible structures after full import
GEOM-QM9 geom-qm9.sqlite 133,123
GEOM-Drugs geom-drugs.sqlite 100,000
BorylXAT-DB borylxat-optimized.sqlite 8,898
BDE bde.sqlite 246,323
tmQMg-Corrected tmqmg-corrected.sqlite 72,040

The commands write databases under .local/datasets/benchmark-cases/. If an import is interrupted, start again with a fresh output file. Omit --limit-molecules for a full run.

GEOM-QM9 and GEOM-Drugs: one download, two databases
mkdir -p .local/datasets/geom
curl --fail --location --continue-at - \
  'https://dataverse.harvard.edu/api/access/datafile/4327252?format=original' \
  --output .local/datasets/geom/rdkit_folder.tar.gz

python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset geom-qm9 --source .local/datasets/geom/rdkit_folder.tar.gz \
  --out .local/datasets/benchmark-cases/geom-qm9.sqlite
python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset geom-drugs --source .local/datasets/geom/rdkit_folder.tar.gz \
  --out .local/datasets/benchmark-cases/geom-drugs.sqlite

The pinned archive is 50,137,579,520 bytes with MD5 e8f2168b7050652db22c976be25c450e. Its .tar.gz extension denotes an uncompressed tar here. The importer streams its contents and restricts deserialization to RDKit molecule constructors. For a pilot, --limit-molecules N takes all conformers of the first N parents. The manifests record the exact frozen selections. QM9 · Drugs

Download and import optimized BorylXAT-DB structures
mkdir -p .local/datasets/borylxat/21330198
curl --fail --location --continue-at - \
  'https://zenodo.org/records/21330198/files/BorylXAT-DB.db?download=1' \
  --output .local/datasets/borylxat/21330198/BorylXAT-DB.db

python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset borylxat --source .local/datasets/borylxat/21330198/BorylXAT-DB.db \
  --out .local/datasets/benchmark-cases/borylxat-optimized.sqlite

The importer checks the database size and MD5 against the release record. If you have an older input database, import to a new file to use the individually optimized components and their reaction annotations.

Download and import BDE radical fragments
mkdir -p .local/datasets/bde
curl --fail --location --continue-at - \
  https://ndownloader.figshare.com/files/22357962 \
  --output .local/datasets/bde/20200415_radical_database.sdf.gz
python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset bde --source .local/datasets/bde/20200415_radical_database.sdf.gz \
  --out .local/datasets/benchmark-cases/bde.sqlite

tmQMg-Corrected

Use release v2026-11-23 of the separate tmQMg-Corrected repository. If you have a complete checkout, point --source at its root. Pinned dataset revision

Download, verify the commit, and import
git clone --depth 1 --branch v2026-11-23 \
  https://github.com/gentle1999/tmQMg-Corrected.git \
  .local/datasets/tmqmg-corrected
git -C .local/datasets/tmqmg-corrected rev-parse HEAD
# aac372de0e859a6daf451084abe84a9ae58ad8e6

python -m benchmarks.dataset_xyz_benchmark.prepare \
  --dataset tmqmg-corrected --source .local/datasets/tmqmg-corrected \
  --out .local/datasets/benchmark-cases/tmqmg-corrected.sqlite
Verify release coverage, files, and attribution

Of 74,547 inputs, 72,040 have native Lewis references. The other 2,507 appear in coverage counts only. They comprise 1,189 boron clusters, 354 bridging boron hydrides, 770 hydrogen-deficient inputs, and 194 inputs excluded on electronic-state evidence. Released singlet ligand diradicals remain eligible.

  • Inputs and references. Reconstruction receives only XYZ, source charge, and multiplicity. Scoring reads the corrected release’s native Lewis graph. Upstream SMILES were generated by xyz2mol_tm’s Hückel method. The bundled fixtures form a regression subset of the corrected release. Upstream data · Offline fixtures
  • File integrity. Layout v4 requires all data/*.sdf files and the XYZ and JSONL files under evidence/inputs/. Manifest paths are relative to the release root. The manifest SHA-256 is ea04563079dfe4344601f6c896e36c24a847a69e4f320ec4f906a69203c3faf3. The importer checks the manifest, shards read, XYZ identity, and native graph hashes. A full import also checks release totals.
  • Pilot runs. Add --limit-molecules 10 and use a fresh database and results directory. The first ten source parents may include exclusions.
  • Attribution. The added Lewis annotations use CC BY 4.0. Cite tmQMg and tmQMg-Corrected, identify the release, and describe any changes. License and credits

For a development check across the full tmQMg dataset, see native batch throughput.

Measure and resume

This example runs MolGR C++ on GEOM-Drugs. Substitute the appropriate input database for cases and give each dataset its own results directory. Run one method at a time.

cases=.local/datasets/benchmark-cases/geom-drugs.sqlite
out=.local/reports/dataset-performance/geom-drugs
method=molgr_cpp

python -m benchmarks.dataset_xyz_benchmark.run \
  --cases "$cases" --out "$out" --method "$method" \
  --workers 64 --timeout 10 --comparison-timeout 5

All five datasets use 10 seconds for reconstruction and 5 seconds for reference comparison, including tmQMg-Corrected. Each worker is pinned to a logical CPU and uses one native thread. Fewer workers suffice to check match counts. For timing comparisons, also match the hardware and concurrency settings.

To resume, repeat the command with the same arguments and output directory. Use a fresh directory if the input hash, code, native extension, dependency versions, CPU allocation, or timeouts change.

The measurement host has two Intel Xeon Gold 6530 processors, 64 physical cores and 128 logical CPUs, with a maximum clock of 4.00 GHz. The 64 workers each bind to a separate physical core when available. Each method’s provenance JSON records the hostname, CPU topology, available and selected CPUs, RAM and container limits, kernel, Python, installed packages, thread settings, source commit, and input and extension hashes. For a Git archive, set MOLGR_BENCHMARK_COMMIT to the archived SHA. For Docker runs, supply the image ID, native compiler and build options, and upstream xyz2mol_tm revision via MOLGR_BENCHMARK_IMAGE_ID, MOLGR_BENCHMARK_NATIVE_BUILD, and MOLGR_BENCHMARK_XYZ2MOL_REVISION.

If a worker cannot start or receive its case ID, the runner retries that slot and queues any undelivered case for another worker. Five consecutive startup failures disable the slot. Other slots continue. In the frozen summary, input_timeout counts input timeouts with no reconstruction time. Each reconstruction_timeout contributes the configured reconstruction limit (10,000 ms in this run) to the time percentiles. A comparison timeout retains the measured reconstruction time and counts as an inconclusive comparison.

Switch reconstruction methods

Change method in the example and use it for both the measurement and summary commands.

Method --method
MolGR C++ / Python molgr_cpp / molgr_fallback
RDKit / Open Babel rdkit_determine_bonds / openbabel_read_xyz
cell2mol v2 / xyzgraph cell2mol_v2 / xyzgraph_cheminf_full
xyz2mol_tm xyz2mol_tm

Before timing starts, xyz2mol_tm selects the Hückel route for elements on the upstream transition-metal list (including La and Lu) and the generic route otherwise. See upstream_entry in each result. Use xyz2mol_tm_local to test the generic route separately.

In cell2mol output, a query atom that specifies exactly one element is converted to an ordinary RDKit atom. Atom order, bonds, charges, isotopes, stereo labels, hydrogen and radical counts, and coordinates are preserved. Ambiguous atom or bond queries count as errors.

Timing boundaries and default deadlines

The Linux runner uses persistent workers started with spawn. Per-case reconstruction time includes adapter conversion and postprocessing. Input reads, process startup, warm-up, and reference comparison are timed separately. Without explicit timeouts, reconstruction gets 30 seconds and comparison uses the source default (60 seconds for tmQMg-Corrected). An explicit comparison timeout can shorten that deadline.

Summarize and check the results

In the same shell, generate the report with the input database and method just measured.

python -m benchmarks.dataset_xyz_benchmark.report \
  --cases "$cases" --results "$out/$method.sqlite" \
  --out "$out/$method-summary.json"
  1. Check for complete: true and pilot: false to confirm a full run.
  2. Compare eligible_conformers with the table above and matched_conformers with match in the corresponding row of the release archive’s summary.csv. Frozen results
  3. If results differ, inspect per-case decisions in <method>.sqlite and the worker logs. Crashes and timeouts are recorded. A graph retained after an API error still enters comparison. See <method>-provenance.json for the environment, source policy, and effective timeouts.

During a run, add --allow-partial to inspect progress. The report keeps all eligible inputs in the denominator and is marked incomplete.

Measure native batch throughput

These commands measure development throughput. The frozen figure uses per-input timings from the run command above.

Reconstruct and score the full tmQMg-Corrected dataset
python -m benchmarks.dataset_xyz_benchmark.native_batch \
  --cases .local/datasets/benchmark-cases/tmqmg-corrected.sqlite \
  --workers 8 --checkers 4 \
  --out .local/reports/dataset-performance/tmqmg-corrected-batch
python -m benchmarks.dataset_xyz_benchmark.report \
  --cases .local/datasets/benchmark-cases/tmqmg-corrected.sqlite \
  --results .local/reports/dataset-performance/tmqmg-corrected-batch/molgr_cpp.sqlite \
  --out .local/reports/dataset-performance/tmqmg-corrected-batch/molgr_cpp-summary.json

By default, eight native reconstruction threads and four independent RDKit postprocessing and scoring processes reconstruct each case once. Scoring preserves double-precision coordinates and MolGR electronic properties. The logs report end-to-end throughput. Completed batches can be resumed with the same source and configuration.

Measure local throughput with regression fixtures
uv run --frozen python benchmarks/native_batch_throughput.py \
  --mode cpp_batch --workers 0 --items 1000 --repeats 3 --warmup 1

Use cpp_batch for end-to-end throughput. Set --mode cpp_native_batch to measure only the native layer.