A suggestion to change your code practice:
Instead of this:
music = {
...
<<{ ... }\\{ ... }>>
...
<<{ ... }\\{ ... }>>
...
}
\score {
\new Staff { \music }
}
Try doing this:
music_upper = {
\oneVoice
...
\voiceOne ... \oneVoice
...
\voiceOne ... \oneVoice
...
}
music_lower = {
\voiceTwo
s
...
s
...
s
}
music = <<{ \music_upper }\\{ \music_lower }>>
\score {
\new Staff { \music }
}
That is, instead of using <<{}\\{}>>
multiple times within
one context, use it once, and use the combination of \voiceOne
,
\voiceTwo
, and \oneVoice
to change voice directions.
The rationale:
According to the bug thread here,
there’s apparently a common misconception about using the <<{}\\{}>>
construct.
I didn’t realize it until I’d typeset several hundred short pieces, but each
time <<{}\\{}>>
is invoked, two additional Voice contexts are
created. That means that if you make use of that construct several times,
you might end up with the compiled equivalent of a \score {}
with
dozens upon dozens of \new Voice {}
contexts.
In my case, this caused a huge slow-down, and led to compile failures. The
proposed solution was to use fewer contexts and make use of \voiceOne
, \voiceTwo
,
and \oneVoice
. Using \voice...
will automatically control certain
aspects of the notation, such as stem direction and articulation direction. (\oneVoice
neutralizes these.)
Think of the differences this way:
RH = \relative c'' {
red
<<{ yellow }\\{ blue }>> red
red
<<{ green }\\{ cyan }>>
red
}

and this:
RH_upper = \relative c'' {
red
\voiceOne red \oneVoice red
red
\voiceOne red \oneVoice
red
}
RH_lower = \relative c'' {
s
blue s
s
blue
s
}
RH = <<{ \RH_upper }\\{ \RH_lower }>>

Five voices in five measures in the first example; two voices in the second example. It can feel a bit more cumbersome to begin with, but I think it helps in the long run, especially if you are going to typeset pieces longer than a few measures.
Using this method specifically, how to make a polyphonic tie:
RH_upper = \relative c' {
\oneVoice
R2. R
}
RH_lower = \relative c' {
s2. s
}
LH_upper = \relative c {
\oneVoice
<gis dis'>2.^~
\voiceOne dis'4 dis8 dis dis dis
}
LH_lower = \relative c {
\voiceTwo
\once \hideNotes
<gis dis'>2.~
gis4. gis
}
pianoRH = <<{ \RH_upper }\\{ \RH_lower }>>
pianoLH = <<{ \LH_upper }\\{ \LH_lower }>>
Incidentally, you will notice that certain notation elements, such as the .
on the first note, are correctly moved above the staff line. They will not be in the other method unless you manually correct them.