Skip to content

Add a proposal for uniformity assertions - #10959

Open
alan-baker wants to merge 3 commits into
gpuweb:mainfrom
alan-baker:proposal-assert-uniform
Open

alan-baker wants to merge 3 commits into
gpuweb:mainfrom
alan-baker:proposal-assert-uniform

Conversation

@alan-baker

Copy link
Copy Markdown
Contributor

Ref #6955

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (8d4f851):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

Comment thread proposals/assert-uniform.md
Comment thread proposals/assert-uniform.md

@mehmetoguzderin mehmetoguzderin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM editorially, thanks for the commit

@alan-baker
alan-baker force-pushed the proposal-assert-uniform branch from 313a235 to cf1fcf8 Compare September 22, 2026 23:08
@stefnotch

Copy link
Copy Markdown
  1. Should the proposal include attributes to facilitate library writers?

I wanted to point out a potential alternative path, inspired by the extensive const-eval capabilities of WGSL and C++ concepts.

WGSL function signatures today can already have calls to @const functions. If there were an explicit space in the syntax for that, then the following would be possible

fn foo(a: bool, b: vec2f) -> bool 
  where assertUniform(b) // part of the function's signature
{
  const threshold = 3;
  let cond = a || assertUniform(dpdx(b)).x > threshold;
  return cond;
}

However, I have not thought through the implications of such a mechanism. Neither have I researched which other parts of WGSL or which WGSL proposals could benefit from this.

This branch has not been deployed

No deployments
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.

4 participants