bridge: k3-beta-scorecard preset — Kakeya vs MLX-only on main (#117)#118
Merged
Conversation
…trim, Kakeya vs MLX-only) Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
cursor Bot
pushed a commit
that referenced
this pull request
Jun 14, 2026
…pology test record Case 1 (RUN): gRPC RuntimeService on Mac M4 sustains 256/256 concurrent agent connections, zero errors; per-session KV bounded 7.80 MB; node KV upper bound ~2.0 GB; server RSS flat ~3.85 GB. Single-tenant caveat: generate serializes (latency linear in N) -> 256 = max concurrent connections served, not parallel inferences. Evidence: results/research/k3_agent_capacity_mac.json. Case 2 (FEASIBILITY): cross-host GPU-proposer<->Mac-verifier discovery+draft is design-only (no distributed.proto / CapabilityService / ProposeBlock) AND WAN-bounded out by latency. Realizable topology: WAN=control/tool plane (bridge), LAN=co-located data plane. Proxies: GPU 1.79x AR (#119), Mac 0.93x (#118), max conns 256+ (Case 1), bounded Mac KV. Also records served-MLX-gemma gap. Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
cursor Bot
pushed a commit
that referenced
this pull request
Jun 14, 2026
…easibility (Case 2) — ADR 0014 (#123) * test(case1): gRPC agent-connection capacity load test + Mac-bridge preset scripts/research/grpc_agent_capacity_loadtest.py launches a RuntimeService subprocess and ramps N concurrent agents (independent gRPC channel + session each), reporting max concurrent agents, per-session bounded KV (GetSessionInfo), node KV upper bound (capacity * per-session bound), create/generate latency curve, and server RSS. Honest about v0.3 single-tenant (shared verifier, RPCs serialized) — measures connection/admission scaling, not parallel inference. New manifest preset 'agent-capacity-loadtest' runs it on the Mac's real MLX gemma verifier. Validated locally on the cloud agent (cpu Qwen3-1.7B). Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test(case1): use cpu Qwen3-0.6B for capacity preset (served MLX gemma path is a v0.4 gap; connection scaling is model-independent) Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test(case2)+adr: ADR 0014 — agent-connection capacity & cross-host topology test record Case 1 (RUN): gRPC RuntimeService on Mac M4 sustains 256/256 concurrent agent connections, zero errors; per-session KV bounded 7.80 MB; node KV upper bound ~2.0 GB; server RSS flat ~3.85 GB. Single-tenant caveat: generate serializes (latency linear in N) -> 256 = max concurrent connections served, not parallel inferences. Evidence: results/research/k3_agent_capacity_mac.json. Case 2 (FEASIBILITY): cross-host GPU-proposer<->Mac-verifier discovery+draft is design-only (no distributed.proto / CapabilityService / ProposeBlock) AND WAN-bounded out by latency. Realizable topology: WAN=control/tool plane (bridge), LAN=co-located data plane. Proxies: GPU 1.79x AR (#119), Mac 0.93x (#118), max conns 256+ (Case 1), bounded Mac KV. Also records served-MLX-gemma gap. Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test(case1): harness --context-len + FD-limit raise; add agent-capacity-stress preset (ramp to 2048, probe connection + memory ceiling) Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test(case1): finer stress levels to pinpoint single-tenant serialization knee; save cap-2048 stress evidence Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test(case2): cross-host RTT-sweep mode — inject per-block proposer<->verifier round-trip into the fused engine to measure the WAN-penalty throughput curve Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * docs: sync ADR 0014 (agent-connection capacity + cross-host topology) into README Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> * test: Case-1 stress ceilings + Case-2 measured cross-host WAN-penalty curve Case 1 stress (Mac M4): FD not the limit (100k); memory scales with capacity x window (cap 2048 -> 11.5GB, node bound 61GB > 24GB RAM); single-tenant serialization caps heavy-context concurrency at ~8 (vs 256 light). Case 2 (H200 real models): injected per-block proposer<->verifier RTT -> measured WAN-penalty curve. Co-located 2.20x AR; break-even ~100ms/block; 150ms -> 0.77x (net loss). LAN (<=15ms) keeps 1.8-2.2x. Confirms WAN data plane infeasible. Updates ADR 0014 + README with measured curves + evidence JSONs. Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
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.
What
Adds a reusable Mac-bridge preset
k3-beta-scorecard(NIAH ctx280, all-MLX fused spec-decode + CUDA-trim, S5) so the post-#117mainbeta can be benchmarked head-to-head against the MLX-only oracle in one harness run: bounded KV, recall, context length, and decode tok/s.This is the preset used to produce the Kakeya-vs-MLX-only scorecard requested after #117 landed on
main.Scorecard (Mac mini M4, Gemma-4 26B-A4B-it 4-bit,
main@9d5e6b4)1) Memory bounded (NIAH ctx280, T=5810 tok)
5 full-attention layers (5,11,17,23,29) hold all 5810 positions exact; sliding layers stay bounded to 68 resident positions.
2) Context length — prompts 4406–5810 tok handled; recall 1.0 (5/5) == MLX-only 1.0 (5/5), byte-identical outputs. Full 5810-tok window kept exact on the 5 full-attn layers.
3) Token throughput (code workload, 128-tok decode, long samples)
Recall 1.0 (8/8) == MLX-only, byte-identical.
Net: bounded memory (~90% KV saving) + full-context recall at MLX-only-identical output, at ~AR-parity throughput on Mac (the 26B
verify(L)compute per block is the throughput floor; >AR remains CUDA-favored — H200 1.27×).Changes
inference_engine/bridge/manifest.py: addk3-beta-scorecardpreset (validate_reports=False; NIAH ctx280, fused all-MLX,--cuda-trim, block-8 default).tests/inference_engine/bridge/test_manifest.py: extend the strict allowlist.Testing
pytest tests/inference_engine/bridge/test_manifest.py(24 passed)k3-beta-scorecard+k3-fused-allmlx-code-trimbothconclusion=success, evidence gate PASS.