Skip to content

render: keep v2 authority gaps on text fallback#1429

Merged
jangster77 merged 6 commits into
edwardkim:develfrom
seo-rii:render-p26
Jun 18, 2026
Merged

render: keep v2 authority gaps on text fallback#1429
jangster77 merged 6 commits into
edwardkim:develfrom
seo-rii:render-p26

Conversation

@seo-rii

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

Copy link
Copy Markdown
Contributor

What

P26 단계로 Text IR v2의 authority gap을 더 보수적으로 닫았습니다.

  • MixedPerGlyph glyph run은 mixedPerGlyphAuthorityPending으로 reject하고 TextRun fallback을 유지합니다.
  • glyphTransforms가 있는 glyph run은 glyphTransformAuthorityPending으로 reject하고 TextRun fallback을 유지합니다.
  • vertical glyph orientation은 verticalGlyphOrientationAuthorityPending으로 reject하고 TextRun fallback을 유지합니다.
  • TextV2Diagnostics도 위 케이스를 strict variant로 보지 않고 같은 fallback reason을 보고합니다.
  • lineBreakRisks는 strict variant가 있는 경우 fallbackFreeStrict에서도 report-only telemetry로 남도록 고정했습니다.
  • P25 리뷰 코멘트의 font proof boundary를 반영해, font resolution/metrics만으로 public GlyphRun을 내보내지 않는 회귀 테스트를 추가했습니다.
  • docs/text-ir-v2.md에 P26 authority follow-up과 font metrics/proof boundary를 정리했습니다.

Why

P25까지 exact font replay proof corpus를 넓혔지만, Text IR v2에는 아직 future vocabulary가 남아 있습니다. MixedPerGlyph, per-glyph transform, vertical orientation 같은 값은 schema vocabulary로는 존재하지만, cluster/grapheme orientation, transform replay, vertical fixture, backend fallback policy가 함께 증명되기 전까지 stable backend replay contract로 보면 안 됩니다.

이번 PR은 새 replay family를 여는 변경이 아닙니다. 오히려 experimental vocabulary가 strict GlyphRun으로 선택되지 않도록 deterministic reject reason을 추가하고, 기존 TextRun fallback을 유지하는 단계입니다.

#1421 리뷰에서 나온 font resolver/proof boundary 정리는 별도 후속으로 두는 게 맞다고 봅니다. 메트릭 DB, runtime fallback, portable fontResources identity를 섞지 않는 방향은 유지하되, 이 PR에서는 font resolver를 확장하지 않지만, resolver가 font availability/metrics 수준만 제공할 때는 public GlyphRun을 내보내지 않는 contract를 테스트로 고정합니다.

Compatibility

  • 기본 TextRun fallback 경로는 유지됩니다.
  • horizontal glyph run의 기존 strict selection 조건은 유지됩니다.
  • MixedPerGlyph, glyphTransforms, vertical glyph orientation은 새 reason으로 fallback합니다.
  • lineBreakRisks는 validation error가 아니라 telemetry로 유지됩니다.
  • schema/JSON 출력 형식 자체를 바꾸지는 않습니다.

Non-goals

  • MixedPerGlyph 또는 per-glyph transform replay를 구현하지 않습니다.
  • vertical glyph orientation direct replay를 구현하지 않습니다.
  • shapedModern, cross-scope variants, public MixedPerGlyph writer emission을 열지 않습니다.
  • font resolver/proof boundary나 --font-path/embedded font 후보 연결은 이 PR에 넣지 않습니다.

Checks

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

Refs #536

@seo-rii seo-rii marked this pull request as ready for review June 18, 2026 01:35
Copilot AI review requested due to automatic review settings June 18, 2026 01:35

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

Tightens Text IR v2 “strict GlyphRun” selection/diagnostics so that experimental vocabulary (mixed-per-glyph orientation, per-glyph transforms, vertical orientation) is deterministically rejected and the existing TextRun fallback remains authoritative until the replay contract is proven.

Changes:

  • Added explicit authority-pending reject reasons for MixedPerGlyph, glyphTransforms, and vertical orientations, and locked them down with new selection tests.
  • Updated TextV2Diagnostics strict/fallback logic to treat those cases as non-strict and to report the same authority-pending fallback reasons.
  • Added a regression test ensuring “font resolution/metrics only” does not emit public GlyphRuns, and documented P26 authority/proof boundaries.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/renderer/layer_renderer.rs Adds new VariantRejectReasons and gates GlyphRun selection with authority-pending reasons + tests.
src/paint/text_v2.rs Updates strictness + fallback-reason computation to account for orientation/transforms and keeps line-break risks report-only.
src/paint/text_shape.rs Adds regression test ensuring lack of shaping proof prevents public GlyphRun emission.
docs/text-ir-v2.md Documents P26 authority follow-ups and clarifies font metrics vs replay-proof boundary.

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

Comment thread src/renderer/layer_renderer.rs Outdated
Comment on lines 543 to 545
if !matches!(run.orientation, GlyphRunOrientation::Horizontal) {
reasons.insert(VariantRejectReason::UnsupportedPaintEffect);
}
Comment thread src/renderer/layer_renderer.rs Outdated
}

#[test]
fn mixed_per_glyph_runs_keep_text_fallback_until_transform_authority_exists() {
@jangster77 jangster77 merged commit ed49d21 into edwardkim:devel Jun 18, 2026
7 checks passed
@jangster77

Copy link
Copy Markdown
Collaborator

@seo-rii 감사합니다. PR #1429 머지 완료했습니다.

Text IR v2 P26 단계에서 MixedPerGlyph, glyphTransforms, vertical orientation을 안정 replay contract로 오인하지 않도록 authority pending reason으로 명확히 막고, TextRun fallback을 유지하는 방향이 적절했습니다.

검증 결과:

  • GitHub Actions: Build & Test, Canvas visual diff, CodeQL 모두 통과
  • 로컬 targeted test:
    • paint::text_v2 통과
    • renderer::layer_renderer 통과
    • font_resolution_without_shaping_proof_never_emits_public_glyph_runs 통과

#536은 트래킹 이슈라 이번 PR merge 후에도 open 상태로 유지하겠습니다. 기여 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants