From 2be6928a4367ff35209484becad6627e34ac9768 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Fri, 2 Oct 2026 06:21:48 +0100 Subject: Run Pure and aup on an x86_64 WSL2 and an M3 Mac against the Pi (029) Every pure-run of aup's check (1,053 runs of 667 modules) gives the same output, errors and exit on the Pi, the WSL2 (x86_64, 4 KiB pages, gcc 13) and the Mac (Apple clang 21); the same events make byte-identical stores on the Pi and the Mac, and either opens the other's and goes on the same. Pure's checks pass one at a time in WSL (each_check.py); its wall clock is set back about 2 s every 32 s (clock.py). stores.py streams pure-run's output, whose size grows with the square of the events. --- research/experiments/029-across-machines/clock.py | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 research/experiments/029-across-machines/clock.py (limited to 'research/experiments/029-across-machines/clock.py') diff --git a/research/experiments/029-across-machines/clock.py b/research/experiments/029-across-machines/clock.py new file mode 100644 index 0000000..f65a21a --- /dev/null +++ b/research/experiments/029-across-machines/clock.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +"""Whether this machine's wall clock jumps (research 029): the wall clock +(time.time) against the monotonic one, read every 20 ms for SECONDS; each +step where the wall clock moved more than 20 ms apart from the monotonic +one, how far, and when (also on the system's monotonic clock). A JSON line +each, then one with the totals. + +clock.py SECONDS""" +import json +import sys +import time + +seconds = float(sys.argv[1]) +start_wall, start_mono = time.time(), time.monotonic() +wall, mono, jumps = start_wall, start_mono, 0 +while mono - start_mono < seconds: + time.sleep(0.02) + now_wall, now_mono = time.time(), time.monotonic() + apart = (now_wall - wall) - (now_mono - mono) + if abs(apart) > 0.02: + jumps += 1 + print(json.dumps({'at_s': round(now_mono - start_mono, 2), 'monotonic': round(now_mono, 2), + 'wall_moved_ms': round((now_wall - wall) * 1000, 1), + 'monotonic_moved_ms': round((now_mono - mono) * 1000, 1)}), flush=True) + wall, mono = now_wall, now_mono +drift = (time.time() - start_wall) - (time.monotonic() - start_mono) +print(json.dumps({'seconds': seconds, 'jumps': jumps, 'wall_minus_monotonic_ms': round(drift * 1000, 1)})) -- cgit v1.2.3