Skip to content

Windows: a guessed liveness must not report a deadline - #2

Merged
TGPSKI merged 2 commits into
mainfrom
fix/windows-budget
Aug 5, 2026
Merged

TGPSKI merged 2 commits into
mainfrom
fix/windows-budget

Conversation

@TGPSKI

@TGPSKI TGPSKI commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Fixes the Windows-only failure on main (Full-scope (windows/amd64) → live run reader).

Two real bugs that Linux hides, both in live.py:

1. A synthetic timestamp was treated as a wall clock.
elapsed preferred the stream's own clock unconditionally. A relative or synthetic timestamp makes now - first_ts astronomically large, so budget pinned at 100% on a run that had just started — the worst direction to be wrong in, because 100% is exactly what a run about to be killed looks like. An epoch in milliseconds is past 1e12; below that it is not a wall clock, and the marker's mtime is the better answer.

2. A deadline was derived from a guess.
Without ps, liveness falls back to "the stream moved recently", which reports a leftover directory as running. A percentage built on that wears the authority of a measurement. Liveness now records whether it was observed or guessed, and no budget is reported when guessed.

Linux never saw either: ps resolves liveness, the directory reads dead, and budget is None before the arithmetic ever runs.

Verified by exercising the guessed-liveness branch directly — state=running, budget=None. 25/25 selftest, ci-local green.

…t a clock

Windows-only red on main, from two real bugs that Linux hides.

1. elapsed preferred the stream's own clock unconditionally. A relative
   or synthetic timestamp makes now-first_ts astronomically large, so
   budget pinned at 100% on a run that had just started -- the worst
   direction to be wrong in, because 100% is what a run about to be
   killed looks like. An epoch in ms is past 1e12; below that it is not a
   wall clock and the marker mtime is the better answer.

2. Without ps, liveness falls back to 'the stream moved recently', which
   reports a leftover directory as running. Deriving a deadline
   percentage from that dresses a guess as a measurement. Track whether
   liveness was observed or guessed, and report no budget when guessed.

Linux never saw either: ps resolves liveness, the directory reads dead,
and budget is None before the arithmetic runs.
@TGPSKI TGPSKI added the full-test Run the cross-platform full-scope CI matrix on this PR label Aug 5, 2026
The workflow documents 'PR carrying the full-test label' as the way to
run cross-platform checks before merging, but pull_request defaults to
opened/synchronize/reopened -- labeling fired nothing and the matrix
stayed skipped. The documented escape hatch was inert, which is how a
Windows-only bug reached main in the first place.
@TGPSKI
TGPSKI merged commit 4d4bc2e into main Aug 5, 2026
6 checks passed
@TGPSKI
TGPSKI deleted the fix/windows-budget branch August 5, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-test Run the cross-platform full-scope CI matrix on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant