Skip to content

refactor(path-layer): separate dash arclength from geometry - #10647

Merged
chrisgervang merged 13 commits into
masterfrom
codex/path-style-dash-varyings
Nov 24, 2026
Merged

chrisgervang merged 13 commits into
masterfrom
codex/path-style-dash-varyings

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Follow up of #10646

Background

With dashes on, vPathPosition.y carries dash arclength (scaled for Z and camera clipping), so PathLayer's cap and joint tests need a separate vPathBounds varying. Moving the dash coordinate to its own varying keeps vPathPosition geometric in both modes.

Change List

  • PathLayer GLSL/WGSL: replace vPathBounds with vDashSegment (position, segment length)
  • PathStyleExtension: read dash phase and fit length from vDashSegment
  • TripsLayer: compute progress from vDashSegment when dashes are on
  • geometry.uv.y is now geometric distance with dashes on
    • Custom shader injections reading dash arclength should use vDashSegment
  • Unit tests
  • Upgrade guide

No golden images changed. Verified with headless unit tests and the WebGL path-dash, path-layer, polygon-layer and trips-layer render suites.


Note

Medium Risk
Modifies core vertex and fragment shader varyings across GLSL and WGSL in PathLayer, PathStyleExtension, and TripsLayer. Any custom shader injections expecting dash arclength in vPathPosition.y will require updating to vDashSegment.

Overview
Separates dash arclength coordinates from PathLayer geometric coordinates across both GLSL and WGSL shaders. Previously, enabling dashes scaled vPathPosition.y and vPathLength to account for 3D Z-deltas and camera clipping, requiring a separate vPathBounds varying to handle cap and joint tests.

Replaces vPathBounds with a new vDashSegment varying carrying the source-segment dash position and length under DASH_ENABLED. vPathPosition, vPathLength, and geometry.uv.y now remain purely geometric in both dash and non-dash modes, while PathStyleExtension and TripsLayer read vDashSegment for dash rendering and trip progress calculations.

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

@coveralls

coveralls commented Sep 3, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.756% (+0.003%) from 82.753% — codex/path-style-dash-varyings into master

@greptile-apps

greptile-apps Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Separates dash distance from PathLayer’s geometric coordinates in GLSL and WGSL.

  • PathLayer keeps dash distance separate from stroke geometry.
  • Dashed TripsLayer paths keep timestamps tied to source segments.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Path segment] --> B[Geometric position and length]
  A --> C[Source-segment dash position and length]
  B --> D[Cap, joint, and edge coverage]
  C --> E[Dash placement and justification]
  C --> F[Trips timestamp progress]
Loading

Reviews (5) · Last reviewed commit: "Merge branch 'codex/path-style-trips-das..." · Reviewed by Greptile

@chrisgervang
chrisgervang force-pushed the codex/path-style-dash-varyings branch from 5dd2826 to 9519568 Compare September 29, 2026 15:15
@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 4, 2026
@chrisgervang
chrisgervang requested a review from ibgreen November 6, 2026 06:34
# Conflicts:
#	test/render/test-cases/path-dash.spec.ts
…tyle-dash-varyings

# Conflicts:
#	modules/extensions/src/path-style/shaders.glsl.ts
#	modules/geo-layers/src/trips-layer/trips-layer.ts
#	modules/geo-layers/src/trips-layer/trips-layer.wgsl.ts
#	test/modules/extensions/path.spec.ts
#	test/modules/geo-layers/trips-layer.spec.ts
@chrisgervang chrisgervang modified the milestones: v9.4 patch releases, v10 Nov 7, 2026

@athomct athomct 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.

I read through both backends and the cap/joint predicate looks equivalent: the dash coordinate is an affine map of the geometric one, and it maps [0, L] exactly onto the old vPathBounds in both billboard and flat modes, so the fragment tests are unchanged. TripsLayer progress is the same ratio as before, and the offset stage scales both components together. The WebGL path, path-layer and trips render suites pass locally on the top of the stack, and the new clipped Trips golden fails if the TripsLayer change is reverted.

Two small suggestions:

  • geometry.uv.y on a dashed PathLayer changes from dash arclength to geometric distance. The custom-layer docs list DECKGL_FILTER_COLOR and geometry as the public injection surface, so a one-line upgrade-guide note for v10 seems worthwhile, pointing to vDashSegment for the dash coordinate.
  • In trips-layer.spec.ts, the WGSL check asserts the vDashSegment.x position argument but not the vDashSegment.y length argument. Asserting the full DECKGL_FILTER_PATH_COLOR_VERTEX(...) call would catch a regression to vPathLength there, which no render test covers on WebGPU.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@ibgreen ibgreen added the chore label Nov 21, 2026

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Base automatically changed from codex/path-style-trips-dash-baseline to master November 24, 2026 03:43

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@chrisgervang
chrisgervang added this pull request to the merge queue Nov 24, 2026
Merged via the queue into master with commit 63a1e4f Nov 24, 2026
11 of 12 checks passed
@chrisgervang
chrisgervang deleted the codex/path-style-dash-varyings branch November 24, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants