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
15 changes: 13 additions & 2 deletions docs/media-showcase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ 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 `d4a1235b035b4244ea73b55b1da0d4f88f64c376`
([source change](https://github.com/forgesworn/relayswarm/commit/d4a1235b035b4244ea73b55b1da0d4f88f64c376)).
The player pins RelaySwarm source `c8120c5bf8c117e334a37a072b3bd6f3de46cc3a`
([source change](https://github.com/forgesworn/relayswarm/commit/c8120c5bf8c117e334a37a072b3bd6f3de46cc3a)).
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
Expand Down Expand Up @@ -569,6 +569,17 @@ integrity failures, and peer eligibility. Each count is a nonnegative safe
integer or `null`; missing values are not inferred as zero. Raw SDK records,
keys, tickets and transfer objects are excluded. Submitted uploads and verified
pieces in a losing race do not become accepted peer-media credit.
The separate `peerFlowDiagnostics` observation retains only the SDK's fixed
short-flow batch counts, bytes and latest span, plus model-evaluation counters
and the latest numeric model inputs. Decisions distinguish a fitting measured
piece, useful unknown flow, an allowed refresh, a cooldown-blocked unknown
model and a retained known slow model. Evaluations are not request counts.
The no-model counter records attempts rejected before transfer creation; its
snapshot describes only the latest candidate from that attempt, alongside
the candidate count. Rates, timing and previous snapshots remain `null` when
unobserved. This projection adds no timers, requests, playback credit or
selection policy. It is diagnostic evidence for choosing subsequent tuning,
not a throughput or sustained-playback qualification.
These attempt counters describe the current SDK generation and may reset after
peer sharing restarts; compare them only within a continuous generation. Terminal
handling retains the projected startup flags and geometry; these other current
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 = 'd4a1235b035b4244ea73b55b1da0d4f88f64c376';
const SOURCE = 'c8120c5bf8c117e334a37a072b3bd6f3de46cc3a';
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=20261028-verified-piece-flow"></script>
<script type="module" src="/media-lab.mjs?v=20261028-peer-fit-models"></script>
</body>
</html>
3 changes: 2 additions & 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=20261028-verified-piece-flow"></script>
<script type="module" src="/media-lab.mjs?v=20261028-peer-fit-models"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions site/media-lab.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readInitialLiveStart } from './media-live-start.mjs';
import { createSourceResponseStats, publicSourceResource, transferBytes } from './media-transfer-stats.mjs?v=20261027-visual-provenance';
import { createNativePlaybackFallback } from './media-playback-fallback.mjs?v=20261025-prepared-room';
import { createPlaybackPrime } from './media-playback-prime.mjs?v=20261025-prepared-room';
import { createPlaybackReport, projectStartupBuffer } from './media-playback-report.mjs?v=20261027-startup-terminal';
import { createPlaybackReport, projectStartupBuffer } from './media-playback-report.mjs?v=20261028-peer-fit-models';

const DASH = '—';
export const observed = (value) => typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
Expand Down 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=20261028-verified-piece-flow'), import('./media-public-swarm.mjs?v=20261028-verified-piece-flow'),
import('./media-listener-session.mjs?v=20261028-peer-fit-models'), import('./media-public-swarm.mjs?v=20261028-peer-fit-models'),
]);
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=20261028-verified-piece-flow');
const { createPublicSwarm, prepareRecordedSource, createRecordedLive } = await import('./media-public-swarm.mjs?v=20261028-peer-fit-models');
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=20261028-verified-piece-flow';
import { finalizeEvent, generateSecretKey, verifyEvent } from './vendor/media-peer-demo.js?v=20261028-peer-fit-models';

export const LISTENER_SESSION_KIND = 30378;
export const LISTENER_TELEMETRY_KIND = 20378;
Expand Down
35 changes: 35 additions & 0 deletions site/media-playback-report.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,40 @@ function connections(input) {
}));
}

function peerFlowModel(input) {
if (!object(input)) return null;
return {
decision: choice(value(input, 'decision'), ['fit', 'useful-unknown', 'refresh', 'cooldown-blocked', 'known-slow']),
availableMs: number(value(input, 'availableMs')), pieceSize: positiveInteger(value(input, 'pieceSize')),
firstByteMs: number(value(input, 'firstByteMs')), rateBytesPerSecond: number(value(input, 'rateBytesPerSecond')),
probeAgeMs: number(value(input, 'probeAgeMs')), usefulAgeMs: number(value(input, 'usefulAgeMs')),
};
}

