Part E · Lesson 1

Feedback latency

A readout window closes. Some time later a pulse that depends on its result opens on another qubit. Error correction lives or dies by that interval. This lesson takes it apart, stage by stage, on the eight-transmon ring.

You should know what a batch, a posted write, the lead and the board hub are (lessons A2, B2, B3 and B4). The background chapter on measurement, feedback and decoding explains why the interval matters for fault tolerance.

1Why one interval matters

What is the controller doing between a measurement and the gate that depends on it?

In feed-forward a later operation depends on a result obtained in the same run. Error correction is feed-forward at scale. Every round produces a syndrome, a decoder turns it into a correction, and a logical measurement whose result selects the next gate has to wait for the decoded value. This wait is the reaction time, and it sets how fast a fault-tolerant computer can execute non-Clifford gates (A. G. Fowler, "Time-optimal quantum computation", arXiv:1210.4626, 2012).

The fault-tolerant virtual machine of the companion paper (the FTQVM, lesson E2) does not model this path in detail. It charges a measurement one latency, a decode another, and a frame update a third. Its model of Gidney and Ekerå's RSA-2048 estimate (Quantum 5, 433, 2021), for example, splits that estimate's 10 µs reaction time into a 550 ns measurement and a 9.45 µs decoder latency. Those are declared numbers. This lesson measures what the classical part of that path costs in a model of a real controller, so you can see what a declared latency has to cover.

Scope. Everything below is the classical controller. No quantum state is simulated, the measured bit is an input you choose, and the readout window itself (the 658 ns demodulation of qubit 0) is not counted: the clock starts when the window closes.

2The program and the number

In this section: the run this lesson measures, and the four times read from its trace.

The run is the Bell program of lesson A1: c = measure q[0]; if (c) x q[2]; on the RISC-Q x6y3 build. The bit is measured by qubit 0's core and the conditioned x is played by qubit 2's core. One batch is one cycle of the 500 MHz dspClk, 2 ns. The posted link of this build has two stages.

The function feedbackSamples in riscq/syscalls.mjs reads four moments from the trace, each in ns after the window closes:

MomentTrace frame it readsns
Result at the measuring coreresult on q0.inbox34
Published at the hubpublish on hub70
At every coreboard on each inbox, child of the publish86
Conditioned pulse openspulse on q2.gate344

The test tests/riscq-syscalls.test.mjs asserts these four values. You will read them yourself from a run in the exercises, so they cannot drift from what the simulator does.

Run the program with the bit set to 1. How many ns after qubit 0's demodulation window closes is the result in qubit 0's result register?

The answer function finds the result frame of the measurement and subtracts the window's closing batch: 17 batches of 2 ns. Section 3 explains the 17.

3Stage by stage

In this section: each stage of the path, with the latency parameter of riscq/soc.mjs that sets it and the RISC-Q document that parameter comes from.

readout core hub ↓ hub ↑ q0 arrives at the barrier; release time t0 at 88 ns SYNC_LEAD: 128 batches from the release time to the first start time 034 7086 88344 ns window closes x opens on qubit 2
The feedback path of the Bell program. Times in ns after the window closes, read from the trace. readout: the readout decoder and the report to the core's sink; core: qubit 0's instructions; hub ↓ and hub ↑: the trip to the hub and back. Boxes on the upper rows run in parallel with the lower ones: qubit 0's core arrives at the barrier while its bit is still on the way back from the hub. Schematic drawing, to scale on the time axis.

0 to 34 ns: decoder and report

When the window closes, the readout channel still has to turn the integral into a bit. RISC-Q's ReadoutDecoder.md gives its pipeline as a complex multiply of 6 stages, one more stage, and log₂ 4 = 2 stages for the four ADC samples of a batch: 9 batches. The bit then travels back to the core's sink over the report path of EventLink.md: up to three puts, a merge, the link and the sink, reportUp = 3 + 2 + L + 1 batches for a link of L stages. With L = 2 that is 8. In all 17 batches, 34 ns. The report latency is an assumed worst case of the stages that document lists; RISC-Q gives no single number.

34 to 52 ns: the measuring core

Qubit 0's core has been stalled since before the window opened, in a load of the result register. The result frame wakes it one batch later. It then stores the bit in its RAM, reports it to the host window and issues the publish: a store into the put window that names shared group 0, slot 0. That store leaves 26 batches after the window closed. The core costs one batch per instruction plus a penalty for each load, store and taken branch, an assumed cost model (riscq/soc.mjs model).

52 to 86 ns: through the hub and back

The publish crosses to the board hub: bridge, link, the per-core queue and the arbiter, decode and dispatch, hubDown = 1 + L + 2 + 4 = 9 batches. The hub writes the bit into group 0 and sends the new word to every core: replica and link, core merge, link, inbox, hubUp = 1 + L + 2 + L + 1 = 8 batches. Both follow PutHub.md, which states 23 batches for the round trip at a link depth of 4. At depth 2 it is 17. The bit reaches every core 43 batches after the window closed, 86 ns.

86 to 344 ns: waiting for the next segment

Qubit 2's core cannot simply read its board register and fire. It does not know when the bit has arrived, and its pulse must open on a batch it agreed on with the other cores. The compiler therefore starts a new segment: all three active cores meet at a barrier, and the last arrival releases them with the hub's own time t0. Qubit 0's core arrives last, because it first had to read the result and publish it. Its arrival is dispatched at 88 ns, so t0 is 44 batches after the window closed.

