Skip to content

feat(experiments): add scheduler integration (#1317)#1349

Merged
bug-ops merged 4 commits intomainfrom
feat-m34-experiment-scheduler
Mar 8, 2026
Merged

feat(experiments): add scheduler integration (#1317)#1349
bug-ops merged 4 commits intomainfrom
feat-m34-experiment-scheduler

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 8, 2026

Summary

  • Add TaskKind::Experiment to zeph-scheduler and ScheduledTaskKind::Experiment to config types
  • Create ExperimentTaskHandler in root binary with non-blocking execution (tokio::spawn + tokio::select! for shutdown)
  • Wire handler into bootstrap_scheduler() when both scheduler and experiments features enabled
  • Add ExperimentEngine::with_source() builder to tag scheduled runs as ExperimentSource::Scheduled
  • Add max_wall_time_secs to ExperimentSchedule (default 1800s) for background run limits
  • AtomicBool running guard prevents overlapping experiment sessions
  • BenchmarkSet::from_file wrapped in spawn_blocking to avoid blocking async runtime
  • VariationGenerator trait now requires Sync; Random::rng wrapped in Mutex

Closes #1317
Part of epic #1312 (Phase 5/6)

Test plan

  • 4649 tests pass (cargo nextest run --features full)
  • cargo clippy --workspace --features full -- -D warnings clean
  • cargo +nightly fmt --check clean
  • New tests: TaskKind::Experiment serde, ScheduledTaskKind conversion, ExperimentEngine source field, assert_sync::(), load_config_tasks experiment mapping
  • Manual test with config/testing.toml + [experiments.schedule] enabled

…1317)

Wire ExperimentEngine into the scheduler as a new TaskKind::Experiment
with non-blocking execution via tokio::spawn and tokio::select! for
graceful shutdown propagation. Scheduled runs use ExperimentSource::Scheduled
tagging, separate wall-time limits, and an AtomicBool guard to prevent
overlapping sessions.
@github-actions github-actions bot added rust Rust code changes core zeph-core crate enhancement New feature or request size/L Large PR (201-500 lines) labels Mar 8, 2026
Update mdbook pages (experiments, scheduler, daemon, feature-flags,
configuration) and README files (root, zeph-core, zeph-scheduler) to
document the new TaskKind::Experiment, ExperimentSchedule.max_wall_time_secs,
cron-based scheduled runs, and overlap guard behavior.
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 8, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 8, 2026 03:45
The mock feature flag was removed in #1346 but the module remains
unconditionally available. Remove the dead cfg gate to fix CI.
@bug-ops bug-ops merged commit aa1aa44 into main Mar 8, 2026
28 checks passed
@bug-ops bug-ops deleted the feat-m34-experiment-scheduler branch March 8, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(experiments): scheduler integration for autonomous runs (Phase 5)

1 participant