02-apply-optimization-measure-improvement produced raw benchmark numbers for ONE optimization attempt. A real capstone submission needs to turn that into an honest, structured verdict, and, crucially, needs a rule for what actually counts as a PASSING submission when comparing several candidate optimizations: a big speedup on broken code, or a correct-but-slower result, must never be treated as a win.
Implement build_capstone_report (turning one optimization's raw stats into a structured pass/fail verdict) and compare_capstone_reports (picking the best PASSING submission out of several).
build_capstone_report(project_name, baseline_stats, optimized_stats, correctness_verified) computes speedup_factor = baseline_stats["median"] / optimized_stats["median"], and passed = correctness_verified and speedup_factor > 1.0."project_name", "speedup_factor", "correctness_verified", "passed", and a one-line "summary" string mentioning the project name.compare_capstone_reports(reports) returns the highest-speedup_factor report AMONG ONLY the ones with passed=True; if none pass, returns {"best_project": None, "best_speedup_factor": None, "num_passing": 0}.Open one at a time. Each gives away a little more than the last.
passed requires BOTH conditions at once (correctness_verified AND speedup_factor > 1.0): a correct-but-not-actually-faster submission fails just as much as an incorrect-but-fast one does.
compare_capstone_reports should FILTER to passed=True reports first, THEN find the max by speedup_factor among only those survivors: never compare a failing report's speedup against a passing one's.
No results yet
Run your code to check it against the examples, or submit to run every test.