Git Product home page Git Product logo

Comments (6)

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on August 14, 2024

I return UINT64_MAX if the product of nrows times ncols can cause int64_t overflow, but I might be overly cautious in this case because ncols is 1 for a GrB_Vector.

It would be a good idea to use 1152921504606846976L to make sure that value is a 64-bit constant.

from graphblas.

eriknw avatar eriknw commented on August 14, 2024

Gotcha. I actually cause this error from Python via python-graphblas (where types are handled correctly):

v = Vector(int, size=2**60)
v[:] = 1
v.nvals  # bad value!

This worked correctly with previous versions of SuiteSparse:GraphBLAS. v8.0.0 introduced a regression.

from graphblas.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on August 14, 2024

Try the latest push to the master branch. I changed how I handle checking integer overflow in Source/GB_uint64_multiply.h in v8.0.0 and I think I introduced this bug then. The latest push to the master branch should fix this.

from graphblas.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on August 14, 2024

That fixed it. I added a new test (GraphBLAS/Test/GB_mex_test25.c) that fails with v8.0.0 (triggering this error) but works fine for the draft v8.0.1.

from graphblas.

DrTimothyAldenDavis avatar DrTimothyAldenDavis commented on August 14, 2024

The fix isn't perfect because the integer overflow guard is not exact (it wasn't exact in v7.x either). For example, if you ask for GrB_Matrix_nvals for a matrix of size 2 by 2^30, it will report INT64_MAX, or 'infinity' because that case triggers the overflow guard. That's by design. It's too costly to put in a precise integer overflow guard.

from graphblas.

eriknw avatar eriknw commented on August 14, 2024

I confirm that this is now fixed in v8.0.1. Thanks @DrTimothyAldenDavis! Closing.

from graphblas.

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.