(label, tok, chars, results)
| 364 | const pctWin = (t) => ((t / o.windowTokens) * 100).toFixed(1); |
| 365 | const rows = []; |
| 366 | const row = (label, tok, chars, results) => rows.push( |
| 367 | `${indent} ${label.padEnd(18)}${(n(tok) + ' tok').padStart(12)} ${(pctCtx(tok) + '%').padStart(6)} of ctx ` + |
| 368 | `${(pctWin(tok) + '%').padStart(6)} of ${Math.round(o.windowTokens / 1000)}k win` + |
| 369 | (chars !== undefined ? ` (${n(chars)} chars, ${results} result${results === 1 ? '' : 's'})` : '') |
| 370 | ); |
| 371 | const out = [`${indent}Residual context occupancy at end of run:`]; |
| 372 | out.push(`${indent} ${'final context'.padEnd(18)}${(n(o.ctxFinal) + ' tok').padStart(12)} ${(pctWin(o.ctxFinal) + '%').padStart(6)} of ${Math.round(o.windowTokens / 1000)}k window`); |
| 373 | row('codegraph', o.residual.codegraph, o.chars.codegraph, o.results.codegraph); |
no test coverage detected