mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1305] [CLOSED] decode: --lookup-chain 1 and 2 do not change the window cap with the default --suffix-draft #3371
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3371
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1305
Author: @ZackO2o
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:lookup-chain-window-cap-fix📝 Commits (1)
08ed4c8decode: size --lookup-chain's window cap from the cap in force, not the stale mtp_max_t📊 Changes
1 file changed (+5 additions, -2 deletions)
View changed files
📝
src/program/generate.cpp(+5 -2)📄 Description
The change
Size the cap from the cap actually in force:
Resulting caps with the default
--suffix-draft 3and--spec 4:The
kVerifyMaxT= 8 ceiling holds, and behavior is unchanged where it should be — verified by evaluating both versions of the arithmetic:--suffix-draft 0: identical for K = 0, 2, 4, 7 (themtp_max_t == 0branch still takes over).--spec 6(already near the ceiling, so the suffix block clamps at 8): identical for K = 1, 2, 3.This is a one-file, 5-line diff and I have not been able to build or run it. Our box runs a self-built sm_70 engine from a different tree, and building this fork to validate a 5-line change is a larger operation than the change itself; I would rather flag that than claim a test I did not run. The arithmetic above is evaluated directly, and the "before" column is measured on 0.1.40 — that is the limit of what I can honestly assert.
If you would rather not take the code change, the alternative is one line of help text so the behavior is discoverable:
The symptom
With the default
--suffix-draft 3,--lookup-chain 1and--lookup-chain 2produce a verify window identical to not passing the flag at all. The option is documented as letting a chained lookup "lengthen one [window] by up to K", so a user setting--lookup-chain 2reasonably expects +2 headroom in the cap. They get +0, silently.Measured on a 2× V100-PCIE-32GB box (sm_70, CUDA 12 source build, Qwen3.8-Flash-Next IQ3_S), reading the window cap back from the engine's own
/metricsengineblock (specis the cap) after a restart per row:--suffix-draft--lookup-chainspec(window cap)mtp_max--lookup-chain 1and2are indistinguishable from unset.3and above do move the cap, but by less than K.The cause
The two blocks run in sequence in
generate.cpp(~line 2089) and the second readsmtp_max_t, which the first has already written:Either the
mtp_max_t == 0guard or themtp_max_tterm is stale by the time block 2 runs. With--spec 4, block 1 leavesspec = 6, so block 2'smin(mtp_max_t + K, 8) = min(4 + K, 8)only exceeds 6 onceK >= 3— and even then it is sizing againstmtp_max_t(4), not against thespec(6) that was actually set.The
--lookup-chainline of--helpsays "the window grows to at most 8", which is true of the ceiling but not of the increment; there is no way for a user to discover that small K values are inert in the default configuration.Why this is worth fixing rather than documenting
The help text implies a monotonic relationship between K and the cap. A user sweeping K looking for the point where chaining starts to pay — which is the natural way to tune an opt-in flag — will see K=1 and K=2 do nothing and conclude, as we initially did, that the feature does not work. Our first write-up of the sweep reported
--lookup-chain 2as a negative result (-1.2% / -3.2%vs default); reading this code afterwards is what showed the window never changed, so that row measured noise in a configuration where the flag could not have helped.What we measured, and what we did not
/metricsafter a restart per row on 0.1.40, one box, one configuration. It is a reading of the cap, not a throughput claim.policy.chain(...)) and byT < S, so a bigger cap is headroom, not a promise of accepted tokens. Our throughput sweeps of--lookup-chain 2/4on prose and code showed no gain, which is consistent with the mechanism documented in--suffix-draft(it pays on repeating context, which neither prompt is).--lookup-chain: #1301.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.