P.S.: Even more of a hint that there's some kind of overflow regarding the spell books in the log diff:
Code:
+spellscore, end score -9999 (boost 86 scorat 0)
+Eval: end score 0 (fat 0)
+comp_castspell: eval end result 0
+spellscore, score 0 (boost 81 scorat 0)
+Eval: score 0 (fat 0)
+comp_castspell: eval result 0
The game evaluates the spell named "end", which is no real spell at all, but just a marker in the data to indicate the end of the spells,
and even the "spell" after that, which just consist of empty, zeroed out data.
So even if this is not the culprit, there's definitely something fishy here.