GithubHelp home page GithubHelp logo

Comments (5)

mame avatar mame commented on August 10, 2024 1

Array[Vector] | Array[Vector] | ... should I open a different issue?

Yep, please. I have no idea why such a type is produced, so will see it later. Thanks!

from typeprof.

mame avatar mame commented on August 10, 2024

Is it too early for bug reports?

No, I really appreciate it!

all the methods that call Array#each_with_index crash

I could reproduce the crash. I have an idea why it fails (it reaches an inconsistent state), but I need to take time to investigate how it reaches the inconsistent state. I will check and fix it.
(Detail: It looks that an wrong-arity generic instance is created. Maybe, RBS declares a two-type-variable class like class Foo[X, Y], but one-type-variable class instance like Foo[X] seems to be created for a unknown reason.)

After ~12 minutes (I have a 2013 MacbookAir 😅 ), it crashes with:

I didn't reproduce it, but I think I fixed the issue at 955df72.

Sorry for ~12 minutes 😭. (Good news: the crash occurs when printing RBS, so the analysis itself is already finished. It will take no more time than 12 minutes 😄)
I know that the analysis performance is a serious problem of typeprof. Though it is fundamentally a slow approach, there are much room to improve the performance. But now I prioritize the not-implemented-yet features.

Thank you!

from typeprof.

marcandre avatar marcandre commented on August 10, 2024

After ~12 minutes (I have a 2013 MacbookAir 😅 ), it crashes with:

I didn't reproduce it, but I think I fixed the issue at 955df72.

I do get an analysis now, great. 🎉

Sorry for ~12 minutes 😭. (Good news: the crash occurs when printing RBS, so the analysis itself is already finished. It will take no more time than 12 minutes 😄)

I know that the analysis performance is a serious problem of typeprof. Though it is fundamentally a slow approach, there are much room to improve the performance. But now I prioritize the not-implemented-yet features.

Yes, of course. Also, I just realized that I was out of Ram (I need a new machine), and Ruby was taking 2G and swapping, so probably much better on a good machine.

Now the results are not particularly usable...

This is what I get for `Matrix#initialize`
def initialize : ((Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
 Array[Complex | Float | Integer | Rational] |
 Array[Integer] |
 Array[Integer] |
 Array[String?] |
 Array[Vector] |
 Array[untyped] |
 Complex | Enumerator[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
 Array[Integer] |
 Array[String?] |
 Array[Vector] |
 Array[untyped] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
 Array[Integer] |
 Array[String?] |
 Array[untyped] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Array[untyped] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
 Array[Vector] |
 Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[Vector] |
 Array[Vector] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[Vector] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Array[Vector?] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Array[nil] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Array[nil] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Rational | String)?] |
 Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Integer | String)?] |
 Array[(Array[(Complex | Float | Integer | Rational | String)?] |
 Complex | Float | Integer | Rational | String)?] |
 Array[(Array[(Integer | String)?] |
 Array[Integer] |
 Array[String?] |
 Integer | String)?] |
 Array[(Array[(Integer | String)?] |
 Array[Integer] |
 Integer)?] |
 Array[(Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
 Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
 Array[(Array[String?] |
 Integer | String)?] |
 Array[(Array[String?] |
 String)?] |
 Array[(Array[Vector] |
 Array[Vector] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[Vector] |
 Array[Vector] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[Vector] |
 Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Array[Vector] |
 Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
 Array[(Complex | Enumerator[untyped] |
 Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
 Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
 Array[(Complex | Float | Integer | Rational | String)?] |
 Array[Array[Integer]] |
 Array[Array[untyped]?] |
 Array[Array[untyped]] |
 Array[Integer?] |
 Array[String?] |
 Array[Vector?] |
 Array[nil] |
 String)?, ?(Complex | Float | Integer | Matrix | Range | Rational)?) -> ((Complex | Float | Integer | Matrix | Range | Rational)?)

First thing I notice is that there are a lot of optionals, which come from a series of deductions of methods that it thinks could return nil: convert_to_array <= Vector#to_a <= Vector@elements <= ?

I will feed it some basic information and see what happens.

A clear bug is that some elements seem repeated... Array[Vector] | Array[Vector] | ... should I open a different issue?

from typeprof.

mame avatar mame commented on August 10, 2024

I think I finally fixed the first issue. The fix has only three lines, but it took a day 😫

Odd result like Array[Vector] | Array[Vector] is not fixed yet (I'll address it in #16), but anyway, now bundle exec exe/typeprof ../ruby/lib/matrix.rb runs in about 40 seconds on my machine without abort.

from typeprof.

marcandre avatar marcandre commented on August 10, 2024

runs in about 40 seconds on my machine without abort.

OMG, what a difference. Ram usage went from 2G+ to ~200MB too 💪

from typeprof.

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.