fix(pflash): score the user query and reject non-finite scores - #679
Open
Graffioh wants to merge 1 commit into
Open
fix(pflash): score the user query and reject non-finite scores#679Graffioh wants to merge 1 commit into
Graffioh wants to merge 1 commit into
Conversation
Graffioh
force-pushed
the
codex/pflash-query-nonfinite
branch
2 times, most recently
from
September 3, 2026 11:37
d3313fc to
78ac617
Compare
Graffioh
marked this pull request as ready for review
September 3, 2026 12:08
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Graffioh
force-pushed
the
codex/pflash-query-nonfinite
branch
from
September 3, 2026 12:58
78ac617 to
7f6c0ac
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
/v1/responsesinput, into the drafter-rendered token stream and uses its last eight tokens as the scorer queryDFLASH_COMPRESS_QUERY_TOKENS, which remains the lexical-anchor windowWhy
The previous fixed
lookahead=8window landed on the rendered assistant suffix rather than on the question. On Strix Halo/gfx1151, corrupted HIP forward values could also reach the scorer; NaN comparisons then left earlier maxima in place and silently produced a selection.Query selection now starts from the same normalized message stream used by prompt rendering. That keeps OpenAI Chat, Anthropic Messages, Responses arrays, and Responses string input under one user-message contract.
Changed flow
flowchart LR A["HTTP request<br/>chat / messages / responses"] --> B["normalize_chat_messages"] B --> C["final user text"] C --> D{"map suffix in<br/>drafter tokens"} D -->|missing| X["reject compression"] D -->|mapped window| E{"drafter placement"} E -->|local or layer split| F["Qwen3 / Qwen3.5 scorer"] E -->|remote| G["PFlash IPC daemon"] G --> F F --> H["capture scorer Q<br/>across 4,096-token chunks"] H --> I["score graph"] I -->|failed or non-finite| X I -->|finite| J["pool and chunk top-k"]FlowKV continues to score the tail of each independently compressed aged message. Whole-prompt PFlash supplies the explicit user-query window.
Verification
Current single-commit tree
78ac6178e:gfx1151:test_server_unitHIP_VISIBLE_DEVICES=1 ./build-hip-gfx1151/test_server_unit: 440 passed, 0 failedgit diff --checkFinite end-to-end Responses string-input validation on Radeon AI PRO R9700/gfx1201, using the supported ROCm Phase 1 q8 fallback:
/v1/responsesstring[12008, 12016)12025 -> 6009tokens (50.0% kept)ORCHID; effective input was 6,009 tokensFresh CI on
78ac6178e:The same long Responses request on the optional ROCm Phase 2 sparse-attention build produced
131072/131072non-finite tail scores at layer 1 and failed closed as intended. The result was unchanged under the documented legacyDFLASH_FP_NOPE_TAIL=0scoring mode.Earlier live 16K Strix Halo/gfx1151 validation of the same scoring mechanism:
[16374, 16382), rather than the rendered assistant suffixPaired long-context benchmark campaign: Luce-Org/luce_box#85.
Boundaries
The underlying ROCm Phase 2/gfx1151 numeric corruption is intentionally not hidden or fixed here. This change makes it observable and prevents quality results from being reported from invalid scores. The supported ROCm Phase 1 path has a finite successful end-to-end result above.
Review status
Ready for human review. The implementation, focused contract tests, finite end-to-end proof, and all runnable CI checks are green. The PR remains marked draft until the author chooses to flip the GitHub review state.