Part E · Lesson 4

Limits: bandwidth, concurrency, depth

A virtual machine that admits a program promises that every shared service stays below its capacity. This lesson finds the capacities of the controller itself: how many bits per microsecond the board can share, how many pulses one core can start at once, how short a pulse train can be, and how deep a link the lead still covers.

Read lessons E1 and E2 first. Lesson B2 explains the lead and the timed queues, lesson B4 the board hub.

1Capacities, not latencies

When does a schedule stop fitting the controller?

Lessons E1 and E2 measured latencies: how long one bit or one decode takes. The fault-tolerant virtual machine of the companion paper also needs capacities. It describes a machine by a qubit capacity and six shared services: gate slots of the control system, ancilla preparation, routing, decoders, factories and classical bandwidth. A call holds a rate r(N, D) = ⌈1000 N / D⌉ on a service for its whole interval, concurrent calls add up, and the sum must stay below the capacity. A request that does not fit waits. The paper shows that this is where finite services turn into runtime: lowering one capacity of its reference machine multiplies the makespan of a feedback workload by 2.1 to 4.8.

The functions in riscq/limits.mjs build small synthetic programs, compile them, run them in the Lean model and report where the modeled RISC-Q build stops keeping the schedule. tests/riscq-limits.test.mjs pins each result. These functions run in Node, not in this page, so the exercises use the quantities that also appear in the runs you can open here, or ask you to apply the formulas the tests confirm.

Two clocks. The hub sweeps run at 500 MHz (2 ns batches) with a 4-stage link, like RISC-Q's default build. The concurrency, pulse-rate and link-depth sweeps run at 100 MHz (10 ns batches). Results are stated in batches; convert with the clock of the build you care about.

2Classical bandwidth of the hub

In this section: how many shared bits per µs one board can move, and what happens beyond that.

Every message between cores goes through the board hub: a published bit, a barrier arrival, a mailbox word. Each core has a queue of eight in front of the hub, and one round-robin arbiter passes one message per batch for the whole board (RISC-Q PutHub.md). Two theorems of the Lean model, nextSource_waiting and nextSource_isSome, state that the arbiter grants only a core that has a message waiting and grants one in every batch in which any core has. A publish carries one bit, so:

hub capacity = 1 bit per batch = clock in MHz bits/µs 500 MHz → 500 bits/µs per board

publishBurst(n) lets n cores publish one bit on the same batch. Alone, a bit reaches every core's board register 23 batches after the store, the number PutHub.md documents for a 4-stage link. With eight cores the arbiter grants them in order c0 to c7, one per batch, and bit k reaches every core after 23 + k batches. Nothing is lost; the last bit waits seven batches.

publishFlood(n, 40) lets each of n cores publish 40 bits back to back. A core needs four batches per publish, so one core offers a quarter of the hub's capacity.

Cores publishingOffered per batchServedDroppedLongest wait
41160 of 16003 batches
51.25196 of 200439 batches
82220 of 32010063 batches

Four cores fill the hub exactly. Beyond that the queues grow, every message waits longer, and once a queue of eight is full a new message is dropped and the model reports a fault. A real system would stall the core instead or lose the bit; either way the schedule no longer holds. The four- and eight-core rows are asserted by the tests; the five-core row comes from the same function.

The repetition round of lesson E2 runs on the x6y3 build. Read its clock from the run (machine.dspPeriodPs). How many shared bits per µs can its hub pass at most?

One bit per batch. A batch is 2,000 ps, so 500 batches per µs: 500 bits/µs for the whole board, whatever the number of cores.

In the companion paper's model of Gidney and Ekerå's machine, one magic-state factory run holds 132,496 bits/µs of classical bandwidth. How many hubs of 500 bits/µs would carry that one factory's traffic?

