2019-05-31 12:36:44
the surfminer now reads only 1G/s for me whereas previously it read 3G/s
Rotonen
2019-05-31 12:37:05
let’s see if it finally submits valid shares
Rotonen
2019-05-31 12:37:44
at least it had already had trouble parsing the status message from the pool
Rotonen
2019-05-31 12:39:02
4 waves, 16 hash threads, 40G work mem, 55G heap size
Rotonen
2019-05-31 12:45:46
seems the GC stalls the waves
Rotonen
2019-05-31 12:51:34
i’m now also convinced surf miner is cpu limited
Rotonen
2019-05-31 12:56:04
and it’s not the gc, just that the queue is not progressing - the gc thread in iotop just coincides with the program being less busy
Rotonen
2019-05-31 12:56:21
correlation does not equal causation
Rotonen
2019-05-31 12:57:57
averaging 5 hashes per second over the first hour, but at least no invalid shares yet :P
Rotonen
2019-05-31 13:01:29
@Fireduck how about you only log the share info line when a new share is found instead of every time the hashrate report fires?
Rotonen
2019-05-31 13:14:09
so on a quick parametre sweep it’d seem the wave count should equal system hyperthreads and the hash thread count real cores
Rotonen
2019-05-31 13:14:56
which makes sense, the 1G cost per wave can make that rough
Rotonen
2019-05-31 16:11:24
you can change the wave size
Fireduck
2019-05-31 16:16:58
The strange thing with burning all the cpu...PoolMiner in ram mode does all the fetching and gets a much higher hash rate, so my nonsense about the L3 cache size probably means nothing
Fireduck
2019-05-31 16:17:05
something else is eating all the CPU
Fireduck
2019-05-31 16:17:34
probably mallocs in the MagicQueue
Fireduck
2019-05-31 16:18:01
what is a good java profiler? Ideally command line to gather data. Graphical to review the data would be fine.
Fireduck
2019-05-31 21:16:43
last time i profiled java was on mobile java 1.4
Rotonen
2019-05-31 21:17:09
you just need a call trace and a way to visualize
Rotonen
2019-05-31 21:17:24
no fancy bells or whistles required
Rotonen
2019-05-31 21:17:50
yep
Fireduck
2019-05-31 21:21:06
is there a separate .proto for the pool communication?
Rotonen
2019-05-31 21:21:53
yeah, mining_pool.proto
Fireduck
2019-05-31 21:21:55
i’m actually gonna take a stab at putting together a prototype in pypy
Rotonen
2019-05-31 21:22:03
excellent
Rotonen
2019-05-31 21:22:19
it depends on the main proto though
Fireduck
2019-05-31 21:22:22
i guess that’s streaming new blocks and pushing shares
Rotonen
2019-05-31 21:22:25
for the block header
Fireduck
2019-05-31 21:22:30
yep
Fireduck
2019-05-31 21:22:37
fair
Rotonen
2019-05-31 21:23:08
SharedMiningService = Arktika
Fireduck
2019-05-31 21:23:09
i’ll start with the build tooling and other build system and packaging stuff
Rotonen
2019-05-31 21:23:30
service MiningPoolService {
rpc GetWork ( GetWorkRequest ) returns (stream WorkUnit) {}
rpc SubmitWork ( WorkSubmitRequest ) returns ( SubmitReply ) {}
}
Fireduck
2019-05-31 21:23:38
That is the actual pool protocol, pretty simple
Fireduck
2019-05-31 21:23:54
and submit reply is bool?
Rotonen
2019-05-31 21:24:22
and work unit is int?
Rotonen
2019-05-31 21:24:58
SubmitReply is a bool and an error message
Fireduck
2019-05-31 21:25:00
or byte array, as every data type, and the game is a hunt for a prefix
Rotonen
2019-05-31 21:25:22
The WorkUnit has a block header, a target hash and an identifier
Fireduck
2019-05-31 21:26:00
i think i have a fair idea of the whole architecture i want to try
Rotonen
2019-05-31 21:26:12
cool
Fireduck
2019-05-31 21:26:23
how do you do the hashrate estimates without those getting in the way?
Rotonen
2019-05-31 21:27:00
i think i’ll just estimate the 1h average based on share diff and count
Rotonen
2019-05-31 21:27:34
What do you mean getting in the way?
Fireduck
2019-05-31 21:27:40
and there is no inherent reason why one could not go for non-integer log2 difficulties?
Rotonen
2019-05-31 21:27:57
well you need to keep books per crank of the handle
Rotonen
2019-05-31 21:28:15
and that happens up to millions of times per second
Rotonen
2019-05-31 21:28:45
MultiAtomicLong
Fireduck
2019-05-31 21:29:05
so just a guaranteed locked int
Rotonen
2019-05-31 21:29:12
https://github.com/fireduck64/duckutil/blob/master/src/MultiAtomicLong.java ```
package duckutil;
import java.util.concurrent.atomic.AtomicLong;
import java.util.LinkedList;
/**
* High performance atomiclong for multiple threads to write to quickly.
* Does not do well if there are many threads being created as each one
* will leave behind an entry. Works great with consistent thread pools.
*
* In testing on a reasonable multicpu machine with 100 threads,
* got 60M/s with normal AtomicLong and 650M/s with this.
*/
public class MultiAtomicLong
{
private LinkedList<AtomicLong> al_list = new LinkedList<>();
private ThreadLocal<AtomicLong> al_local = new ThreadLocal<>();
/**
* Get the sum of all values and reset to zero
*/
public long sumAndReset()
{
long v = 0;
synchronized(al_list)
{
for(AtomicLong l : al_list)
{
v+= l.getAndSet(0L);
}
}
return v;
}
public long sum()
{
long v = 0;
synchronized(al_list)
{
for(AtomicLong l : al_list)
{
v+= l.get();
}
}
return v;
}
public void add(Long v)
{
AtomicLong l = al_local.get();
if (l == null)
{
l = new AtomicLong(0L);
al_local.set(l);
synchronized(al_list) { al_list.add(l); }
}
l.getAndAdd(v);
}
}
```
Fireduck
2019-05-31 21:29:18
meh, i’ll avoid that for now
Rotonen
2019-05-31 21:29:22
Way faster than an AtomicLong
Fireduck
2019-05-31 21:29:55
well, python’s not for such
Rotonen
2019-05-31 21:30:35
but share validation on the pool side, does it only do whole number log2 shares?
Rotonen
2019-05-31 21:30:59
yeah
Fireduck
2019-05-31 21:31:32
wanna eventually handle fractional prefixes as well?
Rotonen
2019-05-31 21:31:52
I don't think so
Fireduck
2019-05-31 21:32:04
doesn't seem like something we would need
Fireduck
2019-05-31 21:32:14
I think the miners would support it currently
Fireduck
2019-05-31 21:32:41
it’s just a bunch of bits, so yep
Rotonen
2019-05-31 21:37:34
i predict i'll hit my head on the madness of python multiprocessing and shared memory and trying to do an LRU cache on that for the reads
Rotonen
2019-05-31 21:38:06
or might just get stuck trying to find a way to run skein
Fireduck
2019-05-31 21:38:38
to go the pypy way i'll need to reimplement stuff in python anyway
Rotonen
2019-05-31 21:39:12
at least i have the worst parts of the lego i seek already done for me https://pypi.org/project/geesefly/ Pure Python implementation of Skein and Threefish
Rotonen
2019-05-31 21:40:33
nice
Fireduck
2019-05-31 21:40:48
or as that's half bitrot i'll probably try normal python for now as there is already https://pythonhosted.org/pyskein/
Rotonen
2019-05-31 21:41:06
this project would have been impossible without the bouncycastle library
Fireduck
2019-05-31 21:45:32
@Fireduck have you evaluated this one? https://github.com/bigfatbrowncat/zetes A lightweight cross-platform GUI application framework based on Avian and SWT
Rotonen
2019-05-31 21:46:09
i have not
Fireduck
2019-05-31 21:46:26
looks... stable
Rotonen
2019-05-31 21:46:44
oh god, mingw
Fireduck