Experiment workflow
This page is the canonical 4-stage process for running and recording a numerical experiment backed by DataVault. Consumer projects (e.g. ReducedEnvExperiments.jl) link here instead of maintaining their own copy.
Every experiment goes through the same four stages so that purpose / computation / data / conclusion are linked by a single ID (EXP-NNN-slug).
Three orthogonal axes
Experiment documentation lives on three independent axes:
| Axis | Who writes | What lives here |
|---|---|---|
| Narrative | human | experiments/EXP-NNN-<slug>/README.md, note/STATUS.md, note/RESEARCH_PLAN.md |
| Provenance | DataVault (automatic) | out/data/<project>/<run>/README.md, schema.toml, figures.toml, INDEX.md |
| Infrastructure | DataVault (fixed) | this page, conventions.md, the TEMPLATE returned by experiment_template |
A clean repository keeps these axes from leaking into each other. Narrative files link to provenance; they do not duplicate it.
Stage 1 — Plan
Scaffold a new experiment directory in one line:
using DataVault
vault = Vault("configs/your_config.toml"; run="your-run-name", outdir="out/")
DataVault.new_experiment(
vault;
slug="finite-temp-smoke",
purpose="Confirm the TPQ pipeline runs end-to-end at tiny size.",
hypothesis="No physical hypothesis; framework test.",
hypothesis_ref="RQ1",
)This writes projects/<P>/experiments/EXP-001-finite-temp-smoke/README.md from the TEMPLATE, substituting the supplied metadata and auto-incrementing the EXP-NNN id. Commit the scaffolded file immediately:
git add experiments/EXP-001-finite-temp-smoke/
git commit -m "Plan EXP-001: finite-temp-smoke"Stage 2 — Freeze inputs
Confirm every input is pinned:
git submodule statusshows the submodule SHAs you want.- The config TOML is on disk and committed.
- The DataVault ledger dir (
out/data/<P>/<run>/) is empty or matches the run you are re-attaching to.
DataVault captures the frozen state automatically the first time the Vault is constructed, via config_snapshot.toml and schema.toml. You do not hand-copy git SHAs into the EXP README — build_experiment_report records them for you.
Stage 3 — Run
Run the compute script:
julia --project=. scripts/compute.jl configs/your_config.tomlDataVault will produce, per run:
out/data/<P>/<run>/— raw JLD2 per key,ledger.csv,config_snapshot.tomlout/figure/<P>/<run>/— PDFs +figures.tomlarchiveout/.datavault/<P>/<run>.log.toml— discovery anchor
As the run progresses, append dated notes to the Log section of experiments/EXP-NNN-<slug>/README.md.
Stage 4 — Analyze
Run the analysis script to regenerate figures and the machine-readable run report:
using DataVault
DataVault.build_experiment_report(
vault, YourComputeModule;
experiments_root = "experiments", # opt-in: links run ↔ EXP-NNN
)
DataVault.build_experiments_index(vault.outdir, "<project>")
DataVault.build_narrative_index("experiments")build_experiment_report updates three things:
out/data/<P>/<run>/README.md— run-level provenance (always).out/data/<P>/<run>/schema.toml— writer package / version / data schema (first-write-only; later calls are a no-op unless identity changes).- When
experiments_rootis provided: every EXP-NNN README whose front-matterdata_runslist contains this run'svault.rungets its## Generated provenancesection re-written with links back to the run report (idempotent).
Fill in Result summary and Conclusion in the EXP README by hand, commit, and tag:
git add experiments/EXP-NNN-<slug>/ out/data/.../README.md
git commit -m "EXP-NNN: <slug> — <one-line conclusion>"
git tag exp/NNN-<slug>
git push origin main exp/NNN-<slug>Narrative section contents (EXP-NNN README)
After the Stage 1 scaffold you own the following sections. Everything else is either machine-generated or small boilerplate:
- Purpose — one paragraph, what physical / methodological question this experiment answers. Reference the RQ it targets.
- Hypothesis — falsifiable prediction, or explicit "exploratory".
- Design — parameter sweep summary, list of observables + references.
- Log — dated entries written during the run.
- Result summary — bulleted numbers / observations.
- Conclusion — 1–3 sentences: hypothesis confirmed / rejected / inconclusive.
- Next actions — checkbox list.
- Cross-references — link to the RQ in
note/RESEARCH_PLAN.mdand any related prior experiments.
The top ## Generated provenance section is owned by DataVault — do not edit it by hand.
Anti-patterns
- Copying git SHAs into the EXP README (they live in
schema.toml.writer.parent_git_hash; DataVault maintains the link). - Hand-editing the
## Generated provenancesection. - Using
docs/src/results/EXP-NNN.mdas a separate "published" tier. EXP-NNN/README.md is the single narrative source. - Running experiments before scaffolding the EXP directory (Purpose / Hypothesis go in before the run).
- Deleting an EXP directory when rerunning — instead, create
EXP-(NNN+1)that cites the old one.
Versioning
DataVault-backed projects follow SemVer:
| Change | Bump |
|---|---|
New bench field / breaking data_schema_version increment | minor (while 0.y) |
| Analysis script bug fix | patch |
New experiment module under src/ | minor |
| Submodule pointer update | usually patch |
Cut a vX.Y.Z tag after every batch of publication-ready experiments.