⌈132,496 / 500⌉ = 265. A one-bit-per-message hub is a controller for a few dozen qubits, not a syndrome network. A machine at that scale needs a different network for syndromes. Liu et al.'s multi-board system, for example, aggregates syndrome bits and moves them between boards over fibre (arXiv:2603.16203).

3Barrier fan-in

In this section: what it costs for n cores to agree on one time.

A barrier is how cores start a segment together. Each core stores its arrival to the hub and stalls until the last arrival releases everyone with the hub's time. Arrivals pass the same arbiter as bits, and PutHub.md adds one rule: an arrival directly behind another for the same barrier waits one more batch. Simultaneous arrivals are therefore counted two batches apart. barrierFanIn(n) confirms it: with eight cores the arrivals are counted 11, 13, 15, … 25 batches after the stores, and every core holds the common time after

23 + 2 · (n − 1) batches 8 cores: 37 batches, 74 ns at 500 MHz

You can see this in the repetition round. When its first segment ends, six cores arrive at the barrier within a few batches, and the hub counts them two apart. The run's summary records the longest wait of any message at the hub in summary.hub.maxWait and the most messages waiting at once in summary.hub.peakWaiting.

The repetition round with both checks fired, at the fifth arrival of the first barrier: qubit 1's core, counted after waiting 8 batches behind four others. Step back to see the earlier arrivals two batches apart.

Run the repetition round with both checks fired. What is the longest any message waited at the hub?

Barrier arrivals behind one another are counted two batches apart. The fifth of a group of simultaneous arrivals waits 2 · 4 = 8 batches. The answer function reads summary.hub.maxWait.

A build has nine cores, eight qubit cores and a decoder, with a 4-stage link. All nine arrive at a barrier on the same batch. After how many batches does every core hold the common time?

23 + 2 · (9 − 1) = 39 batches, 78 ns at 500 MHz. Every segment boundary of lesson E2 pays a cost of this kind, and it grows with the number of cores that must meet.

4Gate concurrency of one core

In this section: why many simultaneous pulses from one core delay the whole segment.

A core issues its timed writes one at a time. When a segment is a plain list of timed writes, the firmware issues it with a loop over a table of four words per write, and the compiler budgets 32 core cycles per write (TABLE_COST in riscq/firmware.mjs). If n pulses must open on the same batch, the first must be issued (n − 1) · 32 batches before the usual lead. The compiler then starts the segment later by that amount, its preroll, for every core, so that all pulses still open on one batch.

preroll(n) = (n − 1) · 32 batches 16 pulses at 100 MHz: 480 batches, 4.8 µs

concurrency(n) confirms the formula for 1, 2, 4, 8 and 16 pulses, and that every pulse still opens on the same batch. The run bundle records the preroll of each segment in preroll. The QCCD example qccd-rotation shows it on a real program: each transport cycle engages 24 electrode channels, issued by three transport cores.

Run qccd-rotation and read its preroll in batches from the bundle. Using the formula above, how many simultaneous writes does its busiest core issue?

The preroll is 224 batches: 224 / 32 + 1 = 8 writes, the 24 channels split over three cores. At 100 MHz that is 2.24 µs before every transport cycle can start, a cost of issuing, not of moving ions.

As a capacity this is a gate-slot limit with a twist. The core can start any number of pulses on one batch, but it pays for the width of the burst in time beforehand. A virtual machine that charges a gate slot only while the gate runs does not see that cost; one that charges a burst of n gates on one core an extra (n − 1) · 32 batches does.

5Pulse rate of one channel

In this section: the shortest pulse a back-to-back train can use, and what the queue depth buys.

A channel's timed queues hold one entry more than the build's queue depth. Each fire is issued one lead, 96 batches, before it starts. shortestTrainPulse(depth) searches for the shortest pulse at which a train of 60 back-to-back pulses on one channel still compiles:

Queue depth14832
Shortest pulse, 60-pulse train48312916
Shortest pulse, 1,000-pulse train48323232

