verify_optimization
Verify an optimized code candidate against the original: checks output equivalence and measures speedup, accepting only if both pass. Rejects incorrect or insufficiently faster code.
Instructions
PROVE an optimisation: same outputs, and measurably faster.
You write the optimised version. This runs both against the same inputs to
confirm they still agree, then TIMES both at increasing sizes and compares.
Accepted only if equivalent AND at least min_speedup faster.
A rejection tells you which gate failed and by how much — "correct but only 1.09x" is the answer an optimiser that fabricates wins cannot give. A candidate that is faster but wrong fails the first gate, and its speed is never measured, because a faster wrong answer is not an optimisation.
An accepted result is graded cross_checked (see grade_basis for the
runtime and the measured speedup). A rejection — wrong OR merely not
faster enough — is graded ungraded: correctness alone does not earn a
grade for the optimisation claim this tool exists to answer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sizes | No | ||
| language | Yes | ||
| original | Yes | ||
| candidate | Yes | ||
| min_speedup | No | ||
| test_inputs | No |