interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / om / q38-head / mutants.py

31 lines · 1657 bytes Raw Blame History
1#!/usr/bin/env python3
2# SPDX-License-Identifier: Apache-2.0
3"""External wrong-program controls; each changed Omega unit must fail the oracle."""
4import json
5import os
6from pathlib import Path
7import subprocess
8import sys
9
10src=Path(__file__).with_name('select.om').read_text()
11out=Path(sys.argv[1]); out.mkdir(parents=True,exist_ok=True)
12cases={
13 'truncated_norm': ('for i ulong 5120', 'for i ulong 2048'),
14 'strict_threshold': ('take = ge upper', 'take = gt upper'),
15 'zero_bound': ('ret up mul f64 coef hn', 'ret 0.0'),
16 'negative_coefficient': ('if lt v 0.0\ntrap 5\nend', 'note missing negative coefficient refusal'),
17 'no_outward_rounding': ('bits = bitcast ulong x', 'ret x\nend\nfn unused x f64 to f64\nbits = bitcast ulong x'),
18}
19results=[]
20for name,(old,new) in cases.items():
21 assert src.count(old)==1,(name,'mutation not unique')
22 p=out/name; p.mkdir(exist_ok=True)
23 unit=p/'select.om'; unit.write_text(src.replace(old,new))
24 with (p/'build.log').open('w') as f:
25 build=subprocess.run(['sh',str(Path(os.environ['OMEGA_BRIDGE'])/'tools/native'),str(p/'native'),str(unit)],stdout=f,stderr=subprocess.STDOUT)
26 assert build.returncode==0,(name,'compile failure is not a caught behavioral mutant')
27 with (p/'check.log').open('w') as f:
28 check=subprocess.run([sys.executable,str(Path(__file__).with_name('check.py')),str(p/'native/libomega_native.so')],stdout=f,stderr=subprocess.STDOUT)
29 assert check.returncode!=0,(name,'mutant survived')
30 results.append({'mutant':name,'build_exit':build.returncode,'check_exit':check.returncode})
31print(json.dumps({'status':'PASS','controls':results},indent=2))