> Could you explain what's the reason for the effect?
lzma doesn't treat the match distances as a single "alphabet".
It only has a model for log2(dist) + high bit and low 4 bits,
while all intermediate bits are stored without compression.
Thus, any changes in the data that affect the distance alignment
would also affect compression.
Of course, my example here is intentionally designed to amplify
the difference (its still not the worst possible case though),
but the same effect is also noticeable with "natural" files.
> Does it impact lzmarec too?
Yes, lzmarec uses a very similar distance decomposition:
> How came Igor didn't do it by himself?
lzma is basically the only codec (besides its clones) which has such a quirk,
so maybe he simply didn't think about this.
But its also a fact that there're many filetypes for which
lzma compression would be affected by alignment of their
start position (eg. exes), and that all existing archive formats
with lzma support and solid compression don't fix up
the stream position on transition between files.
Anyway, there're many possible improvements for lzma which are not
currently implemented (eg. http://encode.ru/threads/1546-init-f...terals-in-lzma )
so its nothing special.