Repository navigation
test(remote): measure the phone's lane as the phone actually negotiates it - #865
Merged
Merged
Conversation
…es it Three instrument faults, each of which had produced a wrong number: **The harness never installed the live-lane capability flags.** They live in the per-pairing shared runtime, and `coalesce_events()` answers an unknown pairing with a fresh, *disabled* flag rather than an error — so declaring coalescing succeeded, asserted success, and wrote to a throwaway flag while the drain read another. Every "coalesced" reading was the undeclared lane. `E2e::on_broker` now does what the supervisor does before building the transport, and the measurement asserts the flag and that merging actually happened. That also needed the harness's flow control to stop counting messages as events: one merged message stands for `coalescedCount` source events, so decrementing per message left the drain permanently behind and asked for a full merge window almost every event (a 3-minute measurement became hours). `assert_lane` learns the same shape — a merged message keeps its group's *newest* envelope and `idx` and carries the whole group's text, which is how the client reads it (`start = idx - coalescedCount + 1`). **The history measurement was not measuring the phone's page.** `dump_entries` fetched a whole session and let the bridge's 512 KiB budget reduce it, which answers "as many newest exchanges as fit", not the newest `HISTORY_PAGE_USER_EXCHANGES` (3, since #607) the phone asks for — three-fold high on a lean page. The scripted agent now pages like the real one (`paginate_backward`), and `measure-lean-history.py --phone-page N` measures the real page through the shipping trim and budget. Its `--session` flag lets a run name the same sessions the other measurement uses. **The numbers follow.** On the three heaviest runs, the phone's lane is undeclared 70.3 / 66.6 / 60.9 MB → coalesced 3.12 / 2.97 / 2.44 MB → coalesced + lean 0.82 / 0.82 / 0.47 MB. The trim's own contribution is **-72% to -81%**, not the ~-98% a raw-to-lean ratio suggests: that credits the trim with merging it did not do. `CONNECTION.md` now states both steps, and its history figures are the phone's page rather than a whole session.
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.
Three instrument faults, each of which had produced a wrong number. No product code changes.
1. The harness never installed the live-lane capability flags
They live in the per-pairing shared runtime, and
coalesce_events()answers an unknown pairing with a fresh, disabled flag rather than an error. So declaring coalescing succeeded, the reply asserted success, and the flag was written to a throwawayArcwhile the drain read another one. Every "coalesced" reading in this harness was the undeclared lane.E2e::on_brokernow installs the shared runtime the way the supervisor does before building the transport, and the measurement asserts both the flag and that merging actually happened — so it cannot pass unnoticed again.That fix needed two more:
coalescedCountsource events, so decrementing per message left the drain permanently "behind" and asked for a full merge window on nearly every event: a 3-minute measurement became hours. It now counts covered source events.assert_laneassumed one message per event. A merged message keeps its group's newest envelope andidxand carries the whole group's text — which is exactly how the client reads it (start = idx - coalescedCount + 1). My first attempt asserted the group's first idx and failed on real data; the fixture test now covers the coalesced lane so the shape is pinned without a 5-minute run.2. The history measurement was not measuring the phone's page
dump_entriesfetched a whole session and let the bridge's 512 KiB budget reduce it. That answers "as many newest exchanges as fit in the budget", not the newestHISTORY_PAGE_USER_EXCHANGES— which is 3 (lowered from 10 in #607), and which my earlier report had aslimit: 10. On a lean page that overstated by ~3×.The scripted agent now pages like the real one (
paginate_backward: newest N user exchanges ending at the cursor), andmeasure-lean-history.py --phone-page Nmeasures the real page through the shipping trim and budget. A--sessionflag lets a run name the same sessions the other measurement uses.3. The numbers follow
Three heaviest runs, real Noise+AEAD, as the phone actually negotiates it:
The trim's own contribution to a phone is −72% to −81%, not the ~−98% a raw-to-lean ratio suggests — that ratio credits the trim with merging it did not do.
CONNECTION.mdnow states both steps separately, and its history figures are the phone's page rather than a whole session.Checks
remote::179 passed,remote_host::83 passed;cargo fmt --check+clippy --all-targets -D warningscleanpython3 scripts/docs/check-docs.py— 205 docs OK--samples 3 --broker fake), needing only the live agent's db + socket.