[GH-ISSUE #4021] [Engine] Opt-in tail-only parking for late conversation branches #1733

Open
opened 2026-11-04 01:53:33 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @fujiichi on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4021

Area

[Engine]

What do you want to do?

Park only the tail of a conversation when an agent client switches to a request that shares everything except the last turn or two, instead of the whole conversation.

Re-tested on 0.2.11 (2026-11-07): unchanged. In the test below (4 branches sharing an ~18K-token prefix, 10 rounds, 2 passes), unmodified 0.2.11 parked a whole image every time: 78 of 78 parks, 1,094.9 MiB and ~370 ms per park, 94 ms per restore — the same as on 0.2.4.2 (1,094.9 MiB, 377 ms). The patch, ported to 0.2.11, cut the parked image to 233.8 MiB and the client latency by 15–16%. Details are in the comment below; the original report follows.

Strata version: v0.2.11 (c3b3f503), built from source (Release, STRATA_ENABLE_CUDA=ON, CMAKE_CUDA_ARCHITECTURES=86, CUDA 13.1). The patch is ported to the same tag.
Graphics card, memory and system: 2× NVIDIA GeForce RTX 3060 12 GB (--layer-split auto), 96 GB RAM, Ubuntu 26.04.1 LTS (Linux 7.0.0), NVIDIA driver 595.

Summary

With an agent client (Claude Code with subagents), a long conversation often alternates with a short side request that shares everything except the last turn or two. Today every switch parks the whole outgoing conversation, although the incoming request rewrites the session only from a cell near the end.

A patch parks only the tail in that case: the running state, the K/V cells from the branch point (page aligned) on, and the newest checkpoint past it. The cells below the branch point stay in the session. An optional part reuses the running-state allocations of a restored tail image for the next tail park.

On v0.2.4.2, 2× RTX 3060, with tail parking and buffer reuse on:

  • Test A, growing conversations, against an unmodified v0.2.4.2 build:
    • every park was a tail (78 of 78);
    • parked image 234 MiB instead of 1,095 MiB (−79%);
    • park 78 ms instead of 377 ms; restore 38 ms instead of 96 ms;
    • client latency 1,774 ms instead of 2,118 ms (−16%).
  • Test B, fixed branches replayed, against the same patched binary with tail parking forced off:
    • client latency 488 ms instead of 691 ms (−29%).
  • Replies after park → restore were byte-identical to a run without the conversation cache.
  • With the switches off, the patched build gave the same replies and the same conversation-cache events as the unmodified build.

Both parts are opt-in (STRATA_TAIL_PARK=1, STRATA_TAIL_PARK_REUSE=1); without STRATA_TAIL_PARK=1 none of the tail steps run. I can open a PR if this is wanted.

Setup

  • Strata v0.2.4.2 (dfa3f402) + the patch, Linux, CUDA 13.1, sm_86, built from source (Release, STRATA_ENABLE_CUDA=ON). The unmodified build is the same tag with the same options.
  • 2× RTX 3060 12 GB, --layer-split auto (layers 0-23 on GPU 0, 24-47 on GPU 1). 96 GB RAM.
  • Qwen3.8-Flash-Next IQ2_XS, --kv int8 --kv-resident 32768 --max-context 524288 --rope-scaling yarn --rope-scale 2 --spec 4 --spec-min-p 0.5 with the MTP draft layer, --conversation-cache-mib 16384 --conversation-cache-min-free-mib 8192 --vram-reserve-mib 1024.

The change

  • Tail parking (STRATA_TAIL_PARK=1).
    • ConversationKv and SavedConversation get a first_cell (0 = whole image, as today).
    • On a switch, the outgoing conversation's boundary with the incoming prompt is the matched checkpoint (resume).
    • If the tail from that page is at most half of the whole image, only the tail is parked. It carries the newest checkpoint past its start (STRATA_TAIL_PARK_CHECKPOINTS=N for more; 0 = all). Carrying all of them made the tail grow by one running-state copy (114 MiB here) per turn, until it failed the half rule after three turns.
    • With --layer-split, every stage's image is parked the same way on its own GPU.
    • ConversationCache::limit_tails(first_dirty) drops a tail image once a later rewrite starts before its first cell (a prompt read from further back, a restore, a slot or session-file restore).
    • Retained-K/V reuse is not used for tails. STRATA_NO_TAIL_PARK=1 forces whole images for A/B tests.
  • Running-state buffer reuse (STRATA_TAIL_PARK_REUSE=1). After a tail restore, the image's five running-state buffers (GDN, PLE, and the indexer's tails / dead / block_pos; 56.5 MiB per GPU here) are kept in the cache budget and reused by the next tail park. Every byte is still copied; only the allocations and their zero fill are saved. If the budget has no room they are released; nothing is evicted to keep them.
  • Default path. The limit_tails calls, limit_reuse before a restore and the running-state estimate in a capture run only with STRATA_TAIL_PARK=1.

