Skip to content

Commit b213f98

Browse files
committed
feat(startup): implement phase2-4 delta rendering and cohort gates
1 parent 9e1e5ea commit b213f98

8 files changed

Lines changed: 614 additions & 43 deletions

File tree

docs/diataxis/en/explanation/startup-node-update-acceleration-plan.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,16 @@ npm run perf:startup:matrix -- --root tmp/startup-logs --single-platform-label w
183183
- Data boundary:
184184
- `tmp/startup-logs-simulated` is synthetic and only valid for pipeline/gate/report flow verification.
185185
- Release-go performance decisions must be based on real same-device baseline/pilot cohorts.
186+
187+
## 13) Phase 2-4 Execution Snapshot (March 31, 2026)
188+
189+
- Phase 2 (delta protocol):
190+
- Worker now emits `tickMode=full|delta` with `isDelta`.
191+
- Delta payloads send changed nodes only (epsilon-controlled) with periodic full-sync fallback (`fullSyncEveryTicks`).
192+
- Tick emission now adapts by alpha (`tickMaxFps` vs `lowAlphaTickMaxFps`).
193+
- Phase 3 (staged rendering):
194+
- SVG startup stage now renders key-edge TopK first (priority by node centrality/degree).
195+
- Full edges are restored automatically after startup window while keeping geometry delay guard.
196+
- Phase 4 (verification and rollout gate):
197+
- Added `perf:startup:cohorts:verify` for three-cohort (`small/medium/large`) automatic gates.
198+
- Supports session-floor gate (`--min-sessions-per-platform`) and strict CI exit (`--strict`).

docs/diataxis/en/reference/interfaces-and-runtime.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@ This reference tracks canonical API/runtime contracts.
3535
- Worker startup profile is passed through `simulationWorker` init payload:
3636
- `startupProfile.id`
3737
- `startupProfile.tickMaxFps`
38+
- `startupProfile.lowAlphaTickMaxFps`
39+
- `startupProfile.lowAlphaThreshold`
3840
- `startupProfile.stableAlphaThreshold`
3941
- `startupProfile.stableHoldTicks`
4042
- `startupProfile.stableTimeoutMs`
43+
- `startupProfile.deltaEnabled`
44+
- `startupProfile.deltaEpsilonPx`
45+
- `startupProfile.fullSyncEveryTicks`
46+
- Worker -> main-thread tick transport contract (Phase 2):
47+
- `tickMode: 'full' | 'delta'`
48+
- `isDelta: boolean`
49+
- `nodes: [{ id, x, y }]` (delta mode only includes changed nodes)
4150
- Multi-platform startup pilot profiles:
4251
- `desktop_windows_pilot`: `26 FPS`, `400ms` edge delay, `1500ms` SVG cap window (`18000` links).
4352
- `desktop_macos_pilot`: `24 FPS`, `430ms` edge delay, `1700ms` SVG cap window (`15000` links).
@@ -73,6 +82,10 @@ This reference tracks canonical API/runtime contracts.
7382
- `npm run perf:startup:matrix:simulate -- --seed-root tmp/startup-logs --out-root tmp/startup-logs-simulated`
7483
- `npm run perf:startup:matrix -- --root tmp/startup-logs-simulated --out tmp/startup-logs-simulated/report-platform-matrix.md`
7584
- Note: `tmp/startup-logs-simulated` is synthetic data and must not be used for release-go performance decisions.
85+
- Three-cohort automatic regression and rollout gate (Phase 4):
86+
- `npm run perf:startup:cohorts:verify -- --root <cohorts-root> --cohorts small,medium,large --out <report-path> --strict`
87+
- Directory contract: `<cohorts-root>/<cohort>/<platform>/baseline|pilot`
88+
- Session floor gate is configurable via `--min-sessions-per-platform <N>`
7689

7790
## Mermaid Canonical Baseline (Obsidian)
7891

docs/diataxis/zh/explanation/startup-node-update-acceleration-plan.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,16 @@ npm run perf:startup:matrix -- --root tmp/startup-logs --single-platform-label w
183183
- 数据边界:
184184
- `tmp/startup-logs-simulated` 全部为模拟数据,仅用于脚本链路、门禁规则与报表产物验证。
185185
- 发布级性能结论必须基于真实设备同设备双阶段样本(baseline/pilot)。
186+
187+
## 13) Phase 2-4 收尾执行快照(2026-03-31)
188+
189+
- Phase 2(增量协议):
190+
- Worker 支持 `tickMode=full|delta``isDelta` 标记。
191+
-`deltaEpsilonPx` 仅回传变化节点,并以 `fullSyncEveryTicks` 周期全量兜底。
192+
- 根据 `alpha` 自动切换 `tickMaxFps``lowAlphaTickMaxFps`(低 alpha 降频)。
193+
- Phase 3(分层渲染):
194+
- SVG 启动阶段改为 key-edge TopK(按节点中心性/度优先)优先渲染。
195+
- 启动窗口结束后自动补齐全边,保留边几何延迟策略。
196+
- Phase 4(验证与灰度):
197+
- 新增 `perf:startup:cohorts:verify`,支持 `small/medium/large` 三规模回归门禁。
198+
- 支持样本量门禁(`--min-sessions-per-platform`)与 `--strict` 失败即退出。

docs/diataxis/zh/reference/interfaces-and-runtime.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@
3535
- Worker 通过 `simulationWorker` 初始化载荷接收启动 profile:
3636
- `startupProfile.id`
3737
- `startupProfile.tickMaxFps`
38+
- `startupProfile.lowAlphaTickMaxFps`
39+
- `startupProfile.lowAlphaThreshold`
3840
- `startupProfile.stableAlphaThreshold`
3941
- `startupProfile.stableHoldTicks`
4042
- `startupProfile.stableTimeoutMs`
43+
- `startupProfile.deltaEnabled`
44+
- `startupProfile.deltaEpsilonPx`
45+
- `startupProfile.fullSyncEveryTicks`
46+
- Worker -> 主线程 tick 传输契约(Phase 2):
47+
- `tickMode: 'full' | 'delta'`
48+
- `isDelta: boolean`
49+
- `nodes: [{ id, x, y }]`(delta 模式仅包含变化节点)
4150
- 多平台启动试点 profile:
4251
- `desktop_windows_pilot``26 FPS``400ms` 边延迟、`1500ms` SVG 窗口(`18000` 条边)。
4352
- `desktop_macos_pilot``24 FPS``430ms` 边延迟、`1700ms` SVG 窗口(`15000` 条边)。
@@ -73,6 +82,10 @@
7382
- `npm run perf:startup:matrix:simulate -- --seed-root tmp/startup-logs --out-root tmp/startup-logs-simulated`
7483
- `npm run perf:startup:matrix -- --root tmp/startup-logs-simulated --out tmp/startup-logs-simulated/report-platform-matrix.md`
7584
- 注意:`tmp/startup-logs-simulated` 为模拟数据,禁止用于 release-go 性能结论,仅用于脚本/门禁流程演练。
85+
- 三规模自动回归与灰度门禁(Phase 4):
86+
- `npm run perf:startup:cohorts:verify -- --root <cohorts-root> --cohorts small,medium,large --out <report-path> --strict`
87+
- 目录约定:`<cohorts-root>/<cohort>/<platform>/baseline|pilot`
88+
- 支持样本量门禁:`--min-sessions-per-platform <N>`
7689

7790
## Mermaid 标准兼容基线(Obsidian)
7891

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"perf:startup:matrix": "node scripts/compare-startup-perf-matrix.js",
6262
"perf:startup:matrix:watch": "node scripts/watch-startup-perf-matrix.js",
6363
"perf:startup:matrix:simulate": "node scripts/simulate-startup-perf-platform-logs.js",
64+
"perf:startup:cohorts:verify": "node scripts/verify-startup-perf-cohorts.js",
6465
"verify:pathbridge:strict": "node scripts/verify-pathbridge-strict-schema.js",
6566
"generate:sbom": "node scripts/generate-sbom.js",
6667
"generate:sbom:attestation": "node scripts/generate-sbom-attestation.js",

0 commit comments

Comments
 (0)