Conversation
Every package in the stack reads its records through this code, so a change here reaches SCALCS, EKDIST and HJCFIT at once. Pinning it here rather than in HJCFIT is the same work with three times the coverage. Five cases over the two shipped records, each fixing resolved-interval counts, period counts, burst counts and openings, mean burst length, mean Popen within bursts, and the histogram binning. Resolutions are chosen so the dead time actually bites. The simulated record's shortest interval is 125 us, so a golden case at 25 or 100 us would merge nothing and exercise the concatenation logic not at all -- one of the invariants now asserts that, so a future case cannot quietly test nothing. Alongside the exact numbers, invariants that hold for any record at any resolution: periods alternate strictly, every burst has an odd interval count, burst openings account for every open period, no within-burst gap exceeds tcrit, the histogram counts every interval, the sign of tcrit is ignored. Those keep meaning something if the example files are ever replaced. Two of them were wrong when first written, and the failures were worth following rather than relaxing: Total time is not conserved outright. impose_resolution starts at the first interval that is both resolvable and usable, because anything earlier has a start that cannot be located, and the time before it is dropped -- 75.8 us of a 102.7 s record on the experimental example at 100 us. The invariant now accounts for that head explicitly rather than allowing a fudge factor that would have hidden it. Resolved intervals are not all at least tres long. Two documented exceptions carry FLAG_UNUSABLE: the negative sentinel for an unfinished final opening, and the short shut emitted when the record ends on a brief shutting that terminates an open run. The invariant is now about usable intervals, which is what a consumer relies on. 83 tests; 345 passing overall. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every package in the stack reads its records through this code, so a change
here reaches SCALCS, EKDIST and HJCFIT at once. Pinning it at the bottom rather
than in HJCFIT is the same work with three times the coverage.
What is pinned
Five cases over the two shipped records, each fixing resolved-interval counts,
period counts, burst counts and openings, mean burst length, mean Popen within
bursts, and the histogram binning.
The resolutions were chosen so the dead time actually bites. The simulated
record's shortest interval is 125 µs, so a golden case at 25 or 100 µs merges
nothing — it would pin the concatenation logic while exercising none of it.
One of the invariants asserts this, so a future case cannot quietly test
nothing.
Alongside the exact numbers, invariants that hold for any record at any
resolution: periods alternate strictly, every burst has an odd interval count,
burst openings account for every open period, no within-burst gap exceeds
tcrit, the histogram counts every interval, the sign oftcritis ignored.Those keep meaning something if the example files are ever replaced.
Two invariants were wrong, and the failures were worth following
I wrote both as obvious truths; both failed on the experimental record at
larger
tres. Neither was a defect — but relaxing the tolerance would haveburied two real facts about the layer.
Total time is not conserved outright.
impose_resolutionstarts at thefirst interval that is both resolvable and usable, because anything earlier has
a start that cannot be located, and the time before it is dropped — 75.8 µs of
a 102.7 s record at 100 µs. Exactly the observed difference. The invariant now
accounts for that head explicitly.
Resolved intervals are not all at least
treslong. Two documentedexceptions carry
FLAG_UNUSABLE: the negative sentinel for an unfinished finalopening, and the short shut emitted when a record ends on a brief shutting that
terminates an open run. The invariant is now about usable intervals, which is
what a consumer relies on.
83 tests here; 345 passing overall.
🤖 Generated with Claude Code