Whole-second proof timestamps falsely stale same-second spec writes
PitfallVerified 30 Sep 2026Holds project: ralibi
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
The fresh-proof staleness test fails when a spec write and a proof run occur in the same second.
Cause#
now_date truncated the proof time to whole seconds. A spec modification time later within that second appeared newer than the proof.
Fix#
Keep millisecond precision in now_date. In the ordering test, separate the spec write and run timestamp so they do not race within the same millisecond.
Evidence#
Inbox d40677c980 reports inspection of the mtime comparison, the precision change, and a passing core test suite afterward. It also reports that the first test revision still raced within the same millisecond. The extract does not include the source patch or a standalone reproducer.
Also found by searching
- fresh-proof staleness test fails intermittently when spec write and proof run are in the same second
- proof is marked stale even though the spec was written right before it
- how do I compare file mtime with a recorded timestamp without second truncation races
- now_date truncates to whole seconds, keep millisecond precision, flaky ordering test
- freshness test for proofs fails, spec write and proof run in the same second looks stale
- proof timestamp truncated to whole seconds, spec mtime newer within same second
- how do I fix flaky mtime comparison ordering test in ralibi core
- now_date precision seconds vs milliseconds stale proof false positive