这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Kangz
Copy link
Contributor

@Kangz Kangz commented May 12, 2022

Issue #2574 shows that we may want to add more information to hints in
the future. To help make the hints future-proof, the layout is made
optional so that authors can in the future pass information like the
primitive type, even if they don't know what the pipeline layout will
be.


💥 Error: 500 Internal Server Error 💥

PR Preview failed to build. (Last tried on May 12, 2022, 3:22 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 CSS Spec Preprocessor - CSS Spec Preprocessor is the web service used to build Bikeshed specs.

🔗 Related URL

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at api.csswg.org Port 443</address>
</body></html>

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

Issue gpuweb#2574 shows that we may want to add more information to hints in
the future. To help make the hints future-proof, the layout is made
optional so that authors can in the future pass information like the
primitive type, even if they don't know what the pipeline layout will
be.
@Kangz Kangz requested a review from kainino0x May 12, 2022 15:21
@kainino0x kainino0x added tacit resolution candidate Editors may be able to resolve and move to tacit resolution queue for webgpu editors meeting labels May 13, 2022
@kainino0x kainino0x added this to the V1.0 milestone May 13, 2022
Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

LGTM. I think this change isn't strictly necessary because we can always make it optional later when we add other fields. But the clear benefit to making it optional now is that future applications won't have to do nasty feature detection or UA detection for older browsers that require this field.

@toji
Copy link
Member

toji commented May 13, 2022

LGTM as well, seems like a good future-proofing strategy.

@kainino0x kainino0x added tacit resolution queue Editors have agreed and intend to land if no feedback is given and removed for webgpu editors meeting tacit resolution candidate Editors may be able to resolve and move to tacit resolution queue labels May 13, 2022
@kainino0x kainino0x removed the tacit resolution queue Editors have agreed and intend to land if no feedback is given label May 23, 2022
@kainino0x kainino0x merged commit 69d4170 into gpuweb:main May 23, 2022
github-actions bot added a commit that referenced this pull request May 23, 2022
SHA: 69d4170
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request May 23, 2022
SHA: 69d4170
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request May 23, 2022
SHA: 69d4170
Reason: push, by @kainino0x

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
jdarpinian pushed a commit to jdarpinian/gpuweb that referenced this pull request Aug 12, 2022
Issue gpuweb#2574 shows that we may want to add more information to hints in
the future. To help make the hints future-proof, the layout is made
optional so that authors can in the future pass information like the
primitive type, even if they don't know what the pipeline layout will
be.
@juj
Copy link

juj commented Aug 17, 2022

Does omitting layout mean the same as having passed layout: 'auto'?

juj added a commit to juj/wasm_webgpu that referenced this pull request Aug 17, 2022
@toji
Copy link
Member

toji commented Aug 17, 2022

No, it doesn't. And that's intentional.

As it turns out, using the auto layout is relatively limiting and probably not the pattern that most developers want to reach for instinctively. It can be a nice shortcut if you know that you won't need the same layout anywhere else, but we wanted that to be an intentional decision on the part of the developer and not the default.

So now you always have to specify a layout, and can explicitly choose auto if that's what you need. The hope is that doing things this way helps nudge developers towards better practices.

[EDIT] I'm an idiot, and didn't realize this was talking about the shader module hint and not the pipeline layout. Sorry.

In this context omitting the layout simply means not providing a hint, which means that any backend that might have tried to pre-emptively optimize with that information can't. If you explicitly specify auto then the backend may be able to to optimize for the case where you use this module with a pipeline using the auto layout as well. Similarly if you gave an explicit layout in the hint the backend may be able to to optimize for the case where you use this module with a pipeline using the same layout. (Although please note: No backends that I'm aware of perform any optimizations with layout hints to date.)

Given that they're just hints, omitting any aspect of that dictionary simply means "No hint provided."

@juj
Copy link

juj commented Aug 17, 2022

Thanks - the reason I am asking is that when marshalling over to wasm, handwritten JS code could specify any type of hint object of form:

  • null (i.e. no hint object specified at all)
  • { },
  • { layout: null },
  • { layout: undefined },
  • { layout: 'auto' }
    so I am trying to figure out what type of polymorphic expressiveness here is needed for wasm side programs to be able to pass. The four first ones are quite reasonably the same thing, but then wondering if wasm code should be able to say { layout: 'auto'} as well, or if that case could be handled statically as one of the above four cases.

@kainino0x
Copy link
Contributor

I filed webgpu-native/webgpu-headers#166 .

juj added a commit to juj/wasm_webgpu that referenced this pull request Aug 18, 2022
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