Skip to main content

SpikeConfig

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, segments is None) — the subprocess executor spawns the oniro-trial child once per replicate, which runs one oniro run end to end and prints one number;
  • segmented (M4.6, segments is Some) — each trial is a chain of resumable oniro run processes driven in-process by a SegmentedObjective, reporting a value and recording a checkpoint reference between them, which is what a scheduler needs in order to decide anything at all.

Fields§

§study_name: String

The study name (also the journal study name).

§trial_runner: PathBuf

Path to the compiled oniro-trial child binary the executor spawns.

§oniro_cli: PathBuf

Path to the oniro_cli binary (or a contract-compatible stand-in).

§base_config: String

The base RunConfig TOML text (from oniro_cli default-config or a user base).

§run_root: PathBuf

The directory oniro run directories and per-trial configs are written under.

§overlay: OverlaySpace

The parsed search-space overlay.

§objective: ObjectiveSource

The objective source (greedy eval by default).

§eval_episodes: usize

Greedy episodes for eval mode.

§seed: u64

The study seed (the root of every derived seed).

§trials: u64

The trial budget.

§parallelism: usize

Concurrent child processes.

§tune_seeds: u32

Tune-seed fan width k.

§test_seeds: u32

Disjoint test seeds for the re-evaluation stage (0 disables it).

§aggregate: Aggregate

The fan aggregate the sampler ranks.

§pairing: Pairing

The seed pairing (paired = common random numbers).

§top_k: usize

How 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: SamplerChoice

The 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: RungFloor

How a segment below the trainer’s learn gate is handled (segmented mode only). See RungFloor.

§resume: bool

Whether 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

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

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

Runs each trial as a chain of resumable segments (M4.6).

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

The multi-seed protocol these fields describe.

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

§

fn clone(&self) -> SpikeConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SpikeConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

The Scheduler seam does not require Debug (and must not start to), so it is rendered as its presence only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more