Skip to content

Expose the Error type for WGSL frontend #7855

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

Closed
wants to merge 6 commits into from

Conversation

aryaveersr
Copy link

@aryaveersr aryaveersr commented Jun 27, 2025

Description
This makes the Error type returned by the WGSL frontend public. Previously, it directly returned the error as a string + spans, which is great for cli output but not much else.

Squash or Rebase?

Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
    • This seems to modify every .toml file, even ones that I haven't touched. Is this intended ?
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@aryaveersr aryaveersr marked this pull request as ready for review June 27, 2025 15:20
@ErichDonGubler
Copy link
Member

Before I dive into details, we need to talk about high-level details like your motivation first. The Naga team has specifically resisted exposing this because it's a very unstable surface.

What problem are you trying to solve? What are you trying to build? Why does exposing Error's details solve this problem?

@aryaveersr
Copy link
Author

aryaveersr commented Jul 12, 2025

My motivation here is to allow re-use of naga's wgsl frontend for cases other than immediate translation, eg: editor tooling, validator for stuff like online wgsl live editors, etc.
I understand projects like wgsl-analyzer exist, with their own frontends that are much more suited for something like this, but naga is more complete and already used in wgpu.

@ErichDonGubler
Copy link
Member

ErichDonGubler commented Jul 16, 2025

Naga contributors spoke together in today's meeting about this PR. We're going to close it, but encourage you to keep chatting with us outside the review queue.


All the use cases mentioned here are very blurry:

cases other than immediate translation, eg: editor tooling, validator for stuff like online wgsl live editors, etc.

Our perception is that this is a very broad solution (with very broad consequences) being presented on behalf of an abstract application. This also seems like a pretty light commit stack to keep rebased in your own fork. Therefore, we'd prefer to keep this change downstream for now, evolving our API in response to specific problems for specific functionality. If and when you know more concretely what sort of information needs to flow between Naga and the layers of your application, let's talk in community chat or issues, so we can get consensus on design.

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.

2 participants