sched: --draft-suffix on, SuffixDecoding as a step selector on the MTP chain

After each commit the scheduler looks in the sequence's own prompt and output
for the latest earlier occurrence of its last --draft-suffix-min-match tokens;
the next step then verifies what followed it (up to --draft-suffix-max rows,
cut where the product of the follower frequencies falls under
--draft-suffix-min-score) in place of the head's draft. The verify window
becomes the larger of the two while the head keeps its own rounds. A sequence
whose history ended in a recurring pattern is not issued ahead, since the step
is built after the commit where the lookup can read the committed end.

It works with the fixed MTP chain, with --draft-depth adaptive and with
--draft-verify traversal. A suffix chain carries no coupled row
(Request::draft_suffix): the sampler binds none of the head's staged states to
its rows, so each row is the target's plain draw and the rows are leaves of the
traversal walk; mtp_rrs_test checks the law with a negative control that fails.
--draft-verify block is refused. The window is at most 7 rows on Flash-Next (the
delta-net fold's register window).

On Flash-Next IQR-V4 (TP2) on our branch, window 7 on chain 3 with coupling:
+1.4% overall, +2.9% on repetitive tasks, +11% on quoting, free chat unchanged;
beside adaptive depth +0.2% [-1.0, +1.5] overall, code +1.0%. Off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Code000andClaude Opus 5.5 committed 2026-11-17 22:11:30 +01:00
1 parent e78d484e60
commit b8bca7885a
22 files changed
+1112 -9

No files matched your search

+5 -2
View File
@@ -60,6 +60,9 @@ class DraftController {
public:
struct Params {
int max_depth = 0; /* the deployment's window; 0 disables speculation entirely */
/* The head's own rounds when the window is wider than they are (--draft-suffix: a suffix
* step verifies more rows than the head drafts); 0 = max_depth. */
int head_depth = 0;
/* The adaptive policy: `--draft-window adaptive` with a serial drafter, decided by
* Scheduler::init. Off, the depth is max_depth. */
bool adapt = false;
@@ -114,7 +117,7 @@ public:
/* The draft depth for the next step; 0 means do not speculate. Constant: under the adaptive
* policy it is the ceiling, and window_for() is the window. */
int next_depth() const { return p_.max_depth; }
int next_depth() const { return p_.head_depth > 0 ? p_.head_depth : p_.max_depth; }
/* ---------------------------------------------------------- the adaptive policy */
bool adaptive() const { return adapt_; }
@@ -146,7 +149,7 @@ public:
/* The deepest window a step at depth D carries: D capped at the deepest stop it was chosen
* over; the ceiling before the first choice or with the policy off. Proposals from outside
* the head (prompt lookup) are held to it, so they add no deeper pass shape. */
int step_window() const { return adapt_ && step_w_ > 0 ? step_w_ : p_.max_depth; }
int step_window() const { return adapt_ && step_w_ > 0 ? step_w_ : next_depth(); }
/* T(R): a drafting decode step of `q_rows` query rows (every sequence's verified token and
* its drafts) took `ms` since the end of the previous step, the head's rounds included. Fed