Skip to content

ci: Add CI step to check if precompiled regl shaders need to be updated#7786

Open
camdecoster wants to merge 6 commits into
masterfrom
cam/7785/check-regl-ci
Open

ci: Add CI step to check if precompiled regl shaders need to be updated#7786
camdecoster wants to merge 6 commits into
masterfrom
cam/7785/check-regl-ci

Conversation

@camdecoster
Copy link
Copy Markdown
Contributor

@camdecoster camdecoster commented Apr 30, 2026

Description

Add a CI step to check if precompiled regl shaders need to be updated.

Closes #7785.

Changes

  • Update CI workflow
  • Update instructions to reflect new process

Testing

  • Create a draft PR that changes one of the files that would affect the shaders
  • Review the workflow run

Notes

  • This is currently a manual process and this (mostly) automates it

@camdecoster camdecoster self-assigned this Apr 30, 2026
@camdecoster camdecoster marked this pull request as ready for review May 20, 2026 20:27
Comment thread .github/workflows/ci.yml
Comment on lines +46 to +47
# stackgl_modules/ is listed here too because the regl-* shader libs live there;
# changes can alter shader output and require regenerating the precompiled shaders.
Copy link
Copy Markdown
Contributor

@emilykl emilykl May 22, 2026

Choose a reason for hiding this comment

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

Adding an additional line of explanation (feel free to adjust if not accurate)

Suggested change
# stackgl_modules/ is listed here too because the regl-* shader libs live there;
# changes can alter shader output and require regenerating the precompiled shaders.
# If any of the directories listed below have changed, we need to re-run the regl-codegen step
# stackgl_modules/ is listed here too because the regl-* shader libs live there;
# changes can alter shader output and require regenerating the precompiled shaders.

Comment thread .github/workflows/ci.yml
check-regl-codegen:
needs: [detect-changes, install-and-cibuild]
if: >-
(github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@camdecoster Does this mean the job will only be triggered on push to master?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We want it to run on pull requests also, right?

Comment thread CONTRIBUTING.md

If you are implementing a new feature that involves regl shaders, or if you are
making changes that affect the usage of regl shaders, you would need to run
making changes that affect the usage of regl shaders, you would need to regenerate the precompiled regl shader code.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
making changes that affect the usage of regl shaders, you would need to regenerate the precompiled regl shader code.
making changes that affect the usage of regl shaders, you will need to regenerate the precompiled regl shader code.

Comment thread CONTRIBUTING.md
Comment on lines 165 to +166
If you are implementing a new feature that involves regl shaders, or if you are
making changes that affect the usage of regl shaders, you would need to run
making changes that affect the usage of regl shaders, you would need to regenerate the precompiled regl shader code.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"if you are making changes that affect the usage of regl shaders"

How would a contributor know whether this applies to them? Is it a "if you know, you know" type of situation? Or, is there a list of files which, if they are changed, the regl shader code will definitely need to be regenerated?

Comment thread CONTRIBUTING.md
Comment on lines +179 to +182
2. Delete `src/generated/regl-codegen/` in your working tree, then unzip the
artifact at the repo root so it replaces (rather than merges into) the
existing directory. Also overwrite the four `regl_precompiled.js` files
under `src/traces/{scattergl,scatterpolargl,splom,parcoords}/`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't quite follow this -- will these regl_precompiled.js files be nested inside src/generated/regl-codegen/?

If you have a link to an uploaded artifact, I can verify

Comment thread CONTRIBUTING.md
Comment on lines +192 to +193
The `rm -rf` mirrors what CI does, so any orphaned shader files left over from
previous changes get cleaned up. `npm run regl-codegen` will prompt you to open a
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `rm -rf` mirrors what CI does, so any orphaned shader files left over from
previous changes get cleaned up. `npm run regl-codegen` will prompt you to open a
The `rm -rf` step is needed to clean up any orphaned shader files left over from
previous changes. `npm run regl-codegen` will prompt you to open a

Comment thread CONTRIBUTING.md
Comment on lines +194 to +196
browser window, run through all traces with 'regl' in the tags, and store the
captured code into
[src/generated/regl-codegen](https://github.com/plotly/plotly.js/blob/master/src/generated/regl-codegen).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some of the captured code will also be stored into src/traces/{scattergl,scatterpolargl,splom,parcoords}/, right?

Or do those files need to be moved manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add CI step to check if precompiled regl shaders need to be updated

2 participants