Skip to content

fix(pflash): read a quoted --prefill-curve as its points; drop dead kernel switches from the banner - #861

Merged
davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:fix/pflash-curve-arg
Oct 21, 2026
Merged

davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:fix/pflash-curve-arg

Conversation

@Graffioh

@Graffioh Graffioh commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What it fixes

Quoted --prefill-curve kept only its first point. --prefill-curve "16384:0.315 32768:0.270 65536:0.270 120000:0.225" reached the parser as one argument. atoi/atof read it as 16384:0.315 and silently dropped the rest, so the keep ratio stayed at a flat 0.315. A ~120K prompt kept 0.317 effective instead of the 0.225 the curve gives there. A user hit this on an R9700 run of the v2 recipe.

The parser now splits each argument on spaces and commas, so quoted, comma-separated and separate arguments all give the same curve. Each point must be TOKENS:RATIO with TOKENS > 0, 0 < RATIO <= 1 and nothing after the ratio. A bad point or an empty curve fails at startup.

The PFlash banner showed kernel switches PFlash doesn't use. fp_use_bsa = ON and fp_alpha were printed under PFlash, which reads as "PFlash runs the BSA kernel". The Qwen3.5-0.8B scorer runs ggml attention (Gated DeltaNet plus ggml_flash_attn_ext) and reads neither switch.

  • LUCE_FP_USE_BSA only picks the FlashPrefill launcher for Gemma 4's sliding-window prefill.
  • LUCE_FP_ALPHA and LUCE_FA_WINDOW have no reader at all.

Changes:

  • The banner drops both lines. When a curve is set, pflash_keep prints that curve instead of the unused flat ratio.
  • PFlash no longer sets LUCE_FP_ALPHA or LUCE_FA_WINDOW. /props bsa_alpha is now null unless the variable is set by hand.
  • LUCE_FP_USE_BSA stays on with PFlash, so Gemma 4 keeps its launcher and its behaviour doesn't change.

Tests

  • test_feature_gate / launch_policy_suite has two new cases:
    • a quoted list, separate arguments and commas all parse to the release curve;
    • bad points are rejected: missing ratio or tokens, zero or negative tokens, ratio 0 or above 1, trailing junk, a third field, overflow.
  • Both pass. A mutated check fails, so the cases do run.
  • server_main.cpp compiles with the HIP build's flags (-fsyntax-only). The full server binary was not rebuilt or launched.

🤖 Generated with Claude Code

View guided diff

…d kernel switches from the banner

--prefill-curve "16384:0.315 32768:0.270 65536:0.270 120000:0.225" (one
quoted argument) parsed with atoi/atof as the single point 16384:0.315 and
dropped the rest without a word, so a 120K prompt kept 0.315 instead of
0.225. Each argument now splits on spaces and commas, and a point must be
TOKENS:RATIO with TOKENS > 0 and 0 < RATIO <= 1 and nothing after it; a bad
point or an empty curve fails startup.

The startup banner listed fp_use_bsa and fp_alpha under PFlash. The Qwen3.5
scorer runs ggml attention and reads neither: LUCE_FP_USE_BSA only picks the
FlashPrefill launcher for Gemma 4's sliding-window prefill, and LUCE_FP_ALPHA
and LUCE_FA_WINDOW have no reader. The banner drops both lines and prints the
curve in force instead of the flat ratio when a curve is set. PFlash no
longer sets the two unread variables; LUCE_FP_USE_BSA stays on with PFlash so
Gemma 4 keeps its launcher.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Graffioh
Graffioh marked this pull request as ready for review October 20, 2026 09:27

@davide221 davide221 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review

No issues found. Checked for bugs and logic errors in the changed code.

Reviewed 01109b09 · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants