Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jgarzik on April 03, 2011, 06:28:22 PM



Title: [PULL] remove 4way SSE2 miner algorithm
Post by: jgarzik on April 03, 2011, 06:28:22 PM

URL: https://github.com/bitcoin/bitcoin/pull/141

Description:

While there is no hard consensus on what to do with CPU mining inside bitcoin, in general, I think most people will agree that 4way can go.

This implementation (with performance enhancements) lives on in cpuminer. bitcoin's 4way was only available on *nix, while cpuminer's 4way works on Windows and Linux.

I conclude that, if you are really serious about CPU mining, you are more likely to use ufasoft's CPU miner, or mine, and so we don't need multiple implementations inside bitcoin.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: adv on April 03, 2011, 11:22:27 PM
Oh yeah! The beginning of a long way for cleaning Bitcoin source from useless garbage.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: error on April 03, 2011, 11:36:21 PM
This looks like just the first step in removing CPU mining entirely. At the least, it makes CPU mining even worse than it already is, which is just about exactly the opposite of what I think should be done.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: jgarzik on April 04, 2011, 12:31:23 AM
This looks like just the first step in removing CPU mining entirely. At the least, it makes CPU mining even worse than it already is, which is just about exactly the opposite of what I think should be done.

Most people are divided between removing CPU mining entirely, or leaving in a simple reference miner that is hidden from normal users.

Either way, 4way is superfluous.



Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: error on April 04, 2011, 12:38:37 AM
This looks like just the first step in removing CPU mining entirely. At the least, it makes CPU mining even worse than it already is, which is just about exactly the opposite of what I think should be done.

Most people are divided between removing CPU mining entirely, or leaving in a simple reference miner that is hidden from normal users.

Either way, 4way is superfluous.

I dunno, I'd be disappointed to see it go. Every single block I've ever generated solo came from that 4way CPU miner. Hiding the miner I'll go for, since it's not very useful with today's high difficulties. But intentionally making it even less useful? This seems pointless.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: jgarzik on April 04, 2011, 12:49:14 AM
I dunno, I'd be disappointed to see it go. Every single block I've ever generated solo came from that 4way CPU miner. Hiding the miner I'll go for, since it's not very useful with today's high difficulties. But intentionally making it even less useful? This seems pointless.

The same algo is available elsewhere on more platforms, with more performance.  The bitcoin codebase lost the CPU mining competition long ago.  It's even more pointless to use either algo for CPU mining.

The only question is whether or not to retain one miner as a reference implementation (IMO, yes) or remove all CPU mining code.  And the reference implementation should lean towards readability, rather than super-optimization.  ScanHash_CryptoPP() is pretty darn straightforward.

Removing 4way from bitcoin.git largely costs us nostalgia, as you point out :)



Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: error on April 04, 2011, 12:50:25 AM
Maybe leave it as a reference optimization? ;D


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: adv on April 04, 2011, 03:33:38 AM
Maybe leave it as a reference optimization? ;D
4way -- it is not optimization AFAIK. This is specialization only for one of the many existing CPUs.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: Pieter Wuille on May 02, 2011, 09:03:25 PM
The only reasons i see for keeping a CPU miner in the main client, are:
  • A reference implementation for educational purposes
  • A very easy way to generate coins on testnet (but not very quickly)

I'm in favor of moving all CPU mining code to eventually having a separately distributed reference RPC miner, but meanwhile, the main client shouldn't carry optimization attempts - there is competition out there even between CPU-only miners, and they are better at it.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: gjs278 on May 02, 2011, 09:07:24 PM
remove cpu mining.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: jimbobway on May 02, 2011, 09:14:27 PM
What if a normal user decides he wants to join the bitcoin lottery?  Chances will be low but if he/she finds a 50 BTC block then it's rags to riches.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: Pieter Wuille on May 02, 2011, 09:33:31 PM
What if a normal user decides he wants to join the bitcoin lottery?  Chances will be low but if he/she finds a 50 BTC block then it's rags to riches.

There are separate programs that are much better at this, they support pool mining and are more efficient. If he really wants to join the lottery, he can do so doing those too, but at least he won't be assuming that he'll make money if he lets his computer run for a few hours.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: citizen on May 03, 2011, 07:08:59 PM
+1 for removing CPU mining from the client entirely.  Having a separate RPC miner is a better idea, with some documentation that explains that CPU mining is not very effective at all.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: xf2_org on May 06, 2011, 12:08:34 PM
Merged into upstream.


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: HostFat on May 06, 2011, 01:22:06 PM
Can you export it so it will be like a plug-in?


Title: Re: [PULL] remove 4way SSE2 miner algorithm
Post by: xf2_org on May 06, 2011, 01:25:21 PM
Can you export it so it will be like a plug-in?

See above discussion.  There are better, faster CPU miners external to the bitcoin client.  See the cpuminer thread (http://bitcointalk.org/index.php?topic=1925.0) or the ufasoft thread (http://bitcointalk.org/index.php?topic=3486.0) for such miners. 

cpuminer includes the 4way algorithm just removed from bitcoin.