fix(pflash): tighten drafter tail-capture view-bounds guard (bug #42)#356
Merged
Merged
Conversation
…-Org#42) Old guard `tail_lo < cs + cl` fires when S%chunk_size ∈ {1..7}, passing a ggml_view_3d that overruns the chunk by up to 7 rows (deterministic assert). New guard `tail_lo + n_lookahead <= cs + cl` rejects straddlers. 5 pure-arithmetic unit tests cover the boundary: T1 RED→GREEN, T2-T4 stable.
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
easel
pushed a commit
to easel/lucebox-hub
that referenced
this pull request
Jun 9, 2026
…FAIL) Bug-repro binary test_drafter_tail_capture_guard_red was compiled but never registered; CI could not enforce that the old guard reproduces the failure.
easel
pushed a commit
to easel/lucebox-hub
that referenced
this pull request
Jun 10, 2026
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.
Re-carved from #274 as a standalone fix off current
main(extracted from multi-feature commit51ea345; the ee7 drafter changes are a later PR).The drafter's tail-capture guard used
tail_lo < cs + cl, which admits a view whosen_lookaheadrows overrun the chunk whentail_lolands in a chunk's lastn_lookaheadrows — a deterministicggml_view_3dassert at S%4096 in {1..7}. Tightened totail_lo + n_lookahead <= cs + clat both capture sites (qwen3_graph.cpp:419,:469).Added
test_drafter_tail_capture_guard.cpp(boundary test). Red→green: reproduces the overrun at S=4097/r=1 with the old guard; all 7 boundary cases + cross-chunk cases pass with the fix. 3 files, +143/-2.