bi-11 step 01 — Ordering and priority, predicted then measured

Goal

Break the single-FIFO mental model with your own measurements.

Tasks

  1. Prerequisite check: fe-01 complete. If not, stop and do it first.
  2. Post work via setTimeout(0), MessageChannel, and scheduler.postTask at several priorities. Register a click handler. Predict the execution order in writing.
  3. Run under synthetic main-thread load. Record actual order and input delay.
  4. Demonstrate that a setTimeout registered before a click can run after it. Explain via task sources and priority.
  5. Measure the setTimeout clamp: nest timers past depth 5 and confirm the ~4 ms floor. Compute the resulting chunks-per-second ceiling.

Done when

  • Predicted vs actual ordering table
  • Timer-after-click demonstrated
  • Clamp measured and its throughput ceiling computed