Skip to content

Fix shader compilation failure in Chrome 131 #9152

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

Merged
merged 1 commit into from
Feb 27, 2025
Merged

Conversation

yakunouyang
Copy link
Contributor

@yakunouyang yakunouyang commented Feb 27, 2025

Related

What

let distance = distance(circle_center, world_position);

The variable distance collide with internal function distance(), resulting in wgsl build error on macOS Chrome.

More information in #8377.

Image

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for opening this pull request.

Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Thanks!

@emilk emilk added 🪳 bug Something isn't working 🔺 re_renderer rendering, graphics, GPU exclude from changelog PRs with this won't show up in CHANGELOG.md labels Feb 27, 2025
@emilk emilk changed the title Fix wgsl build error (#8377) Fix wgsl build error Feb 27, 2025
@emilk emilk added 🕸️ web regarding running the viewer in a browser include in changelog and removed exclude from changelog PRs with this won't show up in CHANGELOG.md labels Feb 27, 2025
@Wumpf
Copy link
Member

Wumpf commented Feb 27, 2025

does not fix the linked issue, that was originally about something else entirely
(Fixed description so it doesn't auto-close)

@Wumpf
Copy link
Member

Wumpf commented Feb 27, 2025

Fix can't hurt, but fwiw I can't repro this on MacOs M1 Chrome 133.0.6943.142 which is surprising since this is almost the exact setup you mentioned in #8377 (comment)
Need to check whether Chrome/Tint or Wgpu/Naga is in spec violation here.

@yakunouyang
Copy link
Contributor Author

yakunouyang commented Feb 27, 2025

Fix can't hurt, but fwiw I can't repro this on MacOs M1 Chrome 133.0.6943.142 which is surprising since this is almost the exact setup you mentioned in #8377 (comment) Need to check whether Chrome/Tint or Wgpu/Naga is in spec violation here.

After some digging, I understand what happened: when I tried to add flag --enable-dawn-features=dump_shaders,disable_symbol_renaming to the chrome browser, it auto updates and take me to the 133.0.6943.142 version. I found the version before update (131.0.6778.0), and this bug reproduces, sorry for the confusion.

As for the specs, this issue may help gpuweb/gpuweb#2619, the latest Chrome/Tint accepts such syntax, and the tint ir dumped by latest Chrome also fixes this problem:
image

That being said, I think this bug still relevant, it affects the older browsers, and the original symbol seems not accepted by Metal Shader Language.

@Wumpf
Copy link
Member

Wumpf commented Feb 27, 2025

Ah no worries! Then this is the same thing I posted on Discord recently. I didn't break it down via --enable-dawn-features=dump_shaders as you did - didn't know about this, this sounds super useful :)
Agreed, we should land this nonwithstanding, but that does then answer the question whether Chrome or Naga/wgpu are at fault: older Chrome version are, and it's fixed already. But it also means that it's not super urgent.
Thank you so much for following up!

Will take care of the intermittent CI breakage later - seems to be an issue in the non-maintainer ci subset only.

@Wumpf Wumpf changed the title Fix wgsl build error Fix shader compiling failure in Chrome 131 Feb 27, 2025
@Wumpf Wumpf changed the title Fix shader compiling failure in Chrome 131 Fix shader compiluation failure in Chrome 131 Feb 27, 2025
@Wumpf Wumpf merged commit 592c4aa into rerun-io:main Feb 27, 2025
44 of 48 checks passed
@abey79 abey79 changed the title Fix shader compiluation failure in Chrome 131 Fix shader compilation failure in Chrome 131 Feb 27, 2025
Wumpf pushed a commit that referenced this pull request Mar 3, 2025
### Related

* Closes #8377
* Follow-up to  #9152

<!--
Include links to any related issues/PRs in a bulleted list, for example:
* Closes #1234
* Part of #1337
-->

### What

This pr is extension of #9152, further fixing the shader variable naming
issue in Chome 131 version.

<img width="1021" alt="Image"
src="https://github.com/user-attachments/assets/fab624cd-3d14-4bbc-8209-5a1cc1ccbd73"
/>

after fix:

<img width="1469" alt="Image"
src="https://github.com/user-attachments/assets/3f08da34-919d-4efb-9104-137dd6fe2863"
/>


<!--
Make sure the PR title and labels are set to maximize their usefulness
for the CHANGELOG,
and our `git log`.

If you have noticed any breaking changes, include them in the migration
guide.

We track various metrics at <https://build.rerun.io>.

For maintainers:
* To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
* To deploy documentation changes immediately after merging this PR, add
the `deploy docs` label.
-->
@emilk emilk mentioned this pull request Apr 11, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working include in changelog 🔺 re_renderer rendering, graphics, GPU 🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants