Skip to content

mibz2 · Research blog

The decoder as a queueing network

Modelled as stations and queues, the decoder shows in advance where more workers stop helping and which experiments to run next.

At ten workers, supplying mibz2's decoder with the codes its emission step would otherwise compute saved nothing measurable, yet the same supply saved 8% once the serial scanner had been relieved as well. A profile cannot explain that, because it says where time is spent, not which work decides when a decode finishes; queueing theory is the discipline built for the second question, and a month of our earlier performance work had been asking it under other names. This post follows the attempt to apply the theory properly, in order: what we expected it to give (a characterisation of the decoder as a system, predictions of what a change would buy, and a search for a better organisation of its work), what each part did when tried, and where it led. The bottleneck law predicted from four worker counts where adding workers stops helping. Little's law decided what the instruments had to record and then audited them. Modification analysis explained the vanishing improvement and changed how every improvement is priced. Load dependence gave one name to a month of interference findings. The exact theory of product-form networks fitted a surrogate of the decoder rather than the decoder, so bounds, interventions and a simulation still to be built do the predicting. And the destination is an experiment that makes each part of the decoder ideal in turn, to map where new mathematics could pay, including where the present structure hides it.

Takeaways

  • The first queueing law tried, the bottleneck law, predicted the knee at 7.49 workers from measurements at one to four; the measured crossover is 7.67, and the best wall, 0.191 s, is at 8.
  • The theory's simplest laws held and its most elegant results did not: operational identities held exactly in 840 traced decodes, while product-form models fitted only a simplified surrogate of the decoder, within 1 to 4 ms.
  • An improvement's value depends on what else is improved: emission's room is 15–17% below the knee, hidden at it, and appears above it mostly behind a relieved scanner. Improvements are now priced in combination.
  • Where threads sit matters as much as what they compute: workers on the two hardware threads of shared cores cost 48% at 8 workers, and two merged changes took 16–37% and 7% off by choosing the kernel and the worker count better.
  • Making each part of the decoder ideal in turn puts the room in construction below the knee (0.58 of the wall at one worker) and in the scanner above it, with the two masking each other at 6 and 8 workers; what the decoder could never shed is still unmeasured.

A technical companion goes beneath this story: Little's law on a finite trace, the bottleneck law, modification analysis, load dependence, product form and the factorial design of the ideal-parts matrix. Beneath the queueing network →

1. An improvement whose value vanished

The question began with an oracle. The inversion work had a way to supply the codes that the emission step would otherwise compute, prepared outside the timed decode, which turns "what if emission's work were cheap?" into a measurement (Masked bottlenecks in a two-stage decoder; journal §44). With one or six workers, the supply saved 17% and 15% of the wall (0.830 and 0.850). With ten, its effect was unresolved, 0.976 with an interval across 1. Two explanations fit that: the work might offer little at ten workers, or something else might be stopping the time it saved from reaching the end of the decode. A second oracle told them apart. It supplied the scanner's output instead, and then both together, with every output checked against the reference across twenty paired rounds.

One change, two values: the four-arm oracle at 10 workers

everything real1.000emission's codes supplied0.976 [0.936, 1.017]scanner's output supplied0.806 [0.782, 0.831]both supplied0.741 [0.717, 0.766]supply emission's codes−2.4%, unresolvedsupply emission's codes−8%0.920 [0.901, 0.939]supply the scanner: −19%−24%The same change, the codes supplied for emission, is worth nothing on the top edge and 8% on the bottom.At 1 and 6 workers, with the workers the bottleneck, it is worth 17% and 15% (0.830, 0.850).
Measured: journal §44, wall time over everything real, 95% intervals; the oracles' preparation is outside the clock and every output matches the reference.

Once the scanner was relieved, supplying emission's codes was worth 8% (0.920 [0.901, 0.939] of the scanner-supplied wall). So the same computation was worth improving in one configuration and apparently worthless in another, and the question that follows is not where the time goes but which work determines when the decode finishes. The 26% with both supplied measures room under an experimental arrangement; finding an algorithm that obtains the supplied information cheaply is a separate problem, and keeping the two apart is what lets such experiments direct mathematical work.

2. Queueing questions under other names

None of this was new territory. For a month the decoder's performance work had been asking queueing questions without the vocabulary, because parallelising a program is largely a matter of rearranging how its work queues: which stage hands what to whom, how many jobs are in flight, and who waits when.

Queueing questions under other names

Performance questions, and their names in queueing theory27 Octserial stationon CI, 4 workers give 1.5–1.9×: the serial scan limits, not the window28 Octthe knee; load-dependent servicethe decoder peaks at 4 workers; IPC halves as workers are added29 Octcapacity provisioningteams of two, as many as keep the tables near 0.7 of the L331 OctLittle's lawlookups in flight = latency × rate inside one worker's walk1 Novwaiting time and utilisationslow job claims are mostly waiting behind busy workers1 Novload-dependent servicefour workers spend 32% more CPU a byte on the same instructions5 Novadmission; head-of-line blockingthe window from 2 to 4 slots a thread: 8–10% off the wall5 Novdiscipline and placementco-run placement: thread pairs, a walk token, interleaving7 Novthe knee; a cycle time of max(S, αP)each block in flight slows the others; three teams beat four9 Novtandem stations; bottlenecka pit crew of service threads: the single thread became the bottleneck17 Novcapacity provisioningseven workers of ten finish sooner21 Novload-dependent servicefast alone, slow in a crowd24 Nova masked bottleneckthe scanner hides the emitter
From the journals and posts linked in this section. Colours group the names: amber the serial station and bottleneck, blue load dependence, green provisioning and admission, steel Little's law and waiting.

The first knee was measured on 28 October: the whole decoder peaked at 4 threads, at 1,013 MB/s, and fell to 0.63 of that by 10; from 6 threads to 10 its instructions stayed constant while instructions per cycle halved (journal). Each added worker made every worker slower, which queueing theory calls a load-dependent service rate, and the same finding recurs as 32% more CPU a byte for four workers (memory interference), as kernels that win alone and lose in a crowd (fast alone, slow in a crowd), and as the reason a lazier kernel with 28% more instructions wins from 8 threads (lazy letters). Slow job claims turned out to be ordinary waiting behind busy workers (block dispatch). Little's law was already in use, to count the lookups in flight inside one worker's walk (32 lanes, 8.6 chains). Widening the admission window from 2 to 4 slots a worker took 8–10% off the wall on CI, because workers had been idle behind a block still decoding or not yet read (journal). Teams of threads, pipelined teams and a crew of service threads were all ways of restructuring stations (why mibz2 stops scaling; pipelined teams; a pit crew), and in the last of them a single service thread busy 96% of the time had become the bottleneck. Rightsizing to seven workers of ten was capacity provisioning under load dependence (modelling the cache).

Underneath all of it sat one structural fact. The scanner that decodes the Huffman codes is a single thread working in order, because a block's end is found only by reading up to its end-of-block symbol, and the next block begins straight after it (the bit buffer). Everything else runs in parallel behind it. The previous post called the scanner the doorman and the workers the assemblers; this one gives that picture its mathematics.

3. What the theory was asked for

The aim was set out before any reading began: a performance analysis in Jain's manner, which would yield a model of the program in the way systems biology models a regulatory network, which would in turn locate where new mathematical devices could fit (journal §52). That asks three things of queueing theory. It should characterise the decoder as it is, as a system of stations rather than a list of kernels. It should predict what a change would buy before the change is built. And it should help search for a different organisation of the work, if a better one exists.

The theory came from two teachers. Raj Jain's course follows his The Art of Computer Systems Performance Analysis (1991), and Mor Harchol-Balter's 15-857 at Carnegie Mellon, with its theory companion 15-849b, follows her Performance Modeling and Design of Computer Systems (2013). What was read is narrower than reading three courses: every module's topic list, six of Jain's slide decks in full (the systematic approach, experimental design, fractional factorials, simulation analysis, the operational laws and mean-value analysis), the textbook's table of contents, the 2025 schedule with its readings, and the theory course's topic and book lists, all saved with notes (what was read). Four readers then mined that material against the decoder's measurements independently, and their disagreements corrected the first reading in several places that recur below (the summary; journal §§58–62).

4. The decoder, drawn as stations

In queueing theory's terms a job here is a block of the compressed file, and a station is a resource that serves it: the scanner, the pool of workers, the reader. Each block makes a demand on each station, the time it needs there, and the stations' throughputs and utilisations follow from those demands; the vocabulary, and the shapes in which queues are combined, are set out in the companion post.

The decoder is a tandem: the scanner feeds a parallel group of k workers, each of which takes a whole block, and a reader hands the finished blocks to the caller in order. Its admission is precise in the code (src/parallel.rs). With issued counting the blocks the scanner has finished and taken the blocks the reader has taken, the scanner waits while \(\text{issued} - \text{taken}\) has reached \(W = 4k\), or while 12 MiB of finished output is unread and at least \(k + 2\) blocks are ahead. The block it is scanning is not yet counted, and a slot frees when the reader takes the next block in order, before it has copied any of it out (taken advances).

The decoder as a network of queues

feederreads andcopies inputscannerone thread:headers, tables,Huffman decodeadmission windowW = 4k blocks in flight:queued, running, or donebut not yet taken in orderk workersMTF and runs,inversion,emission, CRCconsumertakes blocksin order,writes outputa slot is freed only when the next block in order is taken,and finished output is capped at 12 MiBAdmission credit circulates, though each block passes through once: close to a closed network,not one. One slow early block can hold slots and stall the scanner.
The structure the measurements follow. Admission credit circulates; the data passes through once. Start-up, drain and the 12 MiB cap on finished output are where the decoder departs from a true closed network.

That makes four distinct kinds of waiting, with different remedies: the scanner waiting for an admission slot, a scanned block waiting for a worker, a worker waiting for a scanned block, and a finished block waiting behind an earlier one that is not finished. More slots can keep workers busy in the second and third cases; in the fourth they only hold more memory behind a straggler.

The return arrow is why the decoder was first described as a closed network, in which a fixed population of jobs circulates. That description was withdrawn (the summary). The decoder is a finite pipeline with feedback-controlled admission: a finite stream starts empty and drains, \(W\) is a ceiling rather than a population, and the byte cap and the in-order reader make admission depend on the decoder's state. A closed network whose population is the admission permits is a useful surrogate, provided its relation to the real blocks is stated whenever it is used.

5. The bottleneck law

The operational laws relate quantities measured over an interval and assume nothing about how arrivals or service times are distributed (Jain, ch. 33; Harchol-Balter, ch. 6–7). The utilisation law, \(U = XD\), says a station's busy fraction is its throughput times its demand. No station can be busy more than all of the time, so \(U \le 1\) gives the bottleneck law: the system's throughput is at most the capacity of its busiest station over that station's demand.

Applied to a scanner taking \(s\) a block and \(k\) workers each taking \(w\), the scanner can finish at most \(1/s\) blocks a second and the workers together \(k/w\), so

\[ X(k) \le \min\left(\frac{k}{w},\ \frac{1}{s}\right). \]

The workers set the pace until there are enough of them that the scanner cannot keep up, and from then on the scanner alone does; the two limits meet at \(k^* = w/s\). From measurements at one to four workers only, \(s = 106.6\) µs and \(w = 798.3\) µs a block, which puts the knee at 7.49 workers. The measured crossing is 7.67, and the best wall, 0.191 s, is at 8 (journal §57; the data). Nothing was fitted to the knee: two service times measured where the workers bind located the region where the scanner takes over.

The bottleneck law, with the measured decoder

0k5k10k15k20k148121620workers, kblocks a secondknee k* = w/s = 7.49 workersscanner ceiling 1/s = 9,381 blocks a secondthe bound, min(k/w, 1/s)the workers' limit, k/wthe scanner's limit, 1/smeasured: 1,724 blocks over the median wall
The idealised bound from the operational laws, with no start-up, drain, contention or blocking, against the decoder measured on an i9-10900K (median of 20 decodes at each count). With JavaScript, the sliders set the two service times: a cheaper scanner raises the ceiling and moves the knee right, a cheaper worker steepens the rise and moves it left.

In wall time, the same picture reads as follows.

Wall time against workers: the knee predicted from four counts

0.10.20.30.40.50.60.7148121620workersdecode wall time (s)knee predicted from counts 1–4: 7.49measured crossover: 7.671.30 sworkers bind: wall ≈ a/kscanner binds: wall ≈ bstep at 16: the scanner slows 23%measured (median of 20 decodes)fitted two-station model, c + max(b, a/k)
Measured on an i9-10900K (10 cores, 20 threads), one corpus of 1,724 blocks and 839 MB of output, median of 20 decodes at each count, unpinned. The fitted model (steel) has the workers' asymptote a/k on the left and the scanner's b on the right; the dashed line is the knee predicted from counts 1 to 4 alone. The wall at one worker, 1.30 s, is off the scale.

The scanner's time, working and waiting

0.20.40.60.811.21.4148121620workersscanner thread time (s)from 8 workers the scanner almost never waits:it is the bottleneck, and only less work there helpsscanner workingscanner waiting for a free slot
Measured, same run. Below the knee the scanner waits for the workers to free a slot; from 8 workers on it works without pause, so it is the bottleneck and only a lighter scanner moves the wall.

