Skip to main content

nirs4all-benchmarks

nirs4all-benchmarks

Reproducible, scored, weights-free benchmarks — and best-in-class dataviz — for NIRS pipelines.

nirs4all-benchmarks (codename the Arena) is the reference environment for storing, comparing and exploring the performance of NIRS pipelines across the model × pipeline × split × cv × rng × refit × dataset space. It ingests runs produced by nirs4all and/or dag-ml, keys everything by content hashes, and serves an interactive web app to explore the results.

It stores identity cards, canonical pipeline DAGs, versioned scores, and sample-keyed residualsnever fitted artifacts.

Part of the open-source NIRS tools ecosystem: file readers, datasets, methods, browser modelling, reproducible pipelines, papers, benchmarks, and release dashboards for near-infrared spectroscopy.

nirs4all-benchmarks is the public package name; the project is referred to as the Arena internally (design docs, code, the engine output contract). Same project.

Part of the nirs4all ecosystem.

Status & roadmap

⚠️ Early prototype. Schemas, scores, views and the public page may still change.

  • Now (v0.1.x): static, client-side. The public page at benchmarks.nirs4all.org is a fully static snapshot deployed on GitHub Pages — the whole dataviz runs in the browser from a JSON snapshot, no backend required. The FastAPI service runs locally for ingestion and real stores.
  • Next (medium term): a live meta-analysis server that manages runs, pipelines and meta-analyses and interacts with nirs4all-repository (pipeline recipes to score) and nirs4all-datasets (the dataset catalog) — turning the static demo into a continuously-updated public benchmark.

Full plan: docs/ROADMAP.md.


