fw-04 step 01 — Derive the work loop

Goal

Reach a Fiber-shaped structure by needing it. Each step should feel forced by the previous one. Do not read React first.

Tasks

  1. Feel the problem. Render 10,000 nodes with your fw-02 recursive renderer. Measure the task length; compare with the 16.7 ms budget from bi-10. Observe the dropped frames.
  2. Try to yield. Attempt to pause halfway through the recursive render and resume later. Discover you cannot — write down precisely which state you would need and where it lives.
  3. Make the stack explicit. Nodes with child / sibling / return pointers, walked with a loop. Note that return is a parent pointer a recursive traversal never needs.
  4. Now yield. Loop while work remains and time remains; otherwise schedule a continuation. Choose your primitive using bi-11 — and justify why not microtasks.
  5. Get spec stage 9 green: a 60 ms render with a 5 ms slice must span multiple continuations.

Done when

  • The failed pause attempt documented, with the reason stated precisely
  • Explicit work loop replacing recursion
  • Stage 9 green, with a justified yield primitive