Skip to content
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

[naga wgsl-in] Does WGSL really allow duplicate diagnostic filtering directives? #6556

Closed
jimblandy opened this issue Nov 16, 2024 · 3 comments

Comments

@jimblandy
Copy link
Member

jimblandy commented Nov 16, 2024

I'm skeptical that it was the language designers' intention to allow duplicate global diagnostic filters, although I can see why the standard supports that interpretation.

In naga::diagnostic_filter, we have ShouldConflictOnFullDuplicate, whose comments say:

/// Determines whether [`DiagnosticFilterMap::add`] should consider full duplicates a conflict.
///
/// In WGSL, directive position does not consider this case a conflict, while attribute position
/// does.

In the WGSL spec, I can see that:

Maybe I'm just not seeing the rationale, or I haven't found the discussion, but it seems weird to me that duplicates would be tolerated in one place but forbidden in the other. Because of the way the spec is structured, I think there's some chance this was just an oversight.

And my coder's heart deeply and fiercely resents being required to add an enum like ShouldConflictOnFullDuplicate if there isn't some justification for it. That kind of vermin will take over if you let it.

CC @ErichDonGubler

@jimblandy
Copy link
Member Author

Filed: gpuweb/gpuweb#4976

@ErichDonGubler
Copy link
Member

Its definitely intentional (and has CTS coverage), but even a non-normative rationale isn't in the spec. It's unclear why this is desirable. I'm interested to see what upstream says.

@jimblandy
Copy link
Member Author

We got a weak explanation about this. It is indeed intentional.

@github-project-automation github-project-automation bot moved this from Todo to Done in WebGPU for Firefox Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants