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

Cleanup voxel clipping #4397

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Cleanup voxel clipping #4397

merged 3 commits into from
Sep 23, 2024

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Sep 22, 2024

Description

My intention for voxel clipping was to make it work based on voxel centers. I didn't bother with that in CairoMakie initially, but updated it in #4319 since mesh based clipping started looked pretty bad. After that there was still some discrepancy between the GL backends and CairoMakie. Turns out I was using voxel origins instead of centers. This pr fixes that and pulls in the CairoMakie changes. It also adjusts the test to avoid voxel centers sitting directly on the clipping plane, since that results in float precision based differences between backends.

This should make the voxel clip plane test fail, but be consistent between all backends.

Type of change

  • Bug fix as it fixes unintended clipping behaviour

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.

@MakieBot
Copy link
Collaborator

MakieBot commented Sep 22, 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 4.55s (4.45, 4.68) 0.07+- 113.59ms (107.91, 124.53) 5.39+- 474.75ms (462.08, 503.56) 14.76+- 9.45ms (9.08, 10.15) 0.38+- 26.60ms (26.39, 26.88) 0.18+-
master 4.53s (4.46, 4.70) 0.08+- 111.07ms (108.93, 114.39) 2.11+- 487.90ms (478.15, 503.62) 8.53+- 9.67ms (9.48, 10.18) 0.26+- 26.51ms (26.36, 26.80) 0.15+-
evaluation 1.00x invariant, 0.02s (0.23d, 0.67p, 0.08std) 0.98x invariant, 2.52ms (0.61d, 0.28p, 3.75std) 1.03x invariant, -13.14ms (-1.09d, 0.07p, 11.64std) 1.02x invariant, -0.22ms (-0.69d, 0.23p, 0.32std) 1.00x invariant, 0.09ms (0.52d, 0.35p, 0.17std)
CairoMakie 4.19s (4.16, 4.21) 0.02+- 106.66ms (105.38, 108.35) 1.00+- 168.45ms (166.61, 170.61) 1.56+- 9.75ms (9.68, 9.80) 0.05+- 1.15ms (1.14, 1.16) 0.01+-
master 4.20s (4.18, 4.25) 0.03+- 107.08ms (106.19, 108.10) 0.77+- 167.60ms (165.46, 170.01) 1.56+- 9.72ms (9.62, 9.85) 0.08+- 1.17ms (1.15, 1.22) 0.03+-
evaluation 1.00x invariant, -0.01s (-0.45d, 0.41p, 0.03std) 1.00x invariant, -0.41ms (-0.47d, 0.40p, 0.88std) 0.99x invariant, 0.85ms (0.54d, 0.33p, 1.56std) 1.00x invariant, 0.03ms (0.45d, 0.42p, 0.07std) 1.03x faster ✓, -0.03ms (-1.45d, 0.03p, 0.02std)
WGLMakie 4.67s (4.61, 4.74) 0.04+- 106.83ms (104.48, 116.07) 4.14+- 9.24s (9.16, 9.43) 0.11+- 11.42ms (11.19, 11.87) 0.24+- 118.09ms (113.68, 124.86) 3.47+-
master 4.64s (4.61, 4.68) 0.03+- 107.85ms (105.19, 117.05) 4.11+- 9.25s (9.14, 9.30) 0.06+- 12.08ms (11.13, 16.33) 1.89+- 119.11ms (116.47, 121.15) 2.11+-
evaluation 0.99x invariant, 0.04s (0.91d, 0.12p, 0.04std) 1.01x invariant, -1.02ms (-0.25d, 0.65p, 4.13std) 1.00x invariant, -0.0s (-0.05d, 0.93p, 0.08std) 1.06x noisy🤷‍♀️, -0.66ms (-0.49d, 0.39p, 1.07std) 1.01x invariant, -1.01ms (-0.35d, 0.52p, 2.79std)

@ffreyer ffreyer marked this pull request as ready for review September 22, 2024 14:00
@ffreyer
Copy link
Collaborator Author

ffreyer commented Sep 22, 2024

Test failures are the expected changes to voxel clipping:

Before

image

After

image

@ffreyer ffreyer closed this Sep 23, 2024
@ffreyer ffreyer reopened this Sep 23, 2024
@ffreyer ffreyer merged commit efc2fcc into master Sep 23, 2024
29 of 35 checks passed
@ffreyer ffreyer deleted the ff/cleanup_voxel_clipping branch September 23, 2024 11:58
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