AxArgmin_execute_code
Execute Python code in a sandboxed environment with numerical libraries, return exported results, and include verification certificates and diagnostics for solver outputs.
Instructions
Execute Python code in a sandboxed environment with numpy, math, and the ax_core.argmin numerical library available. Code must call export(name, value) at least once to return results. Typically used to run code produced by the generate_code tool, but also accepts hand-written or modified code.
success reports only that the code ran. The Verification: line leading the response is the verdict on whether the answers are solved; read it first. The response also carries the exports and, from a backend that supports it, a verification payload holding the certificate and diagnosis of every exported solver result — both as structured content and as a JSON text block.
Reading verification for the detail behind the verdict line:
_summary.all_passedis an input to that line, not a substitute for it. The line reports a pass only when the summary's four counts are all present, readable and adding up, at least one solve was counted, none was counted as failed or unverified, AND the per-export entries show a successfulsolver_successbehind every solve counted. So a payload claiming a pass over nothing checked, beside a non-zeron_failed/n_unknown, with counts that cannot be read, or on certificates alone is reported as unverified. Where the two disagree, the line wins.a certificate is not a solver verdict. An export carrying a bare certificate — the multistart idiom
export('best_certificate', best['certificate'])— getsVerification: certificate only: the certificate passed at the point returned, but a failed solve's certificate can pass there too, so nothing says the solve converged. Export the result object, or the whole record{'success': ..., 'status': ..., 'certificate': ...}, to get the verdict as well._warningsnames what did not check out, and by how much, per export. It may also carry an advisory that does not bear on the verdict — an export name colliding with a reserved key, say — so a warning is not by itself a failure.each per-export entry carries the
certificate(the KKT / residual / integration-accuracy check re-evaluated at the point actually returned) and, on failure, adiagnosiswhosekindnames the failure class and whosesuggestionsays what to change. Pass those on rather than only that it failed.to get a certificate back at all, the code only has to export the result object itself (
export('result', result)); the certificate and diagnosis travel with it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code to execute. Must call export(name, value) to return results. |