mesh-llm/scripts
James Dumay 2c5dacf212
Pipeline MTP-anchored n-gram verify windows (#938)
* Replace Skippy verify span with verify windows

* Add verify window reply metadata

* Pipeline direct-return n-gram verify windows

* Pipeline MTP-anchored n-gram verify windows

* Support static release builds without features

* Fix split MTP activation-frame serving

* Replace native MTP batched verifier with verify windows

* Restore native MTP verify window batching

* Replace native MTP anchor extension with composite proposals

* Keep composite decode branch on development version

* Expose decode timings for all generation modes

* Retry transient staged lane readiness

* Bound persistent lane readiness handshake

* Keep pure N-gram decode free of MTP drafts

* Report composite proposal totals in decode timings

* Gate composite decode pipeline by candidate depth

* Account direct GGUF MTP weights in split planning

* Avoid MTP cooldown after N-gram tail rejection

* Improve hybrid MTP verification telemetry

* Pipeline native MTP verification replies

* Require useful N-gram tails for hybrid MTP

* Adapt N-gram MTP extensions to tail acceptance

* Fix direct GGUF planning fallback

* Gate N-gram tails on MTP prefix agreement

* Widen initial async verify windows

* Restore anchored N-gram MTP extensions

* Retain ready stages across transient refresh failures

* Document pipelined VerifyWindow decode

* Use llama.cpp N-gram proposer for Skippy

* Add cache-based N-gram proposer

* Add declarative speculative proposer package schema

* Productize Skippy speculative decode plans

* Productize Skippy speculative decode plans

* Support direct N-gram Skippy plans

* Validate speculative package strategy plans

* Add coding agent loop benchmark corpus

* Expose Skippy speculative benchmark counters

* Validate cache N-gram proposer limits

* Document speculative decode configuration

* Fix native MTP proposals and fused restore routing

* Honor configured N-gram extension width

* Document speculative runtime overrides

* Refresh speculative config schema contracts

* Keep N-gram tail rejects from penalizing MTP

* Preserve MTP state after serial tail rejects

* Report adaptive verify width changes accurately

* Fix short simple N-gram extension budgets

* Make VerifyWindow pipelining cost-aware

* Profile prospective VerifyWindow widths

* docs: WAN split performance model + measured latency/compute decomposition

Adds docs/skippy/WAN_SPLIT_PERF.md: the single-stream per-token cost model
(TPOT ~= C_total + (S-1)*2*RTT + (S-1)*P), compute-bound vs latency-bound
criteria, when adding a stage helps (memory, concurrency/pipeline overlap,
dense compute-bound models), and speculation as the WAN amortization lever.

Backed by 2026-07-18 Sydney<->Melbourne 2-node measurements: solo 12.9 ms/tok
compute, split 57.8 ms/tok, decomposing to 12.9 compute + 40 (2xRTT) + 4.9
protocol. Workload was latency-bound (~78% network).

* docs: plan for fast-fail on new requests routed to a dead split stage

Documents the measured ~30s hang when a new request routes to a killed
split stage, the confirmed root cause (60s heartbeat / lenient failure
threshold + slow lane-open timeouts), and a two-layer fix (short
steady-state lane-open deadline; feed lane failures into target_health
cooldown) plus an explicit validation gate. Mesh-timing changes are out
of scope pending live multi-node validation.

* Fast-fail lane reconnects so new requests don't hang on a dead split stage

When a downstream split stage dies, a new request would open a fresh lane
and wait the full ~20s warmup ready-deadline before erroring (observed as a
~30s hang in the Sydney<->Melbourne kill test). The 20s deadline is only
needed during pool warmup, when the downstream may still be loading its
model.

Split the deadline: pool warmup keeps LANE_READY_READ_TIMEOUT (20s); mid-life
reconnects from checkout()/replace_lane() on an already-serving mesh use a
new LANE_STEADY_CONNECT_TIMEOUT (3s). A healthy peer answers in milliseconds,
so a dead stage now fails in ~3s instead of ~30s.

Restores receive_persistent_lane_ready as the shared bounded-handshake helper
(dropped during the main merge) and removes a now-obsolete retry test that
covered pre-#1011 retry behavior. Adds tests asserting the steady-state
deadline stays well under the warmup deadline and that the handshake read
fails fast on a silent downstream.

* docs: latency-aware placement — current behaviour and many-node gaps

Records verified planner behaviour (skippy-coordinator/topology.rs,
skippy-topology, host-runtime call site):
- latency is a placement cost (rtt_ms penalty), not just relay-only exclusion
- planner selects a node subset; does not have to use every eligible node
- stage count is gated on a decode-TPOT target (shallower-that-meets beats
  deeper-that-does-not)

And the gaps that matter at many-node scale:
- no peer-to-peer RTT matrix in production (edge_signals never wired; only
  coordinator-RTT is used) -> co-located nodes cannot be exploited
- network estimate is max(coordinator RTT) x node_count, a worst-case proxy
- no first-class prefer-fewer/never-place-above-Y policy beyond the TPOT gate

* docs: measured speculative recovery cost over WAN (why ngram hurts a latency-bound split)

* Discard dead pooled stage lanes before reuse (fast-fail improvement)

A pooled downstream lane whose stage died while checked in was a dead TCP
stream; reusing it blocked the next generation read forever (handshake
read-timeout is cleared for pooled lanes so long generations don't truncate).
checkout() now probes lane liveness with a nonblocking peek and discards a
dead lane so it reconnects with the short steady-state deadline instead of
hanging.

Validated on a loopback 2-node split with a mid-flight worker kill: new
request now fails faster than main (60s vs main's 90s baseline). Does not
fully solve the recovered-local routing path, tracked as follow-up.

---------

Co-authored-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
2026-07-19 20:14:59 +10:00
..
tests Pipeline MTP-anchored n-gram verify windows (#938) 2026-07-19 20:14:59 +10:00
affected-crates.sh Add native skippy-quantize conversion and quantization CLI (#898) 2026-06-23 12:35:27 +10:00
build-linux-rocm.sh
build-linux.sh
build-llama.sh Fix Windows Vulkan native runtime build (#963) 2026-07-12 10:07:06 +10:00
build-mac.sh Pipeline MTP-anchored n-gram verify windows (#938) 2026-07-19 20:14:59 +10:00
build-release.sh Pipeline MTP-anchored n-gram verify windows (#938) 2026-07-19 20:14:59 +10:00
build-ui.sh
build-windows.ps1
certify-split-startup-recovery.sh
check-sdk-contract.sh
ci-agent-live-fixture-lib.sh
ci-client-auto-test.sh
ci-compat-smoke.sh
ci-goose-smoke.sh
ci-hf-download-smoke.sh
ci-install-native-runtime.sh
ci-kotlin-sdk-smoke.sh
ci-langchain-openai-smoke.py
ci-litellm-smoke.py
ci-openai-node-smoke.cjs
ci-openai-python-smoke.py
ci-opencode-smoke.sh
ci-pi-smoke.sh
ci-prepare-native-runtime.sh
ci-rust-sdk-smoke.sh
ci-sdk-fixture.sh
ci-smoke-test.sh
ci-swift-sdk-smoke.sh
ci-two-node-client-serving-smoke.sh
ci-two-node-split-smoke.sh
console-format.js
console-format.test.js
detect-cuda-arch.sh
detect-llama-device.sh
detect-rocm-arch.sh
download-skippy-parity-candidates.sh
family-certify.sh
generate-bench-corpus.py
generate-native-runtime-release-manifest.sh
install-windows-sdk.ps1
package-native-runtime.sh fix(ci): accept MinGW Windows native runtime DLL names 2026-06-29 05:50:43 -04:00
package-native-sdk-crate.sh
package-native-sdk.sh
package-release.ps1
package-release.sh
package-sdk-console-assets.sh
plan-clippy-batches.sh Add native skippy-quantize conversion and quantization CLI (#898) 2026-06-23 12:35:27 +10:00
prepare-llama.sh fix(ci): make llama prep checksums portable 2026-06-29 05:10:57 -04:00
prepare-swift-package-release.sh
publish-crates.sh Rely on cargo publish for crate status (#935) 2026-07-01 09:57:01 +10:00
qa-agent-tool-call-reliability.py
qa-control-plane-mixed-version.sh feat: add extensible owned-node command system (#1002) 2026-07-18 15:01:16 -04:00
qa-kv-tool-loop-stability.py
qa-model-download-stats.sh Render download progress inline with Ratatui (#911) 2026-06-29 01:44:22 -04:00
qa-nightly-stability.py fix(ci): nightly stability run (#914) 2026-06-28 16:07:23 -04:00
qwen-lab-preflight.sh
rc-release-smoke.sh fix: RC5 release readiness corrections (#918) 2026-06-29 05:04:41 -04:00
release-version.sh Fix dispatched release version preparation (#960) 2026-07-11 14:26:05 +10:00
release.sh Fix release version staging (#996) 2026-07-15 08:45:16 +10:00
reset-swift-package-manifest.sh
run-llama-benchy-openai.sh
run-openai-guardrail-corpus.py
skippy-ci-smoke.sh Add SkippyBench external eval pack (#865) 2026-07-15 06:06:23 +10:00
skippy-llama-parity.py
skippy-openai-smoke.sh
skippy-wan-calibrate.sh
summarize-llama-upstream.sh
task-8-real-binary.sh
update-llama-pin.sh
update-swift-package-manifest.sh
validate-release-native-runtime-matrix.py fix: validate release native runtimes from explicit matrix (#917) 2026-06-28 22:01:24 -04:00
verify-native-runtime-package.sh fix: RC5 release readiness corrections (#918) 2026-06-29 05:04:41 -04:00
verify-native-sdk-package.sh
verify-sdk-console-assets.sh
verify-swift-package-manifest.sh
verify-swift-privacy-manifest.sh
verify-swift-release-artifact.sh