interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / bench / README.md

191 lines · 8803 bytes Raw Blame History Source

MultiPL-E for Omega

bench/ adapts MultiPL-E (pinned at 3025a531af7450e7df8b96fe0440e9804480bbad) to Omega's OM-2 profile. It turns the HumanEval and MBPP problems into Omega prompts plus test programs and grades completions with the pinned omc (omega.ref).

Status: IMPLEMENTED, and EXERCISED on a Linux AArch64 host (the DGX Spark's Grace cores) with the stub model below. No language model has been evaluated yet, so no model pass@k exists.

Not first-party Omega

All Python here (multipl-e/*.py, stub_model.py, score.py) is a foreign-harness adapter. MultiPL-E loads translators as Python classes (dataset_builder/humaneval_to_<ext>.py) and evaluators as Python modules (evaluation/src/eval_<ext>.py), so its plugin API can only be met in Python. None of this code is first-party Omega. It sits outside every Omega product path: nothing in omc, the seed or any shipped .om program depends on it. The programs it writes are plain OM-2 compiled by the unmodified pinned omc. DEPENDENCIES.md lists what it needs.

Layout

pathwhat
multipl-e/humaneval_to_om.pyThe MultiPL-E Translator for Omega (.om).
multipl-e/eval_om.pyThe MultiPL-E evaluator. eval_script(path) returns the MultiPL-E result dict.
multipl-e/build_prompts.pyRuns the translator through the pinned MultiPL-E generic_translator. It writes prompts/.
prompts/{humaneval,mbpp}-om.jsonlThe translated problems (name, language, prompt, tests, stop_tokens, …).
prompts/*.coverage.json, prompts/COVERAGE.mdEach problem's translation result, with a reason for every refusal.
solutions/HumanEval_<n>.omTen hand-written completions: function bodies up to and including end.
stub_model.pyWrites MultiPL-E completion files without a model.
score.pyEvaluates completion files and writes <name>.results.json and summary.json (pass@k).
check.shThe gates.
results/<mode>/The completions, results and summary from the last check.sh run.
upstream/A prepared contribution to nuprl/MultiPL-E. It is not submitted.

Translation

Each problem becomes:

om2
note <docstring, MultiPL-E "reworded" terminology, doctests in Omega call syntax>
note <interface notes: renamed names, the result-array convention>
fn NAME PARAM TYPE ... to TYPE
<completion: the body and its closing end>
<tests>
PythonOmega
intlong
floatf64
boolbool
List[int] / List[float]view long * / view f64 *
strview uchar * (bytes; a non-ASCII test string is refused)
Tuple[int, int], Tuple[float, float] (homogeneous)view long * / view f64 *
list, string or tuple resultan extra last parameter res edit T *; the function returns the element count as long

The tests become one fn tc_K to bool per assertion, then fn main.

Refusals

The translator refuses a problem when OM-2 or the harness can't express it faithfully. MultiPL-E then skips that problem.

Renaming

The translator renames a name and adds a note Omega name: X is Y here. line when the name:

Coverage (MEASURED, prompts/COVERAGE.md)

Running

# prompts (needs a MultiPL-E clone at the pin; plain python3, no extra modules)
python3 bench/multipl-e/build_prompts.py --multipl-e ../MultiPL-E

# completions -> results -> pass@1
python3 bench/stub_model.py hand /tmp/run
OMEGA_OMC=/path/to/omc python3 bench/score.py /tmp/run

# all gates
sh bench/check.sh --omc /path/to/omc [--multipl-e ../MultiPL-E]

eval_om.py reads these settings from the environment:

omc writes static AArch64 Linux executables, so evaluation needs an AArch64 Linux host. An x86-64 host would need qemu-user, which is NOT_RUN.

Outcome mapping:

outcomeom_statusMultiPL-E status
omc exits nonzero or writes to stderr; the output is never runcompile_errorSyntaxError
exit 0 and the final pass linepassOK
exit 1..98wrong_answer, om_case = exit − 1Exception
exit 100..199trap, om_case = trap codeException
exit 0 without the pass lineno_pass_lineException
any other exit or a signalexit_otherException
over the time limit (the process group is killed)timeoutTimeout

Gates (check.sh)

Each gate has a negative control that must be observed failing:

gatepasses whennegative control
constantseval_om's pin equals omega.ref, and both files use the same pass linea mismatch fails it
prompts-rebuildrebuilding the prompts reproduces the committed filesa translator change fails it
stub-sweep-{humaneval,mbpp}every translated problem compiles with the stub body trap 14 and exits 114 in its first casea broken test harness fails to compile or exits otherwise
mode-handthe 10 hand solutions all reach passa deliberately broken solution is classified wrong_answer
mode-wrongconstant answers are all wrong_answer—
mode-invalidnon-Omega text is always compile_error—
mode-traptrap 5 is classified trap with case 5—
mode-timeouta loop of about 2^72 steps is a timeout at 2 s—
pin-refusaleval_om refuses to evaluate when the omc hash is not the pin—
no-pass-lineexit 0 without the pass line is not a pass—

The wrong, invalid, trap and timeout modes are themselves the negative controls for mode-hand. A grader that passed everything would fail them.

The 10 hand solutions are HumanEval 0, 2, 3, 9, 13, 16, 27, 30, 48 and 53. They cover these signatures:

In the last run, pass@1 was 1.0 for hand and 0.0 for every other mode (results/*/summary.json). With one completion per problem, pass@1 is c/n. The values were checked with Wolfram (see the PR text in upstream/).

omc defects worked around (pin e5b32567)

Both are reported to the omega-mv omc owner. The pin is unchanged.