Commit 3663e39
Mac K2.A reviewer: split research A/B vs product-shape smoke (per user directive)
Per user directive 2026-06-09:
'在Mac mini上的k2.a.1的测试脚本严重浪费时间。跑大量无用用例,
而且完全不顾及真是的用户对时延的体验。按照上边的建议进行修改。'
Diagnosis the user reached:
K2.A.1's product question is binary correctness — does KL ON
preserve recall? Is the bf16 dtype crash fixed? — not a
statistical research question. The Mac M4 A/B reviewer
(review_pr_k2a1_integration_on_mac.sh) takes 7-9h to answer
the wrong question for the product:
* 20 samples ≠ 1 user request
* KL OFF / oracle / v0.3 baselines are research-only — they
are NOT on the production path (KL ON + K2.A.2 stateful)
* mean throughput across 20 samples masks first-token latency
that users actually feel
User's product-aligned shape (verbatim):
* Don't run oracle / v0.3 / A/B; only one production arm
* Don't run 20 samples; single request
* K2.A.2 stateful caching, no per-step recompression
* Eventually MLX/Metal — not the current PyTorch MPS research
harness (acknowledged this is a K3 deliverable)
* Long history: incremental update only; do not rebuild
full context every step
Three changes in this PR:
1. NEW scripts/review_pr_k2a_production_smoke_on_mac.sh
~120 LOC. Single-request K2.A production-shape smoke.
Wraps scripts/research/k1e_niah_validation.py with the
product-aligned constraint set:
--n-samples 1 single request, NOT 20
--skip-oracle no oracle arm
--skip-v03 no v0.3 arm
--kl-on KL compression on (production path)
--stateful K2.A.2 incremental decode (default ON)
Default 5.6k context (CTX_LINES=280); ~3-5 min on Mac M4
24 GB. Reports recall hit/miss, prefill latency, first-token
latency, mean tok/s, peak resident memory. Time budget
listed for 1.4k / 5.6k / 16k context rungs so the user
can pick what matches their request distribution.
Explicitly documents what it does NOT validate:
- statistical recall delta (that's the A/B's job)
- throughput parity vs full-attention oracle (gate (c) work
for K2.A.2 + K3)
- MLX/Metal native latency — this is PyTorch MPS, the
conservative upper bound; K3 MLX path will be faster
2. AMENDED scripts/review_pr_k2a1_integration_on_mac.sh
Two banner additions:
(a) Header docstring ('READ THIS BEFORE RUNNING'): explains
this is a 7-9h RESEARCH A/B for PR-K2.A.1 binding gate
(b) recall delta evidence — NOT a product-latency signal.
Points users to review_pr_k2a_production_smoke_on_mac.sh
if that's what they wanted.
(b) Runtime banner with 10-second sleep: prints the same
warning as the script starts running, with a Ctrl-C
window so users who launched the wrong script can abort
before they've burned hours of M4 time.
The A/B itself is unchanged in semantics — it remains the
binding evidence collector for PR-K2.A.1 merge (gate (b)
recall delta ≤ 1pp at every rung, ADR §11.8 criterion 1a).
Cannot be deleted; can be made impossible to run by accident.
3. AMENDED docs/adr/0008-session-bound-runtime-and-grpc-protocol.md
§11.11 K2.A.1 reviewer-scripts subsection now lists three
reviewer scripts (vast A/B, Mac A/B, Mac product smoke) with
a 'scope split' table making explicit:
A/B script binding gate (b) evidence ~7-9h
production smoke user-facing latency + recall ~3-5min
Plus a paragraph (recorded as the user's directive)
stating that the A/B's KL OFF / oracle / v0.3 arms are
research-only and 'must not be conflated' with product
validation. Future contributors can read this section
instead of relearning the lesson.
Tests:
tests/inference_engine/v04/: 253 passed (no v04 code changes).
bash -n syntax check on both Mac reviewer scripts: OK.
Compat:
* No code-path changes. K1.E runner (k1e_niah_validation.py)
is untouched; both scripts use its existing flags
(--n-samples / --skip-oracle / --skip-v03 / --kl-on /
--stateful / --kl-lattice / --kl-q-range).
* The A/B reviewer's default behaviour is unchanged — same
flags, same time budget. Only the banner differs.
* The new product smoke script is additive; it cannot affect
the A/B's binding gate evidence path.
Stack:
Off main, parallel to (does not depend on, does not block):
AgentMemory/v04-pr-k3-block-b-prereqs-1-4-dflash-loader-8e7f
(K3 prereq 1+4 work, currently stashed; will resume after this)
Net effect:
Mac M4 reviewers now answer two distinct questions cleanly.
Users wanting the 'does this work for my latency' answer get
it in ~3-5 min instead of being told to run a 7-9h script
whose stated purpose is statistical research evidence.
Co-authored-by: FluffyAIcode <[email protected]>1 parent e8136a8 commit 3663e39
3 files changed
Lines changed: 294 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2293 | 2293 | | |
2294 | 2294 | | |
2295 | 2295 | | |
2296 | | - | |
| 2296 | + | |
| 2297 | + | |
2297 | 2298 | | |
2298 | 2299 | | |
2299 | | - | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
2300 | 2330 | | |
2301 | 2331 | | |
2302 | 2332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
4 | 34 | | |
5 | 35 | | |
6 | 36 | | |
| |||
166 | 196 | | |
167 | 197 | | |
168 | 198 | | |
169 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
170 | 213 | | |
171 | 214 | | |
172 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
0 commit comments