@blockcast/mmt-container 2.2.0-main.5a10b80fd6e3 → 2.2.0-main.5da4e39e7fb8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockcast/mmt-container",
3
- "version": "2.2.0-main.5a10b80fd6e3",
3
+ "version": "2.2.0-main.5da4e39e7fb8",
4
4
  "description": "MMTP/LOC container parsing for MMT over MoQ and SSM",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -169,10 +169,10 @@
169
169
  "test:watch": "vitest"
170
170
  },
171
171
  "dependencies": {
172
- "@blockcast/fec-worker": "2.2.0-main.5a10b80fd6e3",
173
- "@blockcast/mmt-base": "2.2.0-main.5a10b80fd6e3",
174
- "@blockcast/mmt-fec": "2.2.0-main.5a10b80fd6e3",
175
- "@blockcast/mmt-manifest-verify": "2.2.0-main.5a10b80fd6e3",
172
+ "@blockcast/fec-worker": "2.2.0-main.5da4e39e7fb8",
173
+ "@blockcast/mmt-base": "2.2.0-main.5da4e39e7fb8",
174
+ "@blockcast/mmt-fec": "2.2.0-main.5da4e39e7fb8",
175
+ "@blockcast/mmt-manifest-verify": "2.2.0-main.5da4e39e7fb8",
176
176
  "@noble/curves": "^1.9.7",
177
177
  "@noble/hashes": "^1.8.0",
178
178
  "ajv": "^8.17.1",
@@ -346,3 +346,25 @@ export class DatagramLegWatch {
346
346
  this.#options.onVerdict(verdict, silentMs, clock.limit)
347
347
  }
348
348
  }
349
+
350
+ const wholeCount = (value: unknown): number =>
351
+ typeof value === 'number' && Number.isFinite(value) && value >= 0 ? Math.floor(value) : 0
352
+
353
+ /**
354
+ * How long a player stays on the "mfu" sibling before it takes the
355
+ * "mfu-datagram" leg again, after the leg was handed back on a timer:
356
+ * `ceil(joinDarkMs x 2^n x (1 + rand))`. `n` counts the timed hand-backs in a
357
+ * row (0 after the first; the player resets it once a leg held the rendition
358
+ * longer than its last wait). `rand` in [0, 1) comes from the caller, so the
359
+ * function stays pure and its vectors exact.
360
+ *
361
+ * Never throws, and never waits less than `joinDarkMs`: an `n` that is not a
362
+ * finite number >= 0 counts as 0 (a fraction is floored), a `rand` outside
363
+ * [0, 1) counts as 0. A `joinDarkMs` that is not a finite number > 0 has no
364
+ * leg to return to: undefined. A very large `n` yields Infinity, never a wrap.
365
+ */
366
+ export function datagramLegRetryDelayMs(joinDarkMs: number, n: number, rand: number): number | undefined {
367
+ if (!positive(joinDarkMs)) return undefined
368
+ const jitter = typeof rand === 'number' && rand >= 0 && rand < 1 ? rand : 0
369
+ return Math.ceil(joinDarkMs * 2 ** wholeCount(n) * (1 + jitter))
370
+ }
package/src/index.ts CHANGED
@@ -630,6 +630,7 @@ export {
630
630
  export {
631
631
  computeDatagramLegDeadlines,
632
632
  DatagramLegWatch,
633
+ datagramLegRetryDelayMs,
633
634
  type DatagramLegDeadlineInput,
634
635
  type DatagramLegDeadlineReason,
635
636
  type DatagramLegDeadlines,
@@ -29,9 +29,10 @@
29
29
  * below a RAP the receiver already holds complete is not requested at
30
30
  * all (`moot-rap`), and a P0 FETCH still running when such a RAP
31
31
  * arrives is cancelled (`repair-stopped`, `moot`): the receiver resumes
32
- * from that RAP (draft-ramadan-moq-fec §11.4.2). Only a repair that
33
- * could not land by the block's playout deadline (it relies on the
34
- * keyframe budget's extension) is moot: one that can stalls nothing.
32
+ * from that RAP (draft-ramadan-moq-fec-multicast-01 §6.2.1). Only a
33
+ * repair that cannot land by the block's playout deadline (it relies on
34
+ * the keyframe budget's extension, or that deadline has passed) is
35
+ * moot: one that can stalls nothing.
35
36
  * - P1 (audio) dispatches, uncapped, while no P0 is queued or in flight;
36
37
  * P2 (delta) only while no P0/P1 is, earliest absolute fail deadline
37
38
  * first (§11.4.5 item 3).
@@ -445,7 +446,7 @@ export type RepairSkipReason =
445
446
  | 'group-cannot-complete'
446
447
  /**
447
448
  * The keyframe-bearing block lies below a RAP the receiver already holds
448
- * complete, so its repair would be moot (draft-ramadan-moq-fec §11.4.2).
449
+ * complete, so its repair would be moot (draft-ramadan-moq-fec-multicast-01 §6.2.1).
449
450
  */
450
451
  | 'moot-rap'
451
452
 
@@ -659,7 +660,8 @@ interface RepairEntry {
659
660
  deadlineAt: number
660
661
  /**
661
662
  * `deadlineAt` without the keyframe budget's extension: the block's playout
662
- * deadline. A FETCH landing by it costs no stall, so it is never moot.
663
+ * deadline. A FETCH landing by it costs no stall, so it is not moot
664
+ * while this deadline is still ahead.
663
665
  */
664
666
  playoutDeadlineAt: number
665
667
  /** Inputs `deadlineAt` was computed from; they move with it. */
@@ -800,16 +802,20 @@ export function wireRepairFetch(mc: RepairFetchHost, opts: WireRepairFetchOption
800
802
 
801
803
  /**
802
804
  * A keyframe request whose whole block lies below a RAP already held
803
- * complete, and whose repair can only land on the keyframe budget's
804
- * extension. One that lands by the playout deadline stalls nothing, and
805
- * skipping it only throws away the block's frames (BLO-51635).
805
+ * complete, and whose repair cannot land by the block's playout deadline
806
+ * (draft-ramadan-moq-fec-multicast-01 §6.2.1): the deadline has passed,
807
+ * or send time + RTT is not before it, or no RTT is measured. One that
808
+ * lands by the playout deadline stalls nothing, and skipping it only
809
+ * throws away the block's frames (BLO-51635).
806
810
  */
807
811
  const moot = (entry: RepairEntry): boolean => {
808
812
  if (entry.priority !== 0) return false
809
813
  const rttMs = readRtt()
810
- // A running FETCH lands relative to when it was sent, not to now.
811
- const sentAt = entry.running?.sentAt ?? performance.now()
812
- if (rttMs !== null && sentAt + rttMs < entry.playoutDeadlineAt) return false
814
+ const now = performance.now()
815
+ // A running FETCH lands relative to when it was sent, not to now; once
816
+ // the playout deadline has passed it can no longer land by it.
817
+ const sentAt = entry.running?.sentAt ?? now
818
+ if (rttMs !== null && now < entry.playoutDeadlineAt && sentAt + rttMs < entry.playoutDeadlineAt) return false
813
819
  const last = lastSsId(entry)
814
820
  if (last === undefined) return false
815
821
  try {
@@ -5,7 +5,8 @@
5
5
  "keyframeCadence, mediaUnitsPerSecond and groupDuration pin the neutral catalog rules native receiver adapters share (catalogKeyframeCadenceMs, catalogFecMediaUnitsPerSecond, catalogGroupDurationMs). They are NOT what libmmt's own receiver runs today: resolveCatalogTrackFec reads audio rate from sampleRate ?? samplerate (numeric strings admitted) with no endpoint or timescale fallback, so 'audio MP4-shaped timescale' resolves no rate there; computeBlockClassifierGeometry reads only keyframeInterval*. Converging those is a behaviour change, not part of this extraction.",
6
6
  "deliveryWindow and trackFec run against libmmt's production paths (computeFecDeliveryWindowMs, resolveCatalogTrackFec), so an adapter that drops a catalog field (fec.reorderToleranceMs, say) fails here instead of in the field. An iso-ssbg1-v1 span that is 0 or absent keeps in-band geometry but supplies no elapsed-time deadline; local receiver retention remains bounded without inventing a catalog span.",
7
7
  "interleaveDepth: every row names its D basis. 'access-unit' is what libmmt's receiver and the current publisher run today (D = round(span / (1000/framerate)), multicast-manager FecBlockMapper, fec-manager, block-policy); an adapter must match it to agree with them on block geometry. 'group' is draft-ramadan-moq-fec \u00a75.1/\u00a79 (D over the MoQ group duration); it is the target, not live, and moves only together with the producer contract (BLO-35597). Tick-only groupDurationTicks is authoritative for the group duration.",
8
- "datagramLegDeadlines pins computeDatagramLegDeadlines: whether a player takes an \"mfu-datagram\" leg and the limits it runs on (mmt-02 4.3.1). Inputs come from the datagram entry, never from its \"mfu\" sibling. W = largest ceil(span + tolerance) of the decoded instances; take = base span > 0, G > 0, D > 0 and (W <= D or forced); joinDarkMs = ceil(G + W); darkMs = ceil(max(D, W)); noFrameMs = ceil(max(D, G + u + W)); confirmMs = base tolerance if positive, else u. An absent input field is absent, never null. No value is clamped."
8
+ "datagramLegDeadlines pins computeDatagramLegDeadlines: whether a player takes an \"mfu-datagram\" leg and the limits it runs on (mmt-02 4.3.1). Inputs come from the datagram entry, never from its \"mfu\" sibling. W = largest ceil(span + tolerance) of the decoded instances; take = base span > 0, G > 0, D > 0 and (W <= D or forced); joinDarkMs = ceil(G + W); darkMs = ceil(max(D, W)); noFrameMs = ceil(max(D, G + u + W)); confirmMs = base tolerance if positive, else u. An absent input field is absent, never null. No value is clamped.",
9
+ "datagramLegRetryDelay pins datagramLegRetryDelayMs: how long a player stays on the \"mfu\" sibling after a timed hand-back before it takes the \"mfu-datagram\" leg again. delay = ceil(joinDarkMs x 2^n x (1 + rand)); n = timed hand-backs in a row, rand in [0, 1) from the caller. Never below joinDarkMs: n not a finite number >= 0 counts as 0 (a fraction is floored), rand outside [0, 1) counts as 0; joinDarkMs not a finite number > 0 yields undefined (expect null). Non-finite numbers (NaN, Infinity) cannot be written in JSON and are pinned in the unit test."
9
10
  ],
10
11
  "keyframeCadence": [
11
12
  {
@@ -910,5 +911,187 @@
910
911
  "fecWindowMs": 120
911
912
  }
912
913
  }
914
+ ],
915
+ "datagramLegRetryDelay": [
916
+ {
917
+ "name": "first hand-back, no jitter: joinDarkMs (plan (b))",
918
+ "input": {
919
+ "joinDarkMs": 1120,
920
+ "n": 0,
921
+ "rand": 0
922
+ },
923
+ "expect": 1120
924
+ },
925
+ {
926
+ "name": "first hand-back, jitter near 1: just under 2 x joinDarkMs",
927
+ "input": {
928
+ "joinDarkMs": 1120,
929
+ "n": 0,
930
+ "rand": 0.999
931
+ },
932
+ "expect": 2239
933
+ },
934
+ {
935
+ "name": "first hand-back, half jitter",
936
+ "input": {
937
+ "joinDarkMs": 1120,
938
+ "n": 0,
939
+ "rand": 0.5
940
+ },
941
+ "expect": 1680
942
+ },
943
+ {
944
+ "name": "second hand-back in a row: 2.24 s",
945
+ "input": {
946
+ "joinDarkMs": 1120,
947
+ "n": 1,
948
+ "rand": 0
949
+ },
950
+ "expect": 2240
951
+ },
952
+ {
953
+ "name": "second hand-back, half jitter",
954
+ "input": {
955
+ "joinDarkMs": 1120,
956
+ "n": 1,
957
+ "rand": 0.5
958
+ },
959
+ "expect": 3360
960
+ },
961
+ {
962
+ "name": "third hand-back in a row: 4.48 s",
963
+ "input": {
964
+ "joinDarkMs": 1120,
965
+ "n": 2,
966
+ "rand": 0
967
+ },
968
+ "expect": 4480
969
+ },
970
+ {
971
+ "name": "third hand-back, jitter near 1: just under 8.96 s",
972
+ "input": {
973
+ "joinDarkMs": 1120,
974
+ "n": 2,
975
+ "rand": 0.999
976
+ },
977
+ "expect": 8956
978
+ },
979
+ {
980
+ "name": "a fractional product rounds up to a whole ms",
981
+ "input": {
982
+ "joinDarkMs": 1120,
983
+ "n": 0,
984
+ "rand": 0.0001
985
+ },
986
+ "expect": 1121
987
+ },
988
+ {
989
+ "name": "negative n counts as 0",
990
+ "input": {
991
+ "joinDarkMs": 1120,
992
+ "n": -1,
993
+ "rand": 0
994
+ },
995
+ "expect": 1120
996
+ },
997
+ {
998
+ "name": "fractional n is floored",
999
+ "input": {
1000
+ "joinDarkMs": 1120,
1001
+ "n": 1.9,
1002
+ "rand": 0
1003
+ },
1004
+ "expect": 2240
1005
+ },
1006
+ {
1007
+ "name": "n not a number counts as 0",
1008
+ "input": {
1009
+ "joinDarkMs": 1120,
1010
+ "n": "2",
1011
+ "rand": 0.5
1012
+ },
1013
+ "expect": 1680
1014
+ },
1015
+ {
1016
+ "name": "n null counts as 0",
1017
+ "input": {
1018
+ "joinDarkMs": 1120,
1019
+ "n": null,
1020
+ "rand": 0
1021
+ },
1022
+ "expect": 1120
1023
+ },
1024
+ {
1025
+ "name": "rand 1 is outside [0, 1): counts as 0",
1026
+ "input": {
1027
+ "joinDarkMs": 1120,
1028
+ "n": 1,
1029
+ "rand": 1
1030
+ },
1031
+ "expect": 2240
1032
+ },
1033
+ {
1034
+ "name": "negative rand counts as 0",
1035
+ "input": {
1036
+ "joinDarkMs": 1120,
1037
+ "n": 0,
1038
+ "rand": -0.5
1039
+ },
1040
+ "expect": 1120
1041
+ },
1042
+ {
1043
+ "name": "rand above 1 counts as 0",
1044
+ "input": {
1045
+ "joinDarkMs": 1120,
1046
+ "n": 0,
1047
+ "rand": 3
1048
+ },
1049
+ "expect": 1120
1050
+ },
1051
+ {
1052
+ "name": "rand not a number counts as 0",
1053
+ "input": {
1054
+ "joinDarkMs": 1120,
1055
+ "n": 0,
1056
+ "rand": "0.5"
1057
+ },
1058
+ "expect": 1120
1059
+ },
1060
+ {
1061
+ "name": "joinDarkMs 0: no leg, undefined",
1062
+ "input": {
1063
+ "joinDarkMs": 0,
1064
+ "n": 0,
1065
+ "rand": 0
1066
+ },
1067
+ "expect": null
1068
+ },
1069
+ {
1070
+ "name": "negative joinDarkMs: undefined",
1071
+ "input": {
1072
+ "joinDarkMs": -1120,
1073
+ "n": 0,
1074
+ "rand": 0
1075
+ },
1076
+ "expect": null
1077
+ },
1078
+ {
1079
+ "name": "joinDarkMs not a number: undefined",
1080
+ "input": {
1081
+ "joinDarkMs": "1120",
1082
+ "n": 0,
1083
+ "rand": 0
1084
+ },
1085
+ "expect": null
1086
+ },
1087
+ {
1088
+ "name": "joinDarkMs null: undefined",
1089
+ "input": {
1090
+ "joinDarkMs": null,
1091
+ "n": 0,
1092
+ "rand": 0
1093
+ },
1094
+ "expect": null
1095
+ }
913
1096
  ]
914
1097
  }
@@ -1,45 +1,44 @@
1
1
  {
2
- "version": 1,
3
- "description": "Receiver repair policy (draft-ramadan-moq-fec-01 Section 11.4.2 and Section 11.4.5 item 3, Blockcast/moqcast-draft PR #2 @ 3162ef93). Which repair FETCHes a receiver sends, which it cancels, and which it never sends. Hand-authored from the specification, NOT generated by any implementation (BLO-49776).",
2
+ "version": 2,
3
+ "description": "Receiver repair policy (draft-ramadan-moq-fec-multicast-01 Section 6.2.1 at Blockcast/moqcast-draft main 6293fff (PR #29), which narrows fec-01 Section 11.4.2, and fec-01 Section 11.4.5 item 3, Blockcast/moqcast-draft PR #2 @ 3162ef93). Which repair FETCHes a receiver sends, which it cancels, and which it never sends. Hand-authored from the specification, NOT generated by any implementation (BLO-49776; version 2: BLO-51662).",
4
4
  "scope": [
5
5
  "Section 11.4 applies only to a multicast or AMT leg with a MoQ session (fec-01 11.4). These cases describe that leg; a receiver with no repair FETCH path records ABSENT, not a pass.",
6
6
  "schedulerCases drive a repair scheduler. Every block spans K' = 4 SS_IDs, so block B covers SS_IDs B..B+3. Track video is a source track (packetId 1, keyframe or delta blocks); track audio is packetId 2 (audio blocks). A block is named track/SS_Start.",
7
7
  "Best-effort (delta and audio) requests in schedulerCases are presumed covered by unexpired credit under fec-01 11.4.5 item 2; that credit is a precondition of each case, not something the case exercises.",
8
- "A RAP 'held complete at ssId' is a keyframe access unit at SS_ID ssId that the receiver holds complete: admitted complete under the multicast-01 7.2.7 profile, received or recovered complete outside it. A block lies below it when the block's last SS_ID is less than ssId; a RAP at or inside the block does not make the block moot.",
8
+ "A RAP 'held complete at ssId' is a keyframe access unit at SS_ID ssId that the receiver has admitted complete (fec-multicast-01 6.2.1 condition 1). A block lies below it when the block's last SS_ID is less than ssId; a RAP at or inside the block does not make the block moot.",
9
+ "fec-multicast-01 6.2.1 condition 2: a keyframe repair is moot only when it also cannot arrive by the block's playout deadline, which is the later of the block's FEC deadline and the presentation time of the earliest media the block would repair, and excludes the keyframe-budget hold (the time a receiver holds video presentation for the repair). It cannot arrive when the current time is not earlier than that deadline, or T + RTT is not earlier than it (T: the FETCH's send time, or now for a repair not yet requested; RTT: the receiver's current round-trip estimate for the repair connection), or the receiver has no RTT estimate.",
10
+ "Every schedulerCase names its regime, which fixes RTT and deadlines; the clock starts at 0 when the case starts and every block's media is anchored at the time its request is made. 'playout': RTT 1 ms, playout deadline 1 s after the request, keyframe-budget hold to 5 s, so every repair lands by playout. 'budget': RTT 2 s and the same 1 s playout deadline and 5 s hold for blocks below SS_ID 16, so a repair of such a block can only land within the hold; blocks from SS_ID 16 up are anchored 2 s later and land by playout. 'rtt-unmeasured': the 'playout' regime with no RTT estimate. Op 'clock' moves the clock: at 'arrival-cutoff' (999.5 ms) a repair sent at 0 still lands by its playout deadline but one requested now would not; at 'playout-deadline' (1 s) the playout deadline of a block requested at 0 has passed.",
9
11
  "fetched lists every FETCH the receiver sends, in order. cancelled lists every sent FETCH it then cancels (FETCH_CANCEL on the wire). skipped names requests made but not sent, with the receiver's reason; stopped names sent FETCHes stopped, with the stop reason. A list not given is expected empty.",
10
12
  "assistedCases drive one block of a protected flow (multicast-01 7.2.7) that is one symbol short of SSB_length, with unlisted repair symbols pooled for it. Each unlisted symbol triggers one unlisted-assisted decode in a scratch decoder; outcome 'fail' is a failed decode, 'recover' a decode whose recovered data unit admission accepts, 'recover-unadmitted' a decode whose recovered data unit admission refuses.",
11
- "status names where a case's rule comes from: 'fec-01' is a -01 requirement; 'libmmt interpretation' is our reading where -01 is silent; 'regression' rows were already required at moqcast-draft main 615a9a8 and are kept to pin standing behaviour.",
13
+ "status names where a case's rule comes from: 'fec-01' is a -01 requirement; 'fec-multicast-01' is the 6.2.1 narrowing (moqcast-draft main 6293fff); 'libmmt interpretation' is our reading where the draft is silent; 'regression' rows were already required at moqcast-draft main 615a9a8 and are kept to pin standing behaviour.",
12
14
  "A keyframe request refused before its FETCH is sent (libmmt's reliable-path RTT check) is libmmt-local and deviates from the fec-01 11.4.2 MUST, so it is pinned in libmmt's own suite (repair-fetch-keyframe-budget.test.ts), not here. The 11.4.5 item 3 rule that a block 11.4.2 does not request cancels nothing is exercised by keyframe-below-complete-rap-not-requested."
13
15
  ],
14
16
  "schedulerCases": [
15
17
  {
16
18
  "name": "keyframe-below-complete-rap-not-requested",
17
19
  "status": "fec-01",
18
- "rule": "fec-01 11.4.2: a keyframe-bearing block at its FEC deadline is requested unless it lies below a RAP already held complete; 11.4.5 item 3: a block whose repair 11.4.2 does not request cancels nothing (case a).",
20
+ "regime": "budget",
21
+ "rule": "fec-01 11.4.2: a keyframe-bearing block at its FEC deadline is requested unless it lies below a RAP already held complete; 11.4.5 item 3: a block whose repair 11.4.2 does not request cancels nothing (case a). Under fec-multicast-01 6.2.1 that holds only for a repair that cannot arrive by playout, hence the budget regime.",
19
22
  "ops": [
20
23
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
21
24
  { "op": "rapHeld", "ssId": 4 },
22
25
  { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }
23
26
  ],
24
- "expect": {
25
- "fetched": ["video/20"],
26
- "skipped": [{ "block": "video/0", "reason": "moot-rap" }]
27
- }
27
+ "expect": { "fetched": ["video/20"], "skipped": [{ "block": "video/0", "reason": "moot-rap" }] }
28
28
  },
29
29
  {
30
30
  "name": "control-rap-inside-block-is-requested",
31
31
  "status": "libmmt interpretation",
32
+ "regime": "playout",
32
33
  "rule": "Control for the case above. fec-01 does not define 'lies below'; libmmt reads it so that a RAP at the block's own last SS_ID is part of the block, so the block is not below it and is requested.",
33
- "ops": [
34
- { "op": "rapHeld", "ssId": 3 },
35
- { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }
36
- ],
34
+ "ops": [{ "op": "rapHeld", "ssId": 3 }, { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }],
37
35
  "expect": { "fetched": ["video/0"] }
38
36
  },
39
37
  {
40
38
  "name": "rap-completes-mid-fetch-cancels",
41
39
  "status": "regression",
42
- "rule": "fec-01 11.4.2 (already a SHOULD at main 615a9a8): a RAP completing while a keyframe repair is outstanding makes that repair moot and the receiver cancels it; a block above the RAP keeps its FETCH (case b).",
40
+ "regime": "budget",
41
+ "rule": "fec-01 11.4.2 (already a SHOULD at main 615a9a8): a RAP completing while a keyframe repair is outstanding makes that repair moot and the receiver cancels it; a block above the RAP keeps its FETCH (case b). Under fec-multicast-01 6.2.1 that holds only for a repair that cannot arrive by playout, hence the budget regime.",
43
42
  "ops": [
44
43
  { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
45
44
  { "op": "fire", "track": "video", "block": 8, "class": "keyframe" },
@@ -54,6 +53,7 @@
54
53
  {
55
54
  "name": "audio-request-preempts-nothing",
56
55
  "status": "fec-01",
56
+ "regime": "playout",
57
57
  "rule": "fec-01 11.4.5 item 3: only the keyframe repair 11.4.2 requests cancels best-effort FETCHes; an audio request cancels nothing.",
58
58
  "ops": [
59
59
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
@@ -64,6 +64,7 @@
64
64
  {
65
65
  "name": "sent-keyframe-repair-cancels-delta-and-audio",
66
66
  "status": "regression",
67
+ "regime": "playout",
67
68
  "rule": "fec-01 11.4.5 item 3 (standing at main 615a9a8): a keyframe repair FETCH that is sent cancels the outstanding delta and audio FETCHes (case c-pos).",
68
69
  "ops": [
69
70
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
@@ -73,11 +74,57 @@
73
74
  "expect": {
74
75
  "fetched": ["video/20", "audio/0", "video/40"],
75
76
  "cancelled": ["video/20", "audio/0"],
76
- "stopped": [
77
- { "block": "video/20", "reason": "preempted" },
78
- { "block": "audio/0", "reason": "preempted" }
79
- ]
77
+ "stopped": [{ "block": "video/20", "reason": "preempted" }, { "block": "audio/0", "reason": "preempted" }]
80
78
  }
79
+ },
80
+ {
81
+ "name": "keyframe-repair-landing-by-playout-kept",
82
+ "status": "fec-multicast-01",
83
+ "regime": "playout",
84
+ "rule": "fec-multicast-01 6.2.1: a keyframe repair that can arrive by its playout deadline is not moot, so it is requested below a RAP held complete and kept when a newer RAP completes.",
85
+ "ops": [
86
+ { "op": "rapHeld", "ssId": 4 },
87
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
88
+ { "op": "fire", "track": "video", "block": 8, "class": "keyframe" },
89
+ { "op": "rapComplete", "ssId": 9 }
90
+ ],
91
+ "expect": { "fetched": ["video/0", "video/8"] }
92
+ },
93
+ {
94
+ "name": "sent-fetch-judged-at-send-time",
95
+ "status": "fec-multicast-01",
96
+ "regime": "playout",
97
+ "rule": "fec-multicast-01 6.2.1: a FETCH already sent is judged by the time it was sent; sent at 0 with a 1 ms RTT it lands by the 1 s playout deadline, so a RAP completing at 999.5 ms does not cancel it.",
98
+ "ops": [
99
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
100
+ { "op": "clock", "at": "arrival-cutoff" },
101
+ { "op": "rapComplete", "ssId": 5 }
102
+ ],
103
+ "expect": { "fetched": ["video/0"] }
104
+ },
105
+ {
106
+ "name": "outstanding-repair-past-playout-deadline-cancels",
107
+ "status": "fec-multicast-01",
108
+ "regime": "playout",
109
+ "rule": "fec-multicast-01 6.2.1: once the playout deadline has passed, a newer RAP the receiver has admitted complete makes an outstanding repair moot and the receiver cancels it, however early it was sent.",
110
+ "ops": [
111
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
112
+ { "op": "clock", "at": "playout-deadline" },
113
+ { "op": "rapComplete", "ssId": 5 }
114
+ ],
115
+ "expect": {
116
+ "fetched": ["video/0"],
117
+ "cancelled": ["video/0"],
118
+ "stopped": [{ "block": "video/0", "reason": "moot" }]
119
+ }
120
+ },
121
+ {
122
+ "name": "rtt-unmeasured-keyframe-below-complete-rap-is-moot",
123
+ "status": "fec-multicast-01",
124
+ "regime": "rtt-unmeasured",
125
+ "rule": "fec-multicast-01 6.2.1: a receiver with no RTT estimate treats the repair as unable to arrive by the playout deadline, so a keyframe block below a RAP held complete is moot.",
126
+ "ops": [{ "op": "rapHeld", "ssId": 4 }, { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }],
127
+ "expect": { "skipped": [{ "block": "video/0", "reason": "moot-rap" }] }
81
128
  }
82
129
  ],
83
130
  "assistedCases": [