Load `dense.json.partial`-style file. Return (results, timing_accum) or None.
(partial_path, signature)
| 354 | |
| 355 | |
| 356 | def _load_partial(partial_path, signature): |
| 357 | """Load `dense.json.partial`-style file. Return (results, timing_accum) or None.""" |
| 358 | if not os.path.isfile(partial_path): |
| 359 | return None |
| 360 | try: |
| 361 | with open(partial_path, 'r') as f: |
| 362 | data = json.load(f) |
| 363 | except Exception as e: |
| 364 | print(f"[resume] failed to read {partial_path}: {e}; ignoring partial.") |
| 365 | return None |
| 366 | if data.get("signature") != signature: |
| 367 | print(f"[resume] signature mismatch in {partial_path}; ignoring partial " |
| 368 | f"(re-running from scratch).") |
| 369 | return None |
| 370 | results = data.get("all_results") or [] |
| 371 | timing_accum = data.get("timing_accum") or {} |
| 372 | return results, timing_accum |
| 373 | |
| 374 | |
| 375 | def _save_partial(partial_path, signature, all_results, timing_accum): |