Skip to content

The conic rung: elliptical arcs and rounded rects join the admitted slice - #75

Merged
softmarshmallow merged 2 commits into
mainfrom
feat/conic-rung
Aug 6, 2026
Merged

The conic rung: elliptical arcs and rounded rects join the admitted slice#75
softmarshmallow merged 2 commits into
mainfrom
feat/conic-rung

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

What

The declared Next from #43: the third contract amendmentrframe::PathCommand::ConicTo — and the two constructs it unblocks, run through the amendment-before-code ritual (PaintStack and group-scope precedents).

  • rframe: ConicTo { x1, y1, x, y, weight } with a checked positive-finite weight domain (BadConicWeight), rational-derivative tight bounds in f64, and the refusal re-stated: no arc command — the parameterization stays with the producer, exactly as the module doc's reserved slot promised.
  • websem: the A/a arm emits the conversion a 24-probe Chromium matrix decided (details in the D-N register addendum); <rect rx/ry> resolves by the measured auto/clamp matrix and lowers to four cos-45° conics — measured byte-identical to the equivalent A-command contour in Chromium itself, so Geometry needed no rounded-rect variant. CSS rx/ry join the d-property stylesheet patrol (Chromium honors them over the attributes; the pinned cascade can't represent them — a latent silent-divergence class, now declared).
  • n0: one new glyphless projection arm. The kernel already spoke conics end-to-end.

The headline measurement

All eleven new cells bake byte-exact against Chromium 149.0.7827.55 — half-ellipse identity arc, all four flag combos, a rotated elliptical sweep, both degenerate correct-nothings, uniform/elliptical/clamped rounded rects, and both strokes. Zero tolerance blocks. The corpus README's prediction that arcs would inherit the oval cells' conic scan-converter departure was falsified by measurement: that class belongs to the drawOval construction, not the conic curve class.

Graduations

svg-path-arc and svg-rect-rounded leave the refusal register (fixture + row together, per the directory gate); PathDataError::UnsupportedCommand / CompileError::UnsupportedPathCommand are deleted — every command letter of the d grammar now emits. The checklist ticks rx/ry attribute rows; d stays unchecked while the prefix rule is refused (its own rung), and the CSS twins stay unchecked at the pin.

With rx/ry landed, the remaining row-1 scoreboard construct is in hand — the corpus-growth step toward FLIP eligibility no longer waits on capability.

… on ConicTo

The third contract amendment: rframe::PathCommand gains ConicTo
{x1, y1, x, y, weight} — the rational quadratic Chromium's rasterizer
draws arcs and rounded corners through. The weight has its own checked
domain (positive finite, BadConicWeight by index) and conic tight
bounds solve the rational derivative in f64. "No arc command" stands:
the parameterization resolves at the producer, per the module doc's
reserved slot.

websem emits the conversion a 24-probe Chromium matrix decided:
midpoint-frame center parameterization in plain f64, radii abs and
uniform scale-up, zero radius to the authored line, coincident
endpoints elided, at most four segments of at most a quarter turn at
weight cos(step/2), the authored endpoint exact on the last segment,
and no canonicalization anywhere — a circle's rotation cancels
algebraically and the unreduced angle's residue sits below f32.
<rect rx/ry> resolves by the measured matrix (auto adopts the
*authored* twin, then each axis clamps independently; zero squares;
percentages on width/height) and lowers to four cos-45° conics —
measured byte-identical to the equivalent A-command contour in
Chromium itself, so Geometry needs no rounded-rect variant. The CSS
rx/ry spellings join the d-property stylesheet patrol (Chromium honors
them over the attributes; the pinned cascade cannot represent them).

The arc refusal dies by name: PathDataError::UnsupportedCommand and
CompileError::UnsupportedPathCommand are deleted — every command
letter of the d grammar now emits. Malformed stays malformed at the
same offsets, and the whole-path refusal vs Chromium's valid-prefix
rendering is unchanged (the prefix rule remains its own rung).

svg-path-arc and svg-rect-rounded graduate from the refusal register;
eleven cells join the corpus (flags, rotated elliptical sweep,
degenerates, clamp order, elliptical corners, strokes) — every one
byte-exact against Chromium 149.0.7827.55, no tolerance blocks: the
corpus's declared conic departure class is the drawOval construction's,
not the curve's. n0 gains only the one glyphless projection arm; the
kernel already spoke conics.
The D-N register addendum (probe verdicts, the repaid conic slot, the
falsified departure prediction, graduations); the admitted-slice
statement gains the whole path-data grammar and rounded corners; the
corpus README's conic-departure boundary narrows a third time (the
eleven arc/rounded-rect cells bake byte-exact); the Web checklist ticks
rx and ry (attribute rows; d waits on the prefix rule, the CSS twins on
the pin).
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
nothing Ready Ready Preview Aug 6, 2026 5:22am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This change adds rational conic support to path handling, lowers elliptical arcs and rounded rectangles into conics, updates SVG error handling and attribute patrols, and refreshes tests, documentation, and Web-first fixture records.

Changes

SVG conic geometry

Layer / File(s) Summary
Conic path contract and bounds
crates/rframe/src/path.rs, crates/n0/src/glyphless.rs
Adds validated PathCommand::ConicTo, rational conic bounds, related errors, tests, and n0 conversion.
Elliptical arc lowering
crates/websem/src/svg_path.rs, crates/websem/src/svg.rs
Parses elliptical arcs, applies radii and rotation rules, and emits weighted conic segments.
Rounded rectangle compilation
crates/websem/src/svg.rs
Consumes rx and ry, resolves and clamps radii, and emits rounded-rectangle conic paths.
Geometry and corpus validation
crates/websem/tests/*
Tests arc admission, normalization, degenerate cases, malformed flags, and updated unsupported-corpus entries.
Conformance records and documentation
crates/n0_cli/*, docs/wg/consolidation/*, fixtures/web-first/*
Updates capability descriptions, checklists, fixture manifests, rendered-cell counts, and refusal records.

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

Sequence Diagram(s)

sequenceDiagram
  participant SVGParser
  participant SVGCompiler
  participant RFrame
  participant N0
  SVGParser->>SVGCompiler: parse path or rectangle geometry
  SVGCompiler->>RFrame: emit ConicTo commands
  RFrame->>RFrame: validate weights and calculate bounds
  RFrame->>N0: provide checked path commands
  N0->>N0: compile conic geometry
Loading

Possibly related PRs

  • gridaco/nothing#60: Updates the SVG/chassis rendering pipeline and conformance testing used by this change.
  • gridaco/nothing#64: Introduces related Web-first fixture status and documentation updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding conic support for elliptical arcs and rounded rectangles.
Description check ✅ Passed The description directly explains the conic support, SVG features, validation, tests, fixture updates, and removal of obsolete refusal errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/conic-rung

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@fixtures/web-first/primitives.json`:
- Around line 1306-1319: Add the measured boundary distance, channel delta, and
differing-pixel count for the svg-stroke-path-closed aa-boundary-ring tolerance
beside its existing tolerance documentation. If the original render was
byte-exact, remove this tolerance instead; do not leave an undocumented
tolerance entry.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c02b36a5-29d0-4080-a4fd-4c54cca3efcc

📥 Commits

Reviewing files that changed from the base of the PR and between 64ef914 and 7e5d1b4.

⛔ Files ignored due to path filters (22)
  • fixtures/web-first/chromium/svg-path-arc-degenerate.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-path-arc-flags.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-path-arc-rotated.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-path-arc-stroked.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-path-arc.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded-clamp.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded-elliptical.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded-mirror-auto.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded-negative-rx-auto.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded-stroked.png is excluded by !**/*.png
  • fixtures/web-first/chromium/svg-rect-rounded.png is excluded by !**/*.png
  • fixtures/web-first/svg-path-arc-degenerate.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-path-arc-flags.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-path-arc-rotated.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-path-arc-stroked.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-path-arc.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded-clamp.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded-elliptical.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded-mirror-auto.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded-negative-rx-auto.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded-stroked.svg is excluded by !**/*.svg
  • fixtures/web-first/svg-rect-rounded.svg is excluded by !**/*.svg
📒 Files selected for processing (16)
  • crates/n0/src/glyphless.rs
  • crates/n0_cli/README.md
  • crates/n0_cli/src/main.rs
  • crates/rframe/src/path.rs
  • crates/websem/src/svg.rs
  • crates/websem/src/svg_path.rs
  • crates/websem/tests/best_effort.rs
  • crates/websem/tests/paths_contract.rs
  • crates/websem/tests/unsupported_corpus.rs
  • docs/wg/consolidation/svg-engine-of-record.md
  • docs/wg/consolidation/web-checklist.md
  • fixtures/web-first/README.md
  • fixtures/web-first/STATUS.md
  • fixtures/web-first/oracle-bake.json
  • fixtures/web-first/primitives.json
  • fixtures/web-first/unsupported/README.md
💤 Files with no reviewable changes (2)
  • crates/websem/tests/unsupported_corpus.rs
  • fixtures/web-first/unsupported/README.md

Comment on lines +1306 to +1319
"height": 64,
"tolerance": {
"kind": "aa-boundary-ring",
"max_differing_pixels": 4,
"max_channel_delta": 3,
"boundaries": [
{
"cx": 16,
"cy": 48,
"rx": 6,
"ry": 6
}
]
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Determine whether the svg-stroke-path-closed tolerance is new in this PR.
set -euo pipefail

file="fixtures/web-first/primitives.json"
base=$(git merge-base HEAD origin/main 2>/dev/null || git rev-parse HEAD~1)

echo "=== tolerance at $base ==="
git show "$base:$file" 2>/dev/null \
  | jq '.fixtures[] | select(.id == "svg-stroke-path-closed")' \
  || echo "fixture absent at base"

echo "=== tolerance at HEAD ==="
jq '.fixtures[] | select(.id == "svg-stroke-path-closed")' "$file"

echo "=== did the oracle or source bytes change? ==="
git diff --stat "$base" -- \
  fixtures/web-first/svg-stroke-path-closed.svg \
  fixtures/web-first/chromium/svg-stroke-path-closed.png

echo "=== every cell that carries a tolerance at HEAD ==="
jq -r '.fixtures[] | select(has("tolerance")) | "\(.id)\t\(.tolerance.kind)\t\(.tolerance.max_differing_pixels)"' "$file"

Repository: gridaco/nothing

Length of output: 1564


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== relevant docs mentioning svg-stroke-path-closed ==="
rg -n "svg-stroke-path-closed|stroke-path-closed|conic addendum|aa-boundary-ring|max_differing_pixels" docs fixtures/web-first/primitives.json -S || true

echo
echo "=== svg-stroke-path-closed fixture entry with context ==="
python3 - <<'PY'
import json
from pathlib import Path
p=Path("fixtures/web-first/primitives.json")
data=json.loads(p.read_text())
for i,x in enumerate(data["fixtures"]):
    if x["id"]=="svg-stroke-path-closed":
        print({"index": i, "entry": x})
        break
PY

echo
echo "=== exact diff for primitives around the cell ==="
git diff --unified=0 origin/main -- fixtures/web-first/primitives.json | sed -n '1,220p' | rg -A 80 -B 80 "svg-stroke-path-closed|max_differing_pixels|aa-boundary-ring" || true

echo
echo "=== all source/oracle changes touching primitives in fixtures/doc paths ==="
git diff --stat origin/main -- fixtures docs | sed -n '1,160p'

Repository: gridaco/nothing

Length of output: 11934


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== docs/wg/consolidation/svg-engine-of-record.md relevant section ==="
awk '/conic addendum|aa-boundary-ring|max_differing_pixels|max pixels|pixel|boundary|tolerance|rect|arc|stroke/{p=NR-8; q=NR+8} NR>=p && NR<=q {print NR": "$0}' docs/wg/consolidation/svg-engine-of-record.md | sed -n '1,220p'

echo
echo "=== primitive around svg-stroke-path-closed with 8-line context ==="
python3 - <<'PY'
import json
from pathlib import Path
data=json.loads(Path("fixtures/web-first/primitives.json").read_text())
for i in data["fixtures"]:
    if i["id"]=="svg-stroke-path-closed":
        idx=data["fixtures"].index(i)
        for j in range(max(0, idx-8), min(len(data["fixtures"]), idx+9)):
            print(data["fixtures"][j])
        break
PY

Repository: gridaco/nothing

Length of output: 18860


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== svg-stroke-path-closed source ==="
cat -n fixtures/web-first/svg-stroke-path-closed.svg

echo
echo "=== svg-stroke-path-closed-oracle metadata if present ==="
python3 - <<'PY'
import json
from pathlib import Path
p=Path("fixtures/web-first/oracle-bake.json")
if p.exists():
    data=json.loads(p.read_text())
    keys=list(data.keys())
    print("keys:", keys)
    for i,k in enumerate(keys):
        if "svg-stroke-path-closed" in k or "primitive" in k or "svg" in k:
            print(i, k)
    for k in keys:
        v=data[k]
        if isinstance(v, dict):
            if k == "crates/svg":
                pass
        if "svg-stroke-path-closed" in k:
            print(k, json.dumps(v, indent=2)[:4000])
else:
    print("missing oracle-bake.json")
PY

Repository: gridaco/nothing

Length of output: 579


Record the measured bound before accepting the tolerance.

svg-stroke-path-closed now has a new aa-boundary-ring tolerance, but the curve tolerance rationale only describes arc/ellipse curved cells. Add the measurement (boundary distance, delta, count) beside the existing tolerance documentation, or remove the tolerance if the original render was byte-exact.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@fixtures/web-first/primitives.json` around lines 1306 - 1319, Add the
measured boundary distance, channel delta, and differing-pixel count for the
svg-stroke-path-closed aa-boundary-ring tolerance beside its existing tolerance
documentation. If the original render was byte-exact, remove this tolerance
instead; do not leave an undocumented tolerance entry.

@softmarshmallow
softmarshmallow merged commit ee66801 into main Aug 6, 2026
15 checks passed
@softmarshmallow
softmarshmallow deleted the feat/conic-rung branch August 6, 2026 05:46
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