Skip to content

[Engine] Restore log: name the depth, the prefix matched, and the tail read (2/4 of #7648) - #7651

Open
giphoo wants to merge 1 commit into
Niko1221:mainfrom
giphoo:pr/7648-restore-depth-fields
Open

giphoo wants to merge 1 commit into
Niko1221:mainfrom
giphoo:pr/7648-restore-depth-fields

Conversation

@giphoo

@giphoo giphoo commented Dec 2, 2026 •

Copy link
Copy Markdown

Part 2/4 of #7648 — observability for the restore path.

Background

The restore log line only says "restored N tokens (live|checkpoint)". When a restore lands shallower than the match (a fork or a partial mount), that is invisible in the log.

What this adds

Three fields on the restore line:

  • depth — the depth actually mounted (the resume point);
  • prefix — the prefix the image matched;
  • tail — how much the request still has to read from that depth.

Why

The bug fixed in part 1/4 was invisible because "landed shallower than the match" and "full hit" looked identical in the log. These three fields make the difference readable.

Review focus

  • Pure logging: no behavior change;
  • depth == prefix is the normal case; depth < prefix is a fork or partial mount.

Part 2/4 of #7648. Parts 3–4 follow.

Validation

Commands run:

cmake -S engine -B build -DSTRATA_ENABLE_HIP=ON
cmake --build build --target strata -j
./build/strata --serve --pack <pack> --conversation-spill-persist

Revision tested: upstream main + this patch (the branch head).

Environment: AMD W7900 (gfx1100), ROCm, Qwen3.8-Flash IQ4_XS, 277K-token conversations.

What I saw: the three-session rotation (build → switch → restart → restore) runs green; reuse rate 99.98–99.998% (no regression).

…he tail it reads (Niko1221#7648)

A restore that lands shallower than the match - a fork reading a prefix of a longer live
state - looked the same in the log as a full hit, which is what made Niko1221#7648 take a trace
build to see.  The line now carries depth (what was mounted), prefix (where the image
matched) and tail (the tokens this request reads on from the depth).

Refs Niko1221#7648.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:

  • Add "Validation": the exact commands, the revision and environment tested, and what you saw.

Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-format Title or template does not follow CONTRIBUTING.md yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant