Skip to content

websem: admit static nearest SVG text faces - #129

Merged
softmarshmallow merged 1 commit into
mainfrom
rung/svg-text-nearest-face-selection
Sep 4, 2026
Merged

websem: admit static nearest SVG text faces#129
softmarshmallow merged 1 commit into
mainfrom
rung/svg-text-nearest-face-selection

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

Verdict

T5c is ADMIT / SPLIT.

This advances the admitted SVG text slice from exact-only face selection to deterministic nearest static face selection. It does not tick any checklist row: wider fractional weights, arbitrary stretch percentages, oblique angles, descriptor grammar, variable-font selection, and synthesized faces remain separate work.

  • advances the oracle contract to textlayout-v7
  • selects by family, then stretch, style, and weight in CSS Fonts order
  • never uses manifest order to break an equal winning tuple
  • preserves family-list boundaries
  • refuses equal winners as AmbiguousFace
  • refuses required synthetic bold or italic as SyntheticFaceRequired before shaping
  • keeps strict and best-effort behavior named and path-stable

Chromium measurement

Measured with Chromium 149.0.7827.55.

The committed cell covers 16 discriminating branches:

  • both stretch directions
  • all three weight search regions, seams, and extremes
  • stretch-before-style-before-weight precedence
  • finite normal/italic fallback
  • first-reached-family behavior

Every losing-branch mutation changes exactly 85 pixels at maximum channel delta 255. An independent all-exact-Ahem construction is RGBA-identical to the admitted result.

Equal winning tuples remain CSS source-order sensitive (measured, not celled), so environment order is deliberately not a tie-breaker.

Chromium begins synthetic bold at requested weight 600 when the selected face is below 600; selected weight 600 suppresses it. Synthetic italic and combined synthesis are also observable. Outline calibration did not produce a stable platform-independent realization (measured, not celled), so synthesis is quarantined for a later rung instead of emitting wrong pixels.

Evidence and records

  • text corpus: 14 Chromium-baked cells
  • geometry witnesses: 8
  • named refusal register: 224 rows, unchanged (one refusal row replaced)
  • one new exact-byte Chromium oracle; no tolerance
  • one synthesis refusal fixture covering weight, style, and both
  • no checklist boxes changed
  • no FLIP record or baseline touched
  • no conformance score produced or inspected

The new cell renders through the actual cargo run -p n0_cli --bin n0 seam and is RGBA-identical to Chromium.

Gate sensitivity

Before trusting the gate, I deliberately reversed the 400–500 weight branch. The full fixture gate failed loudly on the new cell by selecting its Allerta losing control. I restored the implementation and reran the full gate green.

Verification

  • cargo test -p textlayout -p csscascade -p websem -p rframe -p n0 -p n0_cli
  • cargo fmt --all
  • cargo clippy --no-deps
  • just bake
  • just text-bake
  • just text-geometry-bake
  • just gate
  • just status
  • strict and best-effort cargo run probes for all 55 measured candidates
  • local link and pre-PR OSS audits

The configured Workflow runner is not exposed in this environment. I therefore reproduced the independent TICK/LAW and REPRO roles by hand, applied their findings, and reran the affected checks. Both manual reviews pass.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nothing Ready Ready Preview Sep 4, 2026 7:42am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 8a87fb2f-22d5-4991-a79e-0163623a8f9f

📥 Commits

Reviewing files that changed from the base of the PR and between 10f94f4 and 67fe8c4.

⛔ Files ignored due to path filters (4)
  • fixtures/web-first/text/chromium/svg-text-nearest-face-selection.png is excluded by !**/*.png
  • fixtures/web-first/text/svg-text-nearest-face-selection.svg is excluded by !**/*.svg
  • fixtures/web-first/unsupported/svg-text-face-descriptor-unmatched.svg is excluded by !**/*.svg
  • fixtures/web-first/unsupported/svg-text-face-synthesis-required.svg is excluded by !**/*.svg
📒 Files selected for processing (25)
  • crates/n0_cli/README.md
  • crates/n0_cli/src/main.rs
  • crates/textlayout/Cargo.toml
  • crates/textlayout/src/artifact.rs
  • crates/textlayout/src/environment.rs
  • crates/textlayout/src/face_descriptor.rs
  • crates/textlayout/src/lib.rs
  • crates/textlayout/src/resolve.rs
  • crates/textlayout/tests/oracle_v7.rs
  • crates/textlayout/tests/oracle_v7_face_selection.rs
  • crates/websem/tests/support/fixture_fonts.rs
  • crates/websem/tests/svg_text.rs
  • crates/websem/tests/svg_text_geometry.rs
  • crates/websem/tests/unsupported_corpus.rs
  • docs/wg/consolidation/index.md
  • docs/wg/consolidation/svg-engine-of-record.md
  • docs/wg/consolidation/text-oracle.md
  • docs/wg/consolidation/web-checklist.md
  • fixtures/web-first/README.md
  • fixtures/web-first/STATUS.md
  • fixtures/web-first/fonts/README.md
  • fixtures/web-first/text/README.md
  • fixtures/web-first/text/cases.json
  • fixtures/web-first/text/oracle-bake.json
  • fixtures/web-first/unsupported/README.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Oracle v7 replaces exact static face matching with directional nearest-face selection. It adds typed refusals for synthetic weight/style and winning-tuple ambiguity, expands SVG and CLI coverage, and records the new fixture and documentation state.

Changes

Static nearest-face selection

Layer / File(s) Summary
Static matching policy
crates/textlayout/src/environment.rs, crates/textlayout/src/face_descriptor.rs, crates/textlayout/src/lib.rs
The resolver selects stretch, style, and weight in order within the first reached family. It returns the selected static descriptor.
Resolution and refusal boundaries
crates/textlayout/src/resolve.rs, crates/textlayout/tests/*
Resolution reports synthetic weight/style requirements and winning-tuple ambiguity. Tests cover directional searches, lexicographic ordering, synthesis, and environment-order independence.
SVG integration and fixture validation
crates/n0_cli/src/main.rs, crates/websem/tests/*, fixtures/web-first/text/*
CLI and SVG tests validate nearest-face rendering, synthetic refusals, pinned fonts, and the new nearest-face fixture.
Oracle and fixture documentation
crates/n0_cli/README.md, docs/wg/consolidation/*, fixtures/web-first/*
Documentation records Oracle v7, the T5c rung, updated suite counts, refusal entries, and fixture font aliases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 67fe8

The nearest-face resolver change is permitted in this crate, and no actionable current-head risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant SVG
  participant TextLayout
  participant FontEnvironment
  participant ChromiumOracle
  SVG->>TextLayout: submit font request
  TextLayout->>FontEnvironment: select static nearest face
  FontEnvironment-->>TextLayout: return selected descriptor or ambiguity
  TextLayout-->>SVG: render or refuse synthesis
  SVG->>ChromiumOracle: compare rendered pixels
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 12 files. (13 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the nearest-face selection changes, refusal behavior, Chromium evidence, affected scope, and verification steps.
Title check ✅ Passed The title clearly and concisely identifies the main change: admitting static nearest SVG text face selection.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 78.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 12 files. (13 skipped: 13 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rung/svg-text-nearest-face-selection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@softmarshmallow
softmarshmallow merged commit 9b53e7c into main Sep 4, 2026
15 checks passed
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.

1 participant