Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hs-test: Verify a working hasher. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rhn
Copy link

@rhn rhn commented Feb 27, 2020

Verifies that the hashing device is working correctly.

Tested with the simple and opencl backends.

This PR is a:

  • Feature

Checklist:

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

Verifies that the hashing device is working correctly.
@pinheadmz
Copy link
Member

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

@rhn
Copy link
Author

rhn commented Feb 27, 2020

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.

@pinheadmz
Copy link
Member

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.

@rhn
Copy link
Author

rhn commented Feb 27, 2020

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.

@pinheadmz
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants