Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

test: chat_eval gives up on a turn that runs too long - #35

Merged
mkhellat merged 1 commit into
mainfrom
test/eval-turn-timeout
Nov 26, 2026
Merged

mkhellat merged 1 commit into
mainfrom
test/eval-turn-timeout

Conversation

@mkhellat

Copy link
Copy Markdown
Owner

A chat_eval run with the 7B model stalled for about 40 minutes. On the log scenario its prompts took more than ten minutes per model call on this CPU, and nothing showed that the run was stuck.

Change

  • A deadline per turn. Each model's scenario runs in a child process (spawn), and the parent waits at most --turn-timeout seconds (default 300) for each turn. A turn that runs longer is recorded as timeout, and the rest of that model's session as skipped, since later turns depend on it. The run then continues with the next model.
  • Clean-up and setup stay in the parent. It owns the temporary project, which is removed even when the child is killed. Agent start-up isn't counted against turn 1.
  • Progress on stderr as each turn finishes; the summary counts timeouts.

Review and CI

  • Implemented by a Sonnet subagent and reviewed locally. Spawn requires module-level functions and imports by name, so the tests import the script from scripts/ on sys.path.
  • Checked live on the 3B with --turn-timeout 120: per-turn progress, 15/18 in 210 s.
  • The chat_eval and build tests pass (42), ruff is clean, and the manual builds without warnings.
  • CI runs once on this head: it changes a script and its tests.

A chat_eval run with the 7B model stalled for about 40 minutes: on
the log scenario its prompts took more than ten minutes per model
call on a laptop CPU, and nothing showed the run was stuck.

Each model's scenario now runs in a child process; the parent waits
at most --turn-timeout seconds (default 300) for each turn.  A turn
that runs longer is recorded as a timeout, the rest of that model's
session as skipped (later turns depend on it), and the run goes on
with the next model.  The temporary project is removed even when the
child is killed.  Each finished turn is reported on stderr as it
happens, and the summary counts timeouts.  Checked live on the 3B:
progress per turn, 15/18 in 210 s.

* scripts/chat_eval.py (run_model): Run the scenario in a child
process; enforce the per-turn limit.
(_child_main): New.
(build_parser): --turn-timeout.
* tests/test_chat_eval.py: Test the timeout path and the option.
* docs/chapters/performance-benchmarking.texi (Chat Session Evaluation):
Document them.
@mkhellat

Copy link
Copy Markdown
Owner Author

Review summary: correct

One sweep, locally.

Conditions.

  • A turn that hasn't reported within --turn-timeout (start-up gets max(timeout, 60)) is recorded as timeout; the model's later turns are recorded as skipped, and the child is terminated (then killed).
  • The temporary directory belongs to the parent's TemporaryDirectory, so it's removed in every case.
  • A child that dies gives error.

Verified:

  • 4 new tests cover the timeout path, clean-up and the option;
  • the live run on the 3B prints progress per turn;
  • the parent's environment is no longer changed (XDG and model are set in the child).

Verdict: correct. I'll merge when CI passes.

@mkhellat

Copy link
Copy Markdown
Owner Author

Merging. CI is green on all five jobs, macOS included. CI on the merge is skipped: the branch sits on main (6b2aa0d), which has not moved, so the merged tree is the tested one; the merge commit carries [skip ci]. I start the docs workflow by hand.

@mkhellat
mkhellat merged commit 5e1f04b into main Nov 26, 2026
7 checks passed
@mkhellat
mkhellat deleted the test/eval-turn-timeout branch November 26, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant