Repository navigation
test(592): the packet envelope's throughput, so the candidate can be priced (AE#592) - #603
Merged
Merged
Conversation
…priced (AE#592) The leading mechanical candidate for the software route's per-byte cost was the PropertyList round trip every packet crosses on the way to the on-disk spool. This measures it instead of arguing about it, with a payload per round so a copy the encoder makes is a copy the number contains. Read on an M1: encode 1028 MB/s (395 us per 425 KB packet), decode 12670 MB/s (32 us), envelope overhead x1.0007. At the session's roughly 10 MB/s that is about 1% of one core, so the candidate cannot account for the reported gap. The "five to seven copies" reading was right; the inference that they are expensive was not. The three round-trip cases are the safety net that made the measurement safe to take: the envelope is documented as lossless and DTS, duration and side data must survive a cache hit. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f
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.
No production change. This adds the instrument that prices the thread's leading mechanical candidate, and the number kills it.
What it measures
SoftwareStoredPacketis the envelope every compressed byte on the software VOD route crosses twice, once into the on-disk spool and once back out, at roughly 425 KB per video packet. The thread named itsPropertyListEncoder/Decoderround trip plus five to seven copies as the leading candidate for the route's per-byte cost.Each round gets its own payload, so a copy the encoder makes is a copy the number contains. On an M1:
At the session's roughly 10 MB/s that is about 24 packets per second, so
24 x 427 usis around 1% of one core. Five times slower on an A15 still leaves 5%, which cannot account for the reported gap.The 395 us for 425 KB is about four to five full copies, so the "five to seven copies" reading was accurate. The inference that they are expensive was not. The envelope also adds 0.07% to the payload, so nothing is being base64 inflated.
So the candidate is dead and should not be optimised. Halving a 1% cost is busywork, and the issue comment records the measurement so the next reader does not re-propose it.
Why the tests are a safety net rather than RED/GREEN
This is a measurement, not a behaviour change, so there is no failing test to write first. The three round-trip cases exist because taking the measurement meant being ready to change the encoding, and the envelope is documented as lossless with DTS, duration and side data required to survive a cache hit. They cover an empty payload, a 425 KB payload with side data, side-data order and type, and
Int64.min/Int32.maxscalars that a narrowing encoder would quietly clamp.The throughput case asserts nothing about timing on purpose: a floor pinned here would be a CI coin toss. It prints.
Full suite green, 3341 tests in 451 suites.
🤖 Generated with Claude Code
https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f