"...programs that each perform..." vs "...programs that each performs...": which is correct?
Each in phrases like each battery is singular; the verb you use in that cases is singular.
Each battery is in a separate compartment.
Vice versa, in sentences like the following the verb is plural.
They each have their own personality.
Foo comprises multiple binary programs that each perform a single task.
Subject and verb must agree in number; in multiple binary programs that each perform a single task, the subject is multiple binary programs, which is plural, and the verb needs to be plural too (perform).
The real problem with the OP is that “each” has been inserted in a position that obfuscates its purpose. It would be clearer if it said:
“ foo [comprises] of multiple binary programs that perform a single task each.
Another style possibility would be: “ foo [comprises] of multiple binary programs, each performing a single task.
Ignoring the error of style, and all other errors, we have the illusion of an internal conflict in this sentence. Both "that" and "each" seem to funcion as the subject for the verb "perform",
BUT in this sentence, "each" is not functioning as a pronoun. Some would argue it is functioning as an adjective modifying the relative pronoun "that", which is the subject of the relative clause. Others would argue it is functioning as an adverb modifying "perform". Either way, "each" is neither singular nor plural. See Each.
Tabulating functions:
Subject: foo
Verb: comprises [sic]
Prepositional phrase: of multiple binary programs
Relative clause: (referent programs) that each perform a single task
In an additional test, the sentence would make perfect sense without the word "each":
foo comprises of multiple binary programs that perform a single task.
Therefore, ignoring other errors, the correct verb form would be perform.
"foo comprises of multiple binary programs that each perform a single task."
Accepting the awkward style and improper use of the word "comprise", that is the correct grammar for "each", but why should we accept such rubbish? Our conversations about grammar could be much clearer if we kept good semantics and style in mind. Choose your words and design your sentences to make the most of the grammar!
Each is always singular. You are talking about how “each program is” doing one thing. Or how “each of these is” doing one thing. Both formulations are allowed, and in either case, it is singular. Only. That means that all of these are inadmissibly wrong — or alternately, each of these is inadmissibly wrong:
- each ∗programs ∗are
- each program ∗are
- each ∗programs is
- each of these programs ∗are
None of that is English.
Well, not correct English, that is. The OED says:
With reference to a sb. going before, or followed by of. Sometimes incorrectly with pl. vb.
All the citations of the incorrect use are also quite old.
No complex analysis is needed here: each, like every, is always singular, even when it is distributing a plural subject.
Also, “foo comprises of ” is also not English. It needs to be “foo comprises”. I know people who never, ever say comprise for fear of using it wrong, or worse, of being miscorrected. There might be betters words here, like consists of.