MCPcopy Index your code
hub / github.com/Doorman11991/smallcode / render

Function render

bench/diff.js:172–209  ·  view source on GitHub ↗
(baseSum, featSum, moves, v, threshold, basePath, featPath)

Source from the content-addressed store, hash-verified

170}
171
172function render(baseSum, featSum, moves, v, threshold, basePath, featPath) {
173 const deltaReward = featSum.reward - baseSum.reward;
174 const deltaMs = featSum.totalMs - baseSum.totalMs;
175 const deltaCalls = featSum.totalToolCalls - baseSum.totalToolCalls;
176
177 const verdictColor = v === VERDICT.IMPROVED ? C.green
178 : v === VERDICT.REGRESSED ? C.red
179 : C.yellow;
180
181 console.log('');
182 console.log(paint(' SmallCode bench diff', C.bold));
183 console.log(paint(' ──────────────────────────────────────────', C.dim));
184 console.log(` baseline : ${paint(basePath, C.cyan)}`);
185 console.log(` feature : ${paint(featPath, C.cyan)}`);
186 console.log('');
187 console.log(` reward : ${pct(baseSum.reward)} → ${pct(featSum.reward)} (Δ ${paint(signed(deltaReward), verdictColor)})`);
188 console.log(` passed : ${baseSum.passed}/${baseSum.total} → ${featSum.passed}/${featSum.total}`);
189 console.log(` walltime : ${ms(baseSum.totalMs)} → ${ms(featSum.totalMs)} (Δ ${signed(deltaMs / 1000, 1)}s)`);
190 console.log(` toolcall : ${baseSum.totalToolCalls} → ${featSum.totalToolCalls} (Δ ${signed(deltaCalls, 0)})`);
191 console.log('');
192
193 if (moves.hard.length > 0) {
194 console.log(paint(` ✗ Regressed tasks (${moves.hard.length}):`, C.red));
195 for (const id of moves.hard) console.log(` ${id}`);
196 }
197 if (moves.recovered.length > 0) {
198 console.log(paint(` ✓ Recovered tasks (${moves.recovered.length}):`, C.green));
199 for (const id of moves.recovered) console.log(` ${id}`);
200 }
201 if (moves.hard.length === 0 && moves.recovered.length === 0) {
202 console.log(paint(' no per-task moves', C.dim));
203 }
204
205 console.log('');
206 console.log(` threshold: ±${threshold}`);
207 console.log(` verdict : ${paint(v, verdictColor + C.bold)}`);
208 console.log('');
209}
210
211// ─── main ────────────────────────────────────────────────────────────────────
212

Callers 1

mainFunction · 0.85

Calls 4

pctFunction · 0.85
signedFunction · 0.85
msFunction · 0.85
paintFunction · 0.70

Tested by

no test coverage detected