[GH-ISSUE #4214] [Other] batch_groups_cache_test reports FAIL with --batch-groups 2 although the reuse it checks for happened #1853

Closed
opened 2026-11-04 01:54:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Dmitry-B on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4214

Area

Other

Desktop app, Terminal or source?

Source

What happened

tools/batch_groups_cache_test.py prints FAIL although the reuse it is there to check did happen. The
script reads the engine log and takes the last six prompt N tokens = M reused lines as its own six
requests, then requires ≥90 % reuse in the last four. With --batch 2 --batch-groups 2 the engine writes
an extra line per request - the slot copy, strata batch: slot 0 takes N tokens (copied in …) - so the
slice the test examines contains lines with reused 0 and it fails. Run against a clean log with
SMOKE_LOG, my run's real reuse in rounds 2 and 3 was 99.2 %, 100 %, 99.2 %, 99.3 %, 100 %, 99.3 % -
the #1604 behaviour is fine, the parser is not.

A second, smaller thing: the script reads the log path from the run config, so on a machine whose service
writes a long-running log it inherits unrelated requests. SMOKE_LOG exists, which is good; using it by
default (or counting only requests the script itself tagged) would avoid this.

Smallest steps or command that reproduce it

STRATA_EXTRA_ARGS="--batch 2 --batch-groups 2 --prompt-cache 4 --conversation-cache-mib 4096 \
                   --conversation-cache-slots 3" SMOKE_LOG=/tmp/bgc.log \
python3 tools/batch_groups_cache_test.py strata-<config>.json /tmp/bgc-out.json

The printed requests (prompt tokens, reused): list then contains 10 entries for 6 requests, and the last
four checked ones include a reused 0 line.

Reproduction status

Reproduces every time with --batch-groups 2; the answers and the reuse counters are correct, only the
PASS/FAIL decision is wrong.

Strata version

Strata 0.2.6 · engine 0.1.51 · commit 4b9e05a2a806a3fe24f7b2560d98626c37dade35

Graphics card, memory and system

RTX 4090 24 GB · 46 GB RAM · Ubuntu 26.04.1, driver 615.71.09, CUDA 13.4

Model, size and settings

Qwen3.8-Flash-Next IQ3_XXS · 204800 context · --resident-experts, --pool-workers 10, --kv int8

Logs

strata batch: slot 0 takes 3142 tokens (copied in 93.3 ms)
strata serve: prompt 3142 tokens = 3141 reused + 1 read in 0 ms
strata batch: slot 1 takes 3142 tokens (copied in 91.7 ms)
strata serve: prompt 3142 tokens = 0 reused + 3142 read in 1812 ms
...
slot gave back lines: 5  conversation cache restores: 0
FAIL
Originally created by @Dmitry-B on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4214 ### Area Other ### Desktop app, Terminal or source? Source ### What happened `tools/batch_groups_cache_test.py` prints FAIL although the reuse it is there to check did happen. The script reads the engine log and takes the last six `prompt N tokens = M reused` lines as its own six requests, then requires ≥90 % reuse in the last four. With `--batch 2 --batch-groups 2` the engine writes an extra line per request - the slot copy, `strata batch: slot 0 takes N tokens (copied in …)` - so the slice the test examines contains lines with `reused 0` and it fails. Run against a clean log with `SMOKE_LOG`, my run's real reuse in rounds 2 and 3 was 99.2 %, 100 %, 99.2 %, 99.3 %, 100 %, 99.3 % - the #1604 behaviour is fine, the parser is not. A second, smaller thing: the script reads the log path from the run config, so on a machine whose service writes a long-running log it inherits unrelated requests. `SMOKE_LOG` exists, which is good; using it by default (or counting only requests the script itself tagged) would avoid this. ### Smallest steps or command that reproduce it ``` STRATA_EXTRA_ARGS="--batch 2 --batch-groups 2 --prompt-cache 4 --conversation-cache-mib 4096 \ --conversation-cache-slots 3" SMOKE_LOG=/tmp/bgc.log \ python3 tools/batch_groups_cache_test.py strata-<config>.json /tmp/bgc-out.json ``` The printed `requests (prompt tokens, reused):` list then contains 10 entries for 6 requests, and the last four checked ones include a `reused 0` line. ### Reproduction status Reproduces every time with `--batch-groups 2`; the answers and the reuse counters are correct, only the PASS/FAIL decision is wrong. ### Strata version Strata 0.2.6 · engine 0.1.51 · commit `4b9e05a2a806a3fe24f7b2560d98626c37dade35` ### Graphics card, memory and system RTX 4090 24 GB · 46 GB RAM · Ubuntu 26.04.1, driver 615.71.09, CUDA 13.4 ### Model, size and settings Qwen3.8-Flash-Next IQ3_XXS · 204800 context · `--resident-experts`, `--pool-workers 10`, `--kv int8` ### Logs ``` strata batch: slot 0 takes 3142 tokens (copied in 93.3 ms) strata serve: prompt 3142 tokens = 3141 reused + 1 read in 0 ms strata batch: slot 1 takes 3142 tokens (copied in 91.7 ms) strata serve: prompt 3142 tokens = 0 reused + 3142 read in 1812 ms ... slot gave back lines: 5 conversation cache restores: 0 FAIL ```
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660137286 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1853
No description provided.