MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / _save_results

Function _save_results

kernelbench/bench_kb.py:700–722  ·  view source on GitHub ↗

Append results to workspace/kb_active/results.json.

(uid, correctness, stability, determinism, perf, vram, meta)

Source from the content-addressed store, hash-verified

698
699
700def _save_results(uid, correctness, stability, determinism, perf, vram, meta):
701 """Append results to workspace/kb_active/results.json."""
702 results_path = KB_ACTIVE_DIR / "results.json"
703 entry = {
704 "timestamp": time.strftime("%Y-%m-%d %H:%M:%S"),
705 "uid": uid,
706 "correctness": correctness.get("correctness", "FAIL"),
707 "speedup": perf.get("speedup", 0.0),
708 "kernel_time_ms": perf.get("kernel_time_ms", 0.0),
709 "reference_time_ms": perf.get("reference_time_ms", 0.0),
710 "worst_max_abs_error": correctness.get("worst_max_abs_error", 0.0),
711 "stability": stability.get("stability", "SKIP"),
712 "determinism": determinism.get("determinism", "SKIP"),
713 "peak_vram_mb": vram.get("peak_mb", 0.0),
714 }
715 history = []
716 if results_path.exists():
717 try:
718 history = json.loads(results_path.read_text(encoding="utf-8"))
719 except json.JSONDecodeError:
720 history = []
721 history.append(entry)
722 results_path.write_text(json.dumps(history, indent=2), encoding="utf-8")
723
724
725if __name__ == "__main__":

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected