Skip to content

Eight routes, not four - #208

Merged
sepehr-safari merged 1 commit into
mainfrom
eight-routes-not-four
Aug 12, 2026
Merged

Eight routes, not four#208
sepehr-safari merged 1 commit into
mainfrom
eight-routes-not-four

Conversation

@sepehr-safari

@sepehr-safari sepehr-safari commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Last of four on read-side outbox routing. Everything else was mechanism; this is the number.

The number

Four was picked before there was anything to measure it against. Measured now, reading only, on my own account of 257 follows (215 with a usable relay list, 191 distinct relays named between them):

Routed connections Follows covered Covered twice Asked of every relay
4 193 134 64
8 202 156 55

"Covered" means reachable through the relays I chose myself or a routed one, which is what the coverage counter measures; the last column is everyone neither reaches, who ride every relay in the pool as before.

Nine more people become directly reachable and nine fewer depend on that fallback. The bigger move is the middle column: twenty-two more people are now carried by two relays rather than one, which is what stops a single relay being down from hiding somebody.

Sixteen sockets in all, matching the pool. Cost measured at 41 threads and 263 MB with all eight connected.

This is not a blank cheque for eight connections. The greedy takes a relay only while one reaches somebody not yet covered twice, so it stops on its own: an account with a tidy follow list opens fewer, and nothing is spent on a socket that would reach nobody new.

Three tests that would have gone quiet

Raising the budget silently turned three tests into tests of nothing, which is the failure mode I keep meeting. All three now count off the budget:

  • the residual test used seven one-author relays. At eight slots everybody is routed and the residual is trivially empty. Now it uses budget + 3 and asserts the residual is exactly 3, rather than "more than nothing".
  • the eviction test filled three of four slots so the fourth was contested. At eight slots there was a spare, so the margin was never consulted. Now it fills budget - 1 slots.
  • the coverage-against-popularity test had four candidate relays against a budget of four, so everything was dialled and the two orderings could not disagree. It never tested its own premise. Now the crowd comes in groups of outbox_relays_per_author and outnumbers the budget, and the test also asserts the thing the coverage numbers cannot show: that the popularity-ranked suggestions never mention the relay the routing dials.

That last one asserts its own construction still outnumbers the budget, so lowering the budget fails loudly instead of passing hollow.

Re-probed the three guards from the previous PR at the new budget: removing per-slot generations, slot-stable placement, or the eviction margin each still fails a test named after it.

Four routed connections was the number picked before there was anything to
measure it against. On a real account of 257 follows, four reach 193 of them
and leave 64 riding the reader's own relays; eight reach 202 and leave 55, with
156 covered by two relays rather than 134. Sixteen sockets in all, matching the
pool, and the greedy still stops on its own: it takes a relay only while one
reaches somebody not yet covered twice.

Three tests had the budget written into them and would have gone quiet rather
than failing. The residual test used seven one-author relays, which at eight
slots leaves nobody over; the eviction test filled three of four slots, which
at eight slots leaves a spare and never reaches contention; and the
coverage-against-popularity test had fewer candidate relays than slots, so the
two orderings could not disagree. All three now count off the budget, and the
last one asserts that its construction still outnumbers the budget so a smaller
one fails loudly instead of passing hollow.
@sepehr-safari
sepehr-safari merged commit cef71cd into main Aug 12, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the eight-routes-not-four branch August 12, 2026 01:23
@sepehr-safari sepehr-safari mentioned this pull request Aug 12, 2026
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