One commit on v0.2.4.2, 8 files (+596 −41): conversation_cache.hpp, conversation_snapshot.{hpp,cpp}, conversation_state.cpp, generate.cpp, the cache and validation tests, DETAILS.md. A first version was written on the 0.1.38 line; this one was redone on 0.1.47 and ported to v0.2.4.2.

Results

The measured engine was built from the patch before its last two edits, which change only comments and DETAILS.md. ctest was run again on the final tree.

A. Growing conversations, five arms

4 branches share an ~18.4K-token prefix. Each branch is a growing conversation: each turn asks for the copper, silver and amber values of two reference blocks and their sum, and the arm's own reply is appended. 10 rounds × 4 branches = 40 replies per pass. Two passes (forward, then reverse arm order), temperature 0, thinking off, --adapt-swaps 0, max_tokens 128; every reply was 51 tokens.

median, both passes unmodified patched, off tail tail + reuse no conversation cache
tail parks — — 78 of 78 78 of 78 —
parked image 1,094.9 MiB 1,094.9 MiB 233.8 MiB 233.8 MiB —
park time 377.2 ms 375.7 ms 122.7 ms 78.2 ms —
restore time 96.0 ms 96.2 ms 43.0 ms 38.2 ms —
client latency 2,118 ms 2,117 ms 1,840 ms 1,774 ms 3,652 ms
latency, pass 1 / pass 2 2,093 / 2,183 2,081 / 2,175 1,819 / 1,859 1,798 / 1,766 3,628 / 3,681
  • Park and restore medians are over all 78 parks and 72 restores per arm. Latency is over rounds 1-9 (72 requests per arm); round 0 is dropped.
  • "No conversation cache" is the unmodified build with --conversation-cache-mib 0. It still reuses the in-session shared prefix (18,372 tokens), so it is a reference without parking, not a re-read from token 0.
  • Default path: the patched build with the switches off gave the same 80 replies as the unmodified build. Its conversation-cache events in both passes matched the unmodified build's first pass line for line once times and byte totals are removed: the same parks and restores in the same order, the same token counts and the same reused_kv_bytes.
    • Each image's snapshot_bytes is 104 bytes larger: the new 8-byte first_cell in 13 K/V records (12 QSA layers + the draft layer).
    • The unmodified build's own second pass differed from its first in two parks (one token shorter), their restores and the next parks' reused_kv_bytes. The same happened in an earlier six-round run, again only in the unmodified build's second pass.
  • Correctness: all four cached arms gave byte-identical replies to the no-cache arm in both passes. The replies are values computed from the reference text. 78 of 80 are correct. The other 2 (the same question in both passes) give the next block's values, identically in every arm, so that is the model's error.

B. Fixed branches replayed (latency)

Same patched binary, tail + reuse vs STRATA_NO_TAIL_PARK=1. Upstream's retained-K/V reuse stays active in the forced-off arm. 4 fixed branches of 18,430 tokens each (18,425 reused on return). ABBA order, 30 requests per run, the first 4 dropped: 52 requests per arm. Every reply is a fixed "OK", so this test measures time only.

