Exercise 3: An 8-Stage Pipeline, Same Bug Position — Possible Solution ==================================================================== SETUP ------------------------------ Extended the chapter's own 4-stage pipeline (validate_cart -> calculate_subtotal -> apply_tax -> apply_shipping) into 8 stages by running a second identical pass over the first pass's own output, using fresh function names (validate_cart_2, calculate_subtotal_2, apply_tax_2, apply_shipping_2) for stages 5-8. The bug stays exactly where the chapter placed it: stage 3, apply_tax. RESULTS ------------------------------ e2e result: expected $33.73, got $49.28, PASSES: False Found it after inspecting 3 of 8 stages (stage 3): expected 21.6, got 36.0 Stages checked before finding it: 3 - identical to the chapter's own 4-stage result (3 of 4). DID THE NUMBER CHANGE? NO - AND HERE'S WHY ------------------------------ Sequential bisection starts at stage 1 and stops the moment it finds a mismatch. The bug's own position in the pipeline (stage 3) is what determines how many stages get inspected - not the pipeline's total length. Doubling the pipeline to 8 stages added 5 more stages *downstream* of the bug, which bisection never has to reach, because it already found the fault and stopped at stage 3. WHY THIS WORKS AS AN ANSWER ------------------------------ This corrects a natural but wrong assumption: that a longer pipeline automatically means worse fault localization for blind e2e bisection. The real relationship is between bisection cost and the bug's OWN position, not overall pipeline length - a bug near the front of a long pipeline is no harder to find via bisection than the same bug in a short pipeline, while a bug near the END of a long pipeline (not tested here) would make the number of stages checked scale with the pipeline's own length. This is exactly why the chapter's own unit-test finding matters more as systems grow: unit tests are unaffected by a bug's position in the pipeline (always 1 targeted check for the component under test), while blind e2e bisection's cost is only sometimes small - and depends on exactly where the bug happens to sit.