Each core then sets its new time base to t0 + SYNC_LEAD, with SYNC_LEAD = LEAD + 32 = 128 batches (riscq/firmware.mjs). The 96-batch lead is RISC-Q's own software lead (map.py): a write issued that early reaches its channel and every timed queue before its start time. The extra 32 batches cover the delivery of the release to the cores (8 batches here) and the instructions that read it. They are this project's firmware choice. The conditioned x sits at offset 0 of the new segment, so it opens at t0 + 128: 44 + 128 = 172 batches, 344 ns.

The run stopped at the result frame on q0.inbox. Step forward to the publish, the eight board frames, the barrier release and, about 40 steps later, the pulse on q2.gate.

How many ns after the window closes is the measured bit in every core's board register?

The latest board frame whose parent is the publish, minus the window's end. The bit needs 17 batches from the core's store to every board: 9 down to the hub, 8 back.

Which stage of this path is the longest?

  1. The readout decoder and report path.
  2. The trip through the board hub and back.
  3. The schedule lead between the barrier release and the conditioned pulse.
  4. The instructions of the measuring core.
256 of the 344 ns lie between the barrier's release time and the pulse. The bit itself is at every core after 86 ns. The rest is the price of issuing writes ahead and landing them exactly, which lesson B2 explains. A firmware that fired a pre-loaded pulse as soon as the bit arrived would be faster and would give up the exact start time.

Read it from the trace: how many batches separate the barrier's release time t0 (the release frame on the hub) from the batch on which the conditioned pulse opens?

SYNC_LEAD = LEAD + 32: the 96-batch lead plus 32 batches for the release to reach the cores and be read. The answer function subtracts the hub's t0 from the pulse's opening batch.

How many ns after the window closes does the conditioned pulse open?

44 batches to the release time plus 128 of lead: 172 batches, 344 ns. The pulse then needs the DAC pipeline and 1,050 mm of coax before it reaches the qubit, which this measurement does not count.

4What the numbers depend on

In this section: which parameters move which stage, and which ones are assumptions.

Every stage above is a formula in a few build parameters. That is what makes the model useful as a calibration: change the build and you know which part of the path moves.

StageBatchesFormulaBasis
Readout decoder9decoderRISC-Q ReadoutDecoder.md
Report to sink83 + 2 + L + 1Assumed worst case of EventLink.md
Measuring core9instructions × costAssumed core cost model
Core to hub91 + L + 2 + 4RISC-Q PutHub.md
Hub to every core81 + L + 2 + L + 1RISC-Q PutHub.md
Release to pulse128LEAD + 32RISC-Q map.py LEAD, plus this project's margin

The link depth L appears in four places. The hub also adds a wait whenever several messages arrive in the same batch, because it passes one message per batch for the whole board; lesson E4 measures that. In this run three barrier arrivals reach the hub within a few batches, and each waits its turn.

Suppose the posted link had four stages instead of two, as in RISC-Q's default build. How many ns after the window closes would the result reach the measuring core? Use the formulas of the table.

The decoder stays at 9 batches. The report path becomes 3 + 2 + 4 + 1 = 10. 19 batches, 38 ns. The answer function reads the latency parameters of the run (program.model) and replaces the link depth.

5Against published systems

In this section: two measured systems, what their numbers cover, and why they are not the same quantity as the model's.

RISC-Q's own QEC system. Liu, Lee, Xu, Huang and Wu built the controller this model follows into a three-board error-correction system on AMD ZCU216 RFSoC boards, with the Helios union-find decoder in FPGA logic (Liu et al., arXiv:2603.16203, 2026). They report an end-to-end decoding-feedback latency of 446 ns for a distance-3 surface code, from the moment the final syndrome bits are available on the leaf boards to the moment the decoded error information is back and ready for feedback. They break it into 206 ns of syndrome aggregation, 56 ns of decoding and 189 ns of error distribution; about 312 ns of that is two fibre transfers between boards. The measurement used no qubits: the RF outputs were looped back into the readout ADCs.

Google's below-threshold experiment. Acharya et al. ran a distance-5 surface code with a real-time decoder and report an average decoder latency of 63 µs (± 17 µs), up to a million cycles of 1.1 µs, defined as the time between the decoding software receiving the final cycle of syndromes and returning its correction (Acharya et al., "Quantum error correction below the surface code threshold", arXiv:2408.13687, 2024). The decoder is a multi-threaded C++ implementation of sparse blossom matching on a workstation that receives the measurements over Ethernet.

Not the same quantity. The model's 86 ns is one board, no decoder, from window close to every core. Liu et al.'s 446 ns starts after the syndrome bits exist, crosses three boards over fibre and includes a decode. Google's 63 µs is a software decoder alone. Use the model to see the structure of the path and which parameter moves which stage, not to rank systems. Lesson E2 adds a decoder core to the same ring.

One comparison is fair: the order of magnitude. On a single board the controller's share of feedback is tens to hundreds of nanoseconds. A software decoder on a separate computer costs tens of microseconds. That is why the Gidney–Ekerå assumption of a 10 µs reaction time is a statement about the decoder, and why the companion paper finds that a fast classical path from measurement to decoder to frame matters more than more factories.

What to remember

  1. On the x6y3 ring a measured bit is at its own core 34 ns after the window closes and at every core after 86 ns.
  2. A pulse conditioned on it opens at 344 ns: most of that is the lead after the barrier, the price of exact timing.
  3. Each stage is a formula in build parameters: the decoder pipeline, the link depth, the hub, the core's instructions.
  4. The report path and the core cost are assumptions; the decoder and hub latencies come from RISC-Q's documents.
  5. Published feedback numbers measure different intervals. Compare the structure, not the totals.