median tail + reuse whole images change
client latency 487.8 ms 690.8 ms −29.4%
client latency, p95 505.0 ms 743.5 ms −32.1%
engine prompt time 164.9 ms 367.2 ms −55.1%
parked image 226.9 MiB 721.1 MiB −68.5%
park time 75.5 ms 230.1 ms −67.2%
restore time 28.6 ms 76.2 ms −62.5%
  • Park and restore are over all events, warm-up included: 58 parks and 52 restores per arm.
  • A 600-request soak over 8 branches (599 parks, 360 tail restores, 235 LRU evictions) had no failures and no CUDA errors in the engine log.
  • The kernel journal of that boot (journalctl -k -b) has no NVRM: Xid line.

Tests

ctest -E ple_parity -j1 on the final tree: 84/84 passed, including the conversation cache, snapshot, validation and transfer tests. ple_parity needs a Q2_0 shard I do not have. The host-side tests check that a tail restore writes back every cell from first_cell on and all running state byte for byte, never writes below first_cell, rejects malformed tails before any write, and that limit_tails drops exactly the stale tails.

  • #3321 (slot ↔ pool copy cost) and PR #3980 (huge pages for a fresh ConversationBuffer) make each copy faster. This patch copies less.
  • #1962 shares physical KV blocks across concurrent conversations. This patch does not share anything between conversations; on a sequential switch it keeps the prefix that is already in the session.

Evidence

Attached: strata-tail-park-evidence.zip. It contains:

  • the patch (git am on v0.2.4.2) and both test scripts with their base config;
  • each run's config, summary JSON, per-request JSONL and engine logs;
  • the ctest log, the kernel-journal check and SHA-256 sums.

Its README says how each number above was aggregated and how to rerun the tests. The prompts are synthetic; local paths and GPU UUIDs are replaced.

Caveats

  • Tested only on Linux/CUDA with 2 GPUs. Not on Windows, HIP or SYCL, or with images in the prompt.
  • A tail image carries only the newest checkpoint past its start, so a later request that rewinds to an earlier point inside the tail re-reads from the last checkpoint below it.
  • A tail image is valid only while later rewrites start at or past its first cell. Two unrelated conversations alternating never take the tail path.
  • With buffer reuse, up to 113 MiB of host memory (inside the cache budget) is held between a tail restore and the next park.
  • One earlier parallel ctest -j4 run on 0.1.47 had a single byte-exact snapshot failure. It has not reproduced in serial runs since, and the cause is not known.
  • Power was not measured.

What do you do today instead?

Whole-image parking, as upstream, with a free-RAM floor so a park cannot exhaust RAM. With ~130K-token agent conversations a whole image was ~3 GB, so many parks were refused and the main branch was re-read later. Writing refused parks to an SSD instead wrote ~275 GB per hour for this pattern, so I stopped that.

strata-tail-park-evidence.zip

Originally created by @fujiichi on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4021 ### Area [Engine] ### What do you want to do? Park only the tail of a conversation when an agent client switches to a request that shares everything except the last turn or two, instead of the whole conversation. Re-tested on **0.2.11** (2026-11-07): unchanged. In the test below (4 branches sharing an ~18K-token prefix, 10 rounds, 2 passes), unmodified 0.2.11 parked a whole image every time: 78 of 78 parks, 1,094.9 MiB and ~370 ms per park, 94 ms per restore — the same as on 0.2.4.2 (1,094.9 MiB, 377 ms). The patch, ported to 0.2.11, cut the parked image to 233.8 MiB and the client latency by 15–16%. Details are in the comment below; the original report follows. **Strata version:** v0.2.11 (`c3b3f503`), built from source (Release, `STRATA_ENABLE_CUDA=ON`, `CMAKE_CUDA_ARCHITECTURES=86`, CUDA 13.1). The patch is ported to the same tag. **Graphics card, memory and system:** 2× NVIDIA GeForce RTX 3060 12 GB (`--layer-split auto`), 96 GB RAM, Ubuntu 26.04.1 LTS (Linux 7.0.0), NVIDIA driver 595. ## Summary With an agent client (Claude Code with subagents), a long conversation often alternates with a short side request that shares everything except the last turn or two. Today every switch parks the **whole** outgoing conversation, although the incoming request rewrites the session only from a cell near the end. A patch parks only the **tail** in that case: the running state, the K/V cells from the branch point (page aligned) on, and the newest checkpoint past it. The cells below the branch point stay in the session. An optional part reuses the running-state allocations of a restored tail image for the next tail park. On v0.2.4.2, 2× RTX 3060, with tail parking and buffer reuse on: - **Test A, growing conversations, against an unmodified v0.2.4.2 build:** - every park was a tail (78 of 78); - parked image 234 MiB instead of 1,095 MiB (−79%); - park 78 ms instead of 377 ms; restore 38 ms instead of 96 ms; - client latency 1,774 ms instead of 2,118 ms (−16%). - **Test B, fixed branches replayed, against the same patched binary with tail parking forced off:** - client latency 488 ms instead of 691 ms (−29%). - Replies after park → restore were byte-identical to a run without the conversation cache. - With the switches off, the patched build gave the same replies and the same conversation-cache events as the unmodified build. Both parts are opt-in (`STRATA_TAIL_PARK=1`, `STRATA_TAIL_PARK_REUSE=1`); without `STRATA_TAIL_PARK=1` none of the tail steps run. I can open a PR if this is wanted. ## Setup - Strata v0.2.4.2 (`dfa3f402`) + the patch, Linux, CUDA 13.1, `sm_86`, built from source (Release, `STRATA_ENABLE_CUDA=ON`). The unmodified build is the same tag with the same options. - 2× RTX 3060 12 GB, `--layer-split auto` (layers 0-23 on GPU 0, 24-47 on GPU 1). 96 GB RAM. - Qwen3.8-Flash-Next IQ2_XS, `--kv int8 --kv-resident 32768 --max-context 524288 --rope-scaling yarn --rope-scale 2 --spec 4 --spec-min-p 0.5` with the MTP draft layer, `--conversation-cache-mib 16384 --conversation-cache-min-free-mib 8192 --vram-reserve-mib 1024`. ## The change - **Tail parking** (`STRATA_TAIL_PARK=1`). - `ConversationKv` and `SavedConversation` get a `first_cell` (0 = whole image, as today). - On a switch, the outgoing conversation's boundary with the incoming prompt is the matched checkpoint (`resume`). - If the tail from that page is at most half of the whole image, only the tail is parked. It carries the newest checkpoint past its start (`STRATA_TAIL_PARK_CHECKPOINTS=N` for more; 0 = all). Carrying all of them made the tail grow by one running-state copy (114 MiB here) per turn, until it failed the half rule after three turns. - With `--layer-split`, every stage's image is parked the same way on its own GPU. - `ConversationCache::limit_tails(first_dirty)` drops a tail image once a later rewrite starts before its first cell (a prompt read from further back, a restore, a slot or session-file restore). - Retained-K/V reuse is not used for tails. `STRATA_NO_TAIL_PARK=1` forces whole images for A/B tests. - **Running-state buffer reuse** (`STRATA_TAIL_PARK_REUSE=1`). After a tail restore, the image's five running-state buffers (GDN, PLE, and the indexer's tails / dead / block_pos; 56.5 MiB per GPU here) are kept in the cache budget and reused by the next tail park. Every byte is still copied; only the allocations and their zero fill are saved. If the budget has no room they are released; nothing is evicted to keep them. - **Default path.** The `limit_tails` calls, `limit_reuse` before a restore and the running-state estimate in a capture run only with `STRATA_TAIL_PARK=1`. One commit on `v0.2.4.2`, 8 files (+596 −41): `conversation_cache.hpp`, `conversation_snapshot.{hpp,cpp}`, `conversation_state.cpp`, `generate.cpp`, the cache and validation tests, DETAILS.md. A first version was written on the 0.1.38 line; this one was redone on 0.1.47 and ported to v0.2.4.2. ## Results The measured engine was built from the patch before its last two edits, which change only comments and DETAILS.md. ctest was run again on the final tree. ### A. Growing conversations, five arms 4 branches share an ~18.4K-token prefix. Each branch is a growing conversation: each turn asks for the copper, silver and amber values of two reference blocks and their sum, and the arm's own reply is appended. 10 rounds × 4 branches = 40 replies per pass. Two passes (forward, then reverse arm order), `temperature 0`, thinking off, `--adapt-swaps 0`, `max_tokens 128`; every reply was 51 tokens. | median, both passes | unmodified | patched, off | tail | tail + reuse | no conversation cache | |---|---:|---:|---:|---:|---:| | tail parks | — | — | 78 of 78 | 78 of 78 | — | | parked image | 1,094.9 MiB | 1,094.9 MiB | 233.8 MiB | 233.8 MiB | — | | park time | 377.2 ms | 375.7 ms | 122.7 ms | 78.2 ms | — | | restore time | 96.0 ms | 96.2 ms | 43.0 ms | 38.2 ms | — | | client latency | 2,118 ms | 2,117 ms | 1,840 ms | 1,774 ms | 3,652 ms | | latency, pass 1 / pass 2 | 2,093 / 2,183 | 2,081 / 2,175 | 1,819 / 1,859 | 1,798 / 1,766 | 3,628 / 3,681 | - Park and restore medians are over all 78 parks and 72 restores per arm. Latency is over rounds 1-9 (72 requests per arm); round 0 is dropped. - "No conversation cache" is the unmodified build with `--conversation-cache-mib 0`. It still reuses the in-session shared prefix (18,372 tokens), so it is a reference without parking, not a re-read from token 0. - **Default path:** the patched build with the switches off gave the same 80 replies as the unmodified build. Its conversation-cache events in both passes matched the unmodified build's first pass line for line once times and byte totals are removed: the same parks and restores in the same order, the same token counts and the same `reused_kv_bytes`. - Each image's `snapshot_bytes` is 104 bytes larger: the new 8-byte `first_cell` in 13 K/V records (12 QSA layers + the draft layer). - The unmodified build's own second pass differed from its first in two parks (one token shorter), their restores and the next parks' `reused_kv_bytes`. The same happened in an earlier six-round run, again only in the unmodified build's second pass. - **Correctness:** all four cached arms gave byte-identical replies to the no-cache arm in both passes. The replies are values computed from the reference text. 78 of 80 are correct. The other 2 (the same question in both passes) give the next block's values, identically in every arm, so that is the model's error. ### B. Fixed branches replayed (latency) Same patched binary, tail + reuse vs `STRATA_NO_TAIL_PARK=1`. Upstream's retained-K/V reuse stays active in the forced-off arm. 4 fixed branches of 18,430 tokens each (18,425 reused on return). ABBA order, 30 requests per run, the first 4 dropped: 52 requests per arm. Every reply is a fixed "OK", so this test measures time only. | median | tail + reuse | whole images | change | |---|---:|---:|---:| | client latency | 487.8 ms | 690.8 ms | −29.4% | | client latency, p95 | 505.0 ms | 743.5 ms | −32.1% | | engine prompt time | 164.9 ms | 367.2 ms | −55.1% | | parked image | 226.9 MiB | 721.1 MiB | −68.5% | | park time | 75.5 ms | 230.1 ms | −67.2% | | restore time | 28.6 ms | 76.2 ms | −62.5% | - Park and restore are over all events, warm-up included: 58 parks and 52 restores per arm. - A 600-request soak over 8 branches (599 parks, 360 tail restores, 235 LRU evictions) had no failures and no CUDA errors in the engine log. - The kernel journal of that boot (`journalctl -k -b`) has no `NVRM: Xid` line. ### Tests `ctest -E ple_parity -j1` on the final tree: 84/84 passed, including the conversation cache, snapshot, validation and transfer tests. `ple_parity` needs a Q2_0 shard I do not have. The host-side tests check that a tail restore writes back every cell from `first_cell` on and all running state byte for byte, never writes below `first_cell`, rejects malformed tails before any write, and that `limit_tails` drops exactly the stale tails. ## Related - #3321 (slot ↔ pool copy cost) and PR #3980 (huge pages for a fresh `ConversationBuffer`) make each copy faster. This patch copies less. - #1962 shares physical KV blocks across concurrent conversations. This patch does not share anything between conversations; on a sequential switch it keeps the prefix that is already in the session. ## Evidence Attached: `strata-tail-park-evidence.zip`. It contains: - the patch (`git am` on `v0.2.4.2`) and both test scripts with their base config; - each run's config, summary JSON, per-request JSONL and engine logs; - the ctest log, the kernel-journal check and SHA-256 sums. Its README says how each number above was aggregated and how to rerun the tests. The prompts are synthetic; local paths and GPU UUIDs are replaced. ## Caveats - Tested only on Linux/CUDA with 2 GPUs. Not on Windows, HIP or SYCL, or with images in the prompt. - A tail image carries only the newest checkpoint past its start, so a later request that rewinds to an earlier point inside the tail re-reads from the last checkpoint below it. - A tail image is valid only while later rewrites start at or past its first cell. Two unrelated conversations alternating never take the tail path. - With buffer reuse, up to 113 MiB of host memory (inside the cache budget) is held between a tail restore and the next park. - One earlier parallel `ctest -j4` run on 0.1.47 had a single byte-exact snapshot failure. It has not reproduced in serial runs since, and the cause is not known. - Power was not measured. ### What do you do today instead? Whole-image parking, as upstream, with a free-RAM floor so a park cannot exhaust RAM. With ~130K-token agent conversations a whole image was ~3 GB, so many parks were refused and the main branch was re-read later. Writing refused parks to an SSD instead wrote ~275 GB per hour for this pattern, so I stopped that. [strata-tail-park-evidence.zip](https://github.com/user-attachments/files/33915644/strata-tail-park-evidence.zip)
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:6659853817 --> @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).
Author
Owner

