johguse/ERADICATE2

[Feature request] --zero-bytes instead of just --zeros

Closed this issue · 4 comments

https://twitter.com/PhABCD/status/1265386127650885632?s=20

Well, for it to make a difference you need bytes that are zero, not just any zeroes. E.g.
0x0000000000100100100100100111111111111111
is about 150 cheaper than
0x1010101010101010101010101010101010101010
even though they have the same number of zeroes.

Would a --zero-bytes flag that searches like this this be difficult to add?

This should be trivial to implement, I'll do it properly tomorrow but if you're in a hurry I guess you can hijack eradicate2_score_benchmark in eradicate2.cl on your own local copy and change the function body to:

int score = 0;

for( int i = 0; i < 20; ++i ) {
	score += !hash[i];
}

eradicate2_result_update(hash, pResult, score, scoreMax, deviceIndex, round);

That should do what you want, increase the score if any of the 20 bytes are zero. There's faster ways to do it since the byte-level access is inefficient on hardware but that should be just about as good as how the other scoring functions are implemented.

Ok. Implemented and done, did it in a rush and hope I didn't break anything. New binaries available in the Release section.

Thank you!

Working great!

./ERADICATE2.x64 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --zero-bytes
Devices:
  GPU0: Intel(R) Gen9 HD Graphics NEO, 26831261696 bytes available, 48 compute units

Initializing OpenCL...
  Creating context...OK
  Compiling kernel...OK
  Building program...OK

Running...

  Time:     1s Score:  4 Salt: 0x1fee1a486da49bda5bdba8fdcd342e091dbdadccdd1bbde4e4351156b611687b Address: 0x556b00001097fdd44d00e5a784b3d69e05605e00
  Time:     4s Score:  5 Salt: 0x1fee1a486da49bdc9088a901ce342e091dbdadccdd1bbde4e4351156b611687b Address: 0x33fb8e00c34a9adcb8000000d22e0085b1f72c95
  Time:    16s Score:  6 Salt: 0x1fee1a486da49b0029c9a812ce342e091dbdadccdd1bbde4e4351156b611687b Address: 0xed00d19893e80013005600009c333176006edcf7
Speed: 23.189 MH/s GPU0: 23.189 MH/s

16 seconds to get as many 0 bytes as CHI has. Not bad at all for integrated GPU.