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

Change 'incompletely specified behavior' phrasing to 'limited local nondeterminism' #141

Merged
merged 9 commits into from
Jun 11, 2015

Conversation

lukewagner
Copy link
Member

As discussed in #107.


WebAssembly is a [portable](Portability.md) sandboxed platform with limited,
local, nondeterminism.
* *limited* : non-deterministic execution can only occur in a small number of
Copy link
Member

Choose a reason for hiding this comment

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

apologies for an unimportant question, but was the space before : intentional here? (it would feel natural for me to not have it there, but maybe it's a style I'm not familiar with)

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, it'd look better w/o space before.

[Control Flow Integrity](http://research.microsoft.com/apps/pubs/default.aspx?id=64250).
* WebAssembly has no [nasal demons](https://en.wikipedia.org/w/index.php?title=Nasal_demons).

Ideally, WebAssembly would be fully deterministic. Nondeterminism is only
Copy link
Member

Choose a reason for hiding this comment

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

Another probably unimportant note, it might be better to avoid saying "fully deterministic" because in a more general sense, there is or will be nondeterminism in wasm - stuff like calling a random number generator. Very nitpicky of course, as your intention is clear, so feel free to ignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha, good point, I forgot about random. I can reword.

@sunfishcode
Copy link
Member

lgtm

Ideally, WebAssembly would be fully deterministic (except where nondeterminism
was introduced by the API, like `random` or input events). Nondeterminism is only
specified as a compromise when there is no other practical way to achieve
[portable](Portability.md), near-native performance.
Copy link
Member

Choose a reason for hiding this comment

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

Drop "near-"? We want native performance!

Copy link
Member

Choose a reason for hiding this comment

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

I think "near-" is an acknowledgement that we are sandboxed and that we are providing a portability abstraction that discards certain unappetizing-but-nonetheless-expedient implementation details, and until we get hardware support there's always going to be some overhead. But ultimately it's a question of taste here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is just the conservative "don't overpromise" engineer in me, but "native" is probably fine here, so I'll take out "near-".

@jfbastien jfbastien mentioned this pull request Jun 11, 2015
@lukewagner lukewagner assigned lukewagner and jfbastien and unassigned lukewagner Jun 11, 2015
- [Fixed-width SIMD may want some flexibility](EssentialPostMVPFeatures.md#fixed-width-simd)
- In SIMD.js, floating point values may or may not have subnormals flushed to zero.
- In SIMD.js, operations ending in "Approximation" return approximations that may vary between platforms.

- Environment-dependent resource limits may be exhausted
Copy link
Member

Choose a reason for hiding this comment

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

Missing period.

@jfbastien
Copy link
Member

lgtm after nit, and assuming you move the race/data stuff to another PR.

@lukewagner
Copy link
Member Author

Pulling this now-hidden note into the main discussion:

So as @jfbastien pointed out, there are two levels of non-determinism here:

  1. the non-seq-cst you get if you have a data race
  2. even with seq-cst, it's still non-deterministic

and 2 isn't really called out, so I think a further update is necessary.

@lukewagner
Copy link
Member Author

How about this?

@jfbastien
Copy link
Member

lgtm

@lukewagner
Copy link
Member Author

@sunfishcode too?


- [When threads are added as a feature](EssentialPostMVPFeatures.md#threads),
even without shared memory, nondeterminism will be visible through the
ordering of API calls. Shared memory will allow further nondeterminism via
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if this is too pedantic, but it's also visible between API calls and WebAssembly program termination.

Copy link
Member Author

Choose a reason for hiding this comment

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

True true, we must never forget termination.

@sunfishcode
Copy link
Member

@lukewagner
Copy link
Member Author

How about this? I couldn't think of how non-termination was visible except through APIs (like postMessage and onmessage).

@sunfishcode
Copy link
Member

lgtm

lukewagner added a commit that referenced this pull request Jun 11, 2015
…d-behavior

Change 'incompletely specified behavior' phrasing to 'limited local nondeterminism'
@lukewagner lukewagner merged commit 985b850 into master Jun 11, 2015
@lukewagner lukewagner deleted the rename-incompletely-specified-behavior branch June 11, 2015 20:47
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.

None yet

4 participants