hs-miner icon indicating copy to clipboard operation
hs-miner copied to clipboard

hs-test: Verify a working hasher.

Open rhn opened this issue 5 years ago • 5 comments

Verifies that the hashing device is working correctly.

Tested with the simple and opencl backends.

This PR is a:

  • [ ] Feature

Checklist:

  • [X] npm run install-regtest 🆗
  • [ ] npm run lint 🆗
  • [X] npm run test fails on master already

rhn avatar Feb 27 '20 12:02 rhn

What does this do that hs-bench, and testing against a local regtest node don't already do?

pinheadmz avatar Feb 27 '20 12:02 pinheadmz

hs-bench doesn't check if the results are sane, it just sets an impossible threshold and lets the computation go regardless of correctness.

Compared to testing with a local regtest node, this doesn't need a local regtest node :) The scope is to test correctness of the kernel, not the network. It's rather similar to miner-test.js, except it ensures that the result is not accidental.

rhn avatar Feb 27 '20 13:02 rhn

In that case, could you refactor your test vector into one of the tests in test/ ? Take a look at the files in there already and see if anything makes sense.

pinheadmz avatar Feb 27 '20 14:02 pinheadmz

Do you think it makes sense to replace miner-test.js with this one? The goal is very close, but this is more accurate.

The reason I even wrote it is because I saw a benchmarking tool but not a testing tool. If there was a mention of a GPU checker in the docs, I would have used that. I'd like to add a mention to the README somewhere. How to run just a single test from tests/?

EDIT: Sorry for the spam, I was led to believe my messages didn't get through.

rhn avatar Feb 27 '20 14:02 rhn

Yeah github was having issues for the last hour or so, no worries.

SO - don't replace or remove any tests, just add. You can look through the test suite in hsd to see the preferred formatting.

The user should be able to install, and npm run test -- with any hardware attached.

You can single out individual tests using mocha's syntax but dont worry about that for now.

pinheadmz avatar Feb 27 '20 16:02 pinheadmz