This was the most straight forward way of solving the puzzle I found, just compare every pair of cardinals you need to compare by placing them on a unification glyph with a pair of known cardinals. Then after cycling through all possible pairs, if it formed Quint they were different, else they are the same, a simple Nand gate to output gold does the trick. For salt, if after comparing all 4 triplets the gold from the Nand gate is still there, you need to output salt.

To improve the Wsum score you mainly need to go faster, which I think could either be done with a better algorithm, but also by simply doing multiple comparisons at the same time, with multiple unification glyphs.

