Giter Site home page Giter Site logo

Comments (3)

gasche avatar gasche commented on June 16, 2024

@Octachron I'm not fond of #12988 as a proposed fix to this issue. My understanding is that when there are several choices that are just as good (from the algorithm's perspective), you tweaked the heuristic on which one to choose to make this specific example work better, at the cost of a degradation in other examples.

My three cents:

  1. If there are several optimal edit paths that look very different, should we consider not showing any of them, instead of showing one of them? (maybe sometimes they share a common prefix that they agree on, and we could still show something?) This gets rid of the "some magic is happening to guess one option" feeling that I agree is disturbing.
  2. Here my internal algorithm tells me that A_impl is closer to A than to B, so I know that the two edit paths are not equivalent. Could we integrate such metrics in our distance computation? (For example: count the number the disagreeing items as part of the distance between two signatures. Or maybe the proportion of disagreeing items.)
  3. @art-w, you are one of the best people around to look at this and have good advice.

from ocaml.

Octachron avatar Octachron commented on June 16, 2024

The diffing algorithm is heuristic by nature.
To keep the algorithm efficient we must cut branches early rather than storing all possible possible paths.

Having a finer grained measure of change distance is definitively part on my plans, but our current weight are already underspecified.

Typically, the more principled version of my change would be to make weight dependent on the position in the diffing matrix: the rule for the functor application will be that inserting missing argument is cheaper near end corner of the matrix. But this introduces even more parameters to choose compared to hard-wiring a prefer for path ending with insertion amongst the path with same weight.

from ocaml.

art-w avatar art-w commented on June 16, 2024

I actually like @Octachron fix! Even with a more fancy algorithm that would weight the similarity of the parameters with the expected interfaces, I expect that it would be necessary to break ties in favor of the application order as it produces the least surprising error message (defaulting to "no magic").

from ocaml.

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.