Environment variables¶
The variables atune sets on a trial's child process, and the one it reads itself.
These are the whole interface for tuning a program that is not a Rust library.
atune run spawns your program once per trial, hands it the sampled parameters and
the trial's identity through the environment, and reads the objective back from its
last line of standard output — so a shell script, a Python entry point or a compiled
binary is tunable with no bindings and no dependency on atune at all.
A child sees each of these only when it applies: ATUNE_CHECKPOINT is absent unless
the trial is a fork or a resume, and the parameter variables are exported only if
the run asks for them.
This page is generated from the code that declares, sets and reads each variable, filtered through an explicit allow-list. Most of what the repository touches is test harness — switches that regenerate a golden file, or hand a role to one of the worker processes a concurrency test forks — and publishing those as though they configured a study would be worse than publishing nothing. So the list is fail-closed in both directions: a variable the code touches and the list does not classify fails the build, and so does a classified variable the code no longer touches.
Generated file. Do not edit between the pragmas below — run
cargo dev generate-all --mode write instead. Everything outside them is
hand-written and is never touched.
atune publishes 10 environment variables. The other 67 the code touches are test-harness switches — golden-blessing flags and multi-process test fixtures — and are deliberately absent: crates/atune_dev/env_public.toml classifies every one of them, and a variable in neither list fails the build rather than guessing (D34).
Most of these are the handshake: the values atune sets on a trial's child process, for the program being tuned to read. A script that reads them needs no atune library at all.
ATUNE_STUDY¶
Declared as ENV_STUDY in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable naming the child's study.
ATUNE_TRIAL¶
Declared as ENV_TRIAL in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable naming the child's trial (its storage-global id).
ATUNE_TRIAL_WORKER¶
Declared as ENV_TRIAL_WORKER in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable carrying the child's lifecycle owner id.
Together with ENV_TRIAL_EPOCH, this lets a child continue only the exact operation handed to it. Storage revalidates both values on every mutation; a trial id alone is not an ownership capability.
ATUNE_TRIAL_EPOCH¶
Declared as ENV_TRIAL_EPOCH in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable carrying the child's lifecycle ownership epoch.
A reclaim advances this value, so a delayed child cannot report or finish work after a successor has taken ownership.
ATUNE_TRIAL_NUMBER¶
Declared as ENV_TRIAL_NUMBER in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable naming the child's per-study trial number.
ATUNE_SEED¶
Declared as ENV_SEED in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable carrying the child's per-trial objective seed.
ATUNE_CHECKPOINT¶
Declared as ENV_CHECKPOINT in crates/atune_core/src/exec/mod.rs; set by atune on a trial's child process.
The environment variable carrying a checkpoint reference for the child to resume from.
Set only for a forked or resumed trial (population-based training): it is the parent's — or, on a resume, the trial's own — latest checkpoint reference, a run-directory path or artifact id the child restores from (e.g. oniro's run_training_resume). atune never reads what it points at; it is a reference hand-off. Absent for an ordinary trial, so a program that never forks or resumes never sees it.
ATUNE_PARAM_ (a prefix)¶
Declared as DEFAULT_PARAM_PREFIX in crates/atune_core/src/exec/mod.rs.
The default prefix for exported parameter environment variables.
With Subprocess::export_params a parameter lr is set as ATUNE_PARAM_lr. The prefix is non-empty by default so a parameter cannot silently clobber an inherited variable such as PATH.
ATUNE_JOURNAL¶
Set by atune in crates/atune_cli/src/run.rs; read by atune in crates/atune_cli/src/common.rs.
The study to act on when a command is given no --study. atune run sets it on every trial's child process, so a scripted worker that calls atune tell or atune best inherits the right journal without being passed a path. No constant declares it: it is the CLI's own default, resolved in crates/atune_cli/src/common.rs.
ATUNE_SAMPLER¶
Declared as ENV_SAMPLER in crates/atune_cli/src/common.rs; set by atune in crates/atune_cli/src/run.rs.
Sampler identity inherited by a scripted child of atune run.