Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions quest/m0/3326-moq-audio-forward-gap-stamps-resampled-output.md

This file was deleted.

53 changes: 33 additions & 20 deletions quest/m0/3360-js-watch-broadcast-is-undefined-at-initialization.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
# [S] js/watch: MoqWatch.broadcast exists from construction
# [S] js/watch: MoqWatch.broadcast is undefined when a framework binds the element

## Goal

`moqWatch.broadcast` is usable the moment the element exists, as its
declared type `broadcast: Broadcast` promises. On 0.5.2 a framework effect
that reads `moqWatch.broadcast.catalog` right after binding the element hits
`broadcast is undefined`; it worked on 0.3.2.
A framework that binds `<moq-watch>` and reads `moqWatch.broadcast` in its
first effect gets the `Broadcast` the type promises, or a documented reason
it cannot yet. On 0.5.2 the read returns `undefined`; it worked on 0.3.2.

## Plan

Either the field is created in the constructor, so it is never undefined,
or the type stops lying. Prefer the first: `connection` and `backend` are
constructed eagerly, and a `Broadcast` whose inputs are signals can exist
before any URL is set, so make `broadcast` the same. If some part of it
genuinely cannot exist before `connectedCallback`, split that part out and
keep the field itself eager.

The issue's side question is a real gap too: `catalog` is a getter, not a
signal, and `observedAttributes` carries `catalog-format` but not `catalog`,
so a framework cannot react to catalog changes. Expose the catalog as a
`Getter` on the element and document in `doc/lib/js` how to read a custom
catalog section from it.

Regression: construct the element, read `broadcast.catalog` before connecting
it, and subscribe to the catalog signal across a catalog update.
The obvious fix is already the implementation: `js/watch/src/element.ts`
constructs `this.broadcast = new Broadcast({..})` synchronously in the
constructor, so the field is never undefined on an upgraded element. What the
report shows is therefore a read before upgrade: Svelte's `bind:this` hands
the framework the raw `HTMLElement` as soon as it is in the DOM, and the
constructor only runs once `customElements.define` has registered the tag. If
the definition lands after the framework's first effect (a module-order
difference between 0.3.2 and 0.5.2 would explain the regression), every field
the class sets is absent until the upgrade.

- Reproduce with the issue's Svelte page and confirm the timing by logging
`customElements.whenDefined("moq-watch")` against the effect.
- Fix whichever side owns it: if the entrypoint defers registration, register
synchronously on import as 0.3.2 did; if the framework simply reads early,
document `await customElements.whenDefined("moq-watch")` in `doc/lib/js`
and make the element's own `connectedCallback` tolerate late upgrade.
- Regression on the ordering itself, not on the upgrade: the browser
upgrades an existing node when the definition is registered, so a test
that waits on `whenDefined` before reading passes either way. Assert
instead that importing the entrypoint has defined `moq-watch` before the
import resolves (`customElements.get("moq-watch")` is set synchronously
after `import "@moq/watch/element"`), so a framework that mounts after the
import can never observe a pre-upgrade node.

The issue's side question, reacting to catalog changes from a framework,
needs no new API: `broadcast.out.catalog` is already a read-only `Getter`,
which `demo/web` reacts to with `effect.get(watch.broadcast.out.catalog)`.
Document that in `doc/lib/js` as part of this quest, with a custom section
read through it.

## Closes

Expand Down
3 changes: 1 addition & 2 deletions quest/m0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ regression test per Root Cause First.

- [#2405](/quest/m0/2405-js-net-connect-logs-on-every-connection-at-the-wrong.md) - js/net: connect logs print the JWT in the relay URL
- [#3361](/quest/m0/3361-js-watch-fails-on-firefox-esr.md) - js/watch: `<moq-watch>` throws from an effect on Firefox ESR, a regression since 0.3.2
- [#3360](/quest/m0/3360-js-watch-broadcast-is-undefined-at-initialization.md) - js/watch: `MoqWatch.broadcast` is undefined at construction although its type says otherwise
- [#3360](/quest/m0/3360-js-watch-broadcast-is-undefined-at-initialization.md) - js/watch: a framework binding the element reads `broadcast` before the custom element is upgraded
- [#3363](/quest/m0/3363-js-watch-audio-only-stream-does-not-resume.md) - js/watch: an audio-only stream resumes only the first time the publisher unmutes
- [#3359](/quest/m0/3359-moq-net-subscribe-error-sends-hardcoded-404.md) - moq-net: SUBSCRIBE_ERROR sends a literal 404 instead of the draft's registered code
- [Adapter namespace map](/quest/m0/rs-adapter-namespace-map.md) - moq-net: a duplicate PUBLISH_NAMESPACE on draft-14/15 strands the first request, and the map never shrinks
- [#3080](/quest/m0/3080-fix-watch-audio-ring-truncate-can-race-the-worklet-reader.md) - watch: an audio ring truncate can race the worklet reader for one quantum
- [#3326](/quest/m0/3326-moq-audio-forward-gap-stamps-resampled-output.md) - moq-audio: a forward timestamp gap stamps resampled output almost a second late
- [#3291](/quest/m0/3291-moq-net-zero-budget-shedding-drops-discontinuity-markers.md) - moq-net (dev): zero-budget shedding drops the empty group that marks a codec reset
- [#2833](/quest/m0/2833-moq-export-ts-a-rewound-timeline-stalls-the-si-table.md) - moq export ts: a rewound timeline stalls SI tables, PCR, and pacing until the media clock catches up
- [#2799](/quest/m0/2799-moq-video-capture-negotiates-twice-so-a-window-resize.md) - moq-transcode: the ladder follows a source resolution change instead of keeping the one it started with
Expand Down
11 changes: 7 additions & 4 deletions quest/m2/3247-moq-audio-cpal-allocates-on-the-audio-thread.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ a dropout, exactly when playback is already degraded.
allocation-free (atomics and `Thread::unpark`). What remains is upstream and
the hand-off:

- Raise it with cpal: allocation-free error emission on the RT paths (a
`&'static str` message, or deferring the `format!` to a non-RT thread),
which is where the dominant allocation lives. Carry the upstream PR as
part of this quest and pin the release that includes it.
- The dominant allocation is upstream; the
[cpal release](/quest/m2/cpal-release.md) gate quest carries that proposal
and the pin bump, and this quest waits on it.
- Pre-check in `moq-audio` what can be checked before `stream.play()`, so
fewer errors are raised from the render path at all.
- Document the residual constraint beside the driver: the callback owns the
Expand All @@ -29,6 +28,10 @@ Test: an allocation-counting harness around the error callback, the same
shape the capture-callback quest used, proving no allocation or free after
construction on the paths this repo controls.

## Required

- [cpal release](/quest/m2/cpal-release.md) - the upstream fix has to ship before the audio thread can be allocation-free

## Closes

- [#3247](https://github.com/moq-dev/moq/issues/3247) - close this issue when the quest finishes
1 change: 1 addition & 0 deletions quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ can act on. Each still carries its own plan and regression test.
- [Cluster flags](/quest/m2/cluster-flags.md) - a discovery mechanism carries its own prerequisites, so an incomplete cluster config cannot be expressed
- [Plan: revalidation updates](/quest/m2/plan-revalidation-updates.md) - settle which fields an auth re-check may update on a live session and which force a reconnect
- [#3137](/quest/m2/3137-moqsrc-bound-the-pending-rendition-subscriptions-a.md) - moqsrc: bound the pending rendition subscriptions a catalog can open
- [cpal release](/quest/m2/cpal-release.md) - a cpal release that emits errors from its real-time paths without allocating
- [#3247](/quest/m2/3247-moq-audio-cpal-allocates-on-the-audio-thread.md) - moq-audio: cpal allocates and frees on the audio thread when it reports a stream error
- [#3115](/quest/m2/3115-moqsink-the-publication-has-no-generation-so-a-flush.md) - moqsink: a flushing restart after EOS opens a new publication generation
- [#709](/quest/m2/709-automatic-letsencrypt-support.md) - the relay provisions and renews its own ACME certificate over HTTP-01, persisted on disk
Expand Down
23 changes: 23 additions & 0 deletions quest/m2/cpal-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# [XS] cpal release with allocation-free error emission

## Goal

A published cpal release emits stream errors from its real-time paths without
allocating, so `moq-audio` can pin it and stop paying an allocator call on
the audio thread when a device fails.

## Plan

Propose the change upstream: a `&'static str` message on the RT emission
paths, or deferring the `format!` in `From<coreaudio::Error>` (and the other
hosts' equivalents) to a non-RT thread. Record the maintainers' answer here.
When a release carries it, remove the bullet below, bump the pin, and
complete this quest; that unblocks the dependent one.

## Required

- A cpal release that emits errors from its real-time paths without allocating

## Related

- [#3247](/quest/m2/3247-moq-audio-cpal-allocates-on-the-audio-thread.md) - the moq-audio work that waits on this release
Loading