Readit News logoReadit News
ambrop7 commented on Disney unveils the HoloTile floor   ign.com/articles/disney-u... · Posted by u/wallflower
BryanLegend · 2 years ago
John Carmacks take:

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

ambrop7 · 2 years ago
The issue is not motion, the vestibular system cannot measure velocity, only linear acceleration and rotation. The only issue is while you are accelerating in a horizontal direction in VR, but you are not actually acccelerating (remember acceleration is absolute not relative). But I don't expect this will be much of an issue. We don't have a problem speeding up or slowing down on a treadmill.

Deleted Comment

ambrop7 commented on Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration   phoronix.com/scan.php?pag... · Posted by u/nirv
floatboth · 6 years ago
That is the whole point, one of the original use cases was passing around buffers between different GPUs on dual-graphics laptops (PRIME)
ambrop7 · 6 years ago
Do you maybe know, when frames rendered by GPU 1 (e.g. fast GPU) need to be sent to GPU 2 (e.g. slow GPU doing the compositing and outputting to the monitor), how does the data actually get transferred? I can imagine the following possibilities:

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)

ambrop7 commented on Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration   phoronix.com/scan.php?pag... · Posted by u/nirv
cycloptic · 6 years ago
It's the opposite. The point of using DMA-BUFs is that those are the handles which are passed around, and the data never leaves GPU memory. The handles can be directly accessed from EGL/Vulkan and used as render source/targets.
ambrop7 · 6 years ago
This is quite unclear to me. Is DMA-BUF so generic that the memory it refers to can be in different types of RAM, including GPU RAM and CPU RAM?
ambrop7 commented on Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration   phoronix.com/scan.php?pag... · Posted by u/nirv
ambrop7 · 6 years ago
The mention of DMA-BUF makes me suspect that it involves rendered video being copied from the GPU to the main RAM and back to the GPU, which wastes energy. Does someone have details about how the integration works?
ambrop7 commented on Fork() can fail: this is important (2014)   rachelbythebay.com/w/2014... · Posted by u/kiyanwang
ambrop7 · 6 years ago
In any case, if the program forks in order to exec, it shouldn't be using fork at all, but posix_spawn. Fork gets more expensive as the virtual memory of the process grows, since it needs to copy page tables. For very large process forking can be prohibitively expensive due to this. And posix_spawn does not have this problem.
ambrop7 commented on Green Wave   en.wikipedia.org/wiki/Gre... · Posted by u/davidmckenna
throw0101a · 6 years ago
Remember folks: lights timed for 40 are also timed for 80. /s
ambrop7 · 6 years ago
Suppose the the period of lights is equal to the time expected to move from one light to the next, and each light is red/green for the same amount of time. You have a green wave if you pass the first light green and drive at the expected speed. But if you drive twice as fast, you reach the second light red instead of green. Now it would work if the period of lights was half the time expected to get from one light to the next, but why would that generally be the case?

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.

ambrop7 commented on My C code works with -O3 but not with -O0   mulle-kybernetik.com/webl... · Posted by u/mulle_nat
thanatropism · 6 years ago
Each int also corresponds to a certain real number, but if you write "x*(1/x)==1" for integer x, you'll either

(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.

ambrop7 · 6 years ago
Programming languages aren't able to express arbitrary real numbers, so to "determine whether a given real number is representable as an int or not" is mostly meaningless in a programming language as opposed to a computer algebra system.

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.

ambrop7 commented on My C code works with -O3 but not with -O0   mulle-kybernetik.com/webl... · Posted by u/mulle_nat
thanatropism · 6 years ago
How is == still defined for floats (in typeful languages)? Fixed precision decimals should be on offer and suggested by compilers in response to an equality-on-floats.
ambrop7 · 6 years ago
Each floating point value that is not a NaN represents a certain real number, -inf or +inf (this can be expressed in terms of the sign bit, exponent and mantissa). Knowing that, a == b when neither operand is a NaN is defined as equality of what they represent, in purely mathematical terms. Similar can be said for inequality operators.

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.

ambrop7 commented on Google is finally killing off Chrome apps, which nobody really used   theverge.com/2020/1/15/21... · Posted by u/doener
kevingadd · 6 years ago
Why use a webapp AND a local native gateway instead of just a native app? If your goal is to just not open any native win32/cocoa/etc UIs for some reason, there are existing native torrent clients with web interfaces served over http and those have been available for like a decade plus.

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?)

ambrop7 · 6 years ago
One benefit would be to protect yourself from security issues in the main torrent code. Anyway it was just an idea, not a serious proposal.

u/ambrop7

KarmaCake day1053August 15, 2012
About
My interests:

- Programming, open source (C, C++)

- Linux, NixOS

- Computer networks

- RepRap 3D printers (got a RepRapPro Mendel)

Most of my open-source software is available here: https://code.google.com/p/badvpn/ . This includes:

- NCD programming language

- Tun2socks network layer proxifier

- Peer-to-peer layer 2 VPN

I'm also developing the APrinter open-source firmware for RepRap's: https://github.com/ambrop72/aprinter .

View Original