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

Function main

scripts/rubi/benchmark.ts:452–658  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

450}
451
452function main(): void {
453 const argv = process.argv;
454 let suite =
455 process.env.RUBI_TESTS ??
456 path.join(os.homedir(), 'dev/rubi/MathematicaSyntaxTestSuite-master');
457 let chapter = '1 Algebraic functions';
458 let limit = Infinity;
459 let sample = 0;
460 let seed = 42;
461 let reportPath = 'scripts/rubi/baseline-report.json';
462 let rubiRules: string | null = null;
463 let only = '';
464 let keysFile = '';
465 for (let i = 2; i < argv.length; i++) {
466 switch (argv[i]) {
467 case '--rubi':
468 rubiRules = argv[++i];
469 break;
470 case '--only':
471 only = argv[++i];
472 break;
473 case '--keys':
474 // file with one `<file>#<index>` key per line — re-validate an
475 // explicit set of problems (e.g. a cluster from a prior report)
476 keysFile = argv[++i];
477 break;
478 case '--suite':
479 suite = argv[++i];
480 break;
481 case '--chapter':
482 chapter = argv[++i];
483 break;
484 case '--limit':
485 limit = parseInt(argv[++i]);
486 break;
487 case '--sample':
488 sample = parseInt(argv[++i]);
489 break;
490 case '--seed':
491 seed = parseInt(argv[++i]);
492 break;
493 case '--report':
494 reportPath = argv[++i];
495 break;
496 default:
497 console.error(`unknown option ${argv[i]}`);
498 process.exit(2);
499 }
500 }
501
502 const { problems, errors } = loadTests(suite, chapter);
503 console.log(
504 `loaded ${problems.length} problems from "${chapter}" (${errors.length} parse errors)`
505 );
506 if (errors.length > 0)
507 console.log(
508 ` first parse errors: ${errors
509 .slice(0, 3)

Callers 1

benchmark.tsFile · 0.70

Calls 12

loadTestsFunction · 0.90
readCorpusDocsFunction · 0.90
compileRuleDocsFunction · 0.90
runProblemFunction · 0.85
toFixedMethod · 0.80
mulberry32Function · 0.70
errorMethod · 0.65
logMethod · 0.65
mapMethod · 0.65
sliceMethod · 0.65
hasMethod · 0.65
entriesMethod · 0.65

Tested by

no test coverage detected