Between a trusted commit

PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Research software practice, verification and validation · Research software practice, verification and validation

Scientific Computing for Physicists, Ch A repository others can build on: collaboration, history and workflows

Problem

Between a trusted commit c0c_0, where the orbit integrator's seeded energy-drift test passes, and the current commit c64c_{64}, where it fails, lie the commits c1,…,c64c_1,\dots,c_{64} on a single line of history. Unknown to the group, c10c_{10} introduced a fault in the half-step velocity update, c30c_{30} repaired it, and c50c_{50} put it back. The test therefore fails on c10c_{10} to c29c_{29} and on c50c_{50} to c64c_{64}, and passes on every other commit. The group runs bisection search with c0c_0 marked good and c64c_{64} marked bad, always testing cmc_m with m=⌊(g+b)/2⌋m=\lfloor(g+b)/2\rfloor, where cgc_g is the current good end and cbc_b the current bad end. ((a)) List the commits tested, in order, with each verdict. State how many runs the search takes and which commit it names as the first bad one. ((b)) The named commit fails and its parent passes, exactly as the search promises. Explain why it is nonetheless not the commit that first introduced the fault, and name the assumption of the chapter's key result that this history breaks. ((c)) Reading the named commit's diff shows that it undoes the change made in c30c_{30}, whose message reads "repair half-step update". Use this to choose a new bad end for a second search from c0c_0. Give the most runs that search can need, and the commit it names.

Browse the problem library