@camstack/addon-matter-broker 0.2.13 → 0.2.14

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/addon.js CHANGED
@@ -25238,13 +25238,24 @@ method(object({
25238
25238
  /** Playback-speed multiplier for the render (1 = realtime). */
25239
25239
  var ExportSpeedSchema = number().min(.25).max(32);
25240
25240
  /**
25241
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25241
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25242
25242
  *
25243
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25244
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25245
- * playlist. Handing it absolute epochs would make every call site responsible
25246
- * for the same subtraction, and the one that forgot would emit a filter that
25247
- * selects nothing — silently, as a uniform timelapse.
25243
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25244
+ * derives these bounds from things that happened at a TIME (a track's
25245
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25246
+ * every segment present for the range, with each recording GAP removed. The
25247
+ * two agree only on a window that recorded without one interruption, and only
25248
+ * the render side knows the segments, so the translation lives there
25249
+ * (`export-dense-map.ts`, addon-pipeline).
25250
+ *
25251
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25252
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25253
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25254
+ * the video was a uniform timelapse, and the log line reported the five ranges
25255
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25256
+ *
25257
+ * Relative and not absolute epoch, because an absolute epoch would make every
25258
+ * call site responsible for the same subtraction.
25248
25259
  */
25249
25260
  var ExportDenseRangeSchema = object({
25250
25261
  fromSec: number().nonnegative(),
@@ -33858,25 +33869,32 @@ object({
33858
33869
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33859
33870
  object({
33860
33871
  /**
33861
- * How long a retained native frame is served before it counts as a miss.
33872
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33873
+ * detection result.
33862
33874
  *
33863
- * Must cover the FULL late-crop horizon: detection inference + the
33864
- * cross-process inference-result hop to hub post-analysis + tracking + the
33865
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33866
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33867
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33875
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33876
+ * a time window was never related to the event the pixels were waiting for.
33877
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33878
+ * — at which moment the runner cuts the subject tiles it actually wanted and
33879
+ * releases the frame. The bound exists only so a runner that stops answering
33880
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33881
+ *
33882
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33883
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33884
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33885
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33886
+ * `holdOverflow` on the metrics line is what says you need it.
33868
33887
  */
33869
- ttlMs: number().int().min(250).max(1e4),
33888
+ holdFrames: number().int().min(1).max(64),
33870
33889
  /**
33871
33890
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33872
33891
  *
33873
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33874
- * which one is actually binding before reasoning from that. At the shipped
33875
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33876
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33877
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33878
- * change that admits fewer frames buys retention WINDOW at constant RAM
33879
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33892
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33893
+ * is what decides how much is held, and the ceiling is the number above which
33894
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
33895
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33896
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33897
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33880
33898
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33881
33899
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33882
33900
  * to replace).
@@ -33902,22 +33920,45 @@ object({
33902
33920
  * there is the signal that some caller names frames outside the inference set
33903
33921
  * and that this must go back to `all`.
33904
33922
  */
33905
- admission: NativeLeaseAdmissionSchema
33923
+ admission: NativeLeaseAdmissionSchema,
33924
+ /**
33925
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
33926
+ * compressed native crops the worker cuts at the moment a frame's detection
33927
+ * result arrives, and keeps long after the frame itself is freed.
33928
+ *
33929
+ * This is the knob that replaced the old retention window, and it buys about
33930
+ * three orders of magnitude more of it: a tile is one subject at native
33931
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
33932
+ * the frame it was cut from. A frame on which nothing was detected costs
33933
+ * nothing at all, which is the real change — the old lease paid per FRAME and
33934
+ * was interrogated per SUBJECT.
33935
+ *
33936
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
33937
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
33938
+ * reproduce that.
33939
+ */
33940
+ tileBudgetMb: number().int().min(0).max(1024)
33906
33941
  });
33907
33942
  /**
33908
- * The values in force when the operator has set nothing — byte-for-byte the
33909
- * constants the decode worker shipped with as env-var defaults, so making these
33910
- * settings changed no behaviour on the day it landed.
33943
+ * The values in force when the operator has set nothing.
33944
+ *
33945
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
33946
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
33947
+ * in the same change that redefines it would make a regression and a retune
33948
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
33949
+ * live traffic.
33911
33950
  */
33912
33951
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33913
- ttlMs: 1200,
33952
+ holdFrames: 8,
33914
33953
  budgetMb: 1024,
33915
33954
  activityMs: 15e3,
33955
+ tileBudgetMb: 64,
33916
33956
  admission: "inferred"
33917
33957
  };
33918
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
33958
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33919
33959
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33920
33960
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33961
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33921
33962
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33922
33963
  //#endregion
33923
33964
  //#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
package/dist/addon.mjs CHANGED
@@ -25236,13 +25236,24 @@ method(object({
25236
25236
  /** Playback-speed multiplier for the render (1 = realtime). */
25237
25237
  var ExportSpeedSchema = number().min(.25).max(32);
25238
25238
  /**
25239
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25239
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25240
25240
  *
25241
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25242
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25243
- * playlist. Handing it absolute epochs would make every call site responsible
25244
- * for the same subtraction, and the one that forgot would emit a filter that
25245
- * selects nothing — silently, as a uniform timelapse.
25241
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25242
+ * derives these bounds from things that happened at a TIME (a track's
25243
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25244
+ * every segment present for the range, with each recording GAP removed. The
25245
+ * two agree only on a window that recorded without one interruption, and only
25246
+ * the render side knows the segments, so the translation lives there
25247
+ * (`export-dense-map.ts`, addon-pipeline).
25248
+ *
25249
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25250
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25251
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25252
+ * the video was a uniform timelapse, and the log line reported the five ranges
25253
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25254
+ *
25255
+ * Relative and not absolute epoch, because an absolute epoch would make every
25256
+ * call site responsible for the same subtraction.
25246
25257
  */
25247
25258
  var ExportDenseRangeSchema = object({
25248
25259
  fromSec: number().nonnegative(),
@@ -33856,25 +33867,32 @@ object({
33856
33867
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33857
33868
  object({
33858
33869
  /**
33859
- * How long a retained native frame is served before it counts as a miss.
33870
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33871
+ * detection result.
33860
33872
  *
33861
- * Must cover the FULL late-crop horizon: detection inference + the
33862
- * cross-process inference-result hop to hub post-analysis + tracking + the
33863
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33864
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33865
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33873
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33874
+ * a time window was never related to the event the pixels were waiting for.
33875
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33876
+ * — at which moment the runner cuts the subject tiles it actually wanted and
33877
+ * releases the frame. The bound exists only so a runner that stops answering
33878
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33879
+ *
33880
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33881
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33882
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33883
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33884
+ * `holdOverflow` on the metrics line is what says you need it.
33866
33885
  */
33867
- ttlMs: number().int().min(250).max(1e4),
33886
+ holdFrames: number().int().min(1).max(64),
33868
33887
  /**
33869
33888
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33870
33889
  *
33871
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33872
- * which one is actually binding before reasoning from that. At the shipped
33873
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33874
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33875
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33876
- * change that admits fewer frames buys retention WINDOW at constant RAM
33877
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33890
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33891
+ * is what decides how much is held, and the ceiling is the number above which
33892
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
33893
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33894
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33895
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33878
33896
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33879
33897
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33880
33898
  * to replace).
@@ -33900,22 +33918,45 @@ object({
33900
33918
  * there is the signal that some caller names frames outside the inference set
33901
33919
  * and that this must go back to `all`.
33902
33920
  */
33903
- admission: NativeLeaseAdmissionSchema
33921
+ admission: NativeLeaseAdmissionSchema,
33922
+ /**
33923
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
33924
+ * compressed native crops the worker cuts at the moment a frame's detection
33925
+ * result arrives, and keeps long after the frame itself is freed.
33926
+ *
33927
+ * This is the knob that replaced the old retention window, and it buys about
33928
+ * three orders of magnitude more of it: a tile is one subject at native
33929
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
33930
+ * the frame it was cut from. A frame on which nothing was detected costs
33931
+ * nothing at all, which is the real change — the old lease paid per FRAME and
33932
+ * was interrogated per SUBJECT.
33933
+ *
33934
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
33935
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
33936
+ * reproduce that.
33937
+ */
33938
+ tileBudgetMb: number().int().min(0).max(1024)
33904
33939
  });
33905
33940
  /**
33906
- * The values in force when the operator has set nothing — byte-for-byte the
33907
- * constants the decode worker shipped with as env-var defaults, so making these
33908
- * settings changed no behaviour on the day it landed.
33941
+ * The values in force when the operator has set nothing.
33942
+ *
33943
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
33944
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
33945
+ * in the same change that redefines it would make a regression and a retune
33946
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
33947
+ * live traffic.
33909
33948
  */
33910
33949
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33911
- ttlMs: 1200,
33950
+ holdFrames: 8,
33912
33951
  budgetMb: 1024,
33913
33952
  activityMs: 15e3,
33953
+ tileBudgetMb: 64,
33914
33954
  admission: "inferred"
33915
33955
  };
33916
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
33956
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33917
33957
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33918
33958
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33959
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33919
33960
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33920
33961
  //#endregion
33921
33962
  //#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",