Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/om/graph/headscale-mutants.py # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / om / graph / headscale-mutants.py` 26 lines · 1726 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 import os, pathlib, subprocess, tempfile 3 root=pathlib.Path(__file__).resolve().parents[2] 4 source=(root/'om/graph/headscale.om').read_text() 5 cc=os.environ.get('CC','cc') 6 bridge=pathlib.Path(os.environ['OMEGA_BRIDGE']) 7 env=dict(os.environ,OMEGA_SEEDED_OMC=os.environ['OMEGA_OMC']) 8 test=root/'tests/test_graph_headscale.c' 9 mutants=[('identity','`528482304`','`1065353216`'),('zero','`528482304`','0'),('negative','`528482304`','`2675965952`'),('half','`528482304`','`520093696`'),('skip','len x','0'),('add','mul get x i','add get x i')] 10 with tempfile.TemporaryDirectory() as td: 11 d=pathlib.Path(td) 12 subprocess.run([cc,'-O2','-ffp-contract=off','-I'+str(root/'src'),str(test),str(root/'src/cudapp_om_graph_headscale.c'),'-o',str(d/'green')],check=True) 13 subprocess.run([str(d/'green')],check=True) 14 p=subprocess.run([cc,'-I'+str(root/'src'),str(test),'-o',str(d/'missing')],capture_output=True) 15 if p.returncode==0: raise SystemExit('FAIL strong link negative control') 16 print('PASS missing binding refused') 17 for name,old,new in mutants: 18 assert source.count(old)==1 19 om=d/(name+'.om'); om.write_text(source.replace(old,new)) 20 with (d/'mut.c').open('w') as out: 21 subprocess.run(['sh',str(bridge/'tools/bridge-seeded'),'--runtime-views','c',str(om)],env=env,stdout=out,check=True) 22 subprocess.run([cc,'-O2','-ffp-contract=off','-I'+str(root/'src'),str(test),str(d/'mut.c'),'-o',str(d/'mut')],check=True) 23 p=subprocess.run([str(d/'mut')],capture_output=True) 24 if p.returncode==0: raise SystemExit('FAIL survived '+name) 25 print('KILLED '+name) 26 print('PASS graph head scaling red control and six mutants')