← Advanced course and all videos

Video 19 of 53 · 4:26 · Execution, sharing and reuse

Choosing materialization boundaries

In this video

  1. 0:00 · Introduction
  2. 0:15 · Choose where a result becomes stored data
  3. 1:10 · Core explanation
  4. 2:19 · A restricted output must include every remaining case
  5. 3:21 · A smaller answer can still be a complete answer
  6. 4:16 · Direct takeaways

Caption transcript

Show transcript
This overview explains how hybrid and partial-hybrid strategies choose which graph regions to materialize. The chosen boundary changes work and representation, while a reduced result may still need alignment for a dense request. Consider a graph with two inner branches and an exclusive-or root. A full four-input vector has sixteen outputs. A materialization boundary marks where a computed value becomes stored data for later consumers, rather than remaining a pending operation. One strategy stores both branch vectors and then combines them. It makes each intermediate available for reuse, but also requires their construction and storage. If neither has another consumer, some of that storage may not provide a benefit. A hybrid strategy can retain a useful shared branch while evaluating another branch on demand. It must still produce every output required by the caller. Selecting internal boundaries is not permission to omit inconvenient assignments from a full-vector request. Hybrid strategies can place a materialization boundary around a region. Partial-hybrid strategies preserve upper structure while dispatching selected children. Follow the actual selected mode rather than treating every hybrid label as the same algorithm. In S AND C AND D, OR S AND E, let S be A AND B. The left boundary encloses the whole eligible subtree. The right boundary encloses only the selected child. The parent and other child remain visible in the second diagram. At 11011 both paths must produce one. Compare all assignments before interpreting a structural difference. No-reinflation is an output contract too. A reduced packed result with live-variable metadata is different from a fully broadcast ambient matrix. Current APIs expose admission and representation diagnostics; ask for dense output explicitly when that is the deliverable. Return to the four-input rule F equals A and B, exclusive-or C or D. The intervening five-input rule is a separate example; E is not part of this four-input rule. Fix C and D to zero. A and B remain free, so this is a restriction, not a complete assignment. After fixing C and D to zero, enumerate both possibilities for A and both for B. The first three assignments return zero and the last returns one. Omitting the last case would produce an incomplete result, even though only four outputs rather than sixteen are required. The restriction fixes C and D, while A and B remain free. Deliver all four remaining outputs: zero, zero, zero, one. This smaller task is complete because every assignment in its declared remaining universe is included; it is not sampling. Suppose the caller explicitly fixes C and D to zero and asks for the remaining function over A and B. The required universe now has four assignments. This is a smaller, declared task, not an incomplete attempt at the original sixteen-output task. The second branch becomes zero, so the final function is A and B. Its four outputs in zero-first order are zero zero zero one. All requested assignments are covered, even though the result is smaller than the unrestricted vector. Keep these two output contracts separate in the comparison. A selective materialization strategy is exact when it returns everything promised by its own contract. Whether it is faster still depends on the chosen boundaries, reuse, and delivery costs. Follow the actual selected mode and output representation. Charge alignment and broadcast whenever the caller requires the full layout.