Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adapted_grid failure #4464

Merged
merged 8 commits into from
Oct 17, 2024
Merged

Fix adapted_grid failure #4464

merged 8 commits into from
Oct 17, 2024

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Oct 9, 2024

Description

With Julia 1.11 the "scatter inputs" refimg now fails because rand(MersenneTwister(1337)) which is used in PlotUtils.adapted_grid() produces different results.

With PlotUtils 1.4.2 we switched to a StableRNG for that piece of code which should avoid the version differences but still requires a refimg test update here.

TODO:

  • switch back to Julia 1 in CI
Previous fix

This pr aims to fix the Problem by allowing StableRNG to be passed.

Some Notes:

  • passing the rng through used_attributes may not be a very stable solution, and it requires explicit passing in refimg tests
  • setting the rng as a global ref in Makie and changing it for CI would mean that two plots with same inputs would generate different data as the rng advances
    • calling seed! to reset the rng would solve that issue, but we can't use Random.default_rng() in that case (we mustn't reset the global rng)

Type of change

  • test/CI fix

@ffreyer ffreyer added the skip-changelog Skips changelog enforcer label Oct 17, 2024
@MakieBot
Copy link
Collaborator

MakieBot commented Oct 17, 2024

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(fig)
using create display create display
GLMakie 6.27s (6.22, 6.30) 0.03+- 161.10ms (158.65, 163.56) 1.53+- 472.42ms (468.90, 479.53) 3.67+- 8.10ms (7.99, 8.22) 0.07+- 26.01ms (25.86, 26.12) 0.10+-
master 6.24s (6.20, 6.32) 0.04+- 162.09ms (159.02, 168.56) 3.30+- 472.65ms (468.54, 480.07) 4.17+- 8.12ms (7.87, 8.22) 0.12+- 26.01ms (25.87, 26.28) 0.13+-
evaluation 0.99x invariant, 0.03s (0.91d, 0.12p, 0.04std) 1.01x invariant, -0.99ms (-0.39d, 0.49p, 2.42std) 1.00x invariant, -0.23ms (-0.06d, 0.91p, 3.92std) 1.00x invariant, -0.02ms (-0.16d, 0.77p, 0.10std) 1.00x invariant, -0.0ms (-0.00d, 1.00p, 0.11std)
CairoMakie 6.11s (5.98, 6.24) 0.10+- 164.48ms (159.69, 167.66) 3.13+- 199.38ms (195.38, 204.37) 3.35+- 8.15ms (7.91, 8.30) 0.15+- 1.21ms (1.20, 1.22) 0.01+-
master 6.07s (5.98, 6.20) 0.08+- 162.53ms (159.84, 168.96) 3.59+- 200.32ms (195.82, 205.42) 3.60+- 8.24ms (8.04, 8.34) 0.09+- 1.22ms (1.20, 1.23) 0.01+-
evaluation 0.99x invariant, 0.04s (0.49d, 0.38p, 0.09std) 0.99x invariant, 1.95ms (0.58d, 0.30p, 3.36std) 1.00x invariant, -0.95ms (-0.27d, 0.62p, 3.47std) 1.01x invariant, -0.08ms (-0.66d, 0.25p, 0.12std) 1.00x invariant, -0.0ms (-0.57d, 0.32p, 0.01std)
WGLMakie 6.39s (6.30, 6.55) 0.08+- 164.87ms (160.01, 179.67) 6.80+- 6.12s (6.04, 6.22) 0.06+- 12.65ms (12.28, 13.69) 0.50+- 134.12ms (131.60, 137.26) 2.26+-
master 6.41s (6.33, 6.64) 0.10+- 162.63ms (159.76, 169.43) 3.48+- 6.12s (6.04, 6.33) 0.10+- 12.55ms (12.33, 12.66) 0.11+- 134.48ms (130.07, 141.32) 4.47+-
evaluation 1.00x invariant, -0.02s (-0.21d, 0.71p, 0.09std) 0.99x invariant, 2.24ms (0.41d, 0.46p, 5.14std) 1.00x invariant, -0.01s (-0.09d, 0.86p, 0.08std) 0.99x invariant, 0.1ms (0.28d, 0.62p, 0.30std) 1.00x invariant, -0.37ms (-0.10d, 0.85p, 3.36std)

@ffreyer ffreyer marked this pull request as ready for review October 17, 2024 12:13
@ffreyer ffreyer merged commit c4e9eae into master Oct 17, 2024
19 checks passed
@ffreyer ffreyer deleted the ff/adapted_grid branch October 17, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skips changelog enforcer
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

3 participants