Re: suffix array/tree deltas (Was: The criss-cross merge case)
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Apr 28, 2005, 04:30 UTC
- Message-ID
- <Pine.LNX.4.21.0504280016000.30848-100000@iabervon.org>
- In-Reply-To
- <1114659700.5910.10.camel@thamachine>
On Wed, 27 Apr 2005, Zed A. Shaw wrote:
Show 11 quoted lines
> On Wed, 2005-04-27 at 19:32 -0400, Daniel Barkalow wrote: > > > My plan is to implement multi-file diff and merge with a suffix tree-based > > algorithm, and then revisit the history stuff once we have a merger that > > can do sensible things with this information. > > Hey, that's neat. I've already implemented two versions of this very > thing with FastCST. The original used suffix trees, but I found that > there were plenty of pathological cases which chewed memory and > processor. Most of these cases were large (>1MB) PDF files. Don't ask > me why PDF drove suffix tree algorithms insane, but they just did.
I'm not too surprised; but can you hope to merge or compare PDFs anyway? I'd think that you'd just screw up alignment or something. (Note that we aren't using deltas for history storage, so we're not interested in the "compressing multiple versions" aspect of diffs.) I think I want to punt anything too binary-like and try to find an unambiguous history-based difference (i.e., there was some commit in the past that replaced one of the versions with the other; therefore, we want the replacing one).
I'm thinking of line-based compressed suffix trees, with the obvious delta algorithm: make the trees, find the longest prefix of the file, find the longest prefix of the rest of the file, add an insertion for a line that doesn't match, repeat. I probably need a few extra things to stabilize the process (prefer that the next chunk come from the same file, prefer that it come from next in the file, ignore copied lines without enough content).
I haven't actually started yet; I'm waiting for a weekend when I'm feeling inspired and not too fried.
-Daniel *This .sig left intentionally blank*