render: add CanvasKit replay policy diagnostics#925
Closed
seo-rii wants to merge 2 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds diagnostics-only CanvasKit replay policy planning so callers can inspect how a PageLayerTree would be classified for CanvasKit direct replay versus compatibility overlays.
Changes:
- Adds
canvaskit_policyanalysis with default/compat modes, summary counts, per-op replay items, and text variant selection reports. - Exposes
getCanvasKitReplayPlan(page, mode)through native/WASM APIs and Studio bridge fallback. - Documents P15 CanvasKit policy direction and adds tests for mode-level export behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/renderer/canvaskit_policy.rs |
Implements CanvasKit replay policy diagnostics and unit tests. |
src/renderer/mod.rs |
Registers the new renderer policy module. |
src/document_core/queries/rendering.rs |
Adds native JSON export for CanvasKit replay plans. |
src/wasm_api.rs |
Exposes the replay plan API to wasm-bindgen callers. |
src/wasm_api/tests.rs |
Adds coverage for mode policy JSON export. |
rhwp-studio/src/core/wasm-bridge.ts |
Adds Studio bridge wrapper and old-WASM fallback plan. |
README.md |
Notes P14/P15 renderer diagnostics milestones. |
docs/text-ir-v2.md |
Documents CanvasKit direct replay and overlay policy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edwardkim
pushed a commit
that referenced
this pull request
May 17, 2026
additive diagnostics API, 기존 렌더링 경로 무변경. - renderer/canvaskit_policy.rs (+829) — replay plan 생성 (default/compat 모드) - wasm_api.rs — getCanvasKitReplayPlan(page, mode) WASM 바인딩 - rendering.rs — native API - rhwp-studio wasm-bridge.ts — fallback 추가 - docs/text-ir-v2.md + README — P15 문서화 검증: - cargo test 1286 passed (+9 신규) - 렌더링 무영향 (시각 판정 불필요) Refs #536 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
검토 + cherry-pick 머지 완료. 감사합니다. 처리 결과
재검증
P12→P13→P14→P15 일관된 단계적 진행입니다. 수고하셨습니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
getCanvasKitReplayPlan(page, mode)native/WASM API를 추가해서 현재PageLayerTree가 CanvasKit에서 어떻게 replay될지 diagnostics JSON으로 확인할 수 있게 했습니다.default/compat으로 나눴습니다.default: native Skia로 이어지는 direct replay 준비 모드입니다. 지원하지 못하는 op를 Canvas2D overlay로 조용히 숨기지 않고directRequired/hiddenOverlayForbidden으로 드러냅니다.compat: 사용자-visible 안정성을 위한 transition 모드입니다. 아직 direct replay가 없는 op는compatOverlay로 표시하고, overlay 허용 여부를 명시합니다.analyze_text_variant_selection결과를 CanvasKit replay plan에 연결했습니다.GlyphRun/GlyphOutline은 여전히 strict sidecar gate를 통과할 때만 direct candidate가 되고, 아니면TextRunfallback을 유지합니다.getCanvasKitReplayPlanfallback을 추가해서 새 wasm이 아니어도 호출부가 깨지지 않게 했습니다.docs/text-ir-v2.md와 README에 P15 방향을 문서화했습니다.Why
P14까지는 Text IR v2의 strict sidecar 후보와 backend selection diagnostics를 잡는 단계였습니다. P15는 그 다음 단계로, CanvasKit을 Canvas2D-assisted preview가 아니라 native Skia로 이어지는 독립 replay backend로 키우기 위한 policy boundary를 먼저 만듭니다.
이번 PR은 CanvasKit renderer를 실제 public path로 전환하지 않습니다. 목적은 “무엇이 direct replay 가능하고, 무엇이 아직 overlay/fallback인지”를 숨기지 않고 reviewer와 후속 PR이 볼 수 있게 만드는 것입니다. 특히 hidden Canvas2D overlay가 기본 경로처럼 굳어지지 않도록
defaultmode에서는 gap을 명시적으로 드러냅니다.Non-goals
GlyphRun/GlyphOutline을 canonical text path로 바꾸지 않습니다.Compatibility
getCanvasKitReplayPlan은 diagnostics-only API입니다.defaultmode는 hidden Canvas2D overlay를 금지하는 계획을 보여줄 뿐, 현재 public render output을 바꾸지 않습니다.compatmode는 transition overlay를 명시적으로 보고합니다.관련 이슈
Refs #536
Tests
git diff --check upstream/devel...HEADcargo test renderer::canvaskit_policy --libcargo test test_canvaskit_replay_plan_export_uses_mode_policy --libcargo clippy -- -D warningscargo test --lib스크린샷
없음.
이번 PR은 renderer output 변경이 아니라 CanvasKit replay policy diagnostics 추가입니다.