Skip to content

test(render): render PathStyleExtension dash cases under GlobeView - #10664

Merged
chrisgervang merged 7 commits into
masterfrom
claude/path-style-globe-GveWO
Oct 3, 2026
Merged

chrisgervang merged 7 commits into
masterfrom
claude/path-style-globe-GveWO

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Follow up of #10657

PathStyleExtension needs no change for GlobeView: dashMode: 'path' accumulates offsets in the active projection's common space, PathLayer measures segments in the same space, and PathLayer invalidates instanceDashOffsets when projectionMode changes at the zoom-12 hand-off. This had not been verified. Tests and docs only.

MapView left, GlobeView right
path-dash-billboard-map-z10-map-vs-globe: 8 px [4, 5] dashes with highPrecisionDash, flat (red) and billboard (blue), dense and sparse paths, zoom 10
path-dash-units-z12-map-vs-globe: dashMode: 'path' with dashUnits: 'widths' (top) and 'pixels' (bottom), zoom 12

No before images: both cases pass on master with this PR's spec, so the images show current behavior. Dash size, gap and phase continue across the centre seam.

Change List

  • path-dash.spec.ts: path-dash-billboard-map-z10 and path-dash-units-z12 also render as one side-by-side image, MapView on the left and GlobeView on the right at the same view state (withGlobeSideBySide)
  • New goldens path-dash-billboard-map-z10-map-vs-globe.png and path-dash-units-z12-map-vs-globe.png. The globe half is about 4% larger and a few pixels lower than the map half: SwiftShader's fp32 sin/cos in project_globe_ displace the sphere surface by a constant amount, which perspective turns into a uniform scale. The CPU projection matches Mercator to 0.03 px. Documented on the helper
  • Unit test: getDashOffsets on GlobeViewport equals the cumulative sphere chord distance and matches the instanceDashOffsets total
  • Documentation: docs/whats-new.md GlobeView compatibility bullet

Ran the render spec headless on WebGL, the unit spec, tsc and lint.


Note

Low Risk
Documentation and test coverage only; no production code paths are modified.

Overview
Adds tests and release notes only—no runtime changes. The work documents and locks in that PathStyleExtension path dashes already match MapView on GlobeView, because offsets and segment lengths use the active projection’s common space (sphere chords below the zoom‑12 handoff).

Render suite: path-dash.spec.ts introduces withGlobeSideBySide (MapView left, GlobeView right, same view state) plus helpers createBillboardMapCase and createDashUnitsCase. New golden cases path-dash-billboard-map-z10-map-vs-globe and path-dash-units-z12-map-vs-globe assert dash size, gap, and phase stay continuous across the seam; globe half uses a slightly looser diff threshold for SwiftShader fp32 drift.

Unit test: On a GlobeViewport, getDashOffsets must equal cumulative chord distance in sphere common space, align with instanceDashOffsets, and differ from Web Mercator distances.

Docs: whats-new.md adds a GlobeView compatibility bullet for PathStyleExtension dashes.

Reviewed by Cursor Bugbot for commit 5e7316e. Bugbot is set up for automated code reviews on this repo. Configure here.

@coveralls

coveralls commented Sep 7, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.524% (-0.003%) from 82.527% — claude/path-style-globe-GveWO into master

@chrisgervang
chrisgervang marked this pull request as ready for review September 7, 2026 08:12
@greptile-apps

greptile-apps Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Adds test cases and golden images for path rendering.

The PR appears safe to merge; both previous findings are resolved and no new actionable issue was identified.

Summary

The PR adds side-by-side MapView and GlobeView dash-rendering goldens, a globe common-space dash-offset unit test, and a release note. No new actionable issue was identified since the previous review.

Reviews (8) · Last reviewed commit: "test(render): shorten the withGlobeSideB..."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is there a bump in the lower two lines

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. It is not a dash artefact: the whole GlobeView half is rendered about 4% larger than the MapView half and shifted ~5 px south, so the two southern paths (at −90/−150 px from centre) land 9–12 px lower on the globe side while the northern ones happen to line up (measured row centres: map 74.5/134.5/314.5/374.5 vs globe 74.5/136.5/323.5/386.5).

What I found tracking it down:

  • CPU math is exact. GlobeViewport.project and WebMercatorViewport.project agree to within 0.03 px for these lines at zoom 10 and 12, so the zoom adjustment / camera placement is not the cause.
  • It comes from the vertex shader's project_globe_. A probe with ScatterplotLayer points at ±30…±210 px offsets in a full-width GlobeView:
    • SF, zoom 12, LNGLAT: uniform ~3.9% magnification (zoom 10: ~0.9%)
    • SF, zoom 12, METER_OFFSETS (origin projected on the CPU, no per-vertex trig): pixel-identical to MapView
    • (0, 0), zoom 12, LNGLAT: pixel-identical to MapView
    • lng −122.4 / lat 0: ~0.9%; lng 0 / lat 37.78: ~3.1%
  • Mechanism: SwiftShader's fp32 sin/cos have an absolute error of roughly 5e-5 (Vulkan only guarantees 2^-11). That displaces the computed sphere position by a constant ~0.015 common units. The radial component moves the surface toward the camera, which at 1.5 viewport heights turns into a uniform perspective scale; the tangential component is the constant shift. Because the error is constant across the tiny visible patch, it looks like scale + offset rather than noise. Hardware GPUs are ~1 ulp here, so on real devices this should be sub-pixel.

This is also the real reason globe goldens have needed the looser 0.985 threshold (the old "tessellation" comment was wrong). f7aaa69 documents it on withGlobeSideBySide so the next reader of these images isn't puzzled. Happy to instead move the paths closer to the centre or use METER_OFFSETS geometry if you'd prefer the seam to be visually clean; I kept LNGLAT since that is what users draw.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure.. by bump do you mean the dashes appear to have different widths?

(Btw, Claude will hopefully not auto-respond anymore.. that was only intended for Greptile and CI issues)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

I meant this step, perhaps it is correct. It just looked odd to me

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh! I was looking at the wrong image which doesn't help..

It's quite odd but accurate - the image is a side by side of a map and globe view, so the jump is just the difference between these views

image

It might be interesting to have more general view comparison render tests - I think this is the first one that looks at this.

And maybe it'd be clearer if the test drew a line down the middle and/or text.. slightly less "pure" of a render test since it'd use deck features to draw, but idk.. maybe it'd be worth it for clarity.

Wdyt?

Base automatically changed from claude/globe-flat-common-helpers-GveWO to master September 25, 2026 17:34
@chrisgervang
chrisgervang force-pushed the claude/path-style-globe-GveWO branch from f7aaa69 to a10f2db Compare September 25, 2026 17:37
Comment thread docs/whats-new.md Resolved
claude added 7 commits October 3, 2026 22:08
PathStyleExtension needs no code change for GlobeView, but that had never been
verified empirically. This adds the proof and documents the reasoning.

dashMode 'path' accumulates dash offsets on the CPU as vec3.dist of
layer.projectPosition(p, {autoOffset: false}), i.e. in the active projection's
common space (sphere XYZ, GLOBE_RADIUS 256, under GlobeViewport). The dash
shader converts them with `instanceDashOffsets * project.scale / dashWidthPixels`
and PathLayer measures segment lengths in the same common space, so both sides
agree in either projection and GlobeViewport.scale converts them to pixels
consistently with Web Mercator (px/km ratio globe/Mercator = 1.00000 at z10-z12).
projectRenderedPathPosition's Taylor branch is guarded by
`instanceof WebMercatorViewport && zoom >= 12`, and PathLayer invalidates
instanceDashOffsets when viewport.projectionMode changes, so the zoom-12
Globe->Mercator handoff is covered too.

Render: path-dash-billboard-map-z10 and path-dash-units-z12 are expanded with
expandViewMatrix(['map', 'globe']) via a small withGlobeVariant helper, keeping
their existing viewState so the map goldens are unchanged. The two new globe
goldens show the same rows, dash lengths, gaps and phase as their map twins
(z10: 16 px dash / 20 px gap in both). z14/z18 are above GlobeView's handoff
and stay map-only.

Observation while baselining: under the Chromium/SwiftShader render device the
whole GlobeView picture at z12 is ~4% magnified and shifted ~6 px relative to
GlobeViewport.project() (z10: ~1%). A ScatterplotLayer probe and a solid
PathLayer show the identical displacement, and a GLSL probe measures
SwiftShader sin/cos errors of 2.6e-5..4.1e-5 (|p| - 1 = 6.1e-5 for the unit
sphere position), which fully accounts for it. It is a property of the render
GPU's trig precision in project_globe_, common to every layer on GlobeView,
and not related to dashing; the globe goldens therefore carry it.

Unit: a GlobeViewport testCase asserts getDashOffsets(path) equals the
cumulative chord distance of GlobeViewport.projectPosition of the vertices,
differs from the Mercator distance, and matches the instanceDashOffsets total.

Docs: Limitations paragraph describing GlobeView support for dashMode 'path'.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…isely

Replace the implementation-level paragraph under Limitations with a single
remark: dashes render the same in GlobeView as in MapView for every dashMode
and dashUnits, including across the zoom-12 hand-off to Web Mercator. It is
an expectation, not a limitation, so it moves above the Limitations heading.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…by side

Replace the separate -globe goldens with a single multi-view image per
case: MapView on the left half and GlobeView on the right half, both at
the same view state. Dashes that cross the seam line up only if size,
gap and phase agree between the two projections, which is the actual
behaviour under test.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…oldens

