1) GPU 1 writes to CPU RAM, GPU 2 reads from CPU RAM
2) GPU 1 writes to GPU 2 RAM via PCI Express (DMA between devices)
3) GPU 2 reads from GPU 1 RAM via PCI Express (DMA between devices)
Deleted Comment
1) GPU 1 writes to CPU RAM, GPU 2 reads from CPU RAM
2) GPU 1 writes to GPU 2 RAM via PCI Express (DMA between devices)
3) GPU 2 reads from GPU 1 RAM via PCI Express (DMA between devices)
Actually I think the opposite will usually hold: you will still have a green wave if you drive at the expected speed divided by an integer.
(a) get x casted to a float
(b) get `div` instead (like in Python 2) and obtain a false result
(c) get cursed out with a type error.
These three options are available because it's possible to determine whether a given real number is representable as an int or not. This is not possible with floats.
What you can do is:
- determine if a float is an integer (trunc(x) == x),
- convert a float to a certain integer type with some kind of rounding, or get an error if it's out of range (see my comment with double_to_uint64),
- convert a float to a certain integer type exactly, or get an error if it's not representable (e.g. by doing both of the above).
The basic reason that so many people fail to use floats correctly is that they act like operations on floats are equivalent to operations on the real numbers they represent, when in fact they are usually defined as the operation on real numbers rounded to a representable value.
Be aware that +0.0 and -0.0 are different floating point values but represent the same real number, so +0.0 == -0.0 follows.
People who say == means nothing for floating point and you always need epsilon checks are wrong, plain and simple. == is very well defined. Don't confuse the definition of floating point operations with common practices for using them effectively.
You can iterate through all non-NaN values and check that successive ones are indeed not equal:
#include <math.h>
#include <stdint.h>
#include <assert.h>
#include <stdio.h>
#include <inttypes.h>
int main()
{
float x = (float)-INFINITY;
uint64_t count = 1;
while (x != (float)INFINITY) {
float y = nextafterf(x, (float)INFINITY);
assert(y != x);
x = y;
++count;
}
printf("Found %" PRIu64 " floats.\n", count);
return 0;
}
$ gcc -std=c99 -O3 a.c -lm -o a
$ ./a
Found 4278190081 floats.
(a little bit harder for doubles)Interestingly, this only finds one zero (-0.0), hence the assert doesn't actually fail around zero.
Webapp + native gateway also means that the torrent traffic ends up being suspended/throttled if the tab isn't foregrounded or if you close it, something you wouldn't have to deal with if the native gateway was just a native torrent client. Chrome Apps had a background privileged context that could keep running even if no tabs were open (though Google naturally discouraged this unless the app needed it), something you can't really get with a PWA currently (though Service Workers come close if you keep the tab open, I think? Maybe?)
I am skeptical of something like this making an impact for consumer VR, but it should be possible to integrate the sensor input at the OpenXR level, allowing it to work with all apps without needing per-app specialization.
However, it probably doesn’t “solve” motion sickness, because the vestibular system still won’t think you are going forward. The bouncing around motion of walking does have a masking effect that will help some.
Source: https://twitter.com/ID_AA_Carmack/status/1750557236798148613