# independent pure-python checker (different code path: python ints, no numpy math)
import numpy as np, math, time
d=np.load('/downloads/anan2090/million/mq_seed.npz')
t=d['t'].tolist();a=d['a'].tolist();b=d['b'].tolist();c=d['c'].tolist();ans=d['ans'].tolist();ab=d['ab'].tolist()
ABST=-2**63
t0=time.perf_counter();ok=bad=abst=0
for i in range(len(t)):
    ti,x,y,z=t[i],a[i],b[i],c[i]
    if ti==0:r=x+y
    elif ti==1:r=x*y
    elif ti==2:r=None if y==0 else x%y
    elif ti==3:r=math.gcd(x,y)
    elif ti==4:r=x*1000
    elif ti==5:r=int(bool(x&1 and y&1) or not (z&1))
    elif ti==6:r=None if y==0 else x//y
    elif ti==7:r=pow(x%z,abs(y)%64,z)
    elif ti==8:r=(x>y)-(x<y)
    else:r=max(x,y)
    if r is None:
        if ab[i] and ans[i]==ABST:abst+=1
        else:bad+=1
    elif not ab[i] and ans[i]==r:ok+=1
    else:bad+=1
dt=time.perf_counter()-t0
print(f"verified {ok+abst+bad} agree {ok} abstain {abst} mismatch {bad} time {dt:.2f}s")
