Skip to content

render: gate advanced glyph outline payloads#1117

Closed
seo-rii wants to merge 6 commits into
edwardkim:develfrom
seo-rii:render-p19
Closed

render: gate advanced glyph outline payloads#1117
seo-rii wants to merge 6 commits into
edwardkim:develfrom
seo-rii:render-p19

Conversation

@seo-rii

@seo-rii seo-rii commented May 25, 2026

Copy link
Copy Markdown
Contributor

What

  • GlyphOutline payload vocabulary에 colorLayers, bitmapGlyph, svgGlyph를 추가합니다.
  • ColorLayers.colrV0, ColorLayers.colrV1, BitmapGlyph, SvgGlyph payload contract와 family exclusivity check를 추가합니다.
  • COLRv1 paint graph를 solid path, linear/radial/sweep gradient path, transform chain으로 나누고, bounded graph validator와 JSON schema를 맞춥니다.
  • CanvasKit text variant selection에서 advanced glyph payload는 기본적으로 선택하지 않고, 명시적으로 열린 COLRv1 subset만 replay합니다.
  • CanvasKit renderer는 COLRv1 solid/linear/radial/sweep graph를 직접 path/shader로 replay하고, unsupported graph는 unsupportedColorGlyph reason으로 TextRun fallback을 유지합니다.
  • Studio 타입과 CanvasKit diagnostics helper를 추가해서 browser 쪽에서도 같은 payload family와 reject reason을 구분합니다.
  • README와 docs/text-ir-v2.md에 P19의 gate 성격, 열린 subset, non-goal을 정리합니다.

Why

P18까지는 CanvasKit image replay의 direct coverage를 닫았습니다. 다음 단계에서 glyph payload를 전부 열면 fallback 조건과 payload family가 섞일 가능성이 큽니다.

이번 PR은 advanced glyph payload vocabulary와 reject/report contract를 먼저 고정하면서, 검증 가능한 첫 replay consumer로 COLRv1 solid/gradient graph subset만 엽니다. 즉 TextRun fallback은 계속 남겨두고, backend가 준비되지 않은 bitmap/SVG glyph나 복잡한 COLRv1 graph를 조용히 path/image처럼 처리하지 않도록 막습니다.

Compatibility

  • public renderer 기본값은 바꾸지 않습니다.
  • CanvasKit은 계속 opt-in path입니다.
  • GlyphRun / GlyphOutline은 canonical text path가 아니고 optional text variant입니다.
  • advanced GlyphOutline payload는 default selection에서 직접 replay되지 않고 TextRun fallback을 유지합니다.
  • COLRv1 solid/linear/radial/sweep graph는 명시적인 CanvasKit gate가 열릴 때만 선택합니다.
  • schema는 schemaVersion: 1 유지, additive schemaMinorVersion: 14로 올립니다.

Non-goals

  • COLRv1 composite/blend/clip/nested paint replay를 구현하지 않습니다.
  • BitmapGlyph image strike replay를 실제 renderer에 연결하지 않습니다.
  • SvgGlyph static vector replay를 실제 renderer에 연결하지 않습니다.
  • native Skia / SVG / Canvas2D full color glyph replay를 켜지 않습니다.
  • font-native COLR/CPAL table을 consumer가 직접 해석하게 만들지 않습니다.
  • font construction proof나 arbitrary glyph id replay를 완료하지 않습니다.

Validation

  • cargo test --lib colrv1
  • cargo test --lib serializes_advanced_glyph_outline_payload_gate_metadata
  • npm --prefix rhwp-studio test -- render-backend
  • npm --prefix rhwp-studio run build
  • cargo fmt --check
  • git diff --check

Refs #536

@edwardkim edwardkim self-requested a review May 26, 2026 03:09
@edwardkim edwardkim added this to the v1.0.0 milestone May 26, 2026
@edwardkim edwardkim added the enhancement New feature or request label May 26, 2026
@seo-rii seo-rii marked this pull request as ready for review May 26, 2026 09:12
Copilot AI review requested due to automatic review settings May 26, 2026 09:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces P19 advanced glyph payload vocabulary for GlyphOutline ops, adding three new payload families (color layers, bitmap glyph, sanitized SVG) with strict contracts, deterministic reject reasons, and a guarded CanvasKit COLRv1 solid/gradient replay subset.

Changes:

  • Add ColorLayersPayload, BitmapGlyphPayload, SvgGlyphPayload and their validation contracts; bump schema minor version to 14 and exclusivity check across payload families.
  • Wire the new reject reasons (UnsupportedColorGlyph/Bitmap/Svg) and TextVariantSelectionOptions gates into the layer renderer and CanvasKit policy, with matching JSON serialization and TS types.
  • Implement a TypeScript glyphOutlinePayloadStatus gate plus a CanvasKit renderer path that draws the guarded COLRv1 solid/linear/radial/sweep subset.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/paint/paint_op.rs New payload types, exclusivity helper, and COLRv1 graph contract validation.
