Skip to content

render: widen strict bitmap/svg glyph payload corpus#1416

Closed
seo-rii wants to merge 5 commits into
edwardkim:develfrom
seo-rii:render-p24
Closed

render: widen strict bitmap/svg glyph payload corpus#1416
seo-rii wants to merge 5 commits into
edwardkim:develfrom
seo-rii:render-p24

Conversation

@seo-rii

@seo-rii seo-rii commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

  • ResourceArena에서 이미지 바이트와 static SVG fragment를 font blob과 같이 intern할 수 있게 했습니다.
  • bitmap/SVG glyph payload의 payloadResourceKey가 실제 resource digest를 포함하도록 보강했습니다.
  • SVG glyph JSON에는 기존 svgRef와 함께 명확한 static vector alias인 vectorResourceId를 같이 내보냅니다.
  • bitmap/SVG glyph payload는 backend option이 켜져 있어도 실제 resource가 없으면 selection에서 reject하도록 했습니다.
  • strict bitmap/SVG glyph producer corpus와 JSON/selection 회귀 테스트를 추가했습니다.

Why

P19/P20에서 advanced glyph payload vocabulary와 resource proof 방향은 열었지만, bitmap/SVG payload가 숫자 id만으로 strict cache/resource identity를 주장하면 같은 imageRef 또는 svgRef가 다른 payload bytes를 가리키는 경우를 구분하기 어렵습니다.

이 PR은 bitmap/SVG glyph replay를 기본 경로로 여는 것이 아니라, 나중에 backend replay를 열 때 필요한 resource identity와 strict payload 조건을 먼저 고정합니다.

Compatibility

  • 기본 TextRun fallback 경로는 유지됩니다.
  • bitmap/SVG glyph payload는 여전히 opt-in backend gate 뒤에 있습니다.
  • backend option이 켜져 있어도 resource bytes 또는 static SVG fragment가 없으면 strict variant로 선택하지 않습니다.
  • schema는 minor feature로 확장됩니다.

Non-goals

  • CanvasKit/native Skia에서 bitmap/SVG glyph를 직접 replay하지 않습니다.
  • document font/image extraction 전체 경로를 완성하지 않습니다.
  • fallback-free text profile을 기본값으로 바꾸지 않습니다.

Checks

  • cargo fmt --check
  • git diff --check upstream/devel...HEAD
  • CARGO_INCREMENTAL=0 cargo test --lib paint::json -- --nocapture
  • CARGO_INCREMENTAL=0 cargo test --lib renderer::layer_renderer -- --nocapture
  • CARGO_INCREMENTAL=0 cargo check --lib

@seo-rii seo-rii marked this pull request as ready for review June 15, 2026 14:37
Copilot AI review requested due to automatic review settings June 15, 2026 14:37

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.

Adds strict bitmap/SVG glyph resource tracking so variant selection and JSON export can validate and key advanced glyph payloads using actual interned bytes/fragments.

Changes:

  • Extend ResourceArena to intern image bytes and SVG fragments, with lookup/iteration APIs and tests.
  • Reject strict bitmap/SVG glyph variants when required payload resources are missing; add corresponding diagnostics/tests.
  • Append resource digest-based keys into payloadResourceKey, export new JSON metadata/features, and bump schema minor version.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/renderer/layer_renderer.rs Threads ResourceArena into variant evaluation and adds rejection reason/tests for missing payload resources.
src/paint/schema.rs Bumps schema minor version to reflect new exported capabilities.
src/paint/resources.rs Adds image/SVG interning and query APIs to ResourceArena plus dedupe tests.
src/paint/paint_op.rs Extends glyph payload resource keys to optionally incorporate digest-derived resource identities.
src/paint/json.rs Passes resources into JSON writer, exports digest-aware payload keys and new feature flags/fields.
docs/text-ir-v2.md Documents the producer corpus/resource identity changes for strict bitmap/SVG glyph payloads.

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

Comment thread src/paint/paint_op.rs Outdated
Comment thread src/paint/paint_op.rs Outdated
Comment thread src/paint/json.rs Outdated
@edwardkim edwardkim self-requested a review June 15, 2026 23:49
@edwardkim edwardkim added the enhancement New feature or request label Jun 15, 2026
@edwardkim edwardkim added this to the v1.0.0 milestone Jun 15, 2026
edwardkim pushed a commit that referenced this pull request Jun 16, 2026
@edwardkim

Copy link
Copy Markdown
Owner

@seo-rii 기여 감사합니다.

PR #1416의 변경은 maintainer 쪽에서 현재 devel 기준으로 cherry-pick 반영했습니다.

반영 커밋:

c8368160 test(render): widen strict glyph payload corpus
ba4151a2 fix(render): require glyph payload resources
295e5b61 fix(render): detect glyph payload digest features structurally
db68ef6e fix(render): cache glyph payload resource keys
f83e25cc fix(render): align glyph digest feature flags

검증 결과:

  • git diff --check origin/devel..HEAD 통과
  • cargo fmt --check 통과
  • CARGO_INCREMENTAL=0 cargo test --lib paint::json -- --nocapture 통과, 13 passed
  • CARGO_INCREMENTAL=0 cargo test --lib renderer::layer_renderer -- --nocapture 통과, 18 passed
  • CARGO_INCREMENTAL=0 cargo test --lib paint::resources -- --nocapture 통과, 4 passed
  • CARGO_INCREMENTAL=0 cargo check --lib 통과

devel 반영 merge commit: a60ea2ad

이 PR은 cherry-pick으로 반영 완료되었으므로 여기서 닫겠습니다. 감사합니다.

@edwardkim edwardkim closed this Jun 16, 2026
edwardkim pushed a commit that referenced this pull request Jun 16, 2026
edwardkim pushed a commit that referenced this pull request Jun 16, 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