Skip to content

Conversation

@ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Jul 25, 2025

Description

This restores the init-time decision between having a line pattern texture or not, and replaces lastlength arrays with dummy data when they are not needed. This fixes an issue reported on Slack, where random segments of a line disappear:

using GLMakie, Dates
f,a,p = lines(Date(2000):Year(1):Date(2009), rand(10))
grafik

I didn't thoroughly think through the cause of this issue, but it's probably a Float32 precision issue with f_pattern_overwrite in process_pattern() in lines.geom. The dates convert to large numbers ~6e13. Without patterns, GLMakie skipped projections when calculating gl_last_length, so that they ended up with ~6f13 values too. With the pattern texture always given, the shader ended up mixing those values with pixel scale offsets, which are way below float precision. I assume that (or something similar) caused texture sampling to break.

Setting gl_last_length to NaN's, Inf's, zeros, etc fixes the issue. Skipping the pattern::Texture branches does too, and it should improve performance.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@github-project-automation github-project-automation bot moved this to Work in progress in PR review Jul 25, 2025
@MakieBot
Copy link
Collaborator

MakieBot commented Jul 25, 2025

Benchmark Results

SHA: 856c53952e202a756b9e4e6a0d5ea6d8d0b05143

Warning

These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking.

GLMakie
CairoMakie
WGLMakie

@ffreyer ffreyer moved this from Work in progress to Ready to merge in PR review Jul 28, 2025
@ffreyer ffreyer marked this pull request as ready for review July 28, 2025 10:27
@ffreyer ffreyer merged commit 40a1749 into master Jul 28, 2025
24 checks passed
@ffreyer ffreyer deleted the ff/fix-lines branch July 28, 2025 15:01
@github-project-automation github-project-automation bot moved this from Ready to merge to Merged in PR review Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants