Skip to content

test: bound the amplification, not the machine - #77

Merged
myobie merged 1 commit into
mainfrom
test/bound-amplification-not-machine-speed
Aug 25, 2026
Merged

test: bound the amplification, not the machine#77
myobie merged 1 commit into
mainfrom
test/bound-amplification-not-machine-speed

Conversation

@myobie

@myobie myobie commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

three_node_2000_file_continuous_mutation_stays_bounded capped reconciles per second, and derived the scan and persist caps from that same per-second figure. Every bound was a function of how fast the machine happened to be, so the test failed on hardware that was merely quick.

It failed that way twice, and the second one was mine

The cap was 4/s, derived when a persist wrote 72 MB of pretty-printed JSON. #74 made a pass cheaper, more legitimate passes fit the same fixed burst, and I re-derived the cap as 5/s from macOS runs only. Linux CI then produced 5.04/s and turned main red on a run whose behaviour was fine.

Raising it again from one platform's numbers would just move the trap.

Measured on both — the rate moves, the ratios don't

reconciles/s scans/reconcile persists/reconcile
macOS 3.99 – 4.27 2.50 – 2.61 1.86 – 1.95
Linux CI 5.04 2.53 1.81

Scans and persists per reconcile are what amplification means, and they don't depend on clock speed.

What changed

Both are now bounded directly, at exactly the strictness the old per-second forms implied — 112/36 scans and 76/36 persists per reconcile. Nothing is loosened. The failing CI run sits inside both, at 2.53 and 1.81.

The reconcile rate keeps a ceiling, but only as a runaway backstop, far above anything either platform has produced. A feedback loop is orders of magnitude, not a fast laptop.

I proved the new bounds can fail

Tightening the scan allowance makes it fail and name the real figure:

scan amplification: 104 scans for 42 reconciles is 2.48 per reconcile,
over the 1.00 this entry is allowed

And the first version of that message lied. With a tightened numerator it still printed the old limit, because the assertion used the constant while the message hardcoded the number. The allowance now has one source, so the two can never disagree.

Agent: Silber.fabric

`three_node_2000_file_continuous_mutation_stays_bounded` capped reconciles
per SECOND, and derived the scan and persist caps from that same
per-second figure. Every bound was therefore a function of how fast the
machine happened to be, so the test failed on hardware that was merely
quick.

IT FAILED THAT WAY TWICE AND THE SECOND ONE WAS MINE. The cap was 4/s,
derived when a persist wrote 72 MB of pretty-printed JSON. Compact
bookkeeping made a pass cheaper, more legitimate passes fit the same fixed
burst, and I re-derived the cap as 5/s from macOS runs. Linux CI then
produced 5.04/s and turned main red on a run whose behaviour was fine.

Raising it again from one platform's numbers would just move the trap.

MEASURED ON BOTH, AND THIS IS THE POINT. The rate moves a lot. The ratios
barely move.

  macOS      3.99 to 4.27 reconciles/s   2.50-2.61 scans   1.86-1.95 persists
  Linux CI   5.04 reconciles/s           2.53 scans        1.81 persists

Scans and persists PER RECONCILE are what amplification means, and they do
not depend on clock speed. So they are bounded directly, at exactly the
strictness the old per-second forms implied: 112/36 scans and 76/36
persists per reconcile. NOTHING IS LOOSENED. The failing CI run sits
inside both, at 2.53 and 1.81.

The reconcile rate keeps a ceiling, but only as a runaway backstop, and it
sits far above anything either platform has produced. A feedback loop is
orders of magnitude, not a fast laptop.

I PROVED THE NEW BOUNDS CAN FAIL. Tightening the scan allowance makes it
fail and name the real figure.

AND THE FIRST FAILURE MESSAGE LIED, so the allowance now has ONE source.
With a tightened numerator the message still printed the OLD limit,
because the assertion used the constant and the message hardcoded the
number. That would send the next reader looking in the wrong place.

Agent: Silber.fabric
@myobie
myobie merged commit 32822f2 into main Aug 25, 2026
2 checks passed
@myobie
myobie deleted the test/bound-amplification-not-machine-speed branch August 25, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant