# Output of shift/run_cache_demo.sh — 2026-10-15T13:43:10Z, gcc 13, cargo 1.97.0 (c980f4866 2026-06-30), OpenSSL 3.0.13
# (Temporary paths and timings vary per run.)

== P1. 20,000 time requests, cache OFF (ask the bridge every call)
  helper: bridge contacted 20000 time(s)
  20000 calls on 1 thread(s) in 0.869 s: 20000 answered, 0 refused, 0 went backward

== P2. Same 20,000 requests, cache ON (freshness limit 1000 ms)
  helper: bridge contacted 1 time(s)
  20000 calls on 1 thread(s) in 0.005 s: 20000 answered, 0 refused, 0 went backward

== P3. Time keeps moving between bridge asks (cache 1000 ms, calls 300 ms apart)
  call 1 at +0 ms: program sees 908458992.107950804
  call 2 at +300 ms: program sees 908458992.408263183
  call 3 at +600 ms: program sees 908458992.708422963
  helper: bridge contacted 1 time(s)

== P4. Bridge stops at about +300 ms (cache 1000 ms, calls 600 ms apart)
   expected: call 2 answered from cache (within the limit); at call 3 (limit passed, bridge gone) the helper makes a full stop (v0.14)
  call 1 at +0 ms: program sees 908458993.016363836
  call 2 at +600 ms: program sees 908458993.616621354
  helper: REFUSED - bridge unreachable at /tmp/tmp.vWugpWip7K/bridge.sock
  helper: FULL STOP - refused in clock_gettime(); stopping the program so it never sees a time it cannot trust
shift/run_cache_demo.sh: line 21:  4888 Aborted                 STB_BRIDGE_SOCKET="$SOCK" STB_BRIDGE_UID="$(id -u)" STB_SHIFT_SECS="$SHIFT" STB_CACHE_MS="$cache" STB_REPORT_ASKS=1 LD_PRELOAD="$WORK/shim.so" "$WORK/time_loop" "$@"

== P5. Bridge's own time source freezes (test clock frozen). The BRIDGE must declare the fault.
   Cache 200 ms, calls 300 ms apart. Expected: answered at first (holding, never backward);
   after the 1 s stall limit the bridge declares FAULT; the helper relays it and stops the program (full stop, v0.14).
  call 1 at +0 ms: program sees 1329307200.000000000
  call 2 at +300 ms: program sees 1329307200.000000000
  call 3 at +600 ms: program sees 1329307200.000000000
  call 4 at +901 ms: program sees 1329307200.000000000
  helper: FAULT declared by bridge: time source stalled for 1201 ms
  helper: FULL STOP - refused in clock_gettime(); stopping the program so it never sees a time it cannot trust
shift/run_cache_demo.sh: line 21:  4897 Aborted                 STB_BRIDGE_SOCKET="$SOCK" STB_BRIDGE_UID="$(id -u)" STB_SHIFT_SECS="$SHIFT" STB_CACHE_MS="$cache" STB_REPORT_ASKS=1 LD_PRELOAD="$WORK/shim.so" "$WORK/time_loop" "$@"

== P5b. A faulty bridge that does NOT check itself keeps sending one fixed time.
   The HELPER must notice the bridge has stopped advancing and declare the fault itself.
  call 1 at +0 ms: program sees 1329307200.000000000
  call 2 at +300 ms: program sees 1329307200.000000000
  call 3 at +601 ms: program sees 1329307200.000000000
  call 4 at +901 ms: program sees 1329307200.000000000
  helper: FAULT declared by helper: bridge time has not advanced for 1202 ms; refusing until restart
  helper: FULL STOP - refused in clock_gettime(); stopping the program so it never sees a time it cannot trust
shift/run_cache_demo.sh: line 21:  4906 Aborted                 STB_BRIDGE_SOCKET="$SOCK" STB_BRIDGE_UID="$(id -u)" STB_SHIFT_SECS="$SHIFT" STB_CACHE_MS="$cache" STB_REPORT_ASKS=1 LD_PRELOAD="$WORK/shim.so" "$WORK/time_loop" "$@"

== P6. 8 threads x 5,000 requests at once (cache 1000 ms): no refusals, nothing backward
  helper: bridge contacted 1 time(s)
  40000 calls on 8 thread(s) in 0.015 s: 40000 answered, 0 refused, 0 went backward
