Struct SpikeConfig
pub struct SpikeConfig {Show 23 fields
pub study_name: String,
pub trial_runner: PathBuf,
pub oniro_cli: PathBuf,
pub base_config: String,
pub run_root: PathBuf,
pub overlay: OverlaySpace,
pub objective: ObjectiveSource,
pub eval_episodes: usize,
pub seed: u64,
pub trials: u64,
pub parallelism: usize,
pub tune_seeds: u32,
pub test_seeds: u32,
pub aggregate: Aggregate,
pub pairing: Pairing,
pub top_k: usize,
pub timeout: Option<Duration>,
pub storage: Option<PathBuf>,
pub sampler: SamplerChoice,
pub segments: Option<SegmentPlan>,
pub rung_floor: RungFloor,
pub resume: bool,
pub scheduler: Option<Arc<dyn Scheduler>>,
}Expand description
The full configuration of one spike run.
Two execution modes share every field below:
- one process per trial (M3.3,
segmentsisNone) — the subprocess executor spawns theoniro-trialchild once per replicate, which runs oneoniro runend to end and prints one number; - segmented (M4.6,
segmentsisSome) — each trial is a chain of resumableoniro runprocesses driven in-process by aSegmentedObjective, reporting a value and recording a checkpoint reference between them, which is what aschedulerneeds in order to decide anything at all.
Fields§
§study_name: StringThe study name (also the journal study name).
trial_runner: PathBufPath to the compiled oniro-trial child binary the executor spawns.
oniro_cli: PathBufPath to the oniro_cli binary (or a contract-compatible stand-in).
base_config: StringThe base RunConfig TOML text (from oniro_cli default-config or a user base).
run_root: PathBufThe directory oniro run directories and per-trial configs are written under.
overlay: OverlaySpaceThe parsed search-space overlay.
objective: ObjectiveSourceThe objective source (greedy eval by default).
eval_episodes: usizeGreedy episodes for eval mode.
seed: u64The study seed (the root of every derived seed).
trials: u64The trial budget.
parallelism: usizeConcurrent child processes.
tune_seeds: u32Tune-seed fan width k.
test_seeds: u32Disjoint test seeds for the re-evaluation stage (0 disables it).
aggregate: AggregateThe fan aggregate the sampler ranks.
pairing: PairingThe seed pairing (paired = common random numbers).
top_k: usizeHow many top configurations the re-evaluation stage re-ranks on test seeds.
timeout: Option<Duration>A per-trial wall-clock timeout. None uses the seven-day ceiling;
SpikeConfig::new sets that ceiling explicitly by default.
storage: Option<PathBuf>A journal file to persist the study to; None keeps it in memory.
sampler: SamplerChoiceThe sampler.
segments: Option<SegmentPlan>Some(plan) runs each trial as a chain of resumable oniro processes
(M4.6); None (the default) keeps the M3.3 one-process-per-trial path.
A scheduler only ever sees a decision point in the
segmented mode, because a value reported between segments is the only
intermediate value an oniro trial can produce (oniro flushes nothing
during a run, docs/design/04-rl-and-oniro.md §B.2).
rung_floor: RungFloorHow a segment below the trainer’s learn gate is handled (segmented mode
only). See RungFloor.
resume: boolWhether a segment resumes the previous one (segmented mode only).
true (the default) chains segments through oniro run --resume. false
starts every segment cold, which is the honest control for measuring what
the resume actually buys.
scheduler: Option<Arc<dyn Scheduler>>The scheduler, if any. None uses the study’s default
(NopScheduler).
Requires the single-seed path (single_seed): inside
a multi-seed fan the study loop captures reports per replicate and never
streams them to a scheduler, so run_spike refuses the combination with
SpikeError::Protocol rather than wiring a scheduler that silently
never decides.
Implementations§
§impl SpikeConfig
impl SpikeConfig
pub fn new(
trial_runner: impl Into<PathBuf>,
oniro_cli: impl Into<PathBuf>,
base_config: impl Into<String>,
overlay: OverlaySpace,
run_root: impl Into<PathBuf>,
) -> Self
pub fn new( trial_runner: impl Into<PathBuf>, oniro_cli: impl Into<PathBuf>, base_config: impl Into<String>, overlay: OverlaySpace, run_root: impl Into<PathBuf>, ) -> Self
A configuration with the spike defaults: eval objective, k = 3 paired tune seeds, IQM aggregate, 5 test seeds, TPE, single-worker.
The five inputs a caller must always supply — the child binary, the
oniro_cli, the base config, the overlay, and a run root — have no honest
default and are taken as arguments.
pub const fn single_seed(self) -> Self
pub const fn single_seed(self) -> Self
Switches off the multi-seed fan and the held-out test stage: one evaluation per trial.
The path a scheduler needs, and the reason it is a
named method rather than three assignments a caller must remember.
Core aggregates aligned fan reports and applies one scheduler decision to
the whole logical trial. Oniro’s segmented adapter still has no
replicate-scoped checkpoint lineage, however: its k run directories
cannot be represented as the one checkpoint a pause/fork resumes.
The multi-seed protocol is the RL-first headline and this gives it up, so it is a deliberate adapter trade until Oniro has an explicit replicate-scoped checkpoint selection contract.
pub const fn segmented(self, plan: SegmentPlan) -> Self
pub const fn segmented(self, plan: SegmentPlan) -> Self
Runs each trial as a chain of resumable segments (M4.6).
pub fn scheduler(self, scheduler: Arc<dyn Scheduler>) -> Self
pub fn scheduler(self, scheduler: Arc<dyn Scheduler>) -> Self
Uses scheduler for the study’s prune/pause/fork decisions.
Pair it with single_seed and
segmented; run_spike refuses a scheduler with a
fan, and a scheduler without segments simply never sees a report.
pub fn protocol(&self) -> SeedProtocol
pub fn protocol(&self) -> SeedProtocol
The multi-seed protocol these fields describe.
pub fn segmented_objective(&self) -> Result<Option<SegmentedObjective>>
pub fn segmented_objective(&self) -> Result<Option<SegmentedObjective>>
The segmented objective this configuration describes, if it is segmented.
Exposed so a caller can drive the same objective through its own study —
an ask/tell population loop, say — rather than through run_spike.
§Errors
Returns the validation, allocation, or base-artifact error from the segmented objective constructor.
Trait Implementations§
§impl Clone for SpikeConfig
impl Clone for SpikeConfig
§fn clone(&self) -> SpikeConfig
fn clone(&self) -> SpikeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more