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

[worklets] Speculative evaluation #406

Closed
asajeffrey opened this issue May 12, 2017 · 2 comments
Closed

[worklets] Speculative evaluation #406

asajeffrey opened this issue May 12, 2017 · 2 comments

Comments

@asajeffrey
Copy link

In the "code idempotency" section of the draft spec (https://drafts.css-houdini.org/worklets/#code-idempotency) there's an encouragement to write idempotent code, because UAs might swap globals.

UAs may also wish to speculatively evaluate worklets: for example in the paint worklet, the calculated values for CSS may be available before the concrete object size, so a UA might speculatively evaluate the worklet using an old value for the size, and discard the result if the speculation turns out to be wrong.

It might be nice if the spec explicitly allowed this?

@dbaron dbaron changed the title [worklets] Speculative evalution [worklets] Speculative evaluation Aug 1, 2017
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Custom Paint.

The full IRC log of that discussion <fantasai> Topic: Custom Paint
<dbaron> Github: https://github.com//issues/406
<fantasai> ??: Ideally we'd have future-proofing simialr to tearing down of worklets now and again for this as well, but to really do that would require existing impls to do speculative execution for no good reason at all
<fantasai> ??: That's a hard sell, so that's not what we're asking for
<jack> fantasai: that's till
<fantasai> ??: What we are asking for is to explicitly allow speculative execution in the spec
<fantasai> s/??/jack/
<jack> ??? = till
<dbaron> s/??/till/
<fantasai> iank_: Basically what we're asking for is a section like " ... user agents my speculatively invoke this function, giving what it thinks it an object size and size could be at a future point in time"
<fantasai> till: We'll work on a PR
<fantasai> iank_: I think this belongs in the paint spec, not the worklets spec though
<fantasai> till: Ideally we should have ability to do this in as many worklets as possible, but doesn't make sense in other places
<fantasai> iank_: Maybe say in worklets spec that downstream specs may choose to do this
<fantasai> dino: What would be an extra parameter?
<fantasai> dino: What's the API for this?
<fantasai> dino: There's a paint function that gets size and style map
<fantasai> iank_: NO additional API
<fantasai> dino: Just the style map would have speculative?
<fantasai> iank_: Yes
<fantasai> till: Should already bee somwhat future-proofed because of req in spec intended to prevent you from relying on state, should hopefully make this possile

@asajeffrey
Copy link
Author

I'll try wordsmithing a PR.

bfgeek pushed a commit that referenced this issue Nov 9, 2017
Added text allowing speculative evaluation.

Fixes #406.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants