[GH-ISSUE #5269] [Benchmark] Windows: concurrent_round wall clock (GetTickCount64, 15.6 ms) measures 0.0 s, aggregate_tps becomes null #3137

Open
opened 2026-11-07 14:38:22 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @yeyeyeason on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5269

Area

[Benchmark] (measurements and reports)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

tests/terminal/test_bench_standard.py::RunTests::test_a_round_total_is_null_when_a_counted_request_has_no_token_count fails on Windows with AssertionError: unexpectedly None (line 696, assertIsNotNone(doc["concurrency_rounds"][0]["aggregate_tps"])).

The cause is not the missing usage entry the test models. Every concurrent request completes (status: completed, failed: 0, output_tokens present), but the round's wall_s is 0.0: on this Windows machine Python's time.monotonic_ns() is backed by GetTickCount64() with a 15.625 ms resolution:

>>> time.get_clock_info("monotonic")
namespace(implementation='GetTickCount64()', monotonic=True, adjustable=False, resolution=0.015625)

The mock server answers in under one tick, so all four threads' t0 and t_end land on the same tick and max(t_end) - min(t0) is 0. The wall > 0 guard in strata_cli/bench_standard.py:555 then sets aggregate_tps to null. Probe runs through the test's own machinery (5 repetitions, 15 rounds): 9 of 15 rounds measured 0.0 s; the rounds that passed had merely crossed one tick.

On Linux monotonic_ns is nanosecond-resolution, so wall is never 0 and the suite passes — this is a Windows-only measurement defect in the bench/test infrastructure, not an engine or protocol problem.

Smallest steps or command that reproduce it

From a v0.2.10 checkout on Windows (Python 3.12.10, pytest 9.2.0):

.venv\Scripts\python.exe -m pytest tests/terminal/test_bench_standard.py -q

Result here: 66 passed, 2 failed (this issue and the timeout-classification one), twice in a row.

Reproduction status

Reproduced locally

Strata version

v0.2.10 checkout, commit ffa80d73 (no engine involved: the failing tests run against the mock server)

Graphics card, memory and system

RTX 4060 Ti 16 GB x2 · 96 GB RAM · Windows 11 Pro (no GPU is used by these tests)

Model, size and settings

Not applicable — the failure is in the mock-server test path.

Logs

Probe output (the test's own run, five repetitions):

[(1, 0.0, None), (2, 0.015, 13333.333333), (3, 0.0, None)]
[(1, 0.0, None), (2, 0.016, 12500.0),      (3, 0.0, None)]
[(1, 0.0, None), (2, 0.0,   None),         (3, 0.0, None)]   # x3 more

(each tuple: round, wall_s, aggregate_tps)

A possible fix would be stamping t0/t_end with time.perf_counter_ns() (QPC on Windows, high-resolution elsewhere; the values are only differenced within one request). Happy to prepare that PR if the direction is agreed.

Originally created by @yeyeyeason on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5269 ### Area [Benchmark] (measurements and reports) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened `tests/terminal/test_bench_standard.py::RunTests::test_a_round_total_is_null_when_a_counted_request_has_no_token_count` fails on Windows with `AssertionError: unexpectedly None` (line 696, `assertIsNotNone(doc["concurrency_rounds"][0]["aggregate_tps"])`). The cause is not the missing usage entry the test models. Every concurrent request completes (`status: completed`, `failed: 0`, `output_tokens` present), but the round's `wall_s` is **0.0**: on this Windows machine Python's `time.monotonic_ns()` is backed by `GetTickCount64()` with a 15.625 ms resolution: ``` >>> time.get_clock_info("monotonic") namespace(implementation='GetTickCount64()', monotonic=True, adjustable=False, resolution=0.015625) ``` The mock server answers in under one tick, so all four threads' `t0` and `t_end` land on the same tick and `max(t_end) - min(t0)` is 0. The `wall > 0` guard in `strata_cli/bench_standard.py:555` then sets `aggregate_tps` to null. Probe runs through the test's own machinery (5 repetitions, 15 rounds): 9 of 15 rounds measured 0.0 s; the rounds that passed had merely crossed one tick. On Linux `monotonic_ns` is nanosecond-resolution, so `wall` is never 0 and the suite passes — this is a Windows-only measurement defect in the bench/test infrastructure, not an engine or protocol problem. ### Smallest steps or command that reproduce it From a v0.2.10 checkout on Windows (Python 3.12.10, pytest 9.2.0): ``` .venv\Scripts\python.exe -m pytest tests/terminal/test_bench_standard.py -q ``` Result here: 66 passed, 2 failed (this issue and the timeout-classification one), twice in a row. ### Reproduction status Reproduced locally ### Strata version v0.2.10 checkout, commit ffa80d73 (no engine involved: the failing tests run against the mock server) ### Graphics card, memory and system RTX 4060 Ti 16 GB x2 · 96 GB RAM · Windows 11 Pro (no GPU is used by these tests) ### Model, size and settings Not applicable — the failure is in the mock-server test path. ### Logs Probe output (the test's own run, five repetitions): ``` [(1, 0.0, None), (2, 0.015, 13333.333333), (3, 0.0, None)] [(1, 0.0, None), (2, 0.016, 12500.0), (3, 0.0, None)] [(1, 0.0, None), (2, 0.0, None), (3, 0.0, None)] # x3 more ``` (each tuple: round, wall_s, aggregate_tps) A possible fix would be stamping `t0`/`t_end` with `time.perf_counter_ns()` (QPC on Windows, high-resolution elsewhere; the values are only differenced within one request). Happy to prepare that PR if the direction is agreed.
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#3137
No description provided.