[PR #4720] [Benchmark] bench run against a running server keeps that engine's log #5150

Open
opened 2026-11-07 16:33:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4720
Author: @coryjett
Created: 10/30/2026
Status: 🔄 Open

Base: main ← Head: fix-bench-attach-log


📝 Commits (1)

  • fe5c7b2 bench: a run against a running server keeps that engine's log (#4492)

📊 Changes

3 files changed (+83 additions, -2 deletions)

View changed files

📝 strata_cli/bench_standard.py (+31 -1)
📝 strata_cli/cli.py (+7 -1)
📝 tests/terminal/test_bench_standard.py (+45 -0)

📄 Description

Problem and result

Fixes #4492. strata bench run --profile <run config> --no-start against a server that is already running
wrote no engine.log, although the profile names a log file. The engine log was only attached when the
runner started the engine itself. A report that reused a running server, the usual case for a production
box, lost the stage plan ("layer split across 2 GPUs ..."), the PCIe probe and expert-cache lines, and the
per-request summaries.

After: the run config's log is kept from the running engine's start line to the end of the run.

#4492

Approach

The run config's log is appended to by every start, so the running engine's lines begin at the newest
[strata] <time> engine started: line, which serve/server.py writes on each start.

  • bench_standard.engine_start_offset(run_log) finds that line in the log's last 64 MiB, starting on a whole
    line.
  • bench run passes that offset to the existing engine_log_since, the same path a runner-started engine
    uses. The attached log therefore covers the engine's start through this run's own requests, and still goes
    through the existing 2 MB tail cap and redaction.

If there is no start line, no log is attached. Otherwise the report would carry an earlier engine's lines.

Validation

Passed:

  • python3.12 -m unittest tests.terminal.test_bench_standard tests.terminal.test_bench: Ran 96 tests in
    66.299s, OK (1 skipped). Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch
    (main 870aedd9 + this commit).
  • New tests:
    • a running profile keeps its log from the newest start line, without the earlier engine's lines
    • no start line means no engine.log
    • the start line is found when the scan window begins mid-file
  • The first of those against main's strata_cli (production files stashed, test kept): FAILED (errors=1).
  • On the T630 (2x RTX 3090, engine 0.1.52), bench run --profile <production run config> --no-start --skip-model-hash against the running server:
    • the result folder now has engine.log, starting [strata] 2026-10-30 11:42:06 engine started: ...
    • it has the layer split across 2 GPUs line and 582 strata serve: prompt summaries
    • home paths are redacted to /home/<user>, and the API key is absent

Failed:

  • None observed.

Not run:

  • Windows.
  • A run config whose log is shared by two profiles.

Limits

  • A long-running server's log since its start includes other clients' request summaries. These are token
    counts and timings, not prompt text. Only the last 2 MB is kept, as for a started engine.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4720 **Author:** [@coryjett](https://github.com/coryjett) **Created:** 10/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-bench-attach-log` --- ### 📝 Commits (1) - [`fe5c7b2`](https://github.com/Niko1221/Strata/commit/fe5c7b254d1217082f6ad6618e6a6b2075461a57) bench: a run against a running server keeps that engine's log (#4492) ### 📊 Changes **3 files changed** (+83 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `strata_cli/bench_standard.py` (+31 -1) 📝 `strata_cli/cli.py` (+7 -1) 📝 `tests/terminal/test_bench_standard.py` (+45 -0) </details> ### 📄 Description ## Problem and result Fixes #4492. `strata bench run --profile <run config> --no-start` against a server that is already running wrote no `engine.log`, although the profile names a `log` file. The engine log was only attached when the runner started the engine itself. A report that reused a running server, the usual case for a production box, lost the stage plan ("layer split across 2 GPUs ..."), the PCIe probe and expert-cache lines, and the per-request summaries. After: the run config's log is kept from the running engine's start line to the end of the run. ## Related discussion #4492 ## Approach The run config's log is appended to by every start, so the running engine's lines begin at the newest `[strata] <time> engine started:` line, which `serve/server.py` writes on each start. - `bench_standard.engine_start_offset(run_log)` finds that line in the log's last 64 MiB, starting on a whole line. - `bench run` passes that offset to the existing `engine_log_since`, the same path a runner-started engine uses. The attached log therefore covers the engine's start through this run's own requests, and still goes through the existing 2 MB tail cap and redaction. If there is no start line, no log is attached. Otherwise the report would carry an earlier engine's lines. ## Validation **Passed:** - `python3.12 -m unittest tests.terminal.test_bench_standard tests.terminal.test_bench`: Ran 96 tests in 66.299s, OK (1 skipped). Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch (main 870aedd9 + this commit). - New tests: - a running profile keeps its log from the newest start line, without the earlier engine's lines - no start line means no `engine.log` - the start line is found when the scan window begins mid-file - The first of those against main's `strata_cli` (production files stashed, test kept): FAILED (errors=1). - On the T630 (2x RTX 3090, engine 0.1.52), `bench run --profile <production run config> --no-start --skip-model-hash` against the running server: - the result folder now has `engine.log`, starting `[strata] 2026-10-30 11:42:06 engine started: ...` - it has the `layer split across 2 GPUs` line and 582 `strata serve: prompt` summaries - home paths are redacted to `/home/<user>`, and the API key is absent **Failed:** - None observed. **Not run:** - Windows. - A run config whose `log` is shared by two profiles. ## Limits - A long-running server's log since its start includes other clients' request summaries. These are token counts and timings, not prompt text. Only the last 2 MB is kept, as for a started engine. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5150
No description provided.