From 1c49b8c6104e1c467205adf66e5a3edec6b235b1 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 20 Sep 2026 11:53:37 +0700 Subject: [PATCH] The monotonic origin bound measures the clock, not the machine --- test/programs/time.flan | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/programs/time.flan b/test/programs/time.flan index 6836c24..cea0388 100644 --- a/test/programs/time.flan +++ b/test/programs/time.flan @@ -19,10 +19,15 @@ (println (>= t2 t1))) ;; And the origin is the first read rather than boot, so the first readings - ;; a program takes are small. Bounded rather than pinned: the number is - ;; whatever this process spent between the calls above and this one, which - ;; is not a second on any machine that can run the suite at all. - (println (< (monotonic-ns) ns-per-second)) + ;; a program takes are small. Bounded rather than pinned, and the bound is + ;; deliberately loose: what separates this clock from a boot-relative one is + ;; hours, so a minute proves it and a second only proved it on hardware. The + ;; tighter bound was a reading after all — memcheck runs this program on a + ;; synthetic CPU tens of times slower than the metal, the second genuinely + ;; elapsed, and the line went false under a tool that has nothing to say + ;; about clocks. A minute is past anything a simulator adds and still short + ;; of the smallest thing the assertion is meant to catch. + (println (< (monotonic-ns) (* 60 ns-per-second))) ;; The f64 face is the i64 one divided, and what is checked is that the two ;; describe the same instant: a later reading in seconds is at or past an