The globe half of the side-by-side PathStyle goldens is magnified by a few
percent and shifted by a few pixels relative to the map half. Document the
cause in the helper: fp32 sin/cos in the globe vertex projection under
SwiftShader displace the sphere surface by a constant amount, which perspective
turns into a uniform scale. The CPU viewport math is exact, and the effect
vanishes at the origin and for meter-offset geometry.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
@chrisgervang
chrisgervang force-pushed the claude/path-style-globe-GveWO branch from 5e7316e to 0657342 Compare October 3, 2026 22:12
@chrisgervang
chrisgervang merged commit cad03c3 into master Oct 3, 2026
7 checks passed
@chrisgervang
chrisgervang deleted the claude/path-style-globe-GveWO branch October 3, 2026 22:30
@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 4, 2026
@chrisgervang chrisgervang mentioned this pull request Oct 7, 2026
53 of 66 tasks
chrisgervang added a commit that referenced this pull request Oct 22, 2026
…10664)

* test(render): render PathStyleExtension dash cases under GlobeView

PathStyleExtension needs no code change for GlobeView, but that had never been
verified empirically. This adds the proof and documents the reasoning.

dashMode 'path' accumulates dash offsets on the CPU as vec3.dist of
layer.projectPosition(p, {autoOffset: false}), i.e. in the active projection's
common space (sphere XYZ, GLOBE_RADIUS 256, under GlobeViewport). The dash
shader converts them with `instanceDashOffsets * project.scale / dashWidthPixels`
and PathLayer measures segment lengths in the same common space, so both sides
agree in either projection and GlobeViewport.scale converts them to pixels
consistently with Web Mercator (px/km ratio globe/Mercator = 1.00000 at z10-z12).
projectRenderedPathPosition's Taylor branch is guarded by
`instanceof WebMercatorViewport && zoom >= 12`, and PathLayer invalidates
instanceDashOffsets when viewport.projectionMode changes, so the zoom-12
Globe->Mercator handoff is covered too.

Render: path-dash-billboard-map-z10 and path-dash-units-z12 are expanded with
expandViewMatrix(['map', 'globe']) via a small withGlobeVariant helper, keeping
their existing viewState so the map goldens are unchanged. The two new globe
goldens show the same rows, dash lengths, gaps and phase as their map twins
(z10: 16 px dash / 20 px gap in both). z14/z18 are above GlobeView's handoff
and stay map-only.

Observation while baselining: under the Chromium/SwiftShader render device the
whole GlobeView picture at z12 is ~4% magnified and shifted ~6 px relative to
GlobeViewport.project() (z10: ~1%). A ScatterplotLayer probe and a solid
PathLayer show the identical displacement, and a GLSL probe measures
SwiftShader sin/cos errors of 2.6e-5..4.1e-5 (|p| - 1 = 6.1e-5 for the unit
sphere position), which fully accounts for it. It is a property of the render
GPU's trig precision in project_globe_, common to every layer on GlobeView,
and not related to dashing; the globe goldens therefore carry it.

Unit: a GlobeViewport testCase asserts getDashOffsets(path) equals the
cumulative chord distance of GlobeViewport.projectPosition of the vertices,
differs from the Mercator distance, and matches the instanceDashOffsets total.

Docs: Limitations paragraph describing GlobeView support for dashMode 'path'.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* docs(extensions): state PathStyleExtension GlobeView expectation concisely

Replace the implementation-level paragraph under Limitations with a single
remark: dashes render the same in GlobeView as in MapView for every dashMode
and dashUnits, including across the zoom-12 hand-off to Web Mercator. It is
an expectation, not a limitation, so it moves above the Limitations heading.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* test(render): compare PathStyle dashes in MapView and GlobeView side by side

Replace the separate -globe goldens with a single multi-view image per
case: MapView on the left half and GlobeView on the right half, both at
the same view state. Dashes that cross the seam line up only if size,
gap and phase agree between the two projections, which is the actual
behaviour under test.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* test(render): explain the GlobeView half offset in the map-vs-globe goldens

The globe half of the side-by-side PathStyle goldens is magnified by a few
percent and shifted by a few pixels relative to the map half. Document the
cause in the helper: fp32 sin/cos in the globe vertex projection under
SwiftShader displace the sphere surface by a constant amount, which perspective
turns into a uniform scale. The CPU viewport math is exact, and the effect
vanishes at the origin and for meter-offset geometry.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* docs(extensions): PathStyleExtension GlobeView note in what's new instead of Remarks

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* docs: narrow the PathStyleExtension GlobeView release note

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* test(render): shorten the withGlobeSideBySide comment

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

---------

Co-authored-by: Claude <[email protected]>
(cherry picked from commit cad03c3)
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.

4 participants