Keep ScatterGL in sync when an axis scale's type changes at runtime#1699
Open
astrofrog wants to merge 2 commits intobqplot:0.12.xfrom
Open
Keep ScatterGL in sync when an axis scale's type changes at runtime#1699astrofrog wants to merge 2 commits intobqplot:0.12.xfrom
ScatterGL in sync when an axis scale's type changes at runtime#1699astrofrog wants to merge 2 commits intobqplot:0.12.xfrom
Conversation
`customLauncher` was a typo for `customLaunchers`, so the custom flags were silently ignored and karma used the built-in ChromeHeadless defaults. That was tolerable on older runners but broke once CI moved to ubuntu-24.04: - ubuntu-24.04's AppArmor user-namespace restriction prevents chromium from starting without --no-sandbox - chromium 132+ requires an explicit --enable-unsafe-swiftshader opt-in to fall back to software WebGL when --disable-gpu is in effect (which the ChromeHeadless base adds automatically)
7343af1 to
0396513
Compare
Contributor
Author
|
I had to fix the CI, as it was failing due to stale config - this should now be ready for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ScatterGLrenders points via a WebGL shader (shaders/scales.glsl,shaders/scatter-vertex.glsl) that uses compile-time preprocessor directives to pick between a linear and a log transform:(see https://github.com/bloomberg/bqplot/blob/861aa219a216281c0dc3d910701815949e5b5615/js/shaders/scatter-vertex.glsl#L104-L113)
The
SCALE_TYPE_x/SCALE_TYPE_ydefines are set fromscales.x.model.typeat the point where the three.jsShaderMaterialis first constructed, and never refreshed afterwards. That was fine when the only way to "switch to log" was to replace the scale object entirely (which triggered a full re-init).However, I've developed a new scale and axis implementation in bqplot-linlog can mutate its own type at runtime — which flips
model.typebetweenlinearandlogwithout replacing the scale. However, when doing thisScatterGLgets left behind: the axis ticks and SVG marks update, but the GL points keep drawing with whichever transform happened to be compiled in at init time.LinesGLin bqplot-image-gl already handles this correctly via its own per-frame shader update (see here). This PR bringsScatterGLin line with the same pattern.To reproduce this, you can run the following in a notebook:
Flip the toggle to

log. Without the fix,ScatterGLvisibly diverges fromScatter:With the fix, they stay identical:
I opened this to 0.12.x since the code no longer exists in master - if this is accepted I can open a similar PR to bqplot-gl, but wanted to also fix it here since it is a bug which is affecting us.