Any attempt to produce an X16R miner from white papers and first principles will fail 100%. If you are new to mining algorithms you must realize that every mining algorithm has within it a tremendous amount of tribal knowledge. Various bit widths, round constants, parameters, conventions, endianness, all changed or modified from original algorithm specifications without documentation of any kind. Mining algorithms have been developed and tweaked from earlier code, which was itself tweaked from earlier code, and so on. SHA-3 refers to a specific and final Keccak variant after several revisions by the original development team. No crypto algorithm actually uses SHA-3, they use what they call 'Keccak' which is an earlier version of that specification, and different crypto algorithms use different variants of Keccak based on different papers published on different dates. There is simply no hope to make a working miner without starting with existing open source code that works.
That makes sense. I'm following source code now for the mining stuff and writing the Statum code myself using various documents. I've gotten that to work and I'm now writing the mining code.