You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stella-core had a Clock port that almost nothing used, and the deadline arithmetic read std::time::Instant::now() itself in nineteen places. #6486 fixed that half: every instant, wait and timeout in the engine now goes through retry::Sleeper (now() joined sleep and jitter), and scripts/core-no-io-baseline.txt is empty. This issue is the other half.
The real time sources are copied. A Unix-epoch wall clock lives three times (stella-cli/src/runtime.rsWallClock, stella-runtime/src/wrapper/stamp.rsHostClock, stella-serve/src/remote.rsWallClock), a Tokio sleeper twice (stella-cli/src/runtime.rs, stella-serve/src/remote.rs), and stella-fleet/src/monitor.rs keeps a Sleeper trait of its own with a third TokioSleeper. The two test doubles (NoopSleeper / NoSleep, and a TokioSleeper on the paused clock) are written about thirty times across stella-core, stella-engine and their tests/ directories. stella-serve may not depend on stella-runtime or stella-cli, and stella-core may not link the Tokio timer, so the copies have no shared home today.
What done looks like
one real TokioSleeper, WallClock and MonotonicClock, in one crate that stella-cli, stella-runtime, stella-serve and stella-fleet all use; the copies are deleted, and stella-fleet's own Sleeper trait is gone
one PausedSleeper and one NoopSleeper test double, shipped behind a test-util feature; the per-file copies in stella-core and stella-engine are deleted
a witness test that reads the tree and fails on any impl Sleeper for or wall/monotonic clock struct outside that crate, with the doubles that stay on purpose named and their reasons given
stella-core may not link tokio/time (make core-no-io), so a faithful sleeper double cannot live there; the crate that holds the real sleeper holds the doubles, and stella-core takes it as a dev-dependency (cargo allows the cycle; tokio / tokio-test is the shape)
scripts/check-core-no-io.py strips only #[cfg(test)], so nothing feature-gated may read a clock inside stella-core
Pillar
Maintainability (one time source, two doubles, one place to fix either) and reliability (the paused double keeps timeouts honest in every test that arms one).
The problem
stella-corehad aClockport that almost nothing used, and the deadline arithmetic readstd::time::Instant::now()itself in nineteen places. #6486 fixed that half: every instant, wait and timeout in the engine now goes throughretry::Sleeper(now()joinedsleepandjitter), andscripts/core-no-io-baseline.txtis empty. This issue is the other half.The real time sources are copied. A Unix-epoch wall clock lives three times (
stella-cli/src/runtime.rsWallClock,stella-runtime/src/wrapper/stamp.rsHostClock,stella-serve/src/remote.rsWallClock), a Tokio sleeper twice (stella-cli/src/runtime.rs,stella-serve/src/remote.rs), andstella-fleet/src/monitor.rskeeps aSleepertrait of its own with a thirdTokioSleeper. The two test doubles (NoopSleeper/NoSleep, and aTokioSleeperon the paused clock) are written about thirty times acrossstella-core,stella-engineand theirtests/directories.stella-servemay not depend onstella-runtimeorstella-cli, andstella-coremay not link the Tokio timer, so the copies have no shared home today.What done looks like
TokioSleeper,WallClockandMonotonicClock, in one crate thatstella-cli,stella-runtime,stella-serveandstella-fleetall use; the copies are deleted, andstella-fleet's ownSleepertrait is gonePausedSleeperand oneNoopSleepertest double, shipped behind atest-utilfeature; the per-file copies instella-coreandstella-engineare deletedimpl Sleeper foror wall/monotonic clock struct outside that crate, with the doubles that stay on purpose named and their reasons givennowsits onSleeper, why the reading is anInstant) and where the real sources and the doubles liveConstraints already found
stella-coremay not linktokio/time(make core-no-io), so a faithful sleeper double cannot live there; the crate that holds the real sleeper holds the doubles, andstella-coretakes it as a dev-dependency (cargo allows the cycle; tokio / tokio-test is the shape)scripts/check-core-no-io.pystrips only#[cfg(test)], so nothing feature-gated may read a clock insidestella-corePillar
Maintainability (one time source, two doubles, one place to fix either) and reliability (the paused double keeps timeouts honest in every test that arms one).