function peerFlowDiagnostics(input) {
if (!object(input)) return null;
const core = value(input, 'core'); if (!object(core)) return null;
const multi = value(core, 'multiHolder'); if (!object(multi)) return null;
const flow = value(multi, 'peerFlow'); if (!object(flow)) return null;
const batch = value(flow, 'lastVerifiedShortBatch'), evaluations = value(flow, 'modelEvaluations');
const noModel = value(flow, 'lastNoModel');
// Fixed scalar projection only: evaluations are not requests or playback
// credit, and the latest model is not a record of every candidate.
return {
verifiedShortBatches: integer(value(flow, 'verifiedShortBatches')),
verifiedShortBytes: integer(value(flow, 'verifiedShortBytes')),
lastVerifiedShortBatch: object(batch) ? { bytes: positiveInteger(value(batch, 'bytes')), spanMs: number(value(batch, 'spanMs')) } : null,
modelEvaluations: object(evaluations) ? {
fit: integer(value(evaluations, 'fit')), 'useful-unknown': integer(value(evaluations, 'useful-unknown')),
refresh: integer(value(evaluations, 'refresh')), 'cooldown-blocked': integer(value(evaluations, 'cooldown-blocked')),
'known-slow': integer(value(evaluations, 'known-slow')),
} : null,
lastModel: peerFlowModel(value(flow, 'lastModel')), noModelTransfers: integer(value(flow, 'noModelTransfers')),
lastNoModel: object(noModel) ? { candidateCount: integer(value(noModel, 'candidateCount')),
model: peerFlowModel(value(noModel, 'model')) } : null,
};
}

function peerAttemptDiagnostics(input) {
if (!object(input)) return null;
const count = (...path) => {
Expand Down Expand Up @@ -202,6 +236,7 @@ function sample(input, elapsedMs) {
sourceTimingCoverage,
peerEnabled: boolean(value(input, 'peerEnabled')), connectedPeers: integer(value(input, 'connectedPeers')),
peerAttemptDiagnostics: peerAttemptDiagnostics(value(input, 'peerAttemptDiagnostics')),
peerFlowDiagnostics: peerFlowDiagnostics(value(input, 'peerAttemptDiagnostics')),
transferWorkerState: choice(value(input, 'transferWorkerState'), ['off', 'waiting-core', 'loading', 'ready', 'failed', 'stopped']),
roomPrepared: boolean(value(input, 'roomPrepared')), roomReady: boolean(value(input, 'roomReady')),
roomListeners: integer(value(input, 'roomListeners')), connections: connections(value(input, 'connections')),
Expand Down
4 changes: 2 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=20261028-verified-piece-flow';
generateSecretKey, relayswarmBuild } from './vendor/media-peer-demo.js?v=20261028-peer-fit-models';
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,7 +479,7 @@ 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=20261028-verified-piece-flow', import.meta.url),
transferWorkerUrl: new URL('./vendor/relayswarm-transfer-worker.js?v=20261028-peer-fit-models', import.meta.url),
zeroBudgetPeerRace: true, lateHaveRace: true, sustainablePeerWait: true,
warmAhead: false,
startupBufferMaxBytes: (needsStartupBuffer ? 32 : 24) * 1024 * 1024,
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=20261028-verified-piece-flow"></script>
<script type="module" src="/media-lab.mjs?v=20261028-peer-fit-models"></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/d4a1235b035b4244ea73b55b1da0d4f88f64c376
https://github.com/forgesworn/relayswarm/tree/c8120c5bf8c117e334a37a072b3bd6f3de46cc3a

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": "d4a1235b035b4244ea73b55b1da0d4f88f64c376",
"sourceCommit": "c8120c5bf8c117e334a37a072b3bd6f3de46cc3a",
"version": "0.4.4",
"sourceArchiveSha256": "441c3482cb43b0b250f439f40bb5457a8aa887e354acb4be8cedb0eb76aa385f",
"sourceArchiveSha256": "c665848cc6d3ec7aa99448dd28cf6cf333e13393f48fc7f5c82ddd31ddc007e2",
"packageLockSha256": "18a91b8d697ebcab1d259d4de876167dcbd4d47fc3c82196d179c4c490adca4a",
"bundle": "media-peer-demo.js",
"bundleSha256": "0678f84ada02ac7ec5d5585363670bdc77730af99c7488b61c61a1512c8a9dc5",
"bundleBytes": 263683,
"bundleSha256": "f9b89c02700b1f82da81eb855bd79d4c7459d02e720a639860c8c38abc723800",
"bundleBytes": 265067,
"transferWorker": {
"file": "relayswarm-transfer-worker.js",
"bytes": 7074,
"sha256": "e1e02f93345f28cdbf96f1a20593e1f65d7b115a7ee1dd0ced1f0ee4b81164ba",
"sha256": "030c8137f5a9bcbca2bf9dde6c3cde64e00262bfc6a9c190f3aa097011f8d7e4",
"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/d4a1235b035b4244ea73b55b1da0d4f88f64c376
https://github.com/forgesworn/relayswarm/tree/c8120c5bf8c117e334a37a072b3bd6f3de46cc3a

MIT License

Expand Down
Loading
Loading