It probably isn't even perjury. Even the law has some room for interpretation. That is the whole point of case history. Technology is so new and fluid that the legal system may never catch up to or well define the things a crafty obfuscator (expert witness or lawyer) can sling out.
Skilled practitioners in the area of science or engineering will immediately identify the obfuscation and unreality of it, but that does not make it perjury, which does have a much more specific and well defined case law meaning.
It doesn't sound like Carmack was accusing the witness of lying, but rather they they believed a bit too much in their own pet theory about how to detect copying in code.
I don't usually like to comment on trials, but I think perhaps he has a point here. If there were a reliable method for detecting 'non-literal copying' of code, then the person who made it should be making a killing by selling refactoring tools.
Except that this is an "expert witness", and not a regular witness. The expert witness offers his/her opinions.
Certainly, an attorney can (and this is true of any witness, not just expert witness) coordinate with a witness on a line of questioning which carefully avoids any questions where perjury would be necessary to avoid damaging the case. That's why we have witnesses subject to examinstion by opposing counsel, as well.
It's unfortunately infrequently pursued when the perjury occurs in a civil case, but if you want to agitate for consequences, agitate for prosecutors willing to enforce the law.
(Or for a civil cause of action for perjury, but that would have to be carefully crafted to prevent an infinite regress of lawsuits.)