What it does

  • Dual producer compatibility. One ingestion contract, two producers: a live adapter for the nirs4all workspace (store.sqlite + arrays/*.parquet) and an adapter for the dag-ml ExecutionBundle. .n4a bundles are accepted as pipeline uploads with the weights stripped.
  • Content-addressed identity. A topology-aware pipeline_dag_hash (a Merkle hash over the canonical graph) dedups "same pipeline, different syntax" across producers; the full run_condition_hash is composed from six dimension hashes. Producer UUIDs are never join keys.
  • Versioned, re-derivable scores. Every score carries a ScoreComputationSpec; metrics (regression + classification) are recomputed with NumPy from sample-keyed residuals, so a metric fix adds a new score set that supersedes the old one — nothing is mutated.
  • Leakage-honest ingestion. Runs that cannot attest out-of-fold safety are quarantined (excluded from published views), never silently dropped. Idempotent: re-ingesting an export is a no-op.
  • Top-tier dataviz. A no-build single-page app (Plotly) with a leaderboard, a pipeline × dataset matrix, operator/parameter effect explorers, a robustness view, a sample-keyed residual complementarity comparator, a DAG-rendering run detail, and an upload page.

See the design docs for the why: DESIGN.md · DATA_MANAGEMENT.md · PERSISTENCE_FORMATS.md.

Quickstart

# install (uv recommended)
uv venv --python 3.11 .venv
uv pip install --python .venv -e ".[service]"

# create a store, seed the demo fixtures, and explore from the terminal
.venv/bin/n4a-benchmarks init      --store ./arena-store
.venv/bin/n4a-benchmarks fixtures  --store ./arena-store
.venv/bin/n4a-benchmarks stats     --store ./arena-store
.venv/bin/n4a-benchmarks leaderboard --store ./arena-store --metric rmse

# launch the dataviz web app  ->  http://127.0.0.1:8000
.venv/bin/n4a-benchmarks serve --store ./arena-store

Ingest real runs:

# from a nirs4all workspace (artifacts ignored)
n4a-benchmarks ingest-workspace /path/to/workspace --store ./arena-store

# from a dag-ml ExecutionBundle (+ optional graph / io envelope)
n4a-benchmarks ingest-bundle bundle.json --graph graph.json --store ./arena-store

# an ArenaRunExport manifest (the freeze contract), or a directory of them
n4a-benchmarks ingest-export run.json --store ./arena-store --release

Compare the RC-v1 legacy and dag-ml execution surfaces without touching the runtime repos:

PYTHONPATH=src \
  ../nirs4all-benchmarks/.venv/bin/n4a-benchmarks perf-compare \
  --json-out ./perf-report.json \
  --markdown-out ./perf-report.md

The harness auto-picks a child interpreter that can import Studio plus a usable workspace nirs4all source tree (preferring the RC-v1 worktree, then falling back to the sibling nirs4all/ checkout when needed), runs fresh subprocesses for each engine/surface pair, and records the dag-ml/legacy timing ratios.

Plan repository pipelines locally without executing them:

from nirs4all_benchmarks.ingestion import list_repository_pipelines, register_repository_pipeline
from nirs4all_benchmarks.store import ArenaStore

rows = list_repository_pipelines(framework="nirs4all")  # optional nirs4all-repository dependency
with ArenaStore("./arena-store") as store:
    register_repository_pipeline(store, rows[0]["id"], target_datasets=["corn"])

This bridge is consumer-only: it reads a repository recipe, registers its pipeline identity in the Arena, and writes only local planned_runs rows in the Arena store. It does not execute the pipeline and it never writes back to nirs4all-repository, datasets, or papers.

With Docker:

docker compose up --build           # serves on :8000 with a persistent volume
docker compose run --rm arena n4a-benchmarks fixtures   # seed demo data once

Documentation

Doc What
docs/ROADMAP.md Status (prototype) + the static-now / live-server-next plan
docs/ARCHITECTURE.md System architecture, module map, data flow
docs/CONTRACT.md The ArenaRunExport v1 ingestion contract (frozen)
docs/IDENTITY.md The identity spine + pipeline_dag_hash
docs/INGESTION.md The ingestion state machine
docs/ADAPTERS.md Dual compatibility: nirs4all / dag-ml / .n4a
docs/API.md REST API + Python Queries reference
docs/DATAVIZ.md The dataviz web app
docs/DEPLOYMENT.md Running the service online + persistently
docs/CLI.md n4a-benchmarks command reference
docs/PERFORMANCE.md RC-v1 legacy vs dag-ml comparison harness
CONTRIBUTING.md Dev setup + green gate

Architecture at a glance

producer run ─► ArenaRunExport (weights-free, content-addressed)
                     │   adapters: nirs4all workspace · dag-ml bundle · .n4a
                     ▼
            INGEST  (verify · dedup · resolve ids · validate · pseudonymize · strip · commit)
                     ▼
   arena.sqlite (dimensions + facts)  +  arrays/residuals_<hash>.parquet (sample-keyed)
                     ▼
            Queries  ─►  FastAPI  /api/*  ─►  Plotly SPA

The Arena is standalone by contract: it needs only the ArenaRunExport bundle. The sibling libraries (nirs4all, dag-ml, nirs4all-io, nirs4all-datasets) are optional — every path degrades gracefully when they are absent.

License

Pipeline code is dual-licensed open-source — CeCILL-2.1 OR AGPL-3.0-or-later — with an optional commercial license (for any commercial use, contact nirs4all-admin@cirad.fr). Scored results and leaderboards are content (CC-BY-4.0). See LICENSING.md and LICENSES/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nirs4all_benchmarks-0.1.6.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nirs4all_benchmarks-0.1.6-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file nirs4all_benchmarks-0.1.6.tar.gz.

File metadata

  • Download URL: nirs4all_benchmarks-0.1.6.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nirs4all_benchmarks-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e79cf4a789c3fbe452da995ab204b6e26a2d00f9a4da6e95ae55d07b7258470a
MD5 7a3e8b9f18f4efa33d79c48209a219b7
BLAKE2b-256 5da82e4670c21be6799fcf872acfeca4969c328ce7161a3b2f5e3f3dd0dc5df5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nirs4all_benchmarks-0.1.6.tar.gz:

Publisher: publish.yml on GBeurier/nirs4all-benchmarks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nirs4all_benchmarks-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for nirs4all_benchmarks-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4fc38d1c2c34c2aed32c2ae0e746fe7391de674d26461b8b8d2c12b256e03c
MD5 9c9b6188c6e7cbee8f88757c260e4d71
BLAKE2b-256 05c30da180aaae320cf06961301d4d9507f4273b55e9618a1b244d8bdc7ad21c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nirs4all_benchmarks-0.1.6-py3-none-any.whl:

Publisher: publish.yml on GBeurier/nirs4all-benchmarks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 files

0.1.5

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page