render: add Text IR v2 diagnostics and schema closure#881
Open
seo-rii wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Text IR v2 “report-only” diagnostics and schema closure metadata to the PageLayerTree JSON export, while keeping the existing schema-v1 flattened TextRun + optional GlyphRun compatibility contract as the canonical path. The goal is to make text variant/fallback state and strict-profile eligibility explicitly diagnosable for future backend adoption.
Changes:
- Introduces
src/paint/text_v2.rsimplementingTextV2Diagnostics(slot diagnostics, validation issues, and line-break risk telemetry) plus compatibility profile guards. - Extends
PageLayerTree::to_json()to emit an additive"textV2"object and updates text feature vocabulary (usedFeatures/knownFeatures). - Bumps layer schema minor version from 1.9 → 1.10 and updates docs describing the new diagnostics/export contract.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/paint/text_v2.rs |
New Text IR v2 diagnostics/guards module (slot diagnostics, validation issues, line-break risk telemetry). |
src/paint/json.rs |
Adds "textV2" diagnostics object to exported JSON and updates feature vocabulary + schema minor assertions. |
src/paint/schema.rs |
Schema minor version bump to 10 and updates stability test. |
src/paint/mod.rs |
Exposes the new text_v2 module and re-exports diagnostics types. |
docs/text-ir-v2.md |
Documents the P13 diagnostics payload and strict-profile/telemetry semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
변경 요약
이번 PR은 render P13 단계로, P12에서 열린 guarded
GlyphRunvariant contract 위에 Text IR v2 diagnostics와 schema closure metadata를 추가합니다.핵심은 기본 렌더링 경로를 바꾸지 않으면서,
TextRunfallback과 optional text variant 사이의 선택 상태를 JSON에서 설명할 수 있게 만드는 것입니다. 즉, 이번 단계는 CanvasKit/native glyph replay를 켜는 PR이 아니라, 후속 backend adoption 전에 fallback reason, strict profile guard, downgrade path를 먼저 안정화하는 PR입니다.Text IR v2 closure 메모
P13은 Text IR v2를 완성하는 단계가 아니라, P11/P12에서 추가한 compatibility contract를 진단 가능한 형태로 닫는 단계입니다. 기존
TextRunfallback은 계속 canonical compatibility path로 남기고,GlyphRun은 optional sidecar variant로만 유지합니다.주요 방향은 아래와 같습니다.
TextRun+ optionalGlyphRun형태를 유지합니다.textV2diagnostics는 renderer output을 바꾸지 않고, consumer가 fallback/variant 상태를 이해하는 데만 씁니다.TextRunfallback이 없는 상태를 validation issue로 보고합니다.자세한 배경과 현재 제한은 문서에 정리했습니다: https://github.com/seo-rii/rhwp/blob/render-p13/docs/text-ir-v2.md
What
src/paint/text_v2.rs추가TextV2DiagnosticsTextV2SlotDiagnosticTextV2VariantDiagnosticTextV2ValidationIssueTextV2LineBreakRiskTextV2CompatibilityProfilePageLayerTree::to_json()에 additivetextV2diagnostics object 추가usedFeatures/knownFeatures에 Text IR v2 diagnostics feature vocabulary 추가1.10으로 올림validate_text_variant_scope()결과를textV2.validationIssues로 노출Non-goals
GlyphRun을 canonical text path로 전환하지 않습니다.GlyphOutline/ outline stroke replay는 포함하지 않습니다.variantOpssidecar reader/writer의 실제 migration은 이 PR에서 완료하지 않습니다.variantOps와 richer outline payload는 같은 Text IR v2 closure 축에 있지만, 이번 PR은 그 전 단계인 diagnostics/downgrade/strict-profile guard를 먼저 여는 범위입니다. 그래서 PR은 draft로 열어두고, 필요하면 같은 branch에 follow-up commit으로 이어 붙일 수 있습니다.Compatibility
textV2diagnostics를 몰라도 기존TextRunfallback을 그대로 사용할 수 있습니다.requiredFeatures는 계속 비워 둡니다.textV2는 additive/report-only payload입니다.compatibilityProfile은v1Compat입니다.schemaV1FlattenedTextRunAndGlyphRundowngrade path를 유지합니다.관련 이슈
Refs #536
테스트
git diff --check upstream/devel...HEADrustfmt --check --edition 2021 src/paint/text_v2.rs src/paint/json.rs src/paint/schema.rsrustfmt --check --edition 2021 --config skip_children=true src/paint/mod.rscargo test --lib -q text_v2cargo test --lib -q paint::cargo test --lib -q text_shapecargo test --lib -q text_variantscargo test --lib -q layer_tree_schema_contract_is_stablecargo test --lib -q serializes_text_and_shape_ops_for_browser_replaycargo test --lib -q serializes_optional_glyph_run_variant_with_text_run_fallbackcargo test --lib -q스크린샷
없음.
이번 PR은 schema/diagnostics export 변경입니다. renderer visual output은 기존
TextRunfallback을 유지합니다.