Skip to content

fix(deckgl-contour): prevent WebGL freeze by clamping and auto-scaling cellSize#37244

Merged
rusackas merged 10 commits intoapache:masterfrom
YousufFFFF:fix/deckgl-contour-freeze
Jan 24, 2026
Merged

fix(deckgl-contour): prevent WebGL freeze by clamping and auto-scaling cellSize#37244
rusackas merged 10 commits intoapache:masterfrom
YousufFFFF:fix/deckgl-contour-freeze

Conversation

@YousufFFFF
Copy link
Contributor

Summary

Fixes #36838

This PR prevents Deck.gl Contour charts from freezing or crashing the browser/WebGL when extremely small cellSize values are used.

It introduces safety guards that:

  • Clamp cellSize to a safe min/max range
  • Auto-scale cellSize when the estimated grid size becomes dangerously large
  • Prevents GPU buffer overflows and UI freezes
  • Keeps existing behavior for normal values

Problem

Very small cellSize values can generate millions of grid cells, which causes:

  • WebGL buffer allocation failures
  • UI freezes
  • Browser tab crashes
  • Console errors like:
image

Solution

We now:

  1. Clamp cellSize between safe min/max bounds
  2. Estimate the total grid cell count
  3. Auto-scale cellSize if the grid becomes too large
  4. Log a warning when auto-adjustment occurs

This keeps the chart responsive and prevents GPU crashes.


After

localhost_8088_explore__viz_type.deck_contour.datasource.3__table.-.Google.Chrome.2026-01-19.14-45-37.mp4

Behavior Changes

  • No change for valid cellSize values
  • Extremely small values are safely adjusted instead of crashing the app

Testing

  • Reproduced freeze/crash with very small cellSize
  • Verified UI no longer freezes
  • Verified chart renders correctly
  • Verified console errors are gone

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 19, 2026

Code Review Agent Run #029ca1

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts - 2
    • Incorrect display name logic · Line 403-410
      The substring check entryName.includes(metricPart) can incorrectly skip adding the metric prefix when entryName contains the metric name as a substring (e.g., dimension "Sales Volume" with metric "Sales" would display as "Sales Volume" instead of "Sales, Sales Volume"). This changes observable chart display behavior. Always concatenate for reliable formatting.
      Code suggestion
       @@ -407,3 +407,1 @@
      -      displayName = entryName.includes(metricPart)
      -        ? entryName
      -        : `${metricPart}, ${entryName}`;
      +      displayName = `${metricPart}, ${entryName}`;
    • Incorrect display name logic · Line 476-483
      Same issue as Query A: the substring check can incorrectly skip the metric prefix, leading to malformed display names in charts with groupby. Revert to consistent concatenation.
      Code suggestion
       @@ -480,3 +480,1 @@
      -      displayName = entryName.includes(metricPart)
      -        ? entryName
      -        : `${metricPart}, ${entryName}`;
      +      displayName = `${metricPart}, ${entryName}`;
Review Details
  • Files reviewed - 2 · Commit Range: 4d8b727..cf13edd
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Jan 19, 2026
@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI finished reviewing your PR.

@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit cf13edd
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/696df740a04bf40008dc0b30
😎 Deploy Preview https://deploy-preview-37244--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@YousufFFFF
Copy link
Contributor Author

Hi @DamianPendrak @rusackas
I’ve opened this PR to fix a Deck.gl Contour freeze/crash caused by extreme cellSize values by adding safety guards and auto-scaling.
Would really appreciate your review when you get a chance. Thanks!

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 19, 2026

Code Review Agent Run #bfcdbf

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: cf13edd..4dde3ce
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI Incremental review completed.

@YousufFFFF
Copy link
Contributor Author

YousufFFFF commented Jan 19, 2026

All CI checks are now passing
This PR is ready for review.
@DamianPendrak , would really appreciate your feedback when you have time. Thanks!

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 19, 2026

