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
16 changes: 12 additions & 4 deletions docs/media-showcase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ The recording label sits with the source caption below the player. It does
not cover the picture or Safari’s native fullscreen control when controls
appear.

The player pins RelaySwarm source `45616b8141987f88e6054e2fdfbeae34710e714b`
([source change](https://github.com/forgesworn/relayswarm/commit/45616b8141987f88e6054e2fdfbeae34710e714b)).
The player pins RelaySwarm source `25354e3cb843b606fc51cdb47a548e9d90d0d091`
([source change](https://github.com/forgesworn/relayswarm/commit/25354e3cb843b606fc51cdb47a548e9d90d0d091)).
It retains the successful peer receipt's stats when hls.js disposes of the
losing HTTP loader, covered by ten regressions using the actual hls.js 1.7.3
loaders. It also retains a fully verified contiguous future prefix before considering
its existing fourth startup slot, including after the held first fragment’s
interval falls behind the room target. The original first response remains
unchanged; releasing it still requires fresh verified coverage of the current
target and measured recovery headroom. Startup remains
bounded to four objects within the existing 24 MiB reservation; steady
target and measured recovery headroom. The full-recording startup explicitly
reserves a 32 MiB encoded reservoir including that original response, within
the existing shared 64 MiB held budget. Its pinned original plus three future
fragments can exceed 24 MiB; the conservative catalogue maximum is
30,602,204 bytes. Future bytes alone remain capped at 24 MiB. This is not total
browser memory. Startup stays bounded to four objects; steady
warm-ahead keeps its three-object limit. Startup now has twelve seconds from
the original first-fragment load entry, clipped to a shorter parent load
deadline; ordinary speculative requests keep their eight-second expiry.
Expand All @@ -36,6 +40,10 @@ playlist revisions. Startup now accepts that difference within a bounded machine
tolerance, capped at one nanosecond, instead of falsely cancelling a matching context; sequence,
continuity, level, key, size and duration checks remain authoritative. This
correction does not establish stall-free or sustained 4K playback.
Once the current target reaches two verified future fragments, their next
contiguous successor keeps its fourth-slot admission instead of being skipped
by the previous fragment's service-time lead. Recovery and deadline checks
still govern release; this fixes selection rather than proving field playback.
When an owned whole-source response finishes and its key is already known,
eligible retained bytes are announced with HAVE before its FETCH claim is
withdrawn, including synchronous hls.js disposal. Unknown keys do not delay
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-media-peer-demo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { tmpdir } from 'node:os';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';

const SOURCE = '45616b8141987f88e6054e2fdfbeae34710e714b';
const SOURCE = '25354e3cb843b606fc51cdb47a548e9d90d0d091';
const sha = bytes => createHash('sha256').update(bytes).digest('hex');
const root = fileURLToPath(new URL('../', import.meta.url));

Expand Down
2 changes: 1 addition & 1 deletion site/live-media.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@
</main>
<!-- SHOWCASE_END -->
<footer class="site-footer"><div class="page-wrap"><div class="footer-inner"><a class="brand" href="/">Forge<span>Sworn</span></a><div class="footer-links"><a href="https://github.com/forgesworn">GitHub</a><a href="/live-media-benchmarks.html">Measured results</a><a href="https://github.com/sponsors/TheCryptoDonkey">Support the work ↗</a></div></div><p class="footer-note">Open-source media software, yours to run. The supplied mix is licensed for this demonstration; its media rights are separate from the MIT code. <a href="/media/dejavu-preview/NOTICE.txt">Media permission</a> · <a href="/llms.txt">For developers and LLMs</a></p></div></footer>
<script type="module" src="/media-lab.mjs?v=20261027-position-roundoff"></script>
<script type="module" src="/media-lab.mjs?v=20261027-startup-bytes"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion site/llms.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/media-lab.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@
</main>
<!-- SHOWCASE_END -->
<footer class="site-footer"><div class="page-wrap"><div class="footer-inner"><a class="brand" href="/">Forge<span>Sworn</span></a><div class="footer-links"><a href="https://github.com/forgesworn">GitHub</a><a href="/live-media-benchmarks.html">Measured results</a><a href="https://github.com/sponsors/TheCryptoDonkey">Support the work ↗</a></div></div><p class="footer-note">Open-source media software, yours to run. The supplied mix is licensed for this demonstration; its media rights are separate from the MIT code. <a href="/media/dejavu-preview/NOTICE.txt">Media permission</a> · <a href="/llms.txt">For developers and LLMs</a></p></div></footer>
<script type="module" src="/media-lab.mjs?v=20261027-position-roundoff"></script>
<script type="module" src="/media-lab.mjs?v=20261027-startup-bytes"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions site/media-lab.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ async function initialise() {
publicRoom?.stop(); publicRoom = null;
const pending = (async () => {
const [{ createListenerSession }, { PUBLIC_SWARM_SOURCE_SHA256, PUBLIC_SWARM_RELAYS }] = await Promise.all([
import('./media-listener-session.mjs?v=20261027-position-roundoff'), import('./media-public-swarm.mjs?v=20261027-position-roundoff'),
import('./media-listener-session.mjs?v=20261027-startup-bytes'), import('./media-public-swarm.mjs?v=20261027-startup-bytes'),
]);
if (request !== publicRoomRequest || pageAbort.signal.aborted) return null;
const clock = createListenerSession({ room: `forgesworn-dejavu-listening-v${quality === 'full' ? 2 : 1}-${quality}`, source: PUBLIC_SWARM_SOURCE_SHA256,
Expand Down Expand Up @@ -1522,7 +1522,7 @@ async function initialise() {
if (player) {
let peer, setupEpoch;
try {
const { createPublicSwarm, prepareRecordedSource, createRecordedLive } = await import('./media-public-swarm.mjs?v=20261027-position-roundoff');
const { createPublicSwarm, prepareRecordedSource, createRecordedLive } = await import('./media-public-swarm.mjs?v=20261027-startup-bytes');
if (!owns() || s.hls !== player) return;
// These two exports share the exact helper module/recording brand.
// A cold first room prepares locally before publishing its clock.
Expand Down
2 changes: 1 addition & 1 deletion site/media-listener-session.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Signed, short-lived observations of a shared listening clock. This is an
// experimental public addressable event (NIP-01), not NIP-78 private app storage.
// Relay partitions and dishonest clients prevent an authoritative audience count.
import { finalizeEvent, generateSecretKey, verifyEvent } from './vendor/media-peer-demo.js?v=20261027-position-roundoff';
import { finalizeEvent, generateSecretKey, verifyEvent } from './vendor/media-peer-demo.js?v=20261027-startup-bytes';

export const LISTENER_SESSION_KIND = 30378;
export const LISTENER_TELEMETRY_KIND = 20378;
Expand Down
5 changes: 3 additions & 2 deletions site/media-public-swarm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// A receiver's ephemeral key wraps that digest for the existing live-commitment
// verifier; this is local attestation, not a live broadcaster signing service.
import { createHlsSwarm, commitmentContent, commitmentPieceSize, segmentMediaContext, KIND_SEGMENT_COMMITMENT, finalizeEvent,
generateSecretKey, relayswarmBuild } from './vendor/media-peer-demo.js?v=20261027-position-roundoff';
generateSecretKey, relayswarmBuild } from './vendor/media-peer-demo.js?v=20261027-startup-bytes';
import { observeOriginLoader } from './media-transfer-stats.mjs?v=20261027-visual-provenance';
import { createPublicTurnCredentials } from './media-turn-credentials.mjs?v=20261025-prepared-room';
import { parseRecordedManifest, createRecordedLive } from './media-recorded-live.mjs?v=20261025-prepared-room';
Expand Down Expand Up @@ -479,9 +479,10 @@ export function createPublicSwarm({ Hls, hls, video, playlistUrl, quality, signa
swarm = createSwarm({ mode: 'peer-first', swarmId: plan.swarmId, relays: [...PUBLIC_SWARM_RELAYS],
streamEvent, getCommitment, serve: true, serveOnCellular: false,
coreWasm: new URL('./vendor/relayswarm-core.wasm?v=20261026-prepared-adoption', import.meta.url), multiHolder: true,
transferWorkerUrl: new URL('./vendor/relayswarm-transfer-worker.js?v=20261027-position-roundoff', import.meta.url),
transferWorkerUrl: new URL('./vendor/relayswarm-transfer-worker.js?v=20261027-startup-bytes', import.meta.url),
zeroBudgetPeerRace: true, lateHaveRace: true, sustainablePeerWait: true,
warmAhead: false,
startupBufferMaxBytes: (needsStartupBuffer ? 32 : 24) * 1024 * 1024,
startupBufferTarget: needsStartupBuffer ? () => {
if (!enabled || stopped || ownGeneration !== generation) return null;
try {
Expand Down
2 changes: 1 addition & 1 deletion site/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,6 @@ <h2 class="reveal">Pick a block and start</h2>
});
});
</script>
<script type="module" src="/media-lab.mjs?v=20261027-position-roundoff"></script>
<script type="module" src="/media-lab.mjs?v=20261027-startup-bytes"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion site/vendor/media-peer-demo.NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RelaySwarm 0.4.4
https://github.com/forgesworn/relayswarm/tree/45616b8141987f88e6054e2fdfbeae34710e714b
https://github.com/forgesworn/relayswarm/tree/25354e3cb843b606fc51cdb47a548e9d90d0d091

MIT License

Expand Down
10 changes: 5 additions & 5 deletions site/vendor/media-peer-demo.build.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"schema": 1,
"project": "https://github.com/forgesworn/relayswarm",
"sourceCommit": "45616b8141987f88e6054e2fdfbeae34710e714b",
"sourceCommit": "25354e3cb843b606fc51cdb47a548e9d90d0d091",
"version": "0.4.4",
"sourceArchiveSha256": "2a9f76f0f6f2e4144dd0988977b8383bb06403ffa79e08c11d1e6efaec1e2f7e",
"sourceArchiveSha256": "4e9819a3583fd13db28234f55cd4ce8dabb177cb14bbb92e7236b614dc979c85",
"packageLockSha256": "18a91b8d697ebcab1d259d4de876167dcbd4d47fc3c82196d179c4c490adca4a",
"bundle": "media-peer-demo.js",
"bundleSha256": "80a80ff9da3ef355afbf20afd9b0b9a409cd25698019e77e0f41745074b83c3f",
"bundleBytes": 261139,
"bundleSha256": "d2c2d70ea64bfa99dcf80fa445aef7ab71ddd6c8345db1bce7d0b4eeb1d60746",
"bundleBytes": 261979,
"transferWorker": {
"file": "relayswarm-transfer-worker.js",
"bytes": 7074,
"sha256": "1355ba213ac3f3e6934d01719c4f6ec98761dd7c796cbedf2056c1c5a20ba563",
"sha256": "caeb0b7957e7d29955010f24566efb30ce17987053599ee58ae4cffaa799adbd",
"source": "src/browser/core-transfer-worker-runtime.mjs"
},
"sourceMap": false,
Expand Down
8 changes: 4 additions & 4 deletions site/vendor/media-peer-demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/vendor/relayswarm-core.NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RelaySwarm Rust/WebAssembly core
https://github.com/forgesworn/relayswarm/tree/45616b8141987f88e6054e2fdfbeae34710e714b
https://github.com/forgesworn/relayswarm/tree/25354e3cb843b606fc51cdb47a548e9d90d0d091

MIT License

Expand Down
2 changes: 1 addition & 1 deletion site/vendor/relayswarm-transfer-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/media-public-swarm.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ test('recorded mode signs actual global sequence and discontinuity against the u
const options = f.cycles[0].options;
assert.equal(options.warmAhead, false, 'steady speculative downloads cannot compete with playback');
assert.equal(options.startupBufferTarget, null, 'startup buffering requires an explicit current-player target');
assert.equal(options.startupBufferMaxBytes, 24 * 1024 * 1024, 'non-startup playback keeps the SDK default');
assert.equal(options.uploadPacing, quality === 'full', 'bounded upload admission is enabled for full 4K only');
assert.equal(options.latePeerRace, quality === 'full', 'a newly available peer may race only for the full 4K player');
assert.equal(options.maxUploadBytesPerSecond, 4 * 1024 * 1024, 'pacing does not increase the existing upload rate');
Expand Down Expand Up @@ -542,10 +543,13 @@ test('startup buffering is confined to the recorded full player and its live ada
} });
await f.adapter.setEnabled(true);
assert.equal(f.cycles[0].options.startupBufferTarget, null, 'plain VOD has no shared room target');
assert.equal(f.cycles[0].options.startupBufferMaxBytes, 24 * 1024 * 1024);
const recording = await f.prepare();
f.useRecorded({ recording, epochId: 'a'.repeat(64) });
await f.adapter.setEnabled(true);
const first = f.cycles[1].options.startupBufferTarget;
assert.equal(f.cycles[1].options.startupBufferMaxBytes, 32 * 1024 * 1024, 'the 4K reservoir includes the retained original');
assert.equal(f.cycles[1].options.maxHeldBytes, 64 * 1024 * 1024, 'startup remains inside the existing shared budget');
assert.equal(first(), 1.25);
target = 3.75;
assert.equal(first(), 3.75, 'the callback reads fresh programme time');
Expand Down
Loading