Document incremental sync verification and performance gaps

This commit is contained in:
Jonathan Sykes
2026-10-08 00:21:19 +08:00
parent 92404563b3
commit 4950d3e417
7 changed files with 2500 additions and 0 deletions

View File

@@ -181,3 +181,34 @@ which receive hashed URLs as HTML scripts. Font preloads retain plain URLs to ma
`fonts.css`; the webmanifest and its icon URLs also stay plain and precached.
`piano-engine.mjs` is manifested but is historically absent from SHELL; this
existing offline piano limitation is deferred to the loader phase.
## Phase 2 incremental-sync verification
The current migration harness verifies the production page's own ready fast path
into `ytplayer-assets`: no `__ytpfresh` downloads, no reload before Refresh UI,
one banner/reload, an open N-1 tab, playback guard, incremental refresh after
an eviction, and offline launch. It preserves the legacy user-triggered reload
exception. Async CacheStorage/registration conditions are polled with awaited
`page.evaluate`; Playwright's `waitForFunction` does not poll async predicates.
```bash
node perf/migration.mjs --browser all --profile lossy
node perf/migration.mjs --browser all --profile unthrottled
node perf/baseline.mjs --runs 1 --browser all --profile lte --scenario all \
--out perf/results/phase2-final-2026-10-07.json \
--compare perf/results/after-phase0-2026-10-07.json
ASSET_SYNC=0 node perf/baseline.mjs --runs 1 --browser all --profile lte \
--scenario offline --out perf/results/phase2-rollback-2026-10-07.json
ASSET_HASHING=0 node perf/baseline.mjs --runs 1 --browser all --profile lte \
--scenario offline --out perf/results/phase2-hashing-rollback-2026-10-07.json
```
Results now include response paths/statuses and compressed response-body bytes
for cold/update runs. The total includes service-worker script checks/imports;
inspect individual responses to distinguish those from app asset downloads.
Migration results are `phase2-migration-<profile>-2026-10-07.json`.
`ASSET_SYNC=0` selects the legacy path while preserving the persistent utility
cache. `ASSET_HASHING=0` also selects legacy sync because single-tag URLs cannot
pass per-file hash checks. Current assets.json groups all block; idle loading and
lazy parsing await Phase 3. Incremental mode now caches the manifested
`piano-engine.mjs` even though it remains absent from the legacy SHELL.