Giter Club home page Giter Club logo

Comments (9)

donofrio avatar donofrio commented on September 17, 2024

Issue was confirmed and reproduced. Fix implemented and this test should be working in the latest devel branch

from rev.

ukasz avatar ukasz commented on September 17, 2024

We've seen it fixed on e285dff, but on latest devel it is still broken (FPU issues in general, not this particular test case).

from rev.

donofrio avatar donofrio commented on September 17, 2024

Can confirm we are still seeing that... root caused to an issue with FP MV, fix in place and will be included in devel shortly

from rev.

donofrio avatar donofrio commented on September 17, 2024

Additional FP op updates pushed to devel - test should be working

from rev.

ukasz avatar ukasz commented on September 17, 2024

This particular test case is fixed on (4414659), but we stil see FPU issues.
Example:

int main() {
        assert(fabs(-1) >= 1);
        assert(fabs(-1) < 1.01);
        return 0;
}

And something less trivial:

#include <cmath>
#define assert(x) if (!(x)) { asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); }

template <typename T> void testPI()
{
        T pi = 0;
        T n = 1;

        for(int i = 0; i < 10000; i++, n += 2) {
                T tmp = 4.0 / n;
                if (i % 2)
                        pi -= tmp;
                else pi += tmp;
        }
        assert(pi > 3.1414);
        assert(pi < 3.1417);
}

int main() {
        testPI<float>();
}

Sqrt is a dedicated instruction, so we need a test for that as well:

#include <cmath>
#define assert(x) if (!(x)) { asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); }

int main() {
        float fx, fy;
        double dx, dy;

        fx = 25;
        fy = sqrt(fx);
        assert(fy > 4.99);
        assert(fy < 5.01);

        dx = 25;
        dy = sqrt(dx);
        assert(dy > 4.99);
        assert(dy < 5.01);

        fx = 8;
        fy = sqrt(fx);
        assert(fy > 2.8);
        assert(fy < 2.9);

        dx = 8;
        dy = sqrt(dx);
        assert(dy > 2.8);
        assert(dy < 2.9);
        return 0;
}

from rev.

ukasz avatar ukasz commented on September 17, 2024

Tested on (581618e), out of the four test cases posted earlier, the last two are failing at this point.

from rev.

ukasz avatar ukasz commented on September 17, 2024

Seems that we have a regression again on devel branch and tests which were passing are now broken.
Example:

volatile float a = 0.199;
volatile float b = 0.2;
assert(a < b);
assert(a <= b);
assert(b > a);
assert(b >= a);
a = 0.2;
assert(a == b);

from rev.

donofrio avatar donofrio commented on September 17, 2024

Revisiting this issue... The test above appears to be working properly, however, the testPi() function appears to still fail. I believe the root cause of this is a double to single precision conversion that Rev is performing incorrectly - will address and have a fix ASAP

from rev.

ukasz avatar ukasz commented on September 17, 2024

This bug has become a container for multiple things. I believe it is not a good idea to track it this way. Original issue has been fixed so I am closing this bug and we'll create simpler self-contained issues with more specific problems.

from rev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.