@fujiichi commented on GitHub (Nov 7, 2026):

Re-tested on 0.2.11 as asked. The issue still applies, and the patch is ported to 0.2.11.

Unmodified 0.2.11 still parks a whole image on every switch in this workload: 78 of 78 parks, 1,094.9 MiB, ~370 ms per park.

Port. Two commits on top of v0.2.11 (local branch; I can push it or open a PR) — the port of the original patch, and a follow-up that keeps the snapshot byte counts identical to upstream when the switch is off. 0.2.11 has no equivalent of tail parking; the parking code was refactored (one park_source for the main session and batch slots, async/VRAM park options), and the patch now:

  • tail-parks the main session only; batch slots are always parked whole;
  • keeps tail images out of the new async staging and VRAM park slots (they are copied synchronously);
  • keeps upstream's take_reuse_for(ids) on the default path and the #4677 fix untouched.
    It also fixes a bug that the original v0.2.4.2 patch had: a borrowed prefix (restore_prefix) could leave a tail image whose start was below the borrowed length. Now a borrow drops all tail images, and restore_prefix refuses a tail record.

Results on 0.2.11 (same workload as the original report; 4 branches, ~18K-token shared prefix, 10 rounds × 2 passes, temperature 0, 2× RTX 3060, Qwen3.8-Flash-Next IQ2_XS):

arm client latency (median) park parked image restore replies = no-cache run
unmodified 0.2.11 2,077 ms 370 ms 1,094.9 MiB 94 ms yes
patched, switches off 2,072 ms 370 ms 1,094.9 MiB 94 ms yes
STRATA_TAIL_PARK=1 1,772 ms (−15%) 120 ms 233.8 MiB 43 ms yes
+ STRATA_TAIL_PARK_REUSE=1 1,742 ms (−16%) 77 ms 233.8 MiB 36 ms yes
no conversation cache 3,542 ms — — — (reference)
  • Tail arms: every park was a tail (78 of 78).
  • Default path: with the switches off, the replies were identical to unmodified 0.2.11, and the conversation-cache event log was byte-identical to one of unmodified 0.2.11's two passes. Unmodified 0.2.11 itself differs between its own two passes from the 4th event (a park of 18,476 vs 18,474 tokens), so that is run-to-run variation, not the patch.
  • ctest -R conversation: 10 of 10 pass, including the tail tests the patch adds.
  • No Xid during the runs.

Happy to open a PR against main if this is wanted.

/reopen

strata-tail-park-evidence-v0211.zip

<!-- gh-comment-id:6700573512 --> @fujiichi commented on GitHub (Nov 7, 2026): Re-tested on **0.2.11** as asked. The issue still applies, and the patch is ported to 0.2.11. **Unmodified 0.2.11** still parks a whole image on every switch in this workload: 78 of 78 parks, 1,094.9 MiB, ~370 ms per park. **Port.** Two commits on top of `v0.2.11` (local branch; I can push it or open a PR) — the port of the original patch, and a follow-up that keeps the snapshot byte counts identical to upstream when the switch is off. 0.2.11 has no equivalent of tail parking; the parking code was refactored (one `park_source` for the main session and batch slots, async/VRAM park options), and the patch now: - tail-parks the main session only; batch slots are always parked whole; - keeps tail images out of the new async staging and VRAM park slots (they are copied synchronously); - keeps upstream's `take_reuse_for(ids)` on the default path and the #4677 fix untouched. It also fixes a bug that the original v0.2.4.2 patch had: a borrowed prefix (`restore_prefix`) could leave a tail image whose start was below the borrowed length. Now a borrow drops all tail images, and `restore_prefix` refuses a tail record. **Results on 0.2.11** (same workload as the original report; 4 branches, ~18K-token shared prefix, 10 rounds × 2 passes, temperature 0, 2× RTX 3060, Qwen3.8-Flash-Next IQ2_XS): | arm | client latency (median) | park | parked image | restore | replies = no-cache run | |---|---|---|---|---|---| | unmodified 0.2.11 | 2,077 ms | 370 ms | 1,094.9 MiB | 94 ms | yes | | patched, switches off | 2,072 ms | 370 ms | 1,094.9 MiB | 94 ms | yes | | `STRATA_TAIL_PARK=1` | 1,772 ms (−15%) | 120 ms | 233.8 MiB | 43 ms | yes | | + `STRATA_TAIL_PARK_REUSE=1` | 1,742 ms (−16%) | 77 ms | 233.8 MiB | 36 ms | yes | | no conversation cache | 3,542 ms | — | — | — | (reference) | - Tail arms: every park was a tail (78 of 78). - Default path: with the switches off, the replies were identical to unmodified 0.2.11, and the conversation-cache event log was byte-identical to one of unmodified 0.2.11's two passes. Unmodified 0.2.11 itself differs between its own two passes from the 4th event (a park of 18,476 vs 18,474 tokens), so that is run-to-run variation, not the patch. - `ctest -R conversation`: 10 of 10 pass, including the tail tests the patch adds. - No Xid during the runs. Happy to open a PR against main if this is wanted. /reopen [strata-tail-park-evidence-v0211.zip](https://github.com/user-attachments/files/34506889/strata-tail-park-evidence-v0211.zip)
Author
Owner

@fujiichi commented on GitHub (Nov 7, 2026):

/reopen

<!-- gh-comment-id:6700596497 --> @fujiichi commented on GitHub (Nov 7, 2026): /reopen
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2026):

Reopened, thank you. A maintainer will pick it up from here.

<!-- gh-comment-id:6700598356 --> @github-actions[bot] commented on GitHub (Nov 7, 2026): Reopened, thank you. A maintainer will pick it up from here.
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#1733
No description provided.