# extrap2520.py -- traversal-fraction extrapolation from wang_prog/wang_prog4 progress lines. # Measured structure (prog17.err, prog17d4.err): a depth-k loop prints p_k - 1 lines (its own skip line is instant) and # skipped residues do not recurse, so the number of depth-D lines in a full run is prod_{k len(dd): continue est = dd[k - 1] * cells_total / k s = f" after {k:6d} cells ({100*k/cells_total:7.3f}% of all): elapsed {dd[k-1]:8.1f} s -> estimate {est/3600:10.2f} h" if total_wall: s += f" (actual {total_wall/3600:.3f} h, ratio {est/total_wall:.2f})" print(s) return cells_total, len(dd), dd[-1] if __name__ == '__main__': import os runs = [ ('prog17.err', 'n=17 target 1079 (> a(17)=965, refutation regime), depth<=2 binary', (2,)), ('prog17d4.err', 'n=17 target 1079 (refutation regime), depth<=4 binary', (2, 3, 4)), ('prog18d4.err', 'n=18 target 1283 (> a(18)=1079, refutation regime)', (4,)), ('prog18x.err', 'n=18 target 1079 = a(18) (attainable regime), 600 s cap', (4,)), ('prog19x.err', 'n=19 target 1283 = a(19) (attainable regime; full run 3227 s wall in ties19), 720 s cap', (4,)), ('prog25.err', 'n=25 target 2454, depth<=2 binary, 1500 s cap', (2,)), ('prog25d4.err', 'n=25 target 2454, depth<=4 binary, 1200 s cap', (4,)), ] for fn, label, Ds in runs: if not os.path.exists(fn): print(label, ': file missing'); continue w = wall(fn) print('==', label, '| wall', w, '| exit', [l.strip() for l in open(fn) if l.startswith('exit=')]) for D in Ds: analyse(fn, label.split(' (')[0], D, w if w else (3227.0 if fn == 'prog19x.err' else None))