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

(Migrated from #489) Expose limits on the adapter #495

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 1 commit into from

Conversation

litherum
Copy link
Contributor

@litherum litherum commented Nov 11, 2019

I don't know how to re-open a GitHub pull request after it's been reverted. Here's a new pull request which should be the same thing.

Migrated from #489

@kainino0x says: There's no reason to leave this out anymore.
Implementations can implement it whenever they want.


Preview | Diff

There's no reason to leave this out anymore.
Implementations can implement it whenever they want.
@kainino0x
Copy link
Contributor

Thanks for taking care of re-opening this. As far as I know, this is the only way to do it.

@kainino0x
Copy link
Contributor

To answer the question from the minutes (which I'm just reading), JG/CW are right, you can't use a dictionary type as an attribute. This is because dictionary is a WebIDL construct instructing the browser how to convert an object into a dictionary - it's input-only; there's no conversion from dictionary to object.

@litherum
Copy link
Contributor Author

litherum commented Nov 15, 2019

Related: https://github.com/orgs/gpuweb/projects/1#card-29251103

We have some ideas for how to do this. We can discuss them on the coming call.

@kvark
Copy link
Contributor

kvark commented Nov 18, 2019

Can we have a function instead of an attribute in order to avoid raw object?

@kdashg
Copy link
Contributor

kdashg commented Nov 18, 2019

What if we made it an interface? We should be able to then use that Limits interface as an attribute, right?

@kainino0x
Copy link
Contributor

kainino0x commented Nov 19, 2019 via email

@kvark
Copy link
Contributor

kvark commented Nov 19, 2019

Also, we shouldn't change the API just to make it slightly more expressible by WebIDL

We already did that for many other things, e.g. enum values as strings. I don't think it's a large change to go from an attribute to a getter function - we used the latter for getQueue() and nobody raised a red flag for a while.

@kainino0x
Copy link
Contributor

I don't think that's accurate. The string enums were chosen because it is "the web way" - a pattern adopted across many userspace JS libraries and Web Platform APIs.

To clarify, my argument is against both proposed changes (Jeff's and Dzmitry's).

In this case we would be changing the API solely for the purpose of expressibility in WebIDL (though, as I said, I suspect Dzmitry's proposal isn't expressible in WebIDL anyway). It wouldn't be because a JS library author would choose to do it that way. (To JS, Jeff's change is equivalent to changing from returning a raw dictionary to returning an instance of a predefined class, which I can imagine a library going either way on.)

@kdashg
Copy link
Contributor

kdashg commented Dec 3, 2019

While that's true, interfaces are duck-type-equivalent to dicts for normal usage. I choose not to pick this battle with upstream webidl, and instead use an interface. The wording of the spec text in this PR even makes it sound like it's going to return something that's instanceof GPULimits, which would have to be an interface.

@kainino0x
Copy link
Contributor

That's all fair. I'd accept that option. Slightly unfortunately, it would require duplicating the list of limits, since we'll still need a dictionary for input and an interface for output.

@kvark kvark changed the base branch from master to main June 23, 2020 13:18
@kainino0x
Copy link
Contributor

This PR is now stale. We have the TODO in the text so we don't really need to track it here.

I may open a new PR about this.

@kainino0x kainino0x closed this Sep 22, 2020
@kainino0x kainino0x deleted the adapterlimits branch September 22, 2020 21:27
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Sep 23, 2020
This allows apps to receive information about individual available
adapter limits, which which let the UA track privacy budgeting with
better granularity.

See also gpuweb#489, gpuweb#495; gpuweb#1098.
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Sep 23, 2020
This allows apps to request information about individual available
adapter limits, which lets the UA track privacy budgeting with
better granularity.

See also gpuweb#489, gpuweb#495; gpuweb#1098.
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Oct 1, 2020
This allows apps to request information about individual available
adapter limits, which lets the UA track privacy budgeting with
better granularity.

See also gpuweb#489, gpuweb#495; gpuweb#1098.
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Oct 1, 2020
This allows apps to request information about individual available
adapter limits, which lets the UA track privacy budgeting with
better granularity.

See also gpuweb#489, gpuweb#495; gpuweb#1098.
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Dec 3, 2020
kainino0x added a commit to kainino0x/gpuweb that referenced this pull request Dec 3, 2020
@kainino0x kainino0x mentioned this pull request Dec 3, 2020
kainino0x added a commit that referenced this pull request Dec 15, 2020
I think it's been determined that this API shouldn't consider privacy budgeting in it's design.

- UAs can still lazily-decide on GPULimits values.
- UAs can still do bucketing ahead of time, or even based on queries to GPULimits members.
- Apps can attempt requestDevice without checking limits, if they just want to know if their requested limits are supported.

Exact IDL interface is TBD, but editorial.

Needs more text to be filled out later. Also adds some other TODOs.

See also #489, #495; #1098, #1100.
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 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