From 1ddf7a10213e94d4018d654b7021fc2a3f690bc1 Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Sun, 14 Jun 2026 16:12:10 +0530 Subject: [PATCH] =?UTF-8?q?opentui(v6):=20bench=20fixture=20=E2=80=94=20HE?= =?UTF-8?q?RMES=5FBENCH=5FTOOL=5FBODY=5FLINES=20knob=20for=20fat=20tool=20?= =?UTF-8?q?output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default lumpy-turn fixture's tool bodies are tiny (2/7/18 short lines), so W3 (HERMES_TUI_TOOL_OUTPUTS=off) shows no RSS delta at realistic sizes — the saved bytes sit below the ~20MB run-to-run noise floor. This adds an env knob to scale every tool result body to N lines, making the retention asymmetry measurable in the bench (a `find /` / big-file-read class fixture). UNSET = the original tiny bodies, byte-identical — existing benches and the determinism digest are unaffected. Set HERMES_BENCH_TOOL_BODY_LINES=N (the bench harness inherits it at fixture-generation time) for a fat run. Measured with this (mem300, ~100KB/tool, ~27MB retained tool text): OpenTUI OFF 244-259MB vs ON 260-261MB vs Ink 269-279MB — i.e. W3 OFF is a real ~5-15MB win at heavy output, and OpenTUI's windowing actually beats Ink at scale (Ink mounts every row; OpenTUI windows). --- ui-opentui/scripts/fixture.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui-opentui/scripts/fixture.ts b/ui-opentui/scripts/fixture.ts index 26300164be2..a86c5bdf413 100644 --- a/ui-opentui/scripts/fixture.ts +++ b/ui-opentui/scripts/fixture.ts @@ -130,7 +130,12 @@ function toolEvents(seed: number, t: number): GatewayEvent[] { const name = TOOL_NAMES[(seed + t) % TOOL_NAMES.length] ?? 'terminal' const variant = (seed + t) % 3 // short / capped-16-line / medium result bodies, mixing the render-cost cases. - const bodyLines = variant === 0 ? 2 : variant === 1 ? 18 : 7 + // BENCH KNOB: HERMES_BENCH_TOOL_BODY_LINES overrides the body size to N lines + // for ALL tools — the "fat tool output" fixture (e.g. a `find /` dump) used to + // make W3's retention win measurable. UNSET = the original tiny bodies (so the + // default fixture stays byte-identical; existing benches are unaffected). + const fatLines = Number.parseInt(process.env.HERMES_BENCH_TOOL_BODY_LINES ?? '', 10) + const bodyLines = Number.isFinite(fatLines) && fatLines > 0 ? fatLines : variant === 0 ? 2 : variant === 1 ? 18 : 7 const resultText = lines(seed + t * 3, bodyLines) const context = sentence(seed + t, 4) // ~half the tools carry a multi-line args block (the expanded-view cost).