MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / classify

Function classify

benchmarks/audit/audit.ts:207–222  ·  view source on GitHub ↗
(c: any, res: any)

Source from the content-addressed store, hash-verified

205 return true;
206}
207function classify(c: any, res: any) {
208 if (!res || res.status === 'error') return { v: 'error', note: res?.error };
209 if (res.status === 'timeout') return { v: 'error', note: 'timeout' };
210 if (res.status === 'unsolved') return { v: 'unsolved' };
211 const vr = c.verify;
212 if (vr.kind === 'equiv' || vr.kind === 'derivcheck') {
213 if (!allClose(res.values, vr.values)) return { v: 'wrong' };
214 if (vr.kind === 'equiv' && vr.form && !formOk(vr.form, res.text))
215 return { v: 'partial', note: vr.form === 'polynomial' ? 'non-polynomial form' : 'not ' + vr.form };
216 return { v: 'correct' };
217 }
218 if (vr.kind === 'mantexp')
219 return allClose(res.values, vr.values) ? { v: 'correct' } : { v: 'wrong' };
220 if (vr.kind === 'value') return allClose(res.values, [vr.value]) ? { v: 'correct' } : { v: 'wrong' };
221 return { v: 'error', note: 'unknown verify' };
222}
223
224// --- run --------------------------------------------------------------------
225console.error('Running multi-op audit — %d cases, CE in-process + SymPy batch + Wolfram batch…', suite.cases.length);

Callers 1

audit.tsFile · 0.70

Calls 2

formOkFunction · 0.85
allCloseFunction · 0.70

Tested by

no test coverage detected