mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4009] [Engine] content bleed, developer cache shipped with a question about 'The Lord' maybe? #1728
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#1728
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 @bob-u on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4009
This is a fun one, model ignored harness, possibly used cached prompt. S1 is a version of a preset (one with S1 and one /w out it). The following is AI written summary:
Cross-conversation context bleed with S1 cache flags: server answers a conversation the client never sent
Severity: Critical (silent output corruption; the model rejects the actual system prompt and responds to a different conversation)
Engine: 0.1.48 —
strata.exe 0.1.48-windows-x86_64-hip-rx9070(Strata app 0.2.3)Hardware / OS: AMD Radeon RX 9070 (gfx1201 / RDNA4), Windows x64, 96 GiB RAM
Model served:
Qwen3.8-Flash-Next-UD-Q4_K_XL(sharded GGUF + PLE table, native packunsloth-ud-q4_k_xl, MTP draft frommtp/rt)Date of incident: 2026-10-24
Reporter environment: single local user, single client process; no other users, no remote traffic (served
--access local, 127.0.0.1:8080). API keys redacted.Summary
With the "S1" extra-flags preset, the engine contaminated a brand-new conversation with a different, prior conversation: a fresh 9,371-token agent request — one whose full client-side payload I later verified byte-for-byte — received answers to a different conversation entirely, including the model rejecting its own actually-received system prompt and quoting a user message that was never sent by any client.
The engine's own log shows that ~60 s before the first request, a short conversation (196 prompt tokens → 3,077 generated tokens) ran and was parked in the conversation cache (
parked=2). The very next conversation — from a different client session with a completely different prompt — then answered it. The phantom conversation's text does not exist anywhere on disk (verified by full-text search of every client session store and every Strata data file), so it was never sent by any client I can find; the engine injected it from cache state.Launching the same model file with the same client and effectively the same prompt under the base profile (without the S1 flags) produces perfectly normal behavior, including parking a similar stray conversation with no bleed. The anomaly is fully contained by the S1 flag set.
Notably, the first contaminated request logged
0 reusedKV tokens, so this did not travel through the reported prefix-reuse path — the bleed moved through a layer that doesn't report there (see "Suspected mechanism").Exact flag delta (S1 vs base, same model)
Base profile (
ud-q4_k_xl-256k.json) args:S1 profile (
ud-q4_k_xl-256k-s1.json) = identical above, plus:Important control fact: the base profile also enables the conversation cache — auto-sized:
"conversation cache sized from the free RAM: 3072 MiB for up to 4 parked conversations". The base log at 13:09+ shows a stray conversation being parked (prompt 195 tokens → 99 generated, parked, reused across turns) and no cross-conversation bleed at all afterwards. So "a conversation cache exists" is not sufficient to reproduce; the S1 additions are required.Timeline (from
ud-q4_k_xl-256k-s1.engine.log+ client session store)**What the model did (symptoms in the corrupted session)
Client sent, turn 1 (verbatim, recorded in the client's session store):
what is the weather like at washington usa?plus harness system prompt + 9 tool schemas + spliced context. The model answered:Evidence
A. The client provably sent the real prompt, byte-identical to healthy runs.
The client (
llm-pi-aiadapter,openai-completions,http://127.0.0.1:8080/v1) persists its request headers. Corrupted session vs. a healthy session on the base profile: request-header records identical, 29,599 bytes (same model field, same 9 tools, same params). System message identical, 6,075 bytes, beginning "You are an AI agent powered by DeepSeek Harness…".B. The model's own chain-of-thought (captured in the corrupted session) reads the phantom text as the user turn.
Turn-1 reasoning excerpt: "The user is asking me to identify what 'The Lord' refers to in a question about 'The Lord.' … Let me re-read it. 'Who are you asking to identify what "The Lord" refers to…' This is a meta-question that's confusingly self-referential." — i.e., inside the model the effective prompt was a different conversation. Later reasoning: "claiming I have a 'DeepSeek harness.' This is factually incorrect." — a prompt present in the request was denied by the model.
C. The engine log shows a parked prior conversation immediately preceding the corrupted session, and only on S1.
S1 log lines 112–133 (trimmed):
Base and iq3_s engine logs contain only the 53-token health probe at startup — the 196→3,077 exchange happened only in the S1 run, ~60 s before the first corrupted request. (I could not attribute the origin of that 196-token request — checking the app's own UI chat history is on my side; it may even be an internal probe. Its content, however, resurfaced verbatim as the corrupted session's "user message.")
D. The corrupted request logged
0 reusedKV.First corrupted request:
prompt 9371 tokens = 0 reused + 9371 read. A later continuation in the same conversation correctly logs9824 reused, so the counter works. Therefore the bleed did not come through the reported prefix-reuse path — it moved through a cache layer that bypasses that accounting.E. Control run — same model, same client, same prompt mix, base flags: clean.
Base profile (started 13:09:47) also parks conversations in the auto conversation cache (
prompt 195 tokens → 99 generated, parked) and serves the same client traffic afterwards with normal behavior: tools used, system prompt honored, replies on-topic. Multiple healthy sessions same day.F. Secondary observation (not the bug, but relevant): the engine serves whatever model file the profile points at, regardless of the
modelfield in the OpenAI request; my client config still names a different model id (…-iq3_s) than the served file (…UD-Q4_K_XL). The model-name mismatch in the system prompt may have made the contaminated model's "I am Qwen, nothing to do with DeepSeek" denial more sticky. Please ignore for the cache bug.Suspected mechanism (bisect candidates, in order)
Given E (auto conversation cache alone = no bleed) and D (no prefix reuse counted), suspects are the S1-only layers that graft state without being counted:
--prompt-cache-spread/--prompt-cache-tailwith--prompt-cache 12— content-keyed (non-positional) KV windows; a key collision, a sloppy tail match, or int8 KV snapshot aliasing could splice the parked conversation's KV into a fresh prompt without touching thereusedcounter.--expert-cache-per-layer— per-layer MoE expert activation cache, 1,920 pre-filled GPU slots, on GPU compute path. The startup banner itself warns: "the GPU computes the experts in the cache; it rounds differently from the CPU, so a reply can differ slightly from a run without the cache". Hash-key collisions on resident expert outputs could bias a fresh prompt's hidden state toward a prior conversation without any token-level trace.--conversation-cache-mib 12288(4× the auto size) — less likely given E, but part of the matrix.@github-actions[bot] commented on GitHub (Oct 24, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (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
@github-actions[bot] commented on GitHub (Oct 24, 2026):
Thanks, this follows the format now.
@bob-u commented on GitHub (Oct 25, 2026):
I figured it must have been a corrupted model because benchmark's sanity checks failed, all 11 of them. After re-downloading all sanity checks pass and so far no weird conversations.
I think the engine should check the checksum on every load to ensure the model is w/o defects.
@bob-u commented on GitHub (Oct 25, 2026):
Right after I posted update...the issue is back:
Maybe it's a harness issue.
@bob-u commented on GitHub (Oct 25, 2026):
It just spit out, in response to my 'hi', functional Task management app. Is someone pranking me? From google search, TaskFlow app exists and looks very similar.
In response to my 'hi' it looks like it thought I wanted it to:
No matter what I say, the analysis for this session is always above.
One thing worth noting is that this does not happen with Swift or IQ_S models, just the IQ4_K_XL
@Niko1221 commented on GitHub (Oct 29, 2026):
Engine 0.1.48 is old and you found a damaged model file first. Please update to 0.2.7.1 and, if an answer to a different conversation shows up again, send the engine log and the exact request body of that turn. Adding the S1 cache flags one at a time would show which one triggers it.
@bob-u commented on GitHub (Oct 30, 2026):
Btw, thank you for this great project. I assumed the file was corrupted, however based on what happened after I am not so sure. Could it be that after loading the model it worked fine because parts of the software (such as caches) were not 'hot' yet (some parts work differently on a fresh start vs next)? I have seen the same issue on 0.1.50. I'll upgrade to the latest and report back.
@bob-u commented on GitHub (Oct 30, 2026):
0.1.54 engine seems to have fixed the issue. With the upgrade, as a bonus, prefill is about 15% faster as well.