mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4413] [Engine] MTP chain_launch() lacks the max_cells clamp draft() has - pipelined chains stage drafter cells past max-context near the context end #1967
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1967
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @udqe on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4413
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
MtpDrafter::draft()guards the chain end explicitly (mtp.cpp ~1628-1630):The pipelined decode path (
--pipeline-windows 2) never callsdraft(); the verdict handlers callchain_launch(..., chain_n, chain_n, ...)withchain_n = kVerifyMaxT - 1(7) and no clamp —chain_launch(mtp.cpp ~1825-1876) holds nost_reference at all. The only context-end check is the front-stage guardif (st == 0 && A.p + A.T > o.max_context) { ending = true; continue; }(generate.cpp ~16186):endingbreaks the loop only at the next iteration (~16098), while the current window's verdict still launches the chain at the bottom of the same iteration (~16306/16337, gated bylastalone — andlastcovers nf/eos/max_new/stop but not the context end, ~16275). A window ending within 7 tokens of--max-contexttherefore stages cells up to max_context+6: in ring mode the K/V write wraps to old slots and rope cos/sin read past the table (layer.hpp calls that class "a wrong rotation rather than a fault") — garbage drafts at the boundary; with--mtp-window 0the same cells index pastpage_table— an out-of-arena device write.Expected: the same clamp as
draft()on every chain path. Actual: none on the pipelined path.A context limit exists on every other drafting path in the file —
GatedDraftLimit(mtp, ..., p + a + 1, o.max_context)(generate.cpp ~16737/~18077/~18383), the windowroom = std::min(..., o.max_context - p)sizing (~16416/~18213/~18253), and the batch guardsl.p + 3 <= o.max_context ? 2 : 1(~12738) — the pipelined chain is the one path without one, andchain_launchtakes no context parameter at all (mtp.cpp ~1825-1826). The pipelinedlastflag covers stop/eos/max_new but not the context end (const bool last = nf || eos || produced_n >= max_new || stop_req.load();, ~16275), so a near-full-context window still launches the full 7-output chain.Smallest steps or command that reproduce it
Static finding (no fault observed on my machine). What would verify: a debug build with a small --max-context (e.g. 2048), --pipeline-windows 2 --spec 4 and --mtp-window 0, a conversation driven to within ~7 tokens of the cap under compute-sanitizer (expect writes past the drafter page table near the boundary); or a ring-K/V run with the old cells' slots poisoned, checking whether they change at the boundary.
Reproduction status
unconfirmed static analysis (recipe above). The pipelined chain path itself is live on this machine every request; only the near-cap boundary condition has not been reached here.
Strata version
Terminal and app 0.2.7, engine 0.1.52 (release store build windows-x86_64-cuda-cuda13); code citations checked against the v0.2.7 source checkout, re-read twice on two separate days.
Graphics card, memory and system
2x RTX 4090 24 GiB (both PCIe 4.0 x16, engine probe 26.3-26.4 GB/s), Threadripper 3970X, 128 GiB RAM, Windows 11 (WDDM), driver 610.88.
Model, size and settings
Qwen3.8-Flash-Next Unsloth UD-Q4_K_XL, --max-context 307200 --kv int8 --kv-resident 32768 --spec 4 --mtp rt --pipeline-windows 2 --layer-split auto (K=22) --vram-reserve-mib 1728 --vram-reserve-later-mib 972 --pcie-frac 0.20 --spec-min-p 0.70 --adapt-async 1 --conversation-cache-mib 12288 --conversation-cache-slots 4 --expert-cache auto --prefill auto. The pipelined chain path this report is about runs on every decode request of this machine (no fault seen here yet).
@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:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.