Skip to content

fix: stop unprofitable server prompt lookup rounds - #2274

Merged
inureyes merged 15 commits into
mainfrom
fix/issue-2264-server-lookup-break-even
Oct 12, 2026
Merged

inureyes merged 15 commits into
mainfrom
fix/issue-2264-server-lookup-break-even

Conversation

@inureyes

@inureyes inureyes commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Server prompt lookup now pauses low-yield verify rounds using a four-token emission floor while preserving profitable copy spans. A complete miss receives one boundary probe only after established accepted-token history; partial low yield and consecutive misses pause, and shadow lookup remains active for recovery. The server also re-primes after the first proposal-free ask and admits the measured paged context envelope through 4608 tokens. CLI defaults, graded adaptation, and nonadaptive behavior remain unchanged.

Test plan

  • Final quiet GB10 matrix: PASS. Chat median −0.275%; short-copy gains +148.602% to +159.283%; concurrency two PASS; paged ratios 2.7349×, 2.8189×, and 1.5221×; dense 8192 ratio 2.3475×; paged 8192 gate closed.
  • Release build PASS in 6m16s; test build, clippy, formatting, and three contract checks PASS.
  • Full CUDA suite PASS: 8,936 root tests and 2,093 core tests, with zero integration failures.
  • Focused selective-policy validation PASS: 54 governor/drafter tests and 20 scheduler tests.

Evidence

Final benchmark report.

Raw attempts, diagnostics, provenance, and checksum manifests.

Technical reports: English, Korean.

Closes #2264

Server prompt lookup can keep accepting isolated tokens while repeated verify rounds cost more than they emit. Add an opt-in emission governor, stronger shadow confirmation, and earlier server re-priming while preserving CLI defaults and per-row scheduler state.

Cover partial-match pauses, actual pipeline recovery, resumed copy verification, concurrent row isolation, and fully accepted narrow blocks. Formatting and static checks pass; CUDA compilation, runtime tests, and performance acceptance remain pending coordinator execution.

Refs #2264
Record each running server's executable and arguments, reject wrong arms and unexpected verification counters, and verify the MLX pin through the canonical helper against the binary source. Preserve original workloads in a separate evidence directory with bounded execution and a fail-closed acceptance analyzer.

Correct stale configuration comments. Sixteen synthetic analyzer cases and shell/Python syntax checks pass. These changes affect comments and measurement scripts only; the release binary source remains 89581b8dd6cbffd315833ee284d7bb9aacc9e307. CUDA runtime and performance validation are pending.

Refs #2264
Initialize the new server-only configuration fields from the unchanged defaults in the existing scripted-miss test fixture so core tests compile without changing the CLI-policy scenarios.
The dispatch resolver now applies CUDA server break-even settings, but its no-drafter regression still expected the unchanged CLI configuration. Assert both configurations explicitly and verify that the dispatch accessor returns the server settings.

The coordinator observed 17 passing dispatch tests and this stale expectation failure; governor, scheduler, and CLI tests passed. This test-only correction passes formatting and diff checks; its runtime rerun remains coordinator-owned.

Refs #2264
The unchanged 4096-target copy workload tokenizes to 4099–4102 prompt tokens. A same-build diagnostic found zero proposals in every flag-on request because the old 4096-total-token cap excluded them before decoding.

Raise the paged cap to 4608, the smallest 512-token boundary covering 4102 prompt plus 256 generated tokens, and keep 8192-token contexts excluded. Add scheduler boundary coverage and document the separate diagnostic without claiming final performance acceptance. Tests and the fresh integrated release build remain pending while another issue's acceptance run is active.

Refs #2264
Keep the original off/on diagnostic records, running-process metadata, model and binary provenance, and server logs byte-for-byte, with a SHA-256 manifest. The source-89581b8d binary used the old 4096 cap and proposed no tokens for any actual 4099–4102-token copy prompt.

This is pre-acceptance admission evidence only. Final performance acceptance requires a new integrated build with the 4608 cap.

Refs #2264
The server break-even governor treated two fully accepted tokens the same as two accepted from a wider proposal. A short proposal therefore counted as below-floor evidence and could pause before the copy run widened, cutting useful verification from copy-heavy requests.

Pass the actual proposal length into the governor and pause only when the latest below-floor round left proposed tokens unaccepted. Add a regression for a partial narrow round followed by a fully accepted narrow round, while retaining the pause for the same acceptance count from a wide proposal.

Formatting passes. Runtime tests and acceptance measurements are delegated to the final integrated verification because the CUDA native build is intentionally owned by the orchestrator.

Refs #2264
Archive the complete first integrated measurement without removing outliers or weakening acceptance thresholds. It passed chat and concurrency but failed short-copy and two paged long-copy gain floors. Add checksums and a separate directory with unchanged drivers for the corrected governor's final verification.

Refs #2264
The acceptance trace showed that one 7/0 round after a long profitable copy run could pull the emitted-token EMA below four and pause lookup permanently. The previous sample-count guard counted all historical rounds, so it did not require repeated low-yield evidence.

Track consecutive incomplete rounds below the emission floor and pause only after two. Full or floor-meeting rounds reset the streak, and shadow resume clears it. Regression coverage reproduces the traced 2/2, 7/7, 0/7 boundary and confirms that a second consecutive low round still pauses.

Formatting passes. CUDA runtime tests and the instrumented trajectory replay are delegated to the orchestrator's warm build.

Refs #2264
The short-proposal correction did not recover the measured copy workload, so preserve the second attempt as incomplete failed evidence. Archive reproducible before/after governor traces proving that isolated misses caused the pause and that consecutive-low-yield evidence restores the copy path. Prepare an unchanged full matrix in a separate final-attempt directory.

The corrected traced build passed 49 governor/drafter and 20 scheduler tests. Trace timings are diagnostic only; final production acceptance remains pending.

Refs #2264
Preserve the third complete measurement and its remaining chat regression instead of marking the issue complete. Copy, concurrency, and long-context gates pass, but chat remains at -1.419% against the -1% floor. Record the retry-limit checkpoint and the next trajectory diagnostic needed before further policy changes.

Fix only evidence path discovery for nested attempts; the acceptance formulas and thresholds are unchanged. All 17 synthetic analyzer checks pass, including nested evidence. Runtime source is unchanged from the fully tested release.

Refs #2264
The blanket low-yield grace preserved copy runs but added unprofitable chat verifications. Limit grace to one complete miss after an accepted-token EMA at least equal to the emission floor; partial low-yield matches pause once their emitted EMA is below the floor.

The unchanged diagnostic workloads preserve copy at 239 proposed, 214 accepted, and 35 rounds while reducing chat by 11 verify rounds. All 54 governor/drafter and 20 scheduler tests pass. Preserve raw traces and prepare the fourth unchanged performance attempt; final performance acceptance remains pending.

Refs #2264
Archive the fourth quiet GB10 matrix and its source, binary, arm metadata, checksums, and validation summaries. Every unchanged criterion passes: chat -0.275%, short-copy gains 148.602% to 159.283%, overlapping concurrency-two ranges, and all long-copy retention floors.

Document the selective boundary-miss heuristic and its measured scope while preserving the three prior failed attempts. Release build, full CUDA workspace tests, clippy, formatting, and fresh-main contract checks pass.

Refs #2264
@inureyes inureyes added status:review Under review type:performance Performance improvements priority:high High priority area:core mlxcel-core: MLX FFI, primitives, KV cache, layers area:inference Generation, sampling, decoding (incl. speculative, DRY) labels Oct 12, 2026
Record the final policy, unchanged acceptance thresholds, all passing GB10 measurements, validation, and limits in English and Korean reports for PR #2274. Preserve links to failed attempts and the trajectory evidence behind selective boundary-miss grace.

Refs #2264
State that grace covers only the first low-yield round and that pausing still requires the emitted-token EMA below the floor. This avoids carrying the earlier blanket two-round description into the final selective policy. Link the acceptance checkpoint to PR #2274.

Validation: documentation-only diff; measured production source and dependencies remain unchanged.

Refs #2264
@inureyes inureyes added status:done Completed and removed status:review Under review labels Oct 12, 2026
@inureyes
inureyes merged commit 8bf2c13 into main Oct 12, 2026
27 checks passed
@inureyes
inureyes deleted the fix/issue-2264-server-lookup-break-even branch October 12, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core mlxcel-core: MLX FFI, primitives, KV cache, layers area:inference Generation, sampling, decoding (incl. speculative, DRY) priority:high High priority status:done Completed type:performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: stop server prompt-lookup rounds that cost more than they emit

1 participant