(rows: Array<EvalRow>)
| 685 | } |
| 686 | |
| 687 | function printTable(rows: Array<EvalRow>) { |
| 688 | console.log('\n=== Results ===\n') |
| 689 | const nameW = 22 |
| 690 | const modelW = 38 |
| 691 | const starsW = 5 |
| 692 | const accW = 4 |
| 693 | const compW = 4 |
| 694 | const tsW = 3 |
| 695 | const cmW = 3 |
| 696 | const msW = 8 |
| 697 | |
| 698 | const header = `${'Model'.padEnd(nameW)} ${'Id'.padEnd(modelW)} ${'★'.padStart(starsW)} ${'ms'.padStart(msW)} ${'Acc'.padStart(accW)} ${'Cmp'.padStart(compW)} ${'TS'.padStart(tsW)} ${'CME'.padStart(cmW)} ${'Spd'.padStart(3)} ${'Tok'.padStart(3)} ${'Stb'.padStart(3)} Error / summary` |
| 699 | console.log(header) |
| 700 | console.log('-'.repeat(header.length + 10)) |
| 701 | |
| 702 | for (const r of rows) { |
| 703 | const acc = r.judge?.accuracy !== undefined ? String(r.judge.accuracy) : '-' |
| 704 | const comp = |
| 705 | r.judge?.comprehensiveness !== undefined |
| 706 | ? String(r.judge.comprehensiveness) |
| 707 | : '-' |
| 708 | const tsq = |
| 709 | r.judge?.typescriptQuality !== undefined |
| 710 | ? String(r.judge.typescriptQuality) |
| 711 | : '-' |
| 712 | const cme = |
| 713 | r.judge?.codeModeEfficiency !== undefined |
| 714 | ? String(r.judge.codeModeEfficiency) |
| 715 | : '-' |
| 716 | const stars = r.stars |
| 717 | ? `${'★'.repeat(r.stars)}${'☆'.repeat(3 - r.stars)}` |
| 718 | : '-' |
| 719 | const err = r.error || '' |
| 720 | const summary = r.judge?.summary |
| 721 | ? r.judge.summary.replace(/\s+/g, ' ').slice(0, 120) |
| 722 | : '' |
| 723 | const tail = err || summary |
| 724 | console.log( |
| 725 | `${r.name.slice(0, nameW - 1).padEnd(nameW)} ${r.model.slice(0, modelW - 1).padEnd(modelW)} ${stars.padStart(starsW)} ${String(r.durationMs).padStart(msW)} ${acc.padStart(accW)} ${comp.padStart(compW)} ${tsq.padStart(tsW)} ${cme.padStart(cmW)} ${String(r.speedTier).padStart(3)} ${String(r.tokenEfficiencyTier).padStart(3)} ${String(r.stabilityTier).padStart(3)} ${tail}`, |
| 726 | ) |
| 727 | } |
| 728 | console.log('') |
| 729 | } |
| 730 | |
| 731 | async function main() { |
| 732 | const { |
no test coverage detected