Three qualifications keep the law honest. First, a station is a resource, not a function: the scanner's header parsing, table building and Huffman decoding share one thread, so their demands add, and drawing them as separate parallel stations would invent capacity. Second, the law bounds throughput; it does not give a completion time. One block that takes a 1 s scan, a 1 s decode and a 1 s delivery in series has a largest demand of 1 s and takes 3 s, so the bottleneck maximum is a lower bound on the wall, not a forecast of it (journal §70). A global fit of \(c + \max(b, a/k)\) to all twenty counts is accordingly less exact than the four-count prediction: its crossover is 7.17, its residuals run about −13 ms from 8 to 14 workers and +21 ms from 17, and its 32 ms constant has no identified cause. Third, the textbook's knee for closed systems, \(N^* = (D + Z)/D_{\max}\), is a knee in the population of jobs, not in the number of servers; the decoder couples the two through \(W = 4k\), but they are different variables (the companion).

6. Little's law, and what the instruments must record

Little's law, \(L = XR\), says the mean number of jobs in a system is its throughput times the mean time each spends there (Little, 1961; Jain, ch. 30; Harchol-Balter, ch. 6). For a finite trace it is a statement about counting the same thing twice.

Little's law as two counts of one area

01234Count the jobs present at every instant, and add up the area under the curve ...... or add up how long each job stayed. For a trace that starts and ends empty, the two totals are equal.job 1job 2job 3job 4job 5timeDivide both by the length of the trace: mean number present L = throughput X × mean residence R.
Schematic, with five illustrative jobs. The finite-trace form is the one stage 1 checks: each buffer's occupancy integral against the sum of its blocks' residences.

That form forces precise questions on the instruments. Which population is meant: blocks waiting for a worker, all blocks issued and not yet taken, or finished blocks waiting to be read? Each has its own residence time, and mixing one population with another's interval gives a plausible number that describes no queue. An early sizing of the admission window made exactly that mistake: throughput times the sum of the service demands suggested 8 or 9 slots, but the law needs residence time, waiting included, and gives a mean occupancy rather than a safe maximum, so the figure was withdrawn (journal §61; the correction).

The law also shaped the tracing that stage 1 of the characterisation used (#841). It keeps a live occupancy integral for each of seven buffers, from admitted to consuming, rebuilds each block's residence from per-thread ledgers, and checks that the two agree exactly, as integers. A design review had warned beforehand that the decoder marks some transitions after releasing a lock and others under it, so sorting events by timestamp could produce an impossible queue history; every transition therefore takes a sequence number under one lock, with one clock read for both (the review; journal §§59–60). Across 840 decodes, all nine identities built from these laws held in every one, Little's law exactly (journal §66). A trace that broke one would have meant a missing or misplaced event, not a surprising decoder. The identities establish consistency, not cost: the ledgers themselves perturbed the timing at 10 workers and above (1.040 at 10, an interval across 1 but wide), so every later comparison judged walls with them off.

7. Modification analysis: asking what if before building

Modification analysis changes one station's demand in the model, or the number of its servers, and recomputes which constraint binds (Harchol-Balter, ch. 7, "Modification Analysis: What-if for Closed Systems"). Jain's operational-laws deck sets the same exercise as homework: make one component twice as fast or twice as slow, and find which becomes the bottleneck. Its lesson is that a faster component need not make a faster system, and that the gain from improving one station depends on the others.

Why improvements must be priced together

Work a block needs from each station (illustrative numbers, not measurements)baselinewall ≈ 100scanner −20%wall ≈ 95workers −20%wall ≈ 100both −20%wall ≈ 80scannerworkersthe wall follows the longer bar, when the stages overlap well
Illustrative numbers, chosen to show the arithmetic, under the approximation that the wall follows the larger stage when stages overlap well.

The four-arm test is that table measured. With the scanner binding, emission's cut cannot reach the wall; with the scanner relieved, it can. The converse also holds: a cut in the scanner's work moves the bottleneck back to the workers, and at 8 workers a 5% cut in the Huffman decode's demand already reaches the workers' limit (journal §61). So improvements are priced in combination, with the worker count retuned after each, and the research target becomes a surface over combinations rather than a list of functions ranked by their share of the profile. A worker-side improvement that is masked today is not worthless: it is a conditional opportunity, and it may also let the decoder reach the same wall with fewer cores. The 2025 course gave a session to the same analysis applied to a real caching system.

8. Load dependence: the month's findings, named

The first approximation treats \(s\) and \(w\) as constants. Real cores share caches, memory bandwidth, execution units and clock frequency, so a service centre's rate can depend on how many jobs are present; Jain's chapter on queueing networks names load-dependent centres among its types. Writing the bound as \(X(k) \le \min\left(1/s(k),\ k/w(k)\right)\) is a reminder that adding a worker raises the pool's nominal capacity and can slow the station that already limits the output.

The measurements show it at every scale. The scanner's work per decode stays near 0.186 s up to 8 workers and rises 23%, to 0.229 s, at 16, and the wall steps up 20% with it (journal §57). Stage 1 measured the same inflation per visit: the Huffman decode costs 84 µs a block at one worker and 105–107 µs at 16 and above, and emission 526 µs at one worker and 816 µs at 14. With the scanner pinned to its own core, putting the workers on the two hardware threads of shared cores rather than on separate cores costs 22% at 4 workers and 48% at 8, a stream of memory traffic running alongside slows the wall by 33% at 8 workers, and a pointer chase by 113%; giving the scanner a quiet core alone takes the wall to 0.960 of the unpinned one (journal §78). These establish the effects of particular placements; they do not decompose every earlier residual.

This is also where the earlier placement work belongs. A design study on 5 November priced four ways to keep the memory-heavy inverse walk from colliding on one core: thread pairs specialised by stage, a token allowing one walk per core at a time, interleaving other work into the walk's stalls, and choosing which ready blocks run together. The first three were modelled, the token in a small discrete-event simulation, and nothing was timed (the study). Its sharpest finding was a shared assumption: every design treated the walk's own footprint as fixed. A kernel that crowds the cache less changes the demand itself rather than arranging its competitors, which is the route the lazy kernel later took.

Of noise that came from the clock

Even the measuring was load-dependent. After a short idle pause the processor drops to a low clock and climbs back slowly: after 0.2 s idle a decode runs at 2.96 GHz and takes 45% longer, and after the standard 1 s pause, 40% of decodes still run low. Spinning every CPU for 100 ms before each timed decode removes the low state and cuts the spread of the log wall from 4.4% to 1.1% (journal §81; #874). That was a repair to the apparatus, not a faster decoder. It leaves a question for users, since a program that decodes after a short pause may meet the slow regime, and whether a decoder should respond is open until more machines are measured.

9. What scheduling can and cannot do

With demands measured, the next question was whether a different order of work, a different queueing discipline, could close the gap to the bound. The operational laws answer part of it before any code is written: no discipline raises the ceiling the demands set, and the decoder already runs at 0.945 to 0.998 of the busiest station's limit at every count, so reordering alone could recover at most about 5%, or 3% on the plateau (journal §57; the discipline lead). That holds only while the demands stay fixed. A policy that improves cache locality or keeps memory-heavy phases apart changes the demands themselves, and the clearest example is the twenty-worker decode, which ran at 0.972 of its bound and still finished 17% sooner with eight workers (the outside reading).

The candidates were size-based scheduling, helpers for the oldest unfinished block, admission by work rather than by count, relaxed resequencing and redundancy; each, with where it comes from and what became of it, is in the companion's table. None was adopted, and only one, a parallel scanner, would raise the ceiling rather than approach it.

Variability is the other reason to keep distributions rather than means. In a single queue with general service times the mean wait grows with the second moment of service time, not only its mean (Harchol-Balter, ch. 23; the companion), so long blocks delay everything behind them. The corpus has two classes of block: 792 of its 1,724 are under 10 kbit and hold 0.1% of the bits, and they are exactly the blocks that skip the main inversion route. Across the mixture the squared coefficient of variation of size is about 0.98; among the real blocks alone it is about 0.07, and their sizes are correlated along the stream (lag-1 \(r = 0.74\)) (journal §§60–61; the opportunities). Which of those numbers matters depends on the question. A paper on the 2025 reading list warns that scheduling policies behave very differently in closed systems than in open ones (Schroeder, Wierman and Harchol-Balter, NSDI 2006), which argues for modelling the admission feedback faithfully, not for declaring scheduling unimportant.

The table's last row is a different kind of change. A discipline moves the decoder closer to a fixed ceiling; a change of topology moves the ceiling.

10. Product form, mean-value analysis and a surrogate

The bottleneck law gives the two asymptotes; near the knee, finite populations and variability round the corner, and a natural next step is a model that computes the curve. The theory has one: product-form networks, from Jackson's open networks through Gordon and Newell's closed ones to the BCMP theorem, which make a network's equilibrium solvable, and Reiser and Lavenberg's mean-value analysis, which computes a closed network's mean queue lengths and throughput by adding one job at a time (the companion, with the papers).

It was tried. One reader computed exact mean-value analysis for a two-station closed surrogate, with a population of \(N = 4k\), a scanner taking 107.9 µs a block and a pool of workers taking 815 µs each, whose rate grows with the blocks present up to \(k\), and no fitted constant (the review):

Workers Surrogate Measured wall
3 0.4683 s 0.4693 s
5 0.2811 s 0.2840 s
7 0.2035 s 0.2069 s
8 0.1887 s 0.1911 s

That is within 1 to 4 ms at every count from 3 to 8, which is better than the hard-max fit and shows the rounded knee is largely what a closed network of this shape produces. Its limits are as clear. It converts a stationary throughput into a file's completion time, so start-up, drain, in-order taking and the byte cap are outside it, and its residual cannot all be called contention. The design reviews listed where the decoder departs from what product form needs: a ceiling rather than a population, a finite stream, in-order taking, contention between workers, a byte cap that gates scanning, and two classes of block (the companion's table).

BCMP itself is broader than its reputation, admitting general service distributions under some disciplines and some load dependence, so none of these is a blanket disqualification; what was never established is a compatible representation of this decoder's particular gates, ordering and contention. Exact mean-value analysis is therefore applied to a documented surrogate, with its error reported as approximation error, and the faithful model is a discrete-event simulation driven by every block's measured trace (journal §§59–60). That simulation has been specified, not built.

From laws to simulation: what each kind of model assumes

Each rung assumes more, or tests more; the measurements decide between themoperational lawsassume nothing about distributions: bounds, and identities a trace must satisfyheld: nine identities in 840 decodesproduct form and MVAassume a network the decoder only resembles: exact means for that networka surrogate within 1–4 ms of the wall at 3–8 workerstrace-driven simulationkeeps the decoder's own rules: the window, the byte cap, in-order takingproposed, not builtinterventionslow, pin or supply one part, and see whether the prediction moves with itstage 2 and the ideal-parts matrix
The status column is the record's: journal §66 for the identities, the course-mining review for the surrogate, journal §§59–60 for the simulation, §§74–88 for the interventions.

11. Testing the explanation by intervention

Accounting says which resources look busy; an intervention asks whether changing one produces the predicted effect. Stage 1 measured the decoder at every count from 1 to 20, with every block's route, stage boundaries and queue transitions logged (journal §66; the report). The limit moves from the workers to the scanner at exactly 8 workers, with a bootstrap interval of [8, 8]; the workers' idle time while the scanner works rises from 0.035 of their time at 8 to 0.551 at 20, while their idle time waiting on input stays under 0.01; and the reader is no co-bottleneck, at 0.017–0.035 ms a block against the scanner's 0.099–0.130.

Stage 2 slowed each activity in turn with a calibrated loop of dependent arithmetic, which adds occupancy without adding memory traffic, so its elasticities describe the response to that intervention rather than an exact scaling of the original code (the decisions). Below the knee the workers' construction and emission controlled the wall; at 8 and 10 only the scanner's Huffman decode did, and with the scanner pinned its intervals narrowed two to four times (journal §§74, 78).

Which activity controls the wall, at 6, 8 and 10 workers

6 workersscanner: Huffman decodeworkers: construction, first passworkers: construction, setupworkers: emission8 workers (scanner pinned)scanner: Huffman decodeworkers: construction, first passworkers: construction, setupworkers: emission10 workers (scanner pinned)scanner: Huffman decodeworkers: construction, first passworkers: construction, setupworkers: emission−101elasticity of the wall, with 95% intervals
Measured: each activity slowed 20% alone; 6 workers from stage 2a (6 blocks), 8 and 10 from stage 2b with the scanner pinned to its own core (16 blocks). Solid where the report finds an activity controls the wall, pale where it doesn't resolve or is negligible. The scanner's Huffman decode is amber, the workers' activities blue. At 10 workers several worker coefficients fall below 0, so slowing them speeds the wall, which the run reads as contention and leaves unexplained in detail.

The sharper test was composition. Composed as a sum of logarithms, the one-at-a-time coefficients predicted an arm kept out of every fit, the Huffman decode and emission both slowed 10%; the first run's wide intervals passed it, and the pinned run's refuted it.

Workers Observed Sum of logarithms Larger coefficient alone
8 1.069 [1.049, 1.090] 1.101, outside 1.079, inside
10 1.063 [1.031, 1.097] 1.034, outside 1.057, inside

A maximum fits, and the surface at 8 workers, both stations slowed together, has a roundness of 0.500 [0.454, 0.548], the value of a sharp maximum. Because the maximum was chosen after the failure, it is registered as the predictor for the next held-out test rather than counted as validated. A second test tried to infer the gain from speeding a part by slowing everything else and rescaling, and its check that the wall scales evenly failed at all four cells. At a crossover the harm from slowing a station cannot be inverted into the gain from speeding it: at 8 workers slowing the scanner costs 0.7 to 1.0 of each unit, but speeding it gains only 0.13 to 0.18, because the workers are close behind and take over at once.

The pulse experiments gave the dynamics. A fluid approximation treats a queue as a reservoir whose level changes at the rate work flows in less the rate it flows out, \(dq/dt = \lambda_{\text{in}} - \mu_{\text{out}}\), bounded below by an empty queue and above by the window; it appears in the theory course's topics, and no fluid model has been fitted to the decoder.

Which side of the queue binds

Slow the scannerslowed: the scanner, +50%in, from the scanner (slowed)out, to the workersbefore4.4 → 0.3 blocksmean queue depth: the workers are starvedrate 0.69 of the undosed run’sSlow emissionslowed: the workers' emission, +50%in, from the scannerout, to the workers (slowed)before3.9 → 8.9 blocksmean queue depth: work piles uprate 0.82 of the undosed run’s
Measured, stage 2a at 8 workers: each pulse slows one activity by 50% over blocks 600 to 800. The tanks show the job queue's mean depth before (dashed) and during (filled); the rate is the rate during the pulse over the undosed run's at the same places. The undosed run's own depth over those places rises from 4.5 to 5.6, so the scanner's drain is the larger departure. Both recover within 2 to 4 ms.

12. What reached the code

The analysis is only as good as what it changes, and the record keeps the outcomes distinct.

What the model said What was done Outcome
The threads requested, the workers built and the kernel chosen are different variables at 5 and 7 requested threads, build the lazy kernel the larger counts already used 0.840 and 0.631 of the wall, with 58% and 63% less memory; merged (#868)
The knee is near 7.5, and the cap of 7 workers sits below it 8 workers from 10 requested threads, measured with the clock warmed 0.929 and 0.932 at 10 and 12 threads, for 2–3% more CPU; merged (#878)
About 15 ms of the scanner's work, 8% of its demand, is two avoidable copies stop re-zeroing symbol buffers, and copy less at the seam between input chunks not adopted at the judged count, faster by about 2% at 10 and 12; open (#846, #857, #861)
The scan is one dependent chain, so fewer lookups a symbol should help three symbols a lookup instead of two lookups fell 12% and time did not; rejected (#870)
A smaller saving inside the same lookup loop count each batch's bits at once about 2% of scanner time locally, unresolved on the whole decode; held (#879)

Two details are instructive. The first readings assumed the Python binding ran 20 workers on this machine; two readers found it built 7, so the live question became 7 against 8, and that is the change that merged (journal §61). And the multi-symbol idea was priced against a baseline that no longer existed: the decoder's table had held up to two symbols an entry since a change merged on 22 November (#745), taking 1.85 symbols a lookup on wikidata, so the third symbol was all that was left to test, and fewer operations of one kind did not lower the total demand (journal §82).

13. Towards an ideal form

The overnight work found useful engineering, but the programme's point was to characterise the decoder's shape with each part treated as a toy problem with ideal behaviour, and to hand that shape to the search for new mathematics (journal §87; the matrix). Three questions need keeping apart. A profile asks where time is spent; a slowing intervention asks which changes hurt completion now; an ideal-part experiment asks how much completion could improve if a computation became cheap, which is what keeps a masked idea visible as a target.

The ideal-parts matrix makes six parts ideal in combination: the Huffman scan (S), emission (E), construction of the inversion's structures (C), the move-to-front and run-length stage (M), the final expansion, checksum and output work (R), and delivery to the caller (D). It ran all 44 arms at 1, 6, 8 and 10 workers, 2,492 decodes in four and a quarter hours, valid in every check, after a first slice of the scanner and emission alone (the full matrix; journal §89; slice A).

The ideal-parts matrix: where the room is, and what masks it

Each part alone ideal, wall over everything real (bold: registered ROOM)1 worker6 workers8 workers10 workersS the scan1.0100.9740.9680.919E emission0.8350.8510.9650.978C construction0.5790.7540.9440.947M MTF and runs0.9250.9160.9760.979R RLE1, CRC, output0.9830.9961.0091.021D delivery1.0110.9890.9920.994The scanner and construction mask each other: each alone, and with the other ideal0.60.70.80.91.06 workers: constructionthe scan0.6050.7818 workers: constructionthe scan0.6610.67910 workers: constructionthe scan0.8250.801alonewith the other part ideal too
Measured: each cell is the wall with that part alone ideal, over everything real, scanner pinned; bold cells are registered ROOM, with the interval's upper bound at or below 0.95, and the full intervals are in the linked report. Below, each part alone (open) and with the other ideal too (filled), as a ratio of the wall it starts from.

Below the knee the room is in the workers. Construction of the inversion's structures, made ideal, leaves 0.58 of the wall at one worker and 0.75 at six; emission leaves 0.83–0.85, and the move-to-front stage about 0.92. At and above the knee the room moves to the scanner, 0.92 at ten workers. The final expansion, checksum and output, and delivery to the caller, have little room of their own.

The largest interaction in the matrix is between the scanner and construction, and it is the four-arm test's masking at full scale. At eight workers construction made ideal saves 6% alone but 34% once the scanner is ideal too, and the scanner the same the other way round; on the log scale the interaction is −0.110 at six workers and −0.071 at eight, a sixth and an eighth of all the variation (the report). By the allocation of variation, construction carries 80% of it at one worker and the scanner 46–53% at eight and ten, and two-part interactions about a fifth from six workers up. For the mathematics that ranks the targets by measured room: construction, then the scan, then emission, with the scan and construction attacked together at the counts that matter.

The matrix cannot say what the decoder could never shed. With every part ideal the wall falls to 0.30 of itself at one worker and 0.72 at ten, but that floor is mostly the oracles' own cost: at one worker the time spent handing over the supplied results, 0.392 s in all, equals the whole all-ideal wall, and from eight workers to ten the all-ideal wall rises, the sign of many threads copying large buffers at once. Measuring the decoder's true residual needs oracles whose handover costs nothing. The same handovers hide part of some rooms: emission's measured room above the knee is small, but net of its handover it is about a quarter, a bound that assumes the handover lies on the critical path rather than a measurement. An ideal part keeps an experimental definition: supplied intermediates bring their own storage and copying, upstream stages still run when only a later one is ideal, and the results measure room within an arrangement, not what any real algorithm will reach.

The outside model asked to predict the matrix before it ran hit 14 of its 28 values, and named the scanner and construction as the largest interaction; most of its misses were the floor, which it predicted without the handover cost.

The design had to be widened before it ran: its registered half fraction of the 64 combinations lacked the arms with a single part ideal, on which room is defined, so the matrix runs 44 arms at each count, the 32 of the fraction for the effects and the 12 odd ones for room, read directly (clarification 8; the companion).

"Ideal form" has three meanings, and the programme needs all three: a tractable model of the decoder, an ideal-part configuration as a counterfactual, and a realisable organisation that meets the output contract and the machine's limits. The third is where the structure itself comes into question.

Where the serial boundary sits

Todayserial Huffman scanscanned blocksparallel inversionin-order outputA questionfind block startsblock queueparallel scanand inversionin-order outputThe second row moves the scan behind the parallel boundary. Whether it pays depends on what findingthe starts costs, what state must be carried across, and how the new demands compete for the same cores.
Schematic. The second row is a question for the search, with its costs unknown.

The fourth reader enumerated the ways the scanner's obligations could be divided between the scanner and the workers and scored each with the two-station law (record 130). Its principle is to keep an obligation on a serial path only if its state has no small summary, and to cut the path wherever the format resets that state. Decoding a single block's codes in parallel is ruled out: the table is chosen afresh every 50 symbols by a running count that nothing in the stream re-synchronises, so each chunk would have to carry at least 50 hypotheses, an obstruction proved from the format with its cost argued. An index of block starts, so that each worker scans its own block, remains the larger structural lead. The same record measured where the workers' time goes on a real block at one worker: construction 45%, emission 38%, the move-to-front stage 10% and the final expansion and checksum 6%, which makes construction, not emission, the largest target for mathematics in the workers.

Two readings give the search its language. Systems biology's question of which structures can perform a given function at all, set out as a five-step programme by Khammash, frames the search for a better decoder as the search for a better network. And the theory of hybrid dynamical systems, the natural continuation of the reservoir picture, says any reorganisation changes one of five things: how fast work runs, where work may proceed, when events may happen, what events do, or what is represented (the companion). Thread pairs, tokens, a parallel scan, a fused stage or a new representation are all instances; the formalism organises the search, and predictions and optimality claims still need their own evidence.

14. How the work is done

The method is written down so that it can be reused (the protocol). It starts from a measured surprise rather than a technique, poses the problem and its referee before any solution, and prefers a model that predicts from little data and is checked on data it did not see. Sources are saved, and several readers and reviewers answer independently before comparing. Every run registers its decision rule before its data. Wrong claims are corrected in place and in public, as the worker count, the closed-network description, the lower bound, the log-additive predictor and the multi-symbol price were here.

15. What runs next

The matrix's map of where mathematics could pay now exists: construction below the knee, the scan above it, and the two together at the counts in between. Two measurements follow from it: oracles whose handover costs nothing, to find the decoder's true floor, and the scanner's copy fixes asked again with the clock warmed. The mathematical search takes the ranked targets from here.

Seen whole, the work moves through three levels. Algorithm analysis asks how much work a computation needs. Queueing theory asks which of that work sets the speed of the whole. The structural question, what organisation of the work could remove it or its dependencies, is where the dynamical systems and the mathematics come in. Queueing theory is the bridge between the first and the third: it says where new mathematics would pay.


Sources: