Comments (3)
@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:
- 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.
- Here my internal algorithm tells me that
A_impl
is closer toA
than toB
, 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.) - @art-w, you are one of the best people around to look at this and have good advice.
from ocaml.
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.
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)
- 5.2.0~alpha1: Issues with (x : Subtype.t list :> Type.t list) in presence of multiple destructive substitutions HOT 7
- `cmo` files have different digest on different platforms and ocaml 5.1.1 variant option HOT 2
- 5.2.0~alpha1: ocamlc -pack changed the expected naming convention for the cmi files HOT 3
- TMC on 5.2 generates unexpected lambda for Melange HOT 8
- Missed ignored partial application due to ignored named binding HOT 6
- Atomic mutable fields for objects HOT 1
- Runtime events does not cleanup pid.events file on SIGSTOP HOT 3
- Clarify @noalloc documentation HOT 1
- [5.2] build error: dllunixbyt.so_The boot compiler cannot load DLLs: No such file or directory HOT 5
- Go to definition in VS Code HOT 4
- undefined symbol: caml_zstd_initialize when building ppx using OCaml built with --without-zstd HOT 2
- Wrong interface mli generation in for loops HOT 1
- Improve error message for optional arguments mismatches
- Error installing 5.1.1: zstd/lib/libzstd.so: undefined reference to `pthread_create@GLIBC_2.34' HOT 3
- Stamps of identifiers are not unique HOT 5
- Test `statmemprof/exception_comballoc` fails under TSan (possibly TSan-internal bug) HOT 25
- ThreadSanitizer CI failures on a PR are not shown in the Github UI HOT 4
- [TSan] ocamlrun should never be linked with `-fsanitize=thread`
- Parallel Dynlink usage under Cygwin+MinGW is unsafe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocaml.