ctests for Additioonal.lyx lyx2lyx round trip failing on master

Scott Kostyshak skostysh at lyx.org
Tue Jan 26 16:58:00 UTC 2021

On Tue, Jan 26, 2021 at 08:30:28AM +0100, Jürgen Spitzmüller wrote:
> Am Montag, dem 25.01.2021 um 15:09 -0500 schrieb Scott Kostyshak:
> > It seems they fail the convergence criteria of the test. That is,
> > with successive round trips the .lyx files keep changing. This is
> > expected in some cases (and we can adapt the tests), but I don't know
> > enough to know whether it's expected here. 
> It's expected. We insert ERT in reversion which we do not remove in
> conversion (we generally don't do this).

Makes sense.

> > Also, it was surprising that the English version conver es but not
> > the Spanish version. Here [1] is a screenshot of the Spanish
> > Additional manual after a few iterations.
> > Interestingly, the first column has only one pair of ERTs, but the
> > second and third columns show the failed convergence. Here [2] is a
> > screenshot of the English Additional manual in case it is helpful for
> > comparison.
> Yes, the ERTs are only inserted if the multirows have multiple
> paragraphs or newline insets.

I see. I think I understand now. For the first column, the newline
insets are replaced with ERT, where as for the second and third columns,
the new paragraphs are not replaced with ERT so the reversion routine
keeps being triggered. A potential solution would be to replace the
paragraph breaks with ERT so they would not trigger reversion routines.

> This is all expected.

Thanks, we'll adapt the tests accordingly.

> You can't expect a LyX document of this
> complexity survive multiple cycles.

Makes sense, I was indeed surprised that convergence actually worked
before. The change is the first expected break to convergence since a
long time. Roundtrips with even 1.6.x format seemed to converge before
(although convergence doesn't mean much: these roundtrips could have
converged due to a bug for example). There must be other ERT backwards
conversions so it seems like a puzzle to me of why convergence worked
before and the recent commit breaks it, but from what I understand it
doesn't seem worth spending time on. My guess at the explanation for the
"puzzle" is our discussion above, that in most cases in backwards
conversion we use ERT to replace the *entire* relevant text (or at least
the parts that would trigger the lyx2lyx routine). In the recent change,
it seems we use ERT to replace only part of it so that the reversion
routine keeps being triggered.

Thanks for taking a look and the explanation, Jürgen.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210126/a03d6fe5/attachment.asc>

More information about the lyx-devel mailing list