@camstack/addon-pipeline 1.2.301 → 1.2.303
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/dist/audio-analyzer/index.js +2 -2
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/{default-detection-model-JDKeiJPf.mjs → default-detection-model-BroB5Jp1.mjs} +1 -1
- package/dist/{default-detection-model-P7IIrP0a.js → default-detection-model-vN686W1U.js} +1 -1
- package/dist/detection-pipeline/index.js +4 -4
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-DvzAabca.mjs → dist-CLZmZfHT.mjs} +35 -4
- package/dist/{dist-BUs7H-fe.js → dist-CyWAhtbJ.js} +35 -4
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-DxVMyys-.js → node-BDrkzYiH.js} +1 -1
- package/dist/{node-DnP_6GBZ.mjs → node-C5LXX8Qo.mjs} +1 -1
- package/dist/pipeline-runner/index.js +274 -17
- package/dist/pipeline-runner/index.mjs +274 -17
- package/dist/{process-memory-BMr61qT1.mjs → process-memory-CCx6i9av.mjs} +1 -1
- package/dist/{process-memory-DmYzYip-.js → process-memory-DMS-0oRT.js} +1 -1
- package/dist/recorder/index.js +1351 -72
- package/dist/recorder/index.mjs +1424 -146
- package/dist/{segment-demux-js-DBqdboBI.mjs → segment-demux-js-BUxZFqkb.mjs} +1 -1
- package/dist/{segment-demux-js-DANvUJgH.js → segment-demux-js-CwQuMR0h.js} +1 -1
- package/dist/session-decode/decode-worker-main.js +250 -57
- package/dist/session-decode/decode-worker-main.mjs +250 -57
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-D0etdxl0.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CF7C68rV.mjs} +2 -2
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-TY9BRVDy.mjs → hostInit-dac4-ofq.mjs} +2 -2
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { An as lazy, At as pickDetailCropConvention, D as MOTION_CLOSE_AFTER_MS, Dn as array, En as _enum, In as string, Mn as number, Nn as object, Nt as pipelineRunnerCapability, O as NativeLeaseAdmissionSchema, On as boolean, Rn as EventCategory, en as errMsg, h as DEFAULT_DETAIL_CROP_CONVENTION, hn as defineCustomActions, i as BackgroundRunRegistry, jn as literal, jt as pickNativeLeaseOverride, k as NativeLeaseSettingsSchema, mn as customAction, nt as deriveDetailCropRect, pn as createEvent, pt as failureContributionCapability, sn as BaseAddon, v as DEFAULT_NATIVE_LEASE_SETTINGS, vt as loadContributionCapability, w as FailureCounters, xn as nodePin } from "../dist-
|
|
2
|
-
import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-
|
|
3
|
-
import { c as macroGateVerdict, d as resolveFrameViewGeometry, g as getStepDefinition, l as rootObjectGate, o as placeDetailStep, r as CustomModelCatalog, s as stepsForElectedPool, u as localFrameRegistry, v as RETIRED_MODEL_IDS } from "../default-detection-model-
|
|
1
|
+
import { An as lazy, At as pickDetailCropConvention, D as MOTION_CLOSE_AFTER_MS, Dn as array, En as _enum, In as string, Mn as number, Nn as object, Nt as pipelineRunnerCapability, O as NativeLeaseAdmissionSchema, On as boolean, Rn as EventCategory, en as errMsg, h as DEFAULT_DETAIL_CROP_CONVENTION, hn as defineCustomActions, i as BackgroundRunRegistry, jn as literal, jt as pickNativeLeaseOverride, k as NativeLeaseSettingsSchema, mn as customAction, nt as deriveDetailCropRect, pn as createEvent, pt as failureContributionCapability, sn as BaseAddon, v as DEFAULT_NATIVE_LEASE_SETTINGS, vt as loadContributionCapability, w as FailureCounters, xn as nodePin } from "../dist-CLZmZfHT.mjs";
|
|
2
|
+
import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-C5LXX8Qo.mjs";
|
|
3
|
+
import { c as macroGateVerdict, d as resolveFrameViewGeometry, g as getStepDefinition, l as rootObjectGate, o as placeDetailStep, r as CustomModelCatalog, s as stepsForElectedPool, u as localFrameRegistry, v as RETIRED_MODEL_IDS } from "../default-detection-model-BroB5Jp1.mjs";
|
|
4
4
|
import { t as isWorkerReply } from "../worker-protocol-D_NzPcnh.mjs";
|
|
5
5
|
import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
|
|
6
6
|
import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
|
|
@@ -34,14 +34,18 @@ var KILL_SIGNALS = {
|
|
|
34
34
|
* parameter rather than a second `child.on('exit')` in the caller because
|
|
35
35
|
* every listener added out here is one somebody can forget to remove.
|
|
36
36
|
*/
|
|
37
|
-
function wrapChild(child, onExit) {
|
|
37
|
+
function wrapChild(child, onExit, killedByRunner = () => false) {
|
|
38
38
|
let spawned = false;
|
|
39
39
|
let exitDelivered = false;
|
|
40
40
|
const exitListeners = [];
|
|
41
|
-
const deliverExit = (
|
|
41
|
+
const deliverExit = (exit) => {
|
|
42
42
|
if (exitDelivered) return;
|
|
43
43
|
exitDelivered = true;
|
|
44
44
|
onExit();
|
|
45
|
+
const info = killedByRunner() ? {
|
|
46
|
+
...exit,
|
|
47
|
+
killedByRunner: true
|
|
48
|
+
} : exit;
|
|
45
49
|
for (const listener of exitListeners) listener(info);
|
|
46
50
|
};
|
|
47
51
|
child.on("spawn", () => {
|
|
@@ -95,19 +99,179 @@ function wrapChild(child, onExit) {
|
|
|
95
99
|
* node-av through `CAMSTACK_FRAMEWORK_DIR` / `CAMSTACK_BUNDLED_ADDONS_DIR` on
|
|
96
100
|
* agents, so a replaced env would silently break decoding off the hub.
|
|
97
101
|
*/
|
|
98
|
-
function forkDecodeWorker(source,
|
|
99
|
-
|
|
102
|
+
function forkDecodeWorker(source, deps) {
|
|
103
|
+
return forkDecodeWorkerAt(CHILD_ENTRY_PATH, source, deps ?? {});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* {@link forkDecodeWorker} with the entry named — the one seam a process-level
|
|
107
|
+
* test needs to fork a stub through the REAL fork, claim and live-worker path.
|
|
108
|
+
* Production forks only {@link CHILD_ENTRY_PATH}.
|
|
109
|
+
*/
|
|
110
|
+
function forkDecodeWorkerAt(entryPath, source, deps) {
|
|
111
|
+
const child = fork(entryPath, [], {
|
|
100
112
|
serialization: "advanced",
|
|
101
113
|
env: { ...process.env }
|
|
102
114
|
});
|
|
103
|
-
const costClaim = costRegistry?.claim({
|
|
115
|
+
const costClaim = deps.costRegistry?.claim({
|
|
104
116
|
role: "decode",
|
|
105
117
|
deviceId: source.deviceId,
|
|
106
118
|
unit: `${source.deviceId}/decode`,
|
|
107
119
|
pid: child.pid
|
|
108
120
|
}) ?? NO_COST_CLAIM;
|
|
109
|
-
|
|
121
|
+
let killedByRunner = false;
|
|
122
|
+
const untrack = deps.liveWorkers?.add({
|
|
123
|
+
deviceId: source.deviceId,
|
|
124
|
+
pid: child.pid,
|
|
125
|
+
killNow: () => {
|
|
126
|
+
killedByRunner = true;
|
|
127
|
+
child.kill("SIGKILL");
|
|
128
|
+
}
|
|
129
|
+
}) ?? (() => void 0);
|
|
130
|
+
return wrapChild(child, () => {
|
|
131
|
+
costClaim.release();
|
|
132
|
+
untrack();
|
|
133
|
+
}, () => killedByRunner);
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/session-decode/live-decode-workers.ts
|
|
137
|
+
var KILL_MESSAGE = {
|
|
138
|
+
shutdown: "session-decode: worker killed at shutdown",
|
|
139
|
+
"forked-after-shutdown": "session-decode: worker forked after shutdown began — killed at once",
|
|
140
|
+
"process-exit": "session-decode: worker killed at process exit"
|
|
141
|
+
};
|
|
142
|
+
/** Send the signal. Never throws: a failure is the outcome. */
|
|
143
|
+
function signal(worker) {
|
|
144
|
+
try {
|
|
145
|
+
worker.killNow();
|
|
146
|
+
return {
|
|
147
|
+
worker,
|
|
148
|
+
error: null
|
|
149
|
+
};
|
|
150
|
+
} catch (err) {
|
|
151
|
+
return {
|
|
152
|
+
worker,
|
|
153
|
+
error: errMsg(err)
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* One line per outcome, each in its own swallowing try. The logger may throw:
|
|
159
|
+
* the `'exit'` hook runs while the transport goes down, and the runner's
|
|
160
|
+
* write path has no guard. A line that fails must not cost another line.
|
|
161
|
+
*/
|
|
162
|
+
function logOutcomes(outcomes, reason, logger) {
|
|
163
|
+
for (const { worker, error } of outcomes) try {
|
|
164
|
+
if (error === null) logger.info(KILL_MESSAGE[reason], {
|
|
165
|
+
tags: { deviceId: worker.deviceId },
|
|
166
|
+
meta: {
|
|
167
|
+
pid: worker.pid ?? null,
|
|
168
|
+
signal: "SIGKILL",
|
|
169
|
+
reason
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
else logger.warn("session-decode: worker kill failed — it may outlive the runner", {
|
|
173
|
+
tags: { deviceId: worker.deviceId },
|
|
174
|
+
meta: {
|
|
175
|
+
pid: worker.pid ?? null,
|
|
176
|
+
reason,
|
|
177
|
+
error
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
} catch {}
|
|
110
181
|
}
|
|
182
|
+
var LiveDecodeWorkers = class {
|
|
183
|
+
live = /* @__PURE__ */ new Set();
|
|
184
|
+
/** Set by {@link close}: from then on a worker is killed as it is added. */
|
|
185
|
+
closedLogger = null;
|
|
186
|
+
/** Track a forked worker; call the returned function from its real exit. */
|
|
187
|
+
add(worker) {
|
|
188
|
+
if (this.closedLogger !== null) {
|
|
189
|
+
const outcome = signal(worker);
|
|
190
|
+
logOutcomes([outcome], "forked-after-shutdown", this.closedLogger);
|
|
191
|
+
if (outcome.error === null) return () => void 0;
|
|
192
|
+
}
|
|
193
|
+
this.live.add(worker);
|
|
194
|
+
return () => {
|
|
195
|
+
this.live.delete(worker);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
get size() {
|
|
199
|
+
return this.live.size;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* SIGKILL every tracked worker now, then one log line per worker. SIGKILL
|
|
203
|
+
* rather than SIGTERM: the runner is about to exit and cannot wait for a
|
|
204
|
+
* fallback, and a worker blocked in a native call never runs a SIGTERM
|
|
205
|
+
* handler (D652).
|
|
206
|
+
*
|
|
207
|
+
* EVERY worker is signalled before ANY line is written: a logger that throws
|
|
208
|
+
* must not stop the kills. A signalled worker is forgotten (a second pass
|
|
209
|
+
* logs nothing twice); one whose kill threw stays tracked, so the exit hook
|
|
210
|
+
* or a later pass tries it again. Returns how many it signalled.
|
|
211
|
+
*/
|
|
212
|
+
killAll(reason, logger) {
|
|
213
|
+
const outcomes = [...this.live].map(signal);
|
|
214
|
+
for (const outcome of outcomes) if (outcome.error === null) this.live.delete(outcome.worker);
|
|
215
|
+
logOutcomes(outcomes, reason, logger);
|
|
216
|
+
return outcomes.filter((outcome) => outcome.error === null).length;
|
|
217
|
+
}
|
|
218
|
+
/** Kill everything tracked, and kill every later `add` at once. */
|
|
219
|
+
close(reason, logger) {
|
|
220
|
+
this.closedLogger = logger;
|
|
221
|
+
return this.killAll(reason, logger);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* The runner's decode workers: every fork is registered in the set, and
|
|
226
|
+
* {@link shutdown} and any process exit kill whatever is still alive.
|
|
227
|
+
*/
|
|
228
|
+
var RunnerDecodeWorkers = class {
|
|
229
|
+
deps;
|
|
230
|
+
live = new LiveDecodeWorkers();
|
|
231
|
+
exitHookArmed = false;
|
|
232
|
+
shutDown = false;
|
|
233
|
+
constructor(deps) {
|
|
234
|
+
this.deps = deps;
|
|
235
|
+
}
|
|
236
|
+
/** Fork one worker, registered and cost-claimed. */
|
|
237
|
+
fork = (source) => {
|
|
238
|
+
this.armExitHook();
|
|
239
|
+
return this.deps.fork(source, {
|
|
240
|
+
costRegistry: this.deps.costRegistry,
|
|
241
|
+
liveWorkers: this.live
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* The addon is shutting down: kill every worker, and every later fork at
|
|
246
|
+
* once. Synchronous, so it is done before the runner's `process.exit`.
|
|
247
|
+
*/
|
|
248
|
+
shutdown() {
|
|
249
|
+
this.shutDown = true;
|
|
250
|
+
const killed = this.live.close("shutdown", this.deps.logger);
|
|
251
|
+
if (this.live.size === 0) this.disarmExitHook();
|
|
252
|
+
return killed;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The process is exiting without having shut this addon down (an uncaught
|
|
256
|
+
* error, or an `onShutdown` that never reached {@link shutdown}). The log
|
|
257
|
+
* line is attempted but will probably not land: the transport goes down
|
|
258
|
+
* with the process.
|
|
259
|
+
*/
|
|
260
|
+
onProcessExit = () => {
|
|
261
|
+
this.exitHookArmed = false;
|
|
262
|
+
this.live.close("process-exit", this.deps.logger);
|
|
263
|
+
};
|
|
264
|
+
armExitHook() {
|
|
265
|
+
if (this.exitHookArmed || this.shutDown) return;
|
|
266
|
+
this.exitHookArmed = true;
|
|
267
|
+
this.deps.process.once("exit", this.onProcessExit);
|
|
268
|
+
}
|
|
269
|
+
disarmExitHook() {
|
|
270
|
+
if (!this.exitHookArmed) return;
|
|
271
|
+
this.exitHookArmed = false;
|
|
272
|
+
this.deps.process.removeListener("exit", this.onProcessExit);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
111
275
|
//#endregion
|
|
112
276
|
//#region src/session-decode/native-lease-config.ts
|
|
113
277
|
/**
|
|
@@ -1715,6 +1879,11 @@ var SessionDecodeSession = class {
|
|
|
1715
1879
|
/** Set when `kill()` is sent, so handleExit can tell an intentional stop from a death. */
|
|
1716
1880
|
killSent = false;
|
|
1717
1881
|
/**
|
|
1882
|
+
* A SIGKILL already went out — an `'immediate'` teardown from the pump
|
|
1883
|
+
* (D666) and the generator's later `finally` both escalate; one kill is enough.
|
|
1884
|
+
*/
|
|
1885
|
+
sigkillSent = false;
|
|
1886
|
+
/**
|
|
1718
1887
|
* Images yielded and not yet closed that a CONSUMER still holds — queued,
|
|
1719
1888
|
* in flight, or being read. Each dies with the worker and somebody was going
|
|
1720
1889
|
* to read it first. This is what a drain waits on.
|
|
@@ -1926,7 +2095,7 @@ var SessionDecodeSession = class {
|
|
|
1926
2095
|
}
|
|
1927
2096
|
/** The drain (or a SIGTERM still waiting on its fallback) gives way to SIGKILL now. */
|
|
1928
2097
|
escalateToImmediate() {
|
|
1929
|
-
if (this.exited) return;
|
|
2098
|
+
if (this.exited || this.sigkillSent) return;
|
|
1930
2099
|
if (this.drainTimer !== null) {
|
|
1931
2100
|
clearTimeout(this.drainTimer);
|
|
1932
2101
|
this.drainTimer = null;
|
|
@@ -2113,7 +2282,14 @@ var SessionDecodeSession = class {
|
|
|
2113
2282
|
}
|
|
2114
2283
|
handleExit(info) {
|
|
2115
2284
|
if (!this.exited) this.hooks.onWorkerExit?.();
|
|
2116
|
-
if (!this.killSent && !this.exited) this.logger.
|
|
2285
|
+
if (!this.killSent && !this.exited && info?.killedByRunner === true) this.logger.debug("session-decode worker ended by the runner shutdown kill", {
|
|
2286
|
+
tags: { deviceId: this.deviceId },
|
|
2287
|
+
meta: {
|
|
2288
|
+
code: info.code,
|
|
2289
|
+
signal: info.signal
|
|
2290
|
+
}
|
|
2291
|
+
});
|
|
2292
|
+
else if (!this.killSent && !this.exited) this.logger.warn(this.stopRequested ? "session-decode worker exited unexpectedly while draining" : "session-decode worker exited unexpectedly", {
|
|
2117
2293
|
tags: { deviceId: this.deviceId },
|
|
2118
2294
|
meta: {
|
|
2119
2295
|
code: info?.code ?? null,
|
|
@@ -2305,11 +2481,15 @@ var SessionDecodeSession = class {
|
|
|
2305
2481
|
tryKill(signal) {
|
|
2306
2482
|
try {
|
|
2307
2483
|
this.child.kill(signal);
|
|
2484
|
+
if (signal === "SIGKILL") this.sigkillSent = true;
|
|
2308
2485
|
} catch (err) {
|
|
2309
|
-
this.logger.warn("session-decode-coordinator: kill() on child failed", {
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2486
|
+
this.logger.warn("session-decode-coordinator: kill() on child failed", {
|
|
2487
|
+
tags: { deviceId: this.deviceId },
|
|
2488
|
+
meta: {
|
|
2489
|
+
signal,
|
|
2490
|
+
err: toError(err).message
|
|
2491
|
+
}
|
|
2492
|
+
});
|
|
2313
2493
|
}
|
|
2314
2494
|
}
|
|
2315
2495
|
};
|
|
@@ -2579,6 +2759,7 @@ function startSessionDecodePump(deps) {
|
|
|
2579
2759
|
stopped = true;
|
|
2580
2760
|
teardownMode = mode;
|
|
2581
2761
|
releaseSpawnSlotOnce();
|
|
2762
|
+
if (mode === "immediate") escalateSession?.("immediate");
|
|
2582
2763
|
iterator.return().catch(() => {});
|
|
2583
2764
|
};
|
|
2584
2765
|
}
|
|
@@ -5952,6 +6133,60 @@ var Semaphore = class {
|
|
|
5952
6133
|
if (next) next();
|
|
5953
6134
|
}
|
|
5954
6135
|
};
|
|
6136
|
+
//#endregion
|
|
6137
|
+
//#region src/pipeline-runner/below-floor-tally.ts
|
|
6138
|
+
var BELOW_FLOOR_BANDS = [
|
|
6139
|
+
"<0.35",
|
|
6140
|
+
"0.35-0.50",
|
|
6141
|
+
"0.50-0.65",
|
|
6142
|
+
">=0.65"
|
|
6143
|
+
];
|
|
6144
|
+
function belowFloorBand(score) {
|
|
6145
|
+
if (score < .35) return "<0.35";
|
|
6146
|
+
if (score < .5) return "0.35-0.50";
|
|
6147
|
+
if (score < .65) return "0.50-0.65";
|
|
6148
|
+
return ">=0.65";
|
|
6149
|
+
}
|
|
6150
|
+
function addInto(into, macroClass, band, n) {
|
|
6151
|
+
const row = into[macroClass] ?? {};
|
|
6152
|
+
row[band] = (row[band] ?? 0) + n;
|
|
6153
|
+
into[macroClass] = row;
|
|
6154
|
+
}
|
|
6155
|
+
/** One frame's `below-threshold` discards, tallied. Other reasons are not the
|
|
6156
|
+
* floor's doing and are not counted here. */
|
|
6157
|
+
function tallyBelowFloor(discarded) {
|
|
6158
|
+
const out = {};
|
|
6159
|
+
if (discarded === void 0) return out;
|
|
6160
|
+
for (const d of discarded) {
|
|
6161
|
+
if (d.reason !== "below-threshold") continue;
|
|
6162
|
+
addInto(out, d.macroClass, belowFloorBand(d.score), 1);
|
|
6163
|
+
}
|
|
6164
|
+
return out;
|
|
6165
|
+
}
|
|
6166
|
+
/** Per-device running sum between two stats reports. */
|
|
6167
|
+
var BelowFloorAccumulator = class {
|
|
6168
|
+
byDevice = /* @__PURE__ */ new Map();
|
|
6169
|
+
add(deviceId, tally) {
|
|
6170
|
+
const classes = Object.keys(tally);
|
|
6171
|
+
if (classes.length === 0) return;
|
|
6172
|
+
const into = this.byDevice.get(deviceId) ?? {};
|
|
6173
|
+
for (const macroClass of classes) {
|
|
6174
|
+
const row = tally[macroClass];
|
|
6175
|
+
if (row === void 0) continue;
|
|
6176
|
+
for (const band of BELOW_FLOOR_BANDS) {
|
|
6177
|
+
const n = row[band];
|
|
6178
|
+
if (n !== void 0 && n > 0) addInto(into, macroClass, band, n);
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
this.byDevice.set(deviceId, into);
|
|
6182
|
+
}
|
|
6183
|
+
/** The sum since the last drain, and reset. `{}` is a measured zero. */
|
|
6184
|
+
drain(deviceId) {
|
|
6185
|
+
const out = this.byDevice.get(deviceId) ?? {};
|
|
6186
|
+
this.byDevice.delete(deviceId);
|
|
6187
|
+
return out;
|
|
6188
|
+
}
|
|
6189
|
+
};
|
|
5955
6190
|
var MotionWithoutInferenceDetector = class {
|
|
5956
6191
|
streak = /* @__PURE__ */ new Map();
|
|
5957
6192
|
reported = /* @__PURE__ */ new Set();
|
|
@@ -6016,6 +6251,8 @@ var PipelineTimingSampler = class {
|
|
|
6016
6251
|
droppedSources = /* @__PURE__ */ new Map();
|
|
6017
6252
|
/** Cumulative value seen at the previous report — the delta base. */
|
|
6018
6253
|
lastDroppedCumulative = /* @__PURE__ */ new Map();
|
|
6254
|
+
/** Boxes the operator's class floor dropped since the last report (D665). */
|
|
6255
|
+
belowFloor = new BelowFloorAccumulator();
|
|
6019
6256
|
reportTimer = null;
|
|
6020
6257
|
log = null;
|
|
6021
6258
|
runtimeInfo = {};
|
|
@@ -6035,6 +6272,7 @@ var PipelineTimingSampler = class {
|
|
|
6035
6272
|
addSample(deviceId, s) {
|
|
6036
6273
|
if (!this.detSamples.has(deviceId)) this.detSamples.set(deviceId, []);
|
|
6037
6274
|
this.detSamples.get(deviceId).push(s);
|
|
6275
|
+
if (s.belowFloor !== void 0) this.belowFloor.add(deviceId, s.belowFloor);
|
|
6038
6276
|
}
|
|
6039
6277
|
/**
|
|
6040
6278
|
* Moving average inference time (ms) per camera over the current
|
|
@@ -6136,6 +6374,7 @@ var PipelineTimingSampler = class {
|
|
|
6136
6374
|
p95: p95(inf)
|
|
6137
6375
|
},
|
|
6138
6376
|
detections: totalDet,
|
|
6377
|
+
belowFloor: this.belowFloor.drain(deviceId),
|
|
6139
6378
|
dropped,
|
|
6140
6379
|
pipelineRuntime: rt.pipelineRuntime ?? null,
|
|
6141
6380
|
pipelineModels: rt.pipelineModels ?? null
|
|
@@ -6959,7 +7198,8 @@ var PipelineRunner = class {
|
|
|
6959
7198
|
resultToEmit: emittedAt - inferDoneAt,
|
|
6960
7199
|
frameAge: typeof capturedAt === "number" && capturedAt > 0 ? pickedAt - capturedAt : -1,
|
|
6961
7200
|
endToEnd: emittedAt - enqueuedAt,
|
|
6962
|
-
detections: result.detections?.length ?? 0
|
|
7201
|
+
detections: result.detections?.length ?? 0,
|
|
7202
|
+
belowFloor: tallyBelowFloor(result.discarded)
|
|
6963
7203
|
});
|
|
6964
7204
|
} else frameReleaseReason = "drop";
|
|
6965
7205
|
} catch {
|
|
@@ -7942,6 +8182,22 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
|
|
|
7942
8182
|
*/
|
|
7943
8183
|
costRegistry = new ChildCostRegistry();
|
|
7944
8184
|
/**
|
|
8185
|
+
* Every decode worker this process forked, from ANY spawn site (live
|
|
8186
|
+
* sessions, occupancy bursts), until its exit. The first thing `onShutdown`
|
|
8187
|
+
* does is kill them, a fork after that is killed at once, and any process
|
|
8188
|
+
* exit kills what is left (D666). The logger is only unready before
|
|
8189
|
+
* `initialize()`, when no worker can have been forked.
|
|
8190
|
+
*/
|
|
8191
|
+
decodeWorkers = new RunnerDecodeWorkers({
|
|
8192
|
+
fork: forkDecodeWorker,
|
|
8193
|
+
costRegistry: this.costRegistry,
|
|
8194
|
+
logger: {
|
|
8195
|
+
info: (message, extras) => this.ctxIfReady?.logger.info(message, extras),
|
|
8196
|
+
warn: (message, extras) => this.ctxIfReady?.logger.warn(message, extras)
|
|
8197
|
+
},
|
|
8198
|
+
process
|
|
8199
|
+
});
|
|
8200
|
+
/**
|
|
7945
8201
|
* Per-camera inference-deadline counters reported through
|
|
7946
8202
|
* `failure-contribution`. Bounded, cumulative, and read (never drained) by
|
|
7947
8203
|
* the provider. Constructed eagerly: created on the first timeout it would
|
|
@@ -8391,6 +8647,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
|
|
|
8391
8647
|
};
|
|
8392
8648
|
}
|
|
8393
8649
|
async onShutdown() {
|
|
8650
|
+
this.decodeWorkers.shutdown();
|
|
8394
8651
|
if (this.runtimeInfoTimer !== null) {
|
|
8395
8652
|
clearInterval(this.runtimeInfoTimer);
|
|
8396
8653
|
this.runtimeInfoTimer = null;
|
|
@@ -9941,7 +10198,7 @@ var PipelineRunnerAddon = class PipelineRunnerAddon extends BaseAddon {
|
|
|
9941
10198
|
* environment. A worker is therefore forkable before anyone knows which
|
|
9942
10199
|
* camera it will serve.
|
|
9943
10200
|
*/
|
|
9944
|
-
forkDecodeWorkerWithLease = (source) =>
|
|
10201
|
+
forkDecodeWorkerWithLease = (source) => this.decodeWorkers.fork(source);
|
|
9945
10202
|
/**
|
|
9946
10203
|
* The lease knobs for the session that is about to start — `setting > env >
|
|
9947
10204
|
* default`, resolved HERE because this process is the one that carries the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-CyWAhtbJ.js");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
5
5
|
let node_child_process = require("node:child_process");
|