Code Review Agent Run #87df25

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 4dde3ce..cc6a173
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@DamianPendrak DamianPendrak added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 20, 2026
@github-actions github-actions bot added 🎪 cc6a173 🚦 building Environment cc6a173 status: building 🎪 cc6a173 📅 2026-01-20T09-13 Environment cc6a173 created at 2026-01-20T09-13 🎪 cc6a173 🤡 DamianPendrak Environment cc6a173 requested by DamianPendrak 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 20, 2026
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for cc6a173

@github-actions github-actions bot added 🎪 cc6a173 🚦 deploying Environment cc6a173 status: deploying 🎪 cc6a173 🚦 running Environment cc6a173 status: running and removed 🎪 cc6a173 🚦 building Environment cc6a173 status: building 🎪 cc6a173 🚦 deploying Environment cc6a173 status: deploying labels Jan 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds safety guards to prevent WebGL freezes and crashes in Deck.gl Contour charts when extremely small cellSize values are used. The fix introduces validation, clamping, and auto-scaling logic to ensure grid cell counts remain within safe limits.

Changes:

  • Added cellSize validation with safe min/max bounds (10-5000)
  • Implemented auto-scaling when estimated grid cells exceed 1 million
  • Added warning logging when auto-adjustment occurs

Copy link
Member

@DamianPendrak DamianPendrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests would be great here. I requested the Copilot review - @YousufFFFF do you think there is something to improve from the suggestions?

@YousufFFFF
Copy link
Contributor Author

YousufFFFF commented Jan 20, 2026

Thanks @DamianPendrak ! I’ve reviewed the Copilot suggestions. I’ll incorporate the safety-related ones (explicit viewport dimension checks, clamping after auto-scaling, and clearer naming)

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@YousufFFFF
Copy link
Contributor Author

YousufFFFF commented Jan 20, 2026

I’ve applied the safety-related Copilot suggestions (explicit viewport checks, post-auto-scale clamping, and clearer naming).

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI Incremental review completed.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 20, 2026

Code Review Agent Run #620d8f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: cc6a173..cd1bbf7
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 22, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 22, 2026

Code Review Agent Run #015b81

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: cd1bbf7..182084e
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/getSafeCellSize.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/getSafeCellSize.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@YousufFFFF
Copy link
Contributor Author

Hey @DamianPendrak !
I have refactored the safety logic into a pure helper (getSafeCellSize) and added unit tests around it.
Would appreciate another look when you have time
Thanks!!

@github-actions github-actions bot removed 🎪 cc6a173 🤡 DamianPendrak Environment cc6a173 requested by DamianPendrak 🎪 cc6a173 🌐 54.202.41.191:8080 Environment cc6a173 URL: http://54.202.41.191:8080 (click to visit) 🎪 cc6a173 📅 2026-01-20T09-13 Environment cc6a173 created at 2026-01-20T09-13 🎪 cc6a173 🚦 running Environment cc6a173 status: running labels Jan 22, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 23, 2026

Code Review Agent Run #cf90a7

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 182084e..8687731
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/getSafeCellSize.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/getSafeCellSize.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copy link
Member

@DamianPendrak DamianPendrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @YousufFFFF! LGTM

@YousufFFFF
Copy link
Contributor Author

Thank you for the review, Damian! Much appreciated.
If any deck.gl–related issues come up, feel free to loop me in. Happy to help.

@rusackas rusackas merged commit b09e60c into apache:master Jan 24, 2026
68 checks passed
sadpandajoe pushed a commit that referenced this pull request Jan 26, 2026
@sadpandajoe sadpandajoe added v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch 🎪 🛑 showtime-trigger-stop Destroy ephemeral environment and clean up AWS resources labels Jan 26, 2026
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins 🎪 🔒 showtime-blocked 🎪 🛑 showtime-trigger-stop Destroy ephemeral environment and clean up AWS resources size/L v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch viz:charts:deck.gl Related to deck.gl charts 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deck.gl Contour bufferData error

5 participants