@trillboards/edge-sdk 0.2.60 → 0.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/litertlm/test_trillboards_litertlm_shim.py +132 -0
- package/deploy/litertlm/trillboards-litertlm-shim.pth +1 -0
- package/deploy/litertlm/trillboards_litertlm_shim.py +214 -0
- package/deploy/macos/bench-local-vlm.sh +8 -4
- package/deploy/macos/build-macos-pkg.sh +4 -0
- package/deploy/macos/scripts/setup-litertlm.sh +210 -0
- package/deploy/macos/test-setup-litertlm-reinstall.sh +59 -1
- package/deploy/systemd/setup-litertlm.sh +218 -10
- package/deploy/windows/build-windows.ps1 +4 -0
- package/deploy/windows/register-litertlm-task.ps1 +22 -0
- package/deploy/windows/setup-litertlm.ps1 +228 -0
- package/deploy/windows/trillboards-edge.cmd +19 -0
- package/dist/CloudSensingManager.d.ts +2 -0
- package/dist/CloudSensingManager.d.ts.map +1 -1
- package/dist/EdgeAgent.js +1 -1
- package/dist/LiteRtVlmProvider.d.ts +74 -7
- package/dist/LiteRtVlmProvider.d.ts.map +1 -1
- package/dist/LiteRtVlmProvider.js.map +1 -1
- package/dist/analyzeCostObserver.d.ts +96 -0
- package/dist/analyzeCostObserver.d.ts.map +1 -0
- package/dist/analyzeCostObserver.js +130 -0
- package/dist/analyzeCostObserver.js.map +1 -0
- package/dist/connectorCadence.d.ts +120 -1
- package/dist/connectorCadence.d.ts.map +1 -1
- package/dist/connectorCadence.js +127 -2
- package/dist/connectorCadence.js.map +1 -1
- package/dist/deployedCadence.d.ts +13 -1
- package/dist/deployedCadence.d.ts.map +1 -1
- package/dist/deployedCadence.js +11 -2
- package/dist/deployedCadence.js.map +1 -1
- package/dist/deployedCadenceSource.d.ts +10 -0
- package/dist/deployedCadenceSource.d.ts.map +1 -1
- package/dist/deployedCadenceSource.js +11 -0
- package/dist/deployedCadenceSource.js.map +1 -1
- package/dist/diagnose.d.ts +1 -1
- package/dist/diagnose.js +1 -1
- package/dist/localInferenceSchema.d.ts +8 -3
- package/dist/localInferenceSchema.d.ts.map +1 -1
- package/dist/localInferenceSchema.js +8 -3
- package/dist/localInferenceSchema.js.map +1 -1
- package/dist/localSensing.d.ts +22 -1
- package/dist/localSensing.d.ts.map +1 -1
- package/dist/localSensing.js +36 -2
- package/dist/localSensing.js.map +1 -1
- package/dist/localVlmBench.d.ts +82 -0
- package/dist/localVlmBench.d.ts.map +1 -1
- package/dist/localVlmBench.js +88 -0
- package/dist/localVlmBench.js.map +1 -1
- package/dist/sensingRunMode.d.ts.map +1 -1
- package/dist/sensingRunMode.js +21 -2
- package/dist/sensingRunMode.js.map +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,14 @@
|
|
|
43
43
|
* localInferenceSchema builds. One slot at 7.30 s is a hard ceiling
|
|
44
44
|
* of 493 analyses/hour for the WHOLE connector, however many
|
|
45
45
|
* cameras it runs.
|
|
46
|
+
* STALE — see the block under MEASURED_LOCAL_ANALYZE_MS. The same
|
|
47
|
+
* harness measures 1.90 s, then 1.22 s with the 2026-08-19
|
|
48
|
+
* config.json change, then a further paired 2.42x with the 2026-08-19
|
|
49
|
+
* fast-conversation shim, on the pinned 0.16.0 — so the real ceiling
|
|
50
|
+
* on this machine class is ~1,895/hour, ~2,951/hour and higher again
|
|
51
|
+
* respectively. The constant is kept as a conservative FLEET default
|
|
52
|
+
* because the fleet varies ~7x; do not quote 493 as this machine's
|
|
53
|
+
* ceiling.
|
|
46
54
|
* (The DOOH audience schema measured 12.48 s median and ranged to
|
|
47
55
|
* 23.8 s because it emits a free-text narrative. The SOP field set
|
|
48
56
|
* is both cheaper and far tighter — 6.0-7.5 s — which is a second,
|
|
@@ -111,6 +119,106 @@
|
|
|
111
119
|
* the SOP schema changes — it is the only free variable here.
|
|
112
120
|
*/
|
|
113
121
|
export declare const MEASURED_LOCAL_ANALYZE_MS = 7300;
|
|
122
|
+
/**
|
|
123
|
+
* ── 7.30 s IS NOT REPRODUCIBLE ON THE PINNED RUNTIME (measured 2026-08-19) ──
|
|
124
|
+
*
|
|
125
|
+
* Four independent measurements of the SHIPPED path — `LiteRtVlmProvider`
|
|
126
|
+
* against Gemma 4 E2B on `,gpu`, operator/SOP schema, the same two committed
|
|
127
|
+
* CCTV fixtures, on the same M4 Max — do not contain 7.30 s:
|
|
128
|
+
*
|
|
129
|
+
* 1.90 s `bench-local-vlm.mjs --arms gpu-sop`, 16 warm-ups, n=6, 6/6 valid,
|
|
130
|
+
* delegate asserted per frame, 0 demotions (2026-08-19, THIS harness)
|
|
131
|
+
* 1.75 s the same request bytes over raw HTTP, 16 warm-ups, n=12
|
|
132
|
+
* 2.01 s `.github/contracts/litert-lm-tested-versions.json`, gpu-sop, 08-14
|
|
133
|
+
* 2.78 s the same contract row re-measured 08-18 with ONE warm-up (E1 showed
|
|
134
|
+
* one warm-up leaves a 36% monotonically-decreasing drift INSIDE the
|
|
135
|
+
* measurement, which is the direction that inflates it)
|
|
136
|
+
*
|
|
137
|
+
* So the ceiling this file derives — "493 analyses/hour for the WHOLE
|
|
138
|
+
* connector" — is roughly 3.8x too pessimistic on this machine class, and
|
|
139
|
+
* `stillSceneLoad`'s `slotShare` is wrong by the same factor. Nothing here is
|
|
140
|
+
* load-bearing for admission (`VlmAdmissionGate` counts SLOTS, not seconds), so
|
|
141
|
+
* a stale value does not throttle anything; what it does is make
|
|
142
|
+
* `periodicIntervalMsForFeedCount` return a SLOWER still-scene heartbeat than
|
|
143
|
+
* the box can afford, which costs hazard-persistence resolution against the
|
|
144
|
+
* 111 s constructive-notice bracket — the one thing this file exists to protect.
|
|
145
|
+
*
|
|
146
|
+
* ── AND IT MOVED AGAIN, 2026-08-19 (the shim) ──────────────────────────────
|
|
147
|
+
*
|
|
148
|
+
* `litert-lm serve` built `ConstrainedDecodingConfig(enable=True, …)` for every
|
|
149
|
+
* request even when nothing asked for a `response_format`, so every frame paid
|
|
150
|
+
* a constraint build for a grammar nothing used. Removing it (see
|
|
151
|
+
* `deploy/litertlm/trillboards_litertlm_shim.py`) is worth a further **paired
|
|
152
|
+
* 2.42x** on the shipped path — two stock serves on two ports, interleaved,
|
|
153
|
+
* n=16, 16/16 schema-valid and 16/16 BYTE-IDENTICAL generations on both arms.
|
|
154
|
+
* `bench-local-vlm.mjs --arms gpu-sop`, back to back in the same window, moves
|
|
155
|
+
* **1.32 -> 0.72 s/frame, i.e. 2,727 -> 5,000 analyses/hour**, at load 22-25
|
|
156
|
+
* where the same harness measures the stock arm at 1.32 s against the 1.22 s
|
|
157
|
+
* this file already records for it — so that window is close to the regime the
|
|
158
|
+
* 1.22 s was taken in, and 0.72 s is the nearest thing to a quotable per-frame
|
|
159
|
+
* number this machine class has.
|
|
160
|
+
*
|
|
161
|
+
* TWO CAVEATS THAT TRAVEL WITH IT. The ratio is itself load-dependent — 3.734x
|
|
162
|
+
* at 0.0% CPU idle against 2.42x at load 25 — because the removed work is
|
|
163
|
+
* CPU-bound and the retained work is GPU-bound, so a figure taken under
|
|
164
|
+
* contention flatters the change. And 0.72 s/frame is still BELOW the capacity
|
|
165
|
+
* target: 4 cameras resolving a 2 s bracket needs 0.5 s/frame (7,200
|
|
166
|
+
* analyses/hour), and this serves 2-3.
|
|
167
|
+
*
|
|
168
|
+
* ── IT IS NOT LOWERED HERE. IT IS NOW A BOOTSTRAP. (2026-08-19) ───────────
|
|
169
|
+
*
|
|
170
|
+
* This is ONE constant for a fleet whose measured spread on the SHIPPED path is
|
|
171
|
+
* 0.50 s/frame (M4 Max, post-#12567/#12594) against tens of seconds on a
|
|
172
|
+
* GPU-less x86 box. No constant is right for both: the fast desk's number would
|
|
173
|
+
* demand ~70x what the slow box can deliver, and the slow box's number makes
|
|
174
|
+
* every heartbeat worse than today. Picking the fast desk is exactly the error
|
|
175
|
+
* `.claude/lessons/2026-08-18-a-benchmark-with-no-machine-axis-is-a-spec-for-
|
|
176
|
+
* one-desk.md` was written about.
|
|
177
|
+
*
|
|
178
|
+
* So the fix was never a better constant, and as of 2026-08-19 it is built: the
|
|
179
|
+
* box DERIVES this for itself. `AnalyzeCostObserver` (analyzeCostObserver.ts)
|
|
180
|
+
* times every successful `analyze()` in `LocalSensingClient`, reports a rolling
|
|
181
|
+
* median over 16 frames, and `periodicIntervalMsForFeedCount` /
|
|
182
|
+
* `resolveDeployedCadence` take it as an optional input. A connector that has
|
|
183
|
+
* measured itself uses its OWN number; one that has not uses this one.
|
|
184
|
+
*
|
|
185
|
+
* NOTE WHAT THAT MAKES THIS CONSTANT. It is the value to assume BEFORE a machine
|
|
186
|
+
* has measured itself, so it should be conservative rather than accurate — and
|
|
187
|
+
* 7.30 s is exactly that. Guessing FAST on a slow box oversubscribes the single
|
|
188
|
+
* admission slot from the first minute; guessing slow costs only heartbeat
|
|
189
|
+
* resolution, and only until the observer settles (8 frames). It is therefore
|
|
190
|
+
* deliberately NOT lowered, and quoting it as a measurement of any machine is
|
|
191
|
+
* still what this block exists to stop.
|
|
192
|
+
*
|
|
193
|
+
* A CONSEQUENCE WORTH KNOWING: because this value does not move, neither does
|
|
194
|
+
* `sensingCatchRate.DEFAULT_SAMPLER.analyzeS`, so none of this required a
|
|
195
|
+
* corpus replay or a `.github/contracts/sensing-catch-rate-baseline.json`
|
|
196
|
+
* regeneration. If you ever DO move it, all of that becomes mandatory in the
|
|
197
|
+
* same change — and the catch-rate ratchet is shrink-only, so a baseline may
|
|
198
|
+
* never be regenerated merely to clear red.
|
|
199
|
+
*
|
|
200
|
+
* ── The idle-box objection, and why it does not block the derivation ────────
|
|
201
|
+
*
|
|
202
|
+
* The 2026-08-19 predecessor of this block held the per-machine derivation back
|
|
203
|
+
* for want of a per-frame number taken on an idle box, on the grounds that a
|
|
204
|
+
* figure measured at 0.0% CPU idle would hardcode one session's contention into
|
|
205
|
+
* every connector. That objection is answered twice over.
|
|
206
|
+
*
|
|
207
|
+
* First, it no longer applies to the DERIVATION at all: nothing global is
|
|
208
|
+
* derived from a measured number any more. Each box measures itself, in situ,
|
|
209
|
+
* under whatever load it actually runs at — which is the right load by
|
|
210
|
+
* definition, and is the one thing a bench on someone else's desk can never
|
|
211
|
+
* reproduce.
|
|
212
|
+
*
|
|
213
|
+
* Second, the verdict turned out not to depend on it. Three measurements of the
|
|
214
|
+
* shipped arm on one M4 Max across a 3x load range: 0.45 s at load 7.77, 0.50 s
|
|
215
|
+
* at load 11.87, 0.72 s at load 22-25. All three clear the 13.88 s/frame budget
|
|
216
|
+
* for 4 cameras by 19-31x, so "this class clears 4 cameras" is invariant across
|
|
217
|
+
* everything that could be measured. Load moves the quotable figure, not the
|
|
218
|
+
* verdict — and the post-merge path is markedly LESS load-sensitive than the one
|
|
219
|
+
* that motivated the objection, because the work #12594 removed was CPU-bound
|
|
220
|
+
* and what remains is GPU-bound.
|
|
221
|
+
*/
|
|
114
222
|
/**
|
|
115
223
|
* Share of the single admission slot the STILL-scene heartbeat floor may take.
|
|
116
224
|
* The rest is held for motion-triggered analyses.
|
|
@@ -385,7 +493,18 @@ export declare const DOOH_PERIODIC_MS = 300000;
|
|
|
385
493
|
* Returns `null` when the count is not a positive integer, so a caller can omit
|
|
386
494
|
* the key entirely rather than write a cadence derived from a bad count.
|
|
387
495
|
*/
|
|
388
|
-
export declare function periodicIntervalMsForFeedCount(feedCount: unknown
|
|
496
|
+
export declare function periodicIntervalMsForFeedCount(feedCount: unknown,
|
|
497
|
+
/**
|
|
498
|
+
* What a frame ACTUALLY costs on this box, in ms, when this box has measured
|
|
499
|
+
* itself (`AnalyzeCostObserver.medianMs()`). Omitted or `null` falls back to
|
|
500
|
+
* `MEASURED_LOCAL_ANALYZE_MS`, which is the BOOTSTRAP — deliberately
|
|
501
|
+
* conservative, and not a measurement of any machine.
|
|
502
|
+
*
|
|
503
|
+
* This parameter is the whole reason a fleet spanning 0.45 s/frame to tens of
|
|
504
|
+
* seconds can share one code path: the equation was always per-machine, and
|
|
505
|
+
* until 2026-08-19 only its input was global.
|
|
506
|
+
*/
|
|
507
|
+
analyzeMs?: number | null): number | null;
|
|
389
508
|
/**
|
|
390
509
|
* How a feed's frames are acquired. The look cadence a connector can SUSTAIN
|
|
391
510
|
* depends on this and on nothing else about the box.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectorCadence.d.ts","sourceRoot":"","sources":["../src/connectorCadence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connectorCadence.d.ts","sourceRoot":"","sources":["../src/connectorCadence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,gBAAgB,OAAQ,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,SAAU,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,OAAO;AAClB;;;;;;;;;GASG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,MAAM,GAAG,IAAI,CAkCf;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,OAAO,EAClB,WAAW,GAAE,WAAwB,GACpC,MAAM,GAAG,IAAI,CA0Bf;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,CAI1E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,OAAO,EAClB,kBAAkB,EAAE,OAAO,GAC1B;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAOhD"}
|
package/dist/connectorCadence.js
CHANGED
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
* localInferenceSchema builds. One slot at 7.30 s is a hard ceiling
|
|
45
45
|
* of 493 analyses/hour for the WHOLE connector, however many
|
|
46
46
|
* cameras it runs.
|
|
47
|
+
* STALE — see the block under MEASURED_LOCAL_ANALYZE_MS. The same
|
|
48
|
+
* harness measures 1.90 s, then 1.22 s with the 2026-08-19
|
|
49
|
+
* config.json change, then a further paired 2.42x with the 2026-08-19
|
|
50
|
+
* fast-conversation shim, on the pinned 0.16.0 — so the real ceiling
|
|
51
|
+
* on this machine class is ~1,895/hour, ~2,951/hour and higher again
|
|
52
|
+
* respectively. The constant is kept as a conservative FLEET default
|
|
53
|
+
* because the fleet varies ~7x; do not quote 493 as this machine's
|
|
54
|
+
* ceiling.
|
|
47
55
|
* (The DOOH audience schema measured 12.48 s median and ranged to
|
|
48
56
|
* 23.8 s because it emits a free-text narrative. The SOP field set
|
|
49
57
|
* is both cheaper and far tighter — 6.0-7.5 s — which is a second,
|
|
@@ -118,6 +126,106 @@ exports.stillSceneLoad = stillSceneLoad;
|
|
|
118
126
|
* the SOP schema changes — it is the only free variable here.
|
|
119
127
|
*/
|
|
120
128
|
exports.MEASURED_LOCAL_ANALYZE_MS = 7300;
|
|
129
|
+
/**
|
|
130
|
+
* ── 7.30 s IS NOT REPRODUCIBLE ON THE PINNED RUNTIME (measured 2026-08-19) ──
|
|
131
|
+
*
|
|
132
|
+
* Four independent measurements of the SHIPPED path — `LiteRtVlmProvider`
|
|
133
|
+
* against Gemma 4 E2B on `,gpu`, operator/SOP schema, the same two committed
|
|
134
|
+
* CCTV fixtures, on the same M4 Max — do not contain 7.30 s:
|
|
135
|
+
*
|
|
136
|
+
* 1.90 s `bench-local-vlm.mjs --arms gpu-sop`, 16 warm-ups, n=6, 6/6 valid,
|
|
137
|
+
* delegate asserted per frame, 0 demotions (2026-08-19, THIS harness)
|
|
138
|
+
* 1.75 s the same request bytes over raw HTTP, 16 warm-ups, n=12
|
|
139
|
+
* 2.01 s `.github/contracts/litert-lm-tested-versions.json`, gpu-sop, 08-14
|
|
140
|
+
* 2.78 s the same contract row re-measured 08-18 with ONE warm-up (E1 showed
|
|
141
|
+
* one warm-up leaves a 36% monotonically-decreasing drift INSIDE the
|
|
142
|
+
* measurement, which is the direction that inflates it)
|
|
143
|
+
*
|
|
144
|
+
* So the ceiling this file derives — "493 analyses/hour for the WHOLE
|
|
145
|
+
* connector" — is roughly 3.8x too pessimistic on this machine class, and
|
|
146
|
+
* `stillSceneLoad`'s `slotShare` is wrong by the same factor. Nothing here is
|
|
147
|
+
* load-bearing for admission (`VlmAdmissionGate` counts SLOTS, not seconds), so
|
|
148
|
+
* a stale value does not throttle anything; what it does is make
|
|
149
|
+
* `periodicIntervalMsForFeedCount` return a SLOWER still-scene heartbeat than
|
|
150
|
+
* the box can afford, which costs hazard-persistence resolution against the
|
|
151
|
+
* 111 s constructive-notice bracket — the one thing this file exists to protect.
|
|
152
|
+
*
|
|
153
|
+
* ── AND IT MOVED AGAIN, 2026-08-19 (the shim) ──────────────────────────────
|
|
154
|
+
*
|
|
155
|
+
* `litert-lm serve` built `ConstrainedDecodingConfig(enable=True, …)` for every
|
|
156
|
+
* request even when nothing asked for a `response_format`, so every frame paid
|
|
157
|
+
* a constraint build for a grammar nothing used. Removing it (see
|
|
158
|
+
* `deploy/litertlm/trillboards_litertlm_shim.py`) is worth a further **paired
|
|
159
|
+
* 2.42x** on the shipped path — two stock serves on two ports, interleaved,
|
|
160
|
+
* n=16, 16/16 schema-valid and 16/16 BYTE-IDENTICAL generations on both arms.
|
|
161
|
+
* `bench-local-vlm.mjs --arms gpu-sop`, back to back in the same window, moves
|
|
162
|
+
* **1.32 -> 0.72 s/frame, i.e. 2,727 -> 5,000 analyses/hour**, at load 22-25
|
|
163
|
+
* where the same harness measures the stock arm at 1.32 s against the 1.22 s
|
|
164
|
+
* this file already records for it — so that window is close to the regime the
|
|
165
|
+
* 1.22 s was taken in, and 0.72 s is the nearest thing to a quotable per-frame
|
|
166
|
+
* number this machine class has.
|
|
167
|
+
*
|
|
168
|
+
* TWO CAVEATS THAT TRAVEL WITH IT. The ratio is itself load-dependent — 3.734x
|
|
169
|
+
* at 0.0% CPU idle against 2.42x at load 25 — because the removed work is
|
|
170
|
+
* CPU-bound and the retained work is GPU-bound, so a figure taken under
|
|
171
|
+
* contention flatters the change. And 0.72 s/frame is still BELOW the capacity
|
|
172
|
+
* target: 4 cameras resolving a 2 s bracket needs 0.5 s/frame (7,200
|
|
173
|
+
* analyses/hour), and this serves 2-3.
|
|
174
|
+
*
|
|
175
|
+
* ── IT IS NOT LOWERED HERE. IT IS NOW A BOOTSTRAP. (2026-08-19) ───────────
|
|
176
|
+
*
|
|
177
|
+
* This is ONE constant for a fleet whose measured spread on the SHIPPED path is
|
|
178
|
+
* 0.50 s/frame (M4 Max, post-#12567/#12594) against tens of seconds on a
|
|
179
|
+
* GPU-less x86 box. No constant is right for both: the fast desk's number would
|
|
180
|
+
* demand ~70x what the slow box can deliver, and the slow box's number makes
|
|
181
|
+
* every heartbeat worse than today. Picking the fast desk is exactly the error
|
|
182
|
+
* `.claude/lessons/2026-08-18-a-benchmark-with-no-machine-axis-is-a-spec-for-
|
|
183
|
+
* one-desk.md` was written about.
|
|
184
|
+
*
|
|
185
|
+
* So the fix was never a better constant, and as of 2026-08-19 it is built: the
|
|
186
|
+
* box DERIVES this for itself. `AnalyzeCostObserver` (analyzeCostObserver.ts)
|
|
187
|
+
* times every successful `analyze()` in `LocalSensingClient`, reports a rolling
|
|
188
|
+
* median over 16 frames, and `periodicIntervalMsForFeedCount` /
|
|
189
|
+
* `resolveDeployedCadence` take it as an optional input. A connector that has
|
|
190
|
+
* measured itself uses its OWN number; one that has not uses this one.
|
|
191
|
+
*
|
|
192
|
+
* NOTE WHAT THAT MAKES THIS CONSTANT. It is the value to assume BEFORE a machine
|
|
193
|
+
* has measured itself, so it should be conservative rather than accurate — and
|
|
194
|
+
* 7.30 s is exactly that. Guessing FAST on a slow box oversubscribes the single
|
|
195
|
+
* admission slot from the first minute; guessing slow costs only heartbeat
|
|
196
|
+
* resolution, and only until the observer settles (8 frames). It is therefore
|
|
197
|
+
* deliberately NOT lowered, and quoting it as a measurement of any machine is
|
|
198
|
+
* still what this block exists to stop.
|
|
199
|
+
*
|
|
200
|
+
* A CONSEQUENCE WORTH KNOWING: because this value does not move, neither does
|
|
201
|
+
* `sensingCatchRate.DEFAULT_SAMPLER.analyzeS`, so none of this required a
|
|
202
|
+
* corpus replay or a `.github/contracts/sensing-catch-rate-baseline.json`
|
|
203
|
+
* regeneration. If you ever DO move it, all of that becomes mandatory in the
|
|
204
|
+
* same change — and the catch-rate ratchet is shrink-only, so a baseline may
|
|
205
|
+
* never be regenerated merely to clear red.
|
|
206
|
+
*
|
|
207
|
+
* ── The idle-box objection, and why it does not block the derivation ────────
|
|
208
|
+
*
|
|
209
|
+
* The 2026-08-19 predecessor of this block held the per-machine derivation back
|
|
210
|
+
* for want of a per-frame number taken on an idle box, on the grounds that a
|
|
211
|
+
* figure measured at 0.0% CPU idle would hardcode one session's contention into
|
|
212
|
+
* every connector. That objection is answered twice over.
|
|
213
|
+
*
|
|
214
|
+
* First, it no longer applies to the DERIVATION at all: nothing global is
|
|
215
|
+
* derived from a measured number any more. Each box measures itself, in situ,
|
|
216
|
+
* under whatever load it actually runs at — which is the right load by
|
|
217
|
+
* definition, and is the one thing a bench on someone else's desk can never
|
|
218
|
+
* reproduce.
|
|
219
|
+
*
|
|
220
|
+
* Second, the verdict turned out not to depend on it. Three measurements of the
|
|
221
|
+
* shipped arm on one M4 Max across a 3x load range: 0.45 s at load 7.77, 0.50 s
|
|
222
|
+
* at load 11.87, 0.72 s at load 22-25. All three clear the 13.88 s/frame budget
|
|
223
|
+
* for 4 cameras by 19-31x, so "this class clears 4 cameras" is invariant across
|
|
224
|
+
* everything that could be measured. Load moves the quotable figure, not the
|
|
225
|
+
* verdict — and the post-merge path is markedly LESS load-sensitive than the one
|
|
226
|
+
* that motivated the objection, because the work #12594 removed was CPU-bound
|
|
227
|
+
* and what remains is GPU-bound.
|
|
228
|
+
*/
|
|
121
229
|
/**
|
|
122
230
|
* Share of the single admission slot the STILL-scene heartbeat floor may take.
|
|
123
231
|
* The rest is held for motion-triggered analyses.
|
|
@@ -392,11 +500,28 @@ exports.DOOH_PERIODIC_MS = 300000;
|
|
|
392
500
|
* Returns `null` when the count is not a positive integer, so a caller can omit
|
|
393
501
|
* the key entirely rather than write a cadence derived from a bad count.
|
|
394
502
|
*/
|
|
395
|
-
function periodicIntervalMsForFeedCount(feedCount
|
|
503
|
+
function periodicIntervalMsForFeedCount(feedCount,
|
|
504
|
+
/**
|
|
505
|
+
* What a frame ACTUALLY costs on this box, in ms, when this box has measured
|
|
506
|
+
* itself (`AnalyzeCostObserver.medianMs()`). Omitted or `null` falls back to
|
|
507
|
+
* `MEASURED_LOCAL_ANALYZE_MS`, which is the BOOTSTRAP — deliberately
|
|
508
|
+
* conservative, and not a measurement of any machine.
|
|
509
|
+
*
|
|
510
|
+
* This parameter is the whole reason a fleet spanning 0.45 s/frame to tens of
|
|
511
|
+
* seconds can share one code path: the equation was always per-machine, and
|
|
512
|
+
* until 2026-08-19 only its input was global.
|
|
513
|
+
*/
|
|
514
|
+
analyzeMs) {
|
|
396
515
|
const n = Number(feedCount);
|
|
397
516
|
if (!Number.isFinite(n) || n < 1)
|
|
398
517
|
return null;
|
|
399
|
-
const
|
|
518
|
+
const measured = Number(analyzeMs);
|
|
519
|
+
// A non-positive or non-finite measurement is not a fast box, it is a broken
|
|
520
|
+
// reading — fall back rather than derive a cadence from it.
|
|
521
|
+
const perFrameMs = Number.isFinite(measured) && measured > 0
|
|
522
|
+
? measured
|
|
523
|
+
: exports.MEASURED_LOCAL_ANALYZE_MS;
|
|
524
|
+
const required = Math.ceil((Math.trunc(n) * perFrameMs) / exports.STILL_FLOOR_SLOT_SHARE);
|
|
400
525
|
// MEASURED 2026-08-18, and left as it is ON PURPOSE — see below.
|
|
401
526
|
//
|
|
402
527
|
// The `DOOH_PERIODIC_MS` cap stops honouring `STILL_FLOOR_SLOT_SHARE` past
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectorCadence.js","sourceRoot":"","sources":["../src/connectorCadence.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"connectorCadence.js","sourceRoot":"","sources":["../src/connectorCadence.ts"],"names":[],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AAG,yCAAiC,CAAC;IACnF,OAAO,CAAC,4BAAoB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,SAAkB,EAClB,kBAA2B;IAE3B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAC/E,MAAM,eAAe,GAAG,CAAC,CAAC,GAAG,OAAS,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,cAAc,GAAG,OAAS,GAAG,iCAAyB,CAAC;IAC7D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,cAAc,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -26,7 +26,14 @@
|
|
|
26
26
|
*
|
|
27
27
|
* `litert-lm serve` is a single-conversation server with exactly one admission
|
|
28
28
|
* slot at a measured 7.30 s/frame, so the whole connector has a hard ceiling of
|
|
29
|
-
* 493 analyses/hour however many cameras it runs.
|
|
29
|
+
* 493 analyses/hour however many cameras it runs. (The SINGLE SLOT is now a
|
|
30
|
+
* measured fact — two concurrent sessions on one engine make the second return
|
|
31
|
+
* an EMPTY generation, silently; see CloudSensingManager. The 7.30 s is NOT:
|
|
32
|
+
* the shipped path measures 1.90 s on the pinned 0.16.0, 1.22 s with the
|
|
33
|
+
* 2026-08-19 config.json change, and a further paired 2.42x with the 2026-08-19
|
|
34
|
+
* fast-conversation shim (0.72 s/frame through bench-local-vlm). The argument below is unaffected — the profile's
|
|
35
|
+
* 5-30 s values still oversubscribe by ~4-24x rather than ~23x — but do not
|
|
36
|
+
* quote 493/hour as this machine's ceiling; see MEASURED_LOCAL_ANALYZE_MS.) That ceiling is what
|
|
30
37
|
* `connectorCadence.periodicIntervalMsForFeedCount` already computes, and it is
|
|
31
38
|
* why the profile's own 5-30 s values were rejected as a cadence source when
|
|
32
39
|
* that module was written: they are the ANDROID tablet's capture rate, where a
|
|
@@ -138,5 +145,10 @@ export declare function resolveDeployedCadence(input: {
|
|
|
138
145
|
requestedMs: unknown;
|
|
139
146
|
mode: SensingRunModeName;
|
|
140
147
|
feedCount: number;
|
|
148
|
+
/**
|
|
149
|
+
* This machine's own measured per-frame analyze cost in ms, or null/undefined
|
|
150
|
+
* while it is still on the bootstrap constant. See `AnalyzeCostObserver`.
|
|
151
|
+
*/
|
|
152
|
+
analyzeMs?: number | null;
|
|
141
153
|
}): DeployedCadence;
|
|
142
154
|
//# sourceMappingURL=deployedCadence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployedCadence.d.ts","sourceRoot":"","sources":["../src/deployedCadence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deployedCadence.d.ts","sourceRoot":"","sources":["../src/deployedCadence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAQH;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc,QAAmB,CAAC;AAE/C,MAAM,MAAM,aAAa;AACvB,4EAA4E;AAC1E,YAAY;AACd;;;GAGG;GACD,iBAAiB;AACnB,uEAAuE;GACrE,kBAAkB;AACpB,qDAAqD;GACnD,wBAAwB;AAC1B;;;;;;;GAOG;GACD,eAAe;AACjB,2FAA2F;GACzF,iBAAiB,CAAC;AAEtB,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mFAAmF;IACnF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;CACvB;AASD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,eAAe,CAoFlB"}
|
package/dist/deployedCadence.js
CHANGED
|
@@ -27,7 +27,14 @@
|
|
|
27
27
|
*
|
|
28
28
|
* `litert-lm serve` is a single-conversation server with exactly one admission
|
|
29
29
|
* slot at a measured 7.30 s/frame, so the whole connector has a hard ceiling of
|
|
30
|
-
* 493 analyses/hour however many cameras it runs.
|
|
30
|
+
* 493 analyses/hour however many cameras it runs. (The SINGLE SLOT is now a
|
|
31
|
+
* measured fact — two concurrent sessions on one engine make the second return
|
|
32
|
+
* an EMPTY generation, silently; see CloudSensingManager. The 7.30 s is NOT:
|
|
33
|
+
* the shipped path measures 1.90 s on the pinned 0.16.0, 1.22 s with the
|
|
34
|
+
* 2026-08-19 config.json change, and a further paired 2.42x with the 2026-08-19
|
|
35
|
+
* fast-conversation shim (0.72 s/frame through bench-local-vlm). The argument below is unaffected — the profile's
|
|
36
|
+
* 5-30 s values still oversubscribe by ~4-24x rather than ~23x — but do not
|
|
37
|
+
* quote 493/hour as this machine's ceiling; see MEASURED_LOCAL_ANALYZE_MS.) That ceiling is what
|
|
31
38
|
* `connectorCadence.periodicIntervalMsForFeedCount` already computes, and it is
|
|
32
39
|
* why the profile's own 5-30 s values were rejected as a cadence source when
|
|
33
40
|
* that module was written: they are the ANDROID tablet's capture rate, where a
|
|
@@ -109,7 +116,9 @@ function resolveDeployedCadence(input) {
|
|
|
109
116
|
// measured. periodicIntervalMsForFeedCount returns null on a bad count; a
|
|
110
117
|
// connector with no countable feeds gets the DOOH default rather than a
|
|
111
118
|
// cadence derived from nothing.
|
|
112
|
-
|
|
119
|
+
// `analyzeMs` is what THIS box measured for itself; undefined/null means it has
|
|
120
|
+
// not measured itself yet and the conservative bootstrap constant governs.
|
|
121
|
+
const floorMs = (0, connectorCadence_1.periodicIntervalMsForFeedCount)(input.feedCount, input.analyzeMs) ?? connectorCadence_1.DOOH_PERIODIC_MS;
|
|
113
122
|
// A cadence finer than the connector may ANALYZE is not deliverable, so it is
|
|
114
123
|
// a floor in every case. This read `LOOK_INTERVAL_MS` until 2026-08-18, when
|
|
115
124
|
// the two constants split: both were 30 000 ms, so the substitution changes no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployedCadence.js","sourceRoot":"","sources":["../src/deployedCadence.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"deployedCadence.js","sourceRoot":"","sources":["../src/deployedCadence.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;;;AA+FH,wDA6FC;AA1LD,yDAI4B;AAU5B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAwC/C,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,KAAc;IACtC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,O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AS,EAAE,sBAAc;YACzB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,iBAAiB;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,sBAAc,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;IACnF,MAAM,OAAO,GAAG,UAAU,KAAK,WAAW,CAAC;IAE3C,IAAI,MAAM,GAAkB,kBAAkB,CAAC;IAC/C,IAAI,UAAU,GAAG,WAAW,EAAE,CAAC;QAC7B,MAAM,GAAG,iBAAiB,CAAC;IAC7B,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QACnB,IAAI,cAAc,KAAK,0CAAuB,IAAI,OAAO,IAAI,0CAAuB;YAAE,MAAM,GAAG,eAAe,CAAC;;YAC1G,MAAM,GAAG,wBAAwB,CAAC;IACzC,CAAC;IAED,OAAO;QACL,UAAU;QACV,WAAW;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,sBAAc;QACzB,OAAO;QACP,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -36,6 +36,16 @@ export interface DeployedCadenceSourceOptions {
|
|
|
36
36
|
mode: SensingRunModeName;
|
|
37
37
|
/** Total feeds this connector runs (drives the LOCAL single-slot floor). */
|
|
38
38
|
feedCount: number;
|
|
39
|
+
/**
|
|
40
|
+
* This machine's own per-frame analyze cost, read AT RESOLVE TIME.
|
|
41
|
+
*
|
|
42
|
+
* A getter and not a number on purpose: the observer settles minutes after the
|
|
43
|
+
* connector starts and then keeps rolling, so a value captured at construction
|
|
44
|
+
* would pin every future cadence to the cold-start estimate — the one reading
|
|
45
|
+
* we specifically know is high. Omitted leaves the conservative bootstrap
|
|
46
|
+
* constant governing, which is exactly today's behaviour.
|
|
47
|
+
*/
|
|
48
|
+
observedAnalyzeMs?: () => number | null;
|
|
39
49
|
}
|
|
40
50
|
/**
|
|
41
51
|
* Build the connector's cadence source. Returns `undefined` when there are no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployedCadenceSource.d.ts","sourceRoot":"","sources":["../src/deployedCadenceSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,4BAA4B;IAC3C,kFAAkF;IAClF,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,IAAI,EAAE,kBAAkB,CAAC;IACzB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"deployedCadenceSource.d.ts","sourceRoot":"","sources":["../src/deployedCadenceSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,4BAA4B;IAC3C,kFAAkF;IAClF,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,IAAI,EAAE,kBAAkB,CAAC;IACzB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,4BAA4B,GACpC,aAAa,GAAG,SAAS,CA6C3B"}
|
|
@@ -62,10 +62,21 @@ function buildDeployedCadenceSource(options) {
|
|
|
62
62
|
// running cadence, and returning null is how the manager is told so.
|
|
63
63
|
if (!anyAnswered)
|
|
64
64
|
return null;
|
|
65
|
+
// Read the machine's own cost NOW, not at construction. A throwing getter
|
|
66
|
+
// must not take the cadence down with it: an unmeasured box is a box on
|
|
67
|
+
// the bootstrap, which is the state it was in a moment ago anyway.
|
|
68
|
+
let analyzeMs = null;
|
|
69
|
+
try {
|
|
70
|
+
analyzeMs = options.observedAnalyzeMs ? options.observedAnalyzeMs() : null;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
analyzeMs = null;
|
|
74
|
+
}
|
|
65
75
|
return (0, deployedCadence_1.resolveDeployedCadence)({
|
|
66
76
|
requestedMs: fastest,
|
|
67
77
|
mode: options.mode,
|
|
68
78
|
feedCount: options.feedCount,
|
|
79
|
+
analyzeMs,
|
|
69
80
|
});
|
|
70
81
|
},
|
|
71
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployedCadenceSource.js","sourceRoot":"","sources":["../src/deployedCadenceSource.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;
|
|
1
|
+
{"version":3,"file":"deployedCadenceSource.js","sourceRoot":"","sources":["../src/deployedCadenceSource.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAiCH,gEA+CC;AA5ED,uDAI2B;AAoB3B;;;;GAIG;AACH,SAAgB,0BAA0B,CACxC,OAAqC;IAErC,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO;QACL,KAAK,CAAC,OAAO;YACX,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EA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
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
declare const SDK_VERSION = "0.2.
|
|
34
|
+
declare const SDK_VERSION = "0.2.63";
|
|
35
35
|
declare function checkNodeVersion(): CheckResult;
|
|
36
36
|
declare function checkPlatform(): CheckResult;
|
|
37
37
|
declare function checkMemory(): CheckResult;
|
package/dist/diagnose.js
CHANGED
|
@@ -63,7 +63,7 @@ const localNetworkAccess_1 = require("./localNetworkAccess");
|
|
|
63
63
|
// ---------------------------------------------------------------------------
|
|
64
64
|
// SDK version — mirrors package.json; kept in sync by CI
|
|
65
65
|
// ---------------------------------------------------------------------------
|
|
66
|
-
const SDK_VERSION = '0.2.
|
|
66
|
+
const SDK_VERSION = '0.2.63';
|
|
67
67
|
exports._SDK_VERSION = SDK_VERSION;
|
|
68
68
|
// ---------------------------------------------------------------------------
|
|
69
69
|
// ANSI helpers (no external deps)
|
|
@@ -45,9 +45,14 @@
|
|
|
45
45
|
* these were taken on has ranged over load average 24-142 — so quote the RATIO,
|
|
46
46
|
* and re-measure both arms in one run before quoting anything.
|
|
47
47
|
*
|
|
48
|
-
* The GPU win is small because
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* The GPU win is small because, ON THE RUNTIME THOSE NUMBERS WERE TAKEN ON,
|
|
49
|
+
* litert-lm pinned the VISION encoder to CPU — 0.13.1's `openai_handler.py`
|
|
50
|
+
* hardcoded `vision_backend = Backend.CPU()` under upstream b/515805503 — so
|
|
51
|
+
* image encode was a fixed per-frame floor no schema could shrink. THAT IS NO
|
|
52
|
+
* LONGER TRUE and the split above should not be re-derived from it: the pinned
|
|
53
|
+
* 0.16.0 resolves the vision backend from `$LITERT_LM_DIR/config.json`, all
|
|
54
|
+
* three provisioners write `vision_backend: "gpu"`, and image encode measured
|
|
55
|
+
* 0.804 s -> 0.175 s p50 when they started. On the CPU delegate — every host
|
|
51
56
|
* with no usable GPU delegate — decode is the bill and the lean set is worth
|
|
52
57
|
* 1.53x. ACCURACY also moved the right way on that run: against the frame's
|
|
53
58
|
* ground truth the operator set scored 16/16 and the 16-key set 12/16, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localInferenceSchema.d.ts","sourceRoot":"","sources":["../src/localInferenceSchema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"localInferenceSchema.d.ts","sourceRoot":"","sources":["../src/localInferenceSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC5G,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACpD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;CAC9B;AAoCD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAGvD,CAAC;AAmGH;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgCzB;AAyBD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAAC,WAAW,CAAC,EAAE,YAAY,EAAE,CAAA;CAAO,GAC7E,MAAM,CAeR"}
|
|
@@ -46,9 +46,14 @@
|
|
|
46
46
|
* these were taken on has ranged over load average 24-142 — so quote the RATIO,
|
|
47
47
|
* and re-measure both arms in one run before quoting anything.
|
|
48
48
|
*
|
|
49
|
-
* The GPU win is small because
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* The GPU win is small because, ON THE RUNTIME THOSE NUMBERS WERE TAKEN ON,
|
|
50
|
+
* litert-lm pinned the VISION encoder to CPU — 0.13.1's `openai_handler.py`
|
|
51
|
+
* hardcoded `vision_backend = Backend.CPU()` under upstream b/515805503 — so
|
|
52
|
+
* image encode was a fixed per-frame floor no schema could shrink. THAT IS NO
|
|
53
|
+
* LONGER TRUE and the split above should not be re-derived from it: the pinned
|
|
54
|
+
* 0.16.0 resolves the vision backend from `$LITERT_LM_DIR/config.json`, all
|
|
55
|
+
* three provisioners write `vision_backend: "gpu"`, and image encode measured
|
|
56
|
+
* 0.804 s -> 0.175 s p50 when they started. On the CPU delegate — every host
|
|
52
57
|
* with no usable GPU delegate — decode is the bill and the lean set is worth
|
|
53
58
|
* 1.53x. ACCURACY also moved the right way on that run: against the frame's
|
|
54
59
|
* ground truth the operator set scored 16/16 and the 16-key set 12/16, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localInferenceSchema.js","sourceRoot":"","sources":["../src/localInferenceSchema.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"localInferenceSchema.js","sourceRoot":"","sources":["../src/localInferenceSchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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W,EAAE,QAAQ,CAAC,CAAC;IAC3E,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,GAAG,IAAI,gEAAgE,KAAK,EAAE,CAAC;AACxF,CAAC"}
|
package/dist/localSensing.d.ts
CHANGED
|
@@ -164,6 +164,14 @@ export declare class LocalSensingClient implements SensingClient {
|
|
|
164
164
|
* that proof self-fulfilling and mask a genuinely dead runtime forever.
|
|
165
165
|
*/
|
|
166
166
|
private localInferencesCompleted;
|
|
167
|
+
/**
|
|
168
|
+
* What a frame costs ON THIS BOX. The connector is already running the exact
|
|
169
|
+
* inference `MEASURED_LOCAL_ANALYZE_MS` describes, once per frame — so the
|
|
170
|
+
* machine-specific number the cadence needs is free to observe, and until
|
|
171
|
+
* 2026-08-19 nothing observed it. See analyzeCostObserver.ts for why the
|
|
172
|
+
* constant stays as the bootstrap and why this is a rolling MEDIAN.
|
|
173
|
+
*/
|
|
174
|
+
private readonly analyzeCost;
|
|
167
175
|
/** The active profile name (for logging / observability). */
|
|
168
176
|
activeProfileName: string | null;
|
|
169
177
|
/**
|
|
@@ -193,10 +201,23 @@ export declare class LocalSensingClient implements SensingClient {
|
|
|
193
201
|
* log-diving. See LiteRtVlmProvider.getAcceleratorHealth.
|
|
194
202
|
*/
|
|
195
203
|
getAcceleratorHealth(): LiteRtAcceleratorHealth;
|
|
196
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Frames the on-device runtime produced a result for, and what they cost.
|
|
206
|
+
*
|
|
207
|
+
* `analyzeMsP50` is `null` until this box has recorded enough successful
|
|
208
|
+
* frames to overrule the bootstrap constant — deliberately distinguishable
|
|
209
|
+
* from "measured, and it happens to equal the default".
|
|
210
|
+
*/
|
|
197
211
|
getLocalInferenceStats(): {
|
|
198
212
|
completed: number;
|
|
213
|
+
analyzeMsP50: number | null;
|
|
214
|
+
analyzeSamples: number;
|
|
199
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* This machine's own per-frame analyze cost, for the cadence derivation.
|
|
218
|
+
* `null` while the conservative bootstrap still governs.
|
|
219
|
+
*/
|
|
220
|
+
getObservedAnalyzeMs(): number | null;
|
|
200
221
|
analyze(request: {
|
|
201
222
|
jpeg: Buffer;
|
|
202
223
|
captureMode?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localSensing.d.ts","sourceRoot":"","sources":["../src/localSensing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"localSensing.d.ts","sourceRoot":"","sources":["../src/localSensing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAoBhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAA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