render: harden CanvasKit direct replay contract#1057
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates CanvasKit replay policy to enforce direct replay (and forbid hidden Canvas2D overlay) across modes, and updates Rust/TypeScript tests and bridge code to match the new contract.
Changes:
- Make CanvasKit replay plan report
hiddenCanvas2dOverlayAllowed: falseanddirectReplayRequired: true(including wasm bridge fallback). - Update Rust policy logic + associated tests to treat compat as direct-replay-required.
- Add/adjust schema and backend tests; tweak TS wasm bridge typing for
getShapeBBox.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/wasm_api/tests.rs | Updates wasm API test expectations for the new replay-plan flags. |
| src/wasm_api.rs | Adjusts public API doc comment to reflect updated replay policy messaging. |
| src/renderer/canvaskit_policy.rs | Enforces “no hidden overlay + direct replay required” in plan construction; updates related unit tests. |
| src/paint/schema.rs | Adds assertions tying exported constants to schema fields. |
| rhwp-studio/tests/render-backend.test.ts | Adds a test to ensure JS fallback JSON contract matches the new policy. |
| rhwp-studio/src/core/wasm-bridge.ts | Changes fallback JSON to constant flags; adds a cast-based call for getShapeBBox. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t check 복구) Task #1058 Stage 16 (adaa0b0) 에서 추가된 신규 파일이 rustfmt 정합 미통과 — devel CI #970 (sha=749048c9) Format check 실패. cargo fmt 적용으로 정정. 본 환경 cargo fmt --check 전체 exit 0 검증. 본 정정은 PR #1057 처리 진행 전 devel CI 회복 위한 단독 commit. 다른 처리분 (PR #1054/#1059 누적 + 예정 PR #1057) 은 별도 누적 push 계획 (작업지시자 결정 "본 PR 처리분 누적 후 push"). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
검토 완료 — merge 수용. devel 에 반영합니다. 검증 결과
처리
평가Copilot 리뷰 6 코멘트를 후속 commit (
frontend 영역 변경도 (1) opt-in CanvasKit path 한정, (2) 신규 의존성 추가 없음, (3) 기존 wasm-bridge / test 영역만 강화 — 거버넌스 우려 없음 확인했습니다. 기여 감사합니다. |
|
devel 반영 완료 (cherry-pick). PR close 합니다. |
render: harden CanvasKit direct replay contract (Refs #536, P17, seo-rii). default/compat 모두 direct replay only 로 contract 고정, Canvas2D overlay fallback 차단. 4 path (native/WASM/frontend/Studio fallback) 동시 정합. Copilot 리뷰 6/6 정직 반영 (CanvasKitReplayPolicy 구조체 추출 + as unknown cast 제거 + schema struct 비교 등). CI 전부 pass + 본 환경 cargo test --lib 1324 passed + canvaskit 14/0 + schema 1/0 + Canvas visual diff pass. 시각 판정 면제 (작업지시자 옵션 A) — CanvasKit opt-in path. feedback_image_renderer_paths_separate 핵심 정합 (4 path 동시 contract). feedback_pr_supersede_chain — P15 → P16 → P17 chain + P18~P21 분리 정직. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 PR 본질 + 3 archives 통합 — author 보존 cherry-pick: - PR #1054 (closes #1049, Jaeook Ryu): VPOS_CORR lazy_base trailing-ls bridge 정합. #1046 가설 반증 후 진짜 원인 (이중 차감) 정확 식별. - PR #1059 (HaimLee-4869): U+00B7 폭 폰트 metric 정합 — 비례폰트 .notdef 위장값 가드. native·WASM 공유 함수 가드. - PR #1057 (Refs #536, seorii): CanvasKit direct replay contract harden (P17). 4 path 동시 정합 + Copilot 6/6 반영. 본 환경 cargo test --release --lib 1324 passed, 0 failed. CI 전부 pass. 시각 판정 면제 (모두 정량 게이트 충족) — 메모리 룰 후보 권위 사례 누적 (PR #1039→#1044→#1054→#1059→#1057 5 사례). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
What
compatreplay diagnostics를 Canvas2D overlay 허용이 아니라 direct replay required policy로 고정합니다.getCanvasKitReplayPlan도hiddenCanvas2dOverlayAllowed=false,directReplayRequired=true를 반환하도록 맞춥니다.DIRECT_ONLY계약으로 모아서compat가 hidden Canvas2D overlay fallback으로 해석되지 않게 합니다.LAYER_TREE_SCHEMA와 동기화되는지 테스트를 보강합니다.Why
P16에서 browser CanvasKit direct renderer가 들어갔으므로, P17은 실제 coverage를 크게 넓히기 전에 replay contract를 먼저 닫는 단계입니다.
중요한 기준은
default와compat모두 Canvas2D overlay fallback이 아니라는 점입니다.compat는 보수적인 direct replay mode일 뿐, hidden Canvas2D paint로 unsupported op를 덮는 모드가 아닙니다. 따라서 native/WASM diagnostics와 Studio fallback bridge가 같은 contract를 말해야 합니다.Compatibility
Non-goals
Validation
wasm-pack build --target web --devnpm --prefix rhwp-studio testnpm --prefix rhwp-studio run buildcargo test canvaskit --libcargo test layer_tree_schema_constants_match_schema --libcargo fmt --checkgit diff --checkRefs #536