src/paint/mod.rs Re-exports newly added payload types.
src/paint/schema.rs Bumps schema_minor_version to 14.
src/paint/text_variants.rs Adds MixedGlyphOutlinePayload scope error and validation.
src/paint/text_v2.rs Marks advanced payload kinds as non-strict and produces fallback reasons.
src/paint/json.rs Serializes color layers/bitmap/svg payloads and updates feature flags.
src/renderer/layer_renderer.rs Reject-reason gates for new payloads plus tests.
src/renderer/canvaskit_policy.rs Opens COLRv1 stage-1 graph gate for CanvasKit planning.
rhwp-studio/src/core/types.ts TS types mirroring the new payload schema.
rhwp-studio/src/view/glyph-outline-payload-status.ts TS payload gate parity with Rust.
rhwp-studio/src/view/canvaskit-renderer.ts CanvasKit replay for guarded COLRv1 subset.
rhwp-studio/tests/render-backend.test.ts Test coverage for the new TS gate.
docs/text-ir-v2.md, README.md Documents P19 payload gates and CanvasKit subset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/layer_renderer.rs
Comment thread src/paint/paint_op.rs
Comment thread src/paint/paint_op.rs
Comment thread rhwp-studio/src/view/glyph-outline-payload-status.ts
Comment thread rhwp-studio/src/view/glyph-outline-payload-status.ts
Comment thread rhwp-studio/src/view/canvaskit-renderer.ts
Comment thread rhwp-studio/src/view/canvaskit-renderer.ts Outdated
Comment thread src/paint/json.rs Outdated
Comment thread src/paint/json.rs
Comment thread src/paint/paint_op.rs
@edwardkim

Copy link
Copy Markdown
Owner

PR #1117 처리 결과 보고서

1. 처리 요약

PR #1117은 권장안대로 체리픽 수용했다.

이 PR은 GlyphOutline의 advanced payload vocabulary를 추가하고, CanvasKit에서 COLRv1의 제한된
solid/gradient graph subset만 명시적으로 replay하도록 gate를 추가한다. 기본 renderer 선택은 바꾸지
않고, unsupported payload는 TextRun fallback 및 diagnostic으로 유지한다.

2. 반영 커밋

체리픽한 커밋:

c54e80d0 feat: gate advanced glyph outline payloads
3945a937 test: expose glyph outline payload diagnostics
225e8229 docs: document P19 glyph payload gates
4d1938e7 feat: replay gated colrv1 glyph gradients
90f6fa84 test: align layer schema tuple expectation
606505bd fix: address p19 glyph gate review

원본 PR head:

b2134a312d88a461173cfbe45b67fa675ae8810a

3. 반영 내용

주요 변경:

1. GlyphOutline payload family 추가
   - colorLayers
   - bitmapGlyph
   - svgGlyph

2. payload family exclusivity 및 contract validation 추가

3. COLRv1 bounded graph contract 추가
   - node count/depth bound
   - duplicate/missing/cycle 검증
   - supported node kind whitelist
   - non-empty glyph range 검증

4. CanvasKit에서 COLRv1 제한 subset replay
   - solid path
   - linear gradient path
   - radial gradient path
   - full-circle sweep gradient path
   - transform chain

5. Studio TypeScript type/gate/diagnostic helper 추가

6. README 및 docs/text-ir-v2.md에 P19 gate 문서화

Schema 변경:

schemaVersion = 1 유지
schemaMinorVersion = 14

4. 검토 결과

검토 결론:

수용 가능

이유:

1. 기본 renderer 동작은 그대로 유지된다.
2. advanced payload는 default selection에서 직접 replay되지 않는다.
3. CanvasKit은 명시적으로 열린 COLRv1 subset만 replay한다.
4. unsupported graph/payload는 fallback과 reject reason으로 남긴다.
5. Rust gate와 TypeScript gate가 주요 contract를 맞춘다.
6. Copilot 지적 10개가 후속 커밋에서 반영되었다.

추가 maintainer-side 코드 수정은 하지 않았다.

5. 검증

실행한 검증:

cargo fmt --check
cargo check
cargo test --lib colrv1
cargo test --lib serializes_advanced_glyph_outline_payload_gate_metadata
npm --prefix rhwp-studio test -- render-backend
git diff --check
docker compose --env-file .env.docker run --rm wasm
npm --prefix rhwp-studio run build

결과:

success

확인된 warning:

- 기존 Rust test warning만 재출력됨
- Vite chunk size warning 및 canvaskit-wasm의 fs/path browser externalization 안내

이번 PR 처리에서 새로 해결해야 할 실패는 없었다.

6. 남은 절차

보고서 승인 후 다음 절차를 진행한다.

1. 검토/완료 보고서 커밋
2. PR #1117에 처리 결과 코멘트 작성
3. PR #1117 close
4. local/devel -> devel 병합
5. devel에서 필요한 검증 확인
6. origin/devel push

@edwardkim

Copy link
Copy Markdown
Owner

PR #1117은 maintainer side에서 cherry-pick 수용했고, 검증 결과를 mydocs/pr/pr_1117_report.md에 기록했습니다.

@edwardkim edwardkim closed this May 26, 2026
edwardkim added a commit that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants