@camstack/addon-provider-velux 0.2.14 → 0.2.15

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
@@ -25141,13 +25141,24 @@ method(object({
25141
25141
  /** Playback-speed multiplier for the render (1 = realtime). */
25142
25142
  var ExportSpeedSchema = number().min(.25).max(32);
25143
25143
  /**
25144
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25144
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25145
25145
  *
25146
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25147
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25148
- * playlist. Handing it absolute epochs would make every call site responsible
25149
- * for the same subtraction, and the one that forgot would emit a filter that
25150
- * selects nothing — silently, as a uniform timelapse.
25146
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25147
+ * derives these bounds from things that happened at a TIME (a track's
25148
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25149
+ * every segment present for the range, with each recording GAP removed. The
25150
+ * two agree only on a window that recorded without one interruption, and only
25151
+ * the render side knows the segments, so the translation lives there
25152
+ * (`export-dense-map.ts`, addon-pipeline).
25153
+ *
25154
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25155
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25156
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25157
+ * the video was a uniform timelapse, and the log line reported the five ranges
25158
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25159
+ *
25160
+ * Relative and not absolute epoch, because an absolute epoch would make every
25161
+ * call site responsible for the same subtraction.
25151
25162
  */
25152
25163
  var ExportDenseRangeSchema = object({
25153
25164
  fromSec: number().nonnegative(),
@@ -33761,25 +33772,32 @@ object({
33761
33772
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33762
33773
  object({
33763
33774
  /**
33764
- * How long a retained native frame is served before it counts as a miss.
33775
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33776
+ * detection result.
33765
33777
  *
33766
- * Must cover the FULL late-crop horizon: detection inference + the
33767
- * cross-process inference-result hop to hub post-analysis + tracking + the
33768
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33769
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33770
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33778
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33779
+ * a time window was never related to the event the pixels were waiting for.
33780
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33781
+ * — at which moment the runner cuts the subject tiles it actually wanted and
33782
+ * releases the frame. The bound exists only so a runner that stops answering
33783
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33784
+ *
33785
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33786
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33787
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33788
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33789
+ * `holdOverflow` on the metrics line is what says you need it.
33771
33790
  */
33772
- ttlMs: number().int().min(250).max(1e4),
33791
+ holdFrames: number().int().min(1).max(64),
33773
33792
  /**
33774
33793
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33775
33794
  *
33776
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33777
- * which one is actually binding before reasoning from that. At the shipped
33778
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33779
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33780
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33781
- * change that admits fewer frames buys retention WINDOW at constant RAM
33782
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33795
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33796
+ * is what decides how much is held, and the ceiling is the number above which
33797
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
33798
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33799
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33800
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33783
33801
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33784
33802
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33785
33803
  * to replace).
@@ -33805,22 +33823,45 @@ object({
33805
33823
  * there is the signal that some caller names frames outside the inference set
33806
33824
  * and that this must go back to `all`.
33807
33825
  */
33808
- admission: NativeLeaseAdmissionSchema
33826
+ admission: NativeLeaseAdmissionSchema,
33827
+ /**
33828
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
33829
+ * compressed native crops the worker cuts at the moment a frame's detection
33830
+ * result arrives, and keeps long after the frame itself is freed.
33831
+ *
33832
+ * This is the knob that replaced the old retention window, and it buys about
33833
+ * three orders of magnitude more of it: a tile is one subject at native
33834
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
33835
+ * the frame it was cut from. A frame on which nothing was detected costs
33836
+ * nothing at all, which is the real change — the old lease paid per FRAME and
33837
+ * was interrogated per SUBJECT.
33838
+ *
33839
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
33840
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
33841
+ * reproduce that.
33842
+ */
33843
+ tileBudgetMb: number().int().min(0).max(1024)
33809
33844
  });
33810
33845
  /**
33811
- * The values in force when the operator has set nothing — byte-for-byte the
33812
- * constants the decode worker shipped with as env-var defaults, so making these
33813
- * settings changed no behaviour on the day it landed.
33846
+ * The values in force when the operator has set nothing.
33847
+ *
33848
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
33849
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
33850
+ * in the same change that redefines it would make a regression and a retune
33851
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
33852
+ * live traffic.
33814
33853
  */
33815
33854
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33816
- ttlMs: 1200,
33855
+ holdFrames: 8,
33817
33856
  budgetMb: 1024,
33818
33857
  activityMs: 15e3,
33858
+ tileBudgetMb: 64,
33819
33859
  admission: "inferred"
33820
33860
  };
33821
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
33861
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33822
33862
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33823
33863
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33864
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33824
33865
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33825
33866
  //#endregion
33826
33867
  //#region src/config.ts
package/dist/addon.mjs CHANGED
@@ -25140,13 +25140,24 @@ method(object({
25140
25140
  /** Playback-speed multiplier for the render (1 = realtime). */
25141
25141
  var ExportSpeedSchema = number().min(.25).max(32);
25142
25142
  /**
25143
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25143
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25144
25144
  *
25145
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25146
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25147
- * playlist. Handing it absolute epochs would make every call site responsible
25148
- * for the same subtraction, and the one that forgot would emit a filter that
25149
- * selects nothing — silently, as a uniform timelapse.
25145
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25146
+ * derives these bounds from things that happened at a TIME (a track's
25147
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25148
+ * every segment present for the range, with each recording GAP removed. The
25149
+ * two agree only on a window that recorded without one interruption, and only
25150
+ * the render side knows the segments, so the translation lives there
25151
+ * (`export-dense-map.ts`, addon-pipeline).
25152
+ *
25153
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25154
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25155
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25156
+ * the video was a uniform timelapse, and the log line reported the five ranges
25157
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25158
+ *
25159
+ * Relative and not absolute epoch, because an absolute epoch would make every
25160
+ * call site responsible for the same subtraction.
25150
25161
  */
25151
25162
  var ExportDenseRangeSchema = object({
25152
25163
  fromSec: number().nonnegative(),
@@ -33760,25 +33771,32 @@ object({
33760
33771
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33761
33772
  object({
33762
33773
  /**
33763
- * How long a retained native frame is served before it counts as a miss.
33774
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33775
+ * detection result.
33764
33776
  *
33765
- * Must cover the FULL late-crop horizon: detection inference + the
33766
- * cross-process inference-result hop to hub post-analysis + tracking + the
33767
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33768
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33769
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33777
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33778
+ * a time window was never related to the event the pixels were waiting for.
33779
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33780
+ * — at which moment the runner cuts the subject tiles it actually wanted and
33781
+ * releases the frame. The bound exists only so a runner that stops answering
33782
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33783
+ *
33784
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33785
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33786
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33787
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33788
+ * `holdOverflow` on the metrics line is what says you need it.
33770
33789
  */
33771
- ttlMs: number().int().min(250).max(1e4),
33790
+ holdFrames: number().int().min(1).max(64),
33772
33791
  /**
33773
33792
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33774
33793
  *
33775
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33776
- * which one is actually binding before reasoning from that. At the shipped
33777
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33778
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33779
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33780
- * change that admits fewer frames buys retention WINDOW at constant RAM
33781
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33794
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33795
+ * is what decides how much is held, and the ceiling is the number above which
33796
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
33797
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33798
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33799
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33782
33800
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33783
33801
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33784
33802
  * to replace).
@@ -33804,22 +33822,45 @@ object({
33804
33822
  * there is the signal that some caller names frames outside the inference set
33805
33823
  * and that this must go back to `all`.
33806
33824
  */
33807
- admission: NativeLeaseAdmissionSchema
33825
+ admission: NativeLeaseAdmissionSchema,
33826
+ /**
33827
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
33828
+ * compressed native crops the worker cuts at the moment a frame's detection
33829
+ * result arrives, and keeps long after the frame itself is freed.
33830
+ *
33831
+ * This is the knob that replaced the old retention window, and it buys about
33832
+ * three orders of magnitude more of it: a tile is one subject at native
33833
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
33834
+ * the frame it was cut from. A frame on which nothing was detected costs
33835
+ * nothing at all, which is the real change — the old lease paid per FRAME and
33836
+ * was interrogated per SUBJECT.
33837
+ *
33838
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
33839
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
33840
+ * reproduce that.
33841
+ */
33842
+ tileBudgetMb: number().int().min(0).max(1024)
33808
33843
  });
33809
33844
  /**
33810
- * The values in force when the operator has set nothing — byte-for-byte the
33811
- * constants the decode worker shipped with as env-var defaults, so making these
33812
- * settings changed no behaviour on the day it landed.
33845
+ * The values in force when the operator has set nothing.
33846
+ *
33847
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
33848
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
33849
+ * in the same change that redefines it would make a regression and a retune
33850
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
33851
+ * live traffic.
33813
33852
  */
33814
33853
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33815
- ttlMs: 1200,
33854
+ holdFrames: 8,
33816
33855
  budgetMb: 1024,
33817
33856
  activityMs: 15e3,
33857
+ tileBudgetMb: 64,
33818
33858
  admission: "inferred"
33819
33859
  };
33820
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
33860
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33821
33861
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33822
33862
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33863
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33823
33864
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33824
33865
  //#endregion
33825
33866
  //#region src/config.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",