Repository navigation
feat(pflash): --pflash on|off, with the unified view by default - #878
Merged
Merged
Conversation
Graffioh
force-pushed
the
fix/pflash-unified-long-line
branch
from
October 22, 2026 13:03
c5a8f61 to
62fa792
Compare
Graffioh
force-pushed
the
fix/pflash-unified-long-line
branch
from
October 23, 2026 08:19
0991056 to
f2b1713
Compare
Graffioh
marked this pull request as ready for review
October 23, 2026 08:19
davide221
reviewed
Oct 23, 2026
davide221
left a comment
Contributor
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed f2b1713c · 1 candidate issue checked, kept at ≥70% confidence · add the code-review label to review again
- A line longer than its cap can take was dropped whole, whatever it scored (a one-line paste with its needle). The check runs on the message's tokens and again on the region's own cap, which leaves out the always-kept head and tail lines. Such a message sends a view the turn would start to the chat view, which selects inside the line; a view that continues serves it verbatim. - Views paged under older rules are not served again (views version bump). - Tool-call turns with empty content no longer break the request probe's message mapping. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- --pflash on|off replaces --prefill-compression off|auto|always. The old flag and LUCE_PREFILL_MODE fail with a hint; the entrypoint takes LUCE_PFLASH=on|off. /props reports pflash.mode "on" or "off". --pflash on --prefill-threshold 0 compresses every prompt. - With --pflash on and the strict-selection environment, the unified view is on, and PFLASH_UNIFIED is gone. A request it hands back goes to the chat view, whose prompt it adopts, so the next turn continues that prompt. - Under concurrent serving the unified view reads the prefix cache as the scheduler thread measured it, as the chat view does, instead of reading it from the compression worker. - A retry that pins pflash_required text is not answered with a stored prompt that may have left it out: the chat view's repeat checks its kept spans, and an adopted prompt, which records none, is compressed afresh. BREAKING CHANGE: --prefill-compression and LUCE_PREFILL_MODE are removed; use --pflash on|off and LUCE_PFLASH=on|off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graffioh
force-pushed
the
fix/pflash-unified-long-line
branch
from
October 25, 2026 12:22
f2b1713 to
9b9732d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PFlash is now
--pflash on|off, and the unified view is the default PFlash path. The chat view serves only the requests the unified view cannot take, and the unified view adopts its output, so the conversation stays on one append-only view.--pflash on|off(or--pflash=on) replaces--prefill-compression off|auto|always:oncompresses prompts from--prefill-thresholdtokens, asautodid.alwaysis gone:--prefill-threshold 0compresses every prompt.--prefill-compressionnow fails startup and points to--pflash.LUCE_PFLASH=on|offinstead ofLUCE_PREFILL_MODE./propsreportspflash.modeas"on"or"off".PFLASH_UNIFIED. With--pflash on, the unified view serves requests whenever the selection gives per-candidate scores. That means a strict-selection environment, which is what the release profile sets. Selections without per-candidate scores (legacy or split scorer, fold strategy) keep the chat view. IfPFLASH_UNIFIEDis still set, startup reports it and ignores it. The release profile drops it and now applies 14 defaults.niah_gen.pywrites it), so about 91 tokens were served and the answer was wrong. A newest-turn message with an over-cap line now counts as content the view cannot page, like content under five lines. The line is checked twice: against a cap on all of the message's tokens, before scoring, and against the region's own cap, which leaves out the always-kept first and last two lines and the overheads (a line that fits the first can still miss the second when those lines are long). Then:[pflash-unified] message N: a X-token line is over its cap Y(orover its region's cap Y).uncachedorreset_uncachedhand-back (cold history, or such a paste), the chat view serves the turn. The unified view then adopts the served prompt as the conversation's view, with no regions. The next turn continues it append-only and reuses its prefix, instead of handing back again. This also covers a tool session the chat view serves whole. Unified stats count it asadopt.<reason>. Trade-off: content the chat view left out of the adopted prompt cannot be recalled later.pflash_requiredtext names lines the stored prompt left out is compressed afresh, not answered with that prompt. The unified view already checked its regions. The chat view's repeat now checks its kept spans (this bug predates this PR). An adopted prompt records no kept spans, so withpflash_requiredit is never repeated.Evidence
Setup: an R9700 (gfx1201) running the release profile with the three published head files, q4_0 KV,
--max-ctx 204800and a fresh--kv-cache-dirper run.Three 120K needle cases from
niah_gen.py, sent to/v1/chat/completions:The chat view's relevance-spread check passes (0.056-0.069 < 0.11). The scorer ranked the needle segment #2 of 318 even on main; the needle was lost at paging, not at scoring.
Two-turn chat, needle paste then a follow-up question:
Agent request with an 80,635-token tool output (4,000 lines, key on line 2500), after an empty-content tool-call turn:
In the same session, the follow-up request continued the view and its recall fired.
Tests
test_unified_long_line_paste_goes_to_the_chat_viewfails on main, where the 12K-token line is replaced by a marker. Here it passes, and a follow-up turn continues the adopted view.test_unified_long_line_tool_output_is_served_whole: a fresh agent turn with a one-line tool output is served raw by the chat view and adopted. The next call continues the view with prefix equality.test_unified_cold_chat_history_is_adopted_after_the_chat_view: turn 1 matches the chat-view-only baseline token for token; turn 2 continues and reuses the snapshot cut.test_unified_long_line_under_the_message_cap_but_over_the_region_cap: two long always-kept lines, then a kiwi line that fits the message's cap but not the region's. It fails without the region check (the line is dropped) and passes here (hand-back, kiwi served).test_unified_repeat_of_an_adopted_prompt_with_a_new_pin_serves_it: an adopted chat-view prompt, then a retry pinning a sentence it dropped. It fails without either the chat-view or the unified-view check.test_entrypoint.shpasses withLUCE_PFLASH.test_server_unit: 1062 passed, 0 failed, 4 skipped;test_tool_checks: 92 passed (HIP build, rebased on 3ef243e).Not covered
🤖 Generated with Claude Code