[darcs-devel] shrinkPatchInfo goes into infinite loop

Ben Franksen ben.franksen at online.de
Mon Mar 2 10:58:15 UTC 2020


> I've spent a while playing with this and I am partially convinced that
> it's your change that triggered the loop.
> 
> I've just sent some new draft patches on top of yours in patch2006. If
> you just take these ones:
> 
>   * introduce empty
>   * tests: bugfix for shrinking log lines
>   * WIP: introduce shrinking tests
> 
> You'll see that the new tests I added to check shrinking pass.
> 
> If you then take the rest, they start failing. My suspicion is that your
> change to the shrinking of names:
> 
>> -      sn <- f1 (piName pi)
>> +      sn <- f1 (justName pi)
> 
> along with the other underlying changes, has made it possible for an
> empty name to be shrunk to an empty name.

Let's see. The input to shrink cannot be a tag, as we don't generate
these, only regular PatchNames. If could have an inverted flag though.

Suppose the internal bytestring patch name is empty, perhaps as a result
of previous shrinks. Then, if legacy inverted is set, we have justName
pi == "UNDO: ". We then use this to generate a supposedly smaller
PatchInfo, which now actually becomes larger. This is clearly wrong! And
I think this is what causes the loop.

Cheers
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 4211 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20200302/5336801e/attachment-0001.key>


More information about the darcs-devel mailing list