Two limits meet here. The queue must hold every write issued ahead: with depth 1, two entries must cover the 96-batch lead, so a pulse must last at least 48 batches. With deeper queues the core's issue rate takes over: one write per 32 cycles. A deeper queue lets the core run ahead of a train of shorter pulses for a while, so a 60-pulse train of 16-batch pulses fits at depth 32. A train that never ends cannot borrow time forever. The second row is not in the tests; it comes from the same function with a longer train, shortestTrainPulse(depth, 1000), and shows that the sustained limit is the issue cost.

At queue depth 32 a 60-pulse train of 16-batch pulses fits, but a 1,000-pulse train needs 32-batch pulses. Why?

  1. Long trains heat the DAC.
  2. The core issues one timed write per 32 cycles. The queue only buffers a lead the core builds up early; a long enough train uses it up.
  3. The queue depth is reset after 60 entries.
  4. The lead grows with the number of pulses.
A buffer helps with bursts, not with sustained rate. Each write takes the core 32 cycles to issue; pulses shorter than that make the core fall further behind with every pulse, and the queue can only absorb the first few dozen. As a capacity: one channel driven by the table loop sustains at most one pulse per 32 batches.

6Link depth and program memory

In this section: two build parameters that do not show up as a rate but bound what a core can do.

Link depth. A deeper posted link lets a board run at a higher clock or reach farther. In this model it costs the lead twice per stage: the core's copy of the time lags by the link, and the write crosses the link once more. deepestLink() finds that a pulse issued 96 batches ahead still opens on time with up to 13 stages. At 14, the phase, whose queue lead of 35 batches is the longest of the fired parameters, no longer lands on the same batch as the others while the window still opens, and the model reports misaligned parameters. That the core's time lags by exactly the link depth is an assumption: RISC-Q states a constant lag without a number. The Lean theorem land_late states the general rule: a write that misses its margin lands late by exactly the amount it missed.

Program memory. The table loop stores four words per timed write: issue time, start time, register address, data. A core of 16,384 words keeps 320 for its classical bit table and stack, leaving 16,064. In the H2 GHZ program of QCCD Studio, 16 electrode channels on one core need 16,577 words, so the lowering splits them over three transport cores. Memory is not a service of the virtual machine, but it bounds how long a straight-line schedule one core can hold, which is why the FTQVM keeps loops symbolic.

7From limits to a machine declaration

Limit in the modelValueWhat it means for a system call
Hub bandwidth1 bit per batch per boardCapacity of the classical-bandwidth service: 500 bits/µs at 500 MHz
Barrier fan-in23 + 2(n − 1) batchesPart of every latency that crosses a segment boundary; grows with the cores involved
Gate concurrency(n − 1) · 32 batches of prerollA gate-slot cost paid before a burst, not while it runs
Pulse rate48 / 31 / 29 / 16 batches at depth 1 / 4 / 8 / 32, 60 pulsesGate throughput per channel; sustained, one pulse per 32 batches
Link depth13 stages at a lead of 96A build constraint the declared latencies assume
Program memory4 words per timed writeBounds the unrolled schedule per core
Scope. These are limits of the modeled RISC-Q build, under the model's latencies and its assumed core cost. They are not measurements of a board, and they say nothing about gate fidelity or qubit physics. Where a limit depends on an assumption (the core cost, the core's time lag) the text says so.

What to remember

  1. The board hub passes one message per batch: 500 shared bits/µs at 500 MHz. Four publishing cores fill it; eight overflow it.
  2. n cores meet at a barrier in 23 + 2(n − 1) batches at a 4-stage link.
  3. n simultaneous pulses from one core cost (n − 1) · 32 batches of preroll before the segment.
  4. Deeper queues admit shorter pulses in a finite train; a sustained train is bounded by the core's issue cost.
  5. A lead of 96 batches covers at most 13 link stages in this model; a timed write costs four words of program memory.