Skip to main content

Module overlay

Module overlay 

Expand description

The search-space overlay: a TOML [space] table over the oniro config.

This is the zero-code path to a search space (04-rl-and-oniro.md §B.5): rather than deriving the space from oniro::config_schemas() (the richer path, which needs an oniro library dependency), the overlay names the exact oniro config keys to tune and gives each a distribution in the string DSL. Because oniro’s RunConfig is #[serde(default)] at every level, a config with only those keys overridden trains the same run with the tuned values substituted — “the TOML-overlay DSL works on oniro configs unchanged”.

§Format

A [space] table whose keys are dotted RunConfig paths and whose values are string-DSL specs:

[space]
"ppo.learning_rate" = "loguniform(1e-5, 1e-2)"
"ppo.clip"          = "uniform(0.05, 0.3)"
"ppo.entropy_coef"  = "uniform(0.0, 0.05)"
"ppo.gae_lambda"    = "uniform(0.9, 0.99)"
"ppo.epochs"        = "int(1, 20)"

The dotted key is the parameter name in the resulting SpaceSchema, so the executor exports each sampled value as ATUNE_PARAM_<dotted.key> and the child sets it at exactly that path in the trial config.

A TOML table is unordered, so the schema orders its parameters by sorted key — a stable, deterministic order (which is what reproducibility needs), not the order the lines happen to appear in the file.

A top-level table with no [space] key is accepted as a bare mapping of dotted-key → spec, so a minimal overlay file need not indent under [space].

A spec may also carry a growth keyword – open, open=up, open=down, limit=<range>, or around(center, times=<n>|plus=<n>) – the growing grammar atune::space::dsl::parse_growing documents. The overlay parses and validates it exactly as atune run --param does (a malformed one is rejected with the same message, naming the dotted key); the resulting per-parameter policy rides OverlaySpace::policy into the harness’s study, where the declared bounds may then grow while the sweep runs.

§Fixed overrides

A bare number (128, 0.001) or bool pins that value without tuning it. A fixed string — selecting train.algo = "ppo", say — has no bare DSL form, so it is written as a single-element choice(ppo): a one-choice categorical that always renders ppo. Fixed, untuned settings can equally live in the base config instead of the overlay.

Structs§

OverlaySpace
A parsed search-space overlay: the schema plus the dotted config keys it tunes, in sorted-key order.

Functions§

parse_overlay
Parses a TOML overlay into an OverlaySpace.