core22 min studyLesson 107 in Engineering

Out-of-order execution: readiness before source order

Trace dependency graphs, register renaming, and finite scheduling windows without confusing completion with commitment.

On this page

What you’ll understand

  • Identify which operations can execute before an older stalled operation.
  • Distinguish true data dependencies from removable register-name dependencies.
  • Explain why more independent work helps only within finite hardware resources.

Program order is the order in which instructions appear along the chosen path. An out-of-order processor can execute some younger instructions before older ones when their operands and resources are ready, while preserving the required architectural behavior. This opportunity is bounded by dependency chains and finite internal capacity. The goal is to see exactly which work is independent, not to imagine that hardware can arbitrarily reorder a program into a faster algorithm.

A dependency graph exposes legal overlap

If instruction B reads the result of instruction A, B cannot compute the correct value before A produces it. This read-after-write edge is a true dependency. An independent instruction C may execute while A waits for a load, provided C is available to the scheduler and its own resources are ready. Draw values as edges and operations as nodes. Source-code line order alone can hide this parallelism, especially after a compiler transforms loops or introduces extra address arithmetic.

A critical path is a chain whose successive dependent latencies cannot overlap with one another. Independent work can fill otherwise unused execution capacity but cannot shorten that chain without changing the computation. If four dependent operations each require three cycles before their outputs can be used, their chain needs at least twelve cycles under that latency assumption. Four independent operations might overlap substantially, but their throughput still depends on available execution resources. State both dependency and capacity assumptions before comparing the two.

Tcycles≥max⁡p∈P∑i∈pℓiT_{\rm cycles}\geq\max_{p\in\mathcal P}\sum_{i\in p}\ell_i
P is the set of dependency paths and ℓ_i is the assumed producer-to-consumer latency in cycles for operation i. This critical-path lower bound omits finite issue capacity, memory delays, and other resource restrictions.↔ Scroll wide equations horizontally.

Renaming removes names, not missing values

Architectural registers are a limited set of visible names. Two instructions that both write a name need not represent the same internal storage location. Register renaming assigns distinct physical destinations to different versions, allowing a later independent write to execute without overwriting a value that an older instruction still needs. This can remove write-after-write and write-after-read name dependencies. It does not remove a read-after-write dependency when a consumer genuinely needs the value produced by a particular instruction.

Imagine an older instruction reading the old value of R1 while a younger independent instruction writes a new R1. Distinct physical versions let both needs coexist. The rename mapping tracks which version each read should use, rather than letting the younger write destroy the older input. Physical registers, scheduling entries, load/store structures, and reorder capacity are finite. A long wait can fill those structures and stop additional useful work from entering, so an unlimited-window schedule is only an upper-bound thought experiment.

Tcycles≥⌈Uw⌉T_{\rm cycles}\geq\left\lceil\frac{U}{w}\right\rceil
U counts internal operations and w is an assumed maximum operations issued per cycle into a particular modeled capacity. The bound is dimensionless cycles and must use the matching internal-operation definition, not substitute architectural instructions without justification.↔ Scroll wide equations horizontally.

Memory and speculation add constraints

Loads and stores need more than register readiness. Their addresses may not yet be known, and a younger load could refer to data written by an older store. Implementations can predict or check dependencies and recover when speculation was wrong, but must satisfy the architecture’s memory rules. This does not grant a language-level data race defined behavior. Likewise, an executed wrong-path operation may have microarchitectural effects even though it never becomes a committed instruction result; architectural recovery is not a claim of side-channel invisibility.

The network lab makes a single computation graph inspectable: a multiply and offset feed a sigmoid. Change x or w, and predict which downstream quantities change. It does not animate instruction scheduling, register renaming, or speculative memory. Its useful lesson is that outputs depend on specific inputs. Draw a separate dependency graph for the worked schedule and ask which missing input blocks a node. That reasoning supports realistic experiments such as using multiple independent accumulators, with care about changed floating-point evaluation order.

Hide one long wait with independent work

A teaching scheduler sees an older load that produces A at cycle 8. One ADD consumes A with one-cycle latency. A separate chain contains three one-cycle operations with ready initial inputs. Assume one suitable operation can issue per cycle and the load is already outstanding.

  1. The dependent ADD cannot issue before A is ready at cycle 8, regardless of how early it was decoded. Its result is ready at cycle 9 under the one-cycle latency assumption.

  2. The independent chain can issue at cycles 0, 1, and 2, making its final value ready at cycle 3. It need not wait until the older load returns if the scheduler can see it and resources are available.

  3. All required values are therefore ready at cycle 9 in this simplified schedule. Issuing the independent chain only after the load and its ADD would leave useful capacity idle and complete later; real limits may prevent achieving the ideal overlap.

The result

Readiness allows independent work to overlap the load wait. It does not let the ADD that needs A run before A exists.

Explore the model

Interactive lab

Interactive lab · network

Follow dependencies in one computation graph

Adjust input x and weight w for σ(wx−0.5). Predict how the multiplication and output respond. The graph illustrates data dependence only; it is not an out-of-order scheduler, renaming model, or full neural network.

Follow dependencies in one computation graphOne inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Current readings: Product · wx: 1.2; Logit · wx − 0.5: 0.7; Sigmoid output: 0.6682. All parameters are adjustable with the labeled controls below.One input. One weight. One sigmoid.x1.20× w1.20+ b0.70σ0.668output0.668w = 1.00b = −0.50σ(z) = 1 / (1 + exp(−z))
Computation graphSignal trace
Product · wx
1.2
Logit · wx − 0.5
0.7
Sigmoid output
0.6682
t = 0 s

One inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA consumer waits for its actual input; unrelated work needs separate evidence of readiness and resources.

Check your understanding

Which dependency can register renaming remove without changing the actual computation?

Try it yourself

Three dependent multiplies each have four-cycle producer-to-consumer latency. Two unrelated one-cycle adds are also available. What is the chain’s lower bound, and can the adds lower it?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Separate useful overlapping work from the length of the dependent chain.

Compare with the solution

The multiply path is at least 3×4=12 cycles under the assumed latency model. The independent adds may execute during that interval if resources allow, improving total utilization, but they do not shorten the multiply dependency path. Actual completion can exceed the bound because of other limits.

Take it with you

  • Out-of-order execution exploits readiness within a finite window.
  • Renaming removes false name conflicts, not true data dependencies.
  • Critical-path and resource bounds describe different limits on overlap.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.