Skip to content

Round join tessellation and CPU edge accuracy - #417

Merged
JimBobSquarePants merged 2 commits into
release/3.1.xfrom
js/round-join-arc-guard
Sep 11, 2026
Merged

Round join tessellation and CPU edge accuracy#417
JimBobSquarePants merged 2 commits into
release/3.1.xfrom
js/round-join-arc-guard

Conversation

@JimBobSquarePants

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Round joins in both backends computed their arc step with an unguarded expression, while round caps used a guarded one. A zero or negative ArcDetailScale turned round joins into bevels on the CPU and gave the GPU an undefined vertex count. Joins now share the cap helper, and StrokeOptions.ArcDetailScale rejects values that are not greater than zero.

Parity tests at non-default scales exposed three CPU rasterizer errors on antialiased edges. Band boundary X accumulated truncation across 16 row bands, so long slanted edges drifted by up to a few hundredths of a pixel. Coverage was quantized to 1/256 steps before the blend. The DDA walkers floored every row and column boundary. All three are fixed, and CPU and GPU output now agree to the precision of the CPU's 24.8 fixed point geometry.

Reference images are updated for the corrected edge coverage.

…PU edge accuracy

- CalcArc and stroke_calc_arc take their vertex count from the guarded
  GetArcSubdivisionCount and stroke_arc_subdivision_count used by round caps.
- StrokeOptions.ArcDetailScale rejects values not greater than zero.
- DefaultRasterizer: band boundary X is interpolated from the segment
  endpoint and rounded to nearest, coverage uses the exact doubled area,
  and the DDA walkers round row and column boundaries to nearest.
- Tests: ArcDetailScale validation, subdivision count monotonicity, and
  CPU/GPU parity theories for round joins at scales 0.01 to 16.
- Reference images updated for the corrected edge coverage.
@JimBobSquarePants JimBobSquarePants added the bug Something isn't working label Sep 11, 2026
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79%. Comparing base (61bd770) to head (9bbd0a5).

Files with missing lines Patch % Lines
...ng/Processing/Backends/DefaultRasterizer.Stroke.cs 87% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release/3.1.x    #417   +/-   ##
=============================================
  Coverage             79%     79%           
=============================================
  Files                232     232           
  Lines              27356   27359    +3     
  Branches            3113    3114    +1     
=============================================
+ Hits               21875   21879    +4     
+ Misses              4589    4587    -2     
- Partials             892     893    +1     
Flag Coverage Δ
unittests 79% <96%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JimBobSquarePants
JimBobSquarePants merged commit 9b612ed into release/3.1.x Sep 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant