interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / bench

02ee45c bench: MultiPL-E adapter for Omega (OM-2) (#1) aien-spark committed 2026-10-30
..
multipl-e/
prompts/
results/
solutions/
upstream/
.gitattributes23
.gitignore13
DEPENDENCIES.md1844
README.md8803
check.sh4442
score.py3963
stub_model.py3866

README.md

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.

  • main returns K+1 for the first failing case K. A translation holds at most 98 cases, so this is 1..98.
  • When every case holds, main writes the line MultiPL-E Omega: all tests passed and returns 0. The evaluator requires exit 0 and that final line. A completion that ends the process early with status 0 is therefore not a pass.
  • A trap exits 100 + code.
  • Floats compare with exact eq, as MultiPL-E's Python tests compare with ==.

Refusals

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

  • Types: List[str], List[bool] (omc has no bool arrays), nested or compound lists, mixed tuples, Optional, Union, Dict, Set, Any, and unannotated or None results.
  • Values: a non-ASCII string, an int outside i64, or a non-finite float.
  • ABI: more than 6 argument slots.
  • Tests: more than 98 cases, or a test that calls something other than the candidate.

Renaming

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

  • is a keyword;
  • collides with a harness name;
  • is a parameter longer than omc's 8-character local limit;
  • is a function name longer than 8 characters whose first 8 bytes spell an 8-letter keyword, such as truncate_number. Function names in this case get their first letter capitalised.

Coverage (MEASURED, prompts/COVERAGE.md)

  • HumanEval: 129 of 164 translate. MultiPL-E's originals already drop 3 of the 164 (HumanEval_32, _38 and _50). Of its 161, the translator refuses 32: List[str] 17, compound list 4, Optional 3, Union 3, mixed tuple 3, Dict 2.
  • MBPP (mbpp-typed): 272 of 400 translate; 128 are refused. The largest reasons are compound list 67, List[str] 22, mixed tuple 11 and Dict 10.

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:

  • OMEGA_OMC: the omc path (required).
  • OMEGA_OMC_SHA256: the pin. It defaults to omega.ref's; on a mismatch the evaluator raises and records nothing.
  • OMEGA_EVAL_TIMEOUT: seconds per program (default 15).
  • OMEGA_EVAL_WRAP: an optional command prefix, for example nice -n 19 taskset -c 10-14.

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:

  • List[float] → bool
  • float → float
  • List[int] → bool
  • List[int] → List[int] (twice)
  • int → int
  • str → int
  • str → str
  • str → bool

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)

  • Keyword-prefix function names. omc looks a function name up in the keyword table by its first 8 bytes. A longer name that starts with an 8-letter keyword, such as truncate_number, is refused with error 16 (omc.om fn kw caller near line 6681). The translator renames such names.
  • Empty text passed to a view. An empty text "" passed to an unsized view parameter gives the callee a stale register as its length. omc.om arrarg takes nm_len 0 to mean an unsized parameter. The result was a garbage len, and a segfault when the callee indexed the view. The translator passes "" as part a 0 0 instead.

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