Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Enumerate sources of undefined and indeterminate behaviour #2

Open
dneto0 opened this issue Nov 15, 2018 · 4 comments
Open

Enumerate sources of undefined and indeterminate behaviour #2

dneto0 opened this issue Nov 15, 2018 · 4 comments
Assignees

Comments

@dneto0
Copy link
Contributor

dneto0 commented Nov 15, 2018

Issue gpuweb/gpuweb#34 was an investigation of sources of undefined and indeterminate behaviour in the SPIR-V core spec. The WebGPU environment spec for SPIR-V should call out those cases and recommend what an implementation should do about them.

@dneto0 dneto0 self-assigned this Nov 15, 2018
@dneto0
Copy link
Contributor Author

dneto0 commented Nov 15, 2018

It's also worth taking a second closer look, in case we missed something the first time around.

@dneto0
Copy link
Contributor Author

dneto0 commented Nov 26, 2018

After #3 was merged, the following items from gpuweb/gpuweb#34 remain to be addressed in spirv-execution-env.md:

  • division by zero
  • (not in the old issue): signed integer division, of INT_MIN by -1. This is an overflow of the positive signed integers
  • arithmetic or logical shift by more than the size of the integer type
  • using derivatives outside of uniform control flow (for the derivative group of instructions)
  • (not in the old issue): image instructions that rely on an implicit derivative should be in uniform control flow (for the derivative group)
  • anything from GLSL.std.450 extended instruction set?

@dneto0
Copy link
Contributor Author

dneto0 commented Nov 26, 2018

The old issue explicitly did not deal with floating point exceptional cases. But the environment spec should bound the behaviours.

@RobinMorisset
Copy link

Out of all of these, derivatives outside of uniform control flow is the one that significantly concerns me. Are the underlying implementations actually safe and using "undefined behaviour" for mere wrong results, or can they actually access arbitrary memory in that case (for example)? I've tried to look it up in the various specifications/documentations, but with very little success.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants