I run the basic tests you provided and everything works as reported. This is only a superficial review since I am not knowledgeable on this topic.
Looking forward to milestone 2 “GPU acceleration with OpenCL/Metal”, time to test your metal .
edge-bits 21+: High memory usage, may crash on systems with <32GB RAM
The above text betrays a lack of understanding of lean mining.
Lean mining a CuckatooN graph should require only 2^{N+1} bits of memory for trimming.
E.g. my lean miner reports:
Looking for 42-cycle on cuckatoo19(“”) with trimming to 11 bits, 96 trimming rounds, 1 threads
Using 64KB edge and 64KB node memory, and 1-way siphash
Edge bits 21 should take well under 1MB of memory, which is a rather small amount easily fitting in a CPU’s cache. More than 16GB should only be needed for cuckatoo36.
Can you please report back when you have a demonstrable lean mining ability to find 42-cycles in a 19 edge-bits cuckatoo graph?
Checking cuckatoo-core v0.1.0 (/Users/tromp/grin/cuckatoo-mining/cuckatoo-core)
warning: field `edge_to_index` is never read
--> cuckatoo-core/src/trimming.rs:151:5
|
147 | struct EdgeBitmap {
| ---------- field in this struct
...
151 | edge_to_index: HashMap<Edge, usize>,
| ^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: method `active_count` is never used
--> cuckatoo-core/src/trimming.rs:199:8
|
156 | impl EdgeBitmap {
| --------------- method in this implementation
...
199 | fn active_count(&self) -> usize {
| ^^^^^^^^^^^^
warning: methods `get_degree` and `active_count` are never used
--> cuckatoo-core/src/trimming.rs:257:8
|
212 | impl NodeBitmap {
| --------------- methods in this implementation
...
257 | fn get_degree(&self, node: Node) -> u32 {
| ^^^^^^^^^^
...
262 | fn active_count(&self) -> usize {
| ^^^^^^^^^^^^
Tests are failing for me:
running 22 tests
test hashing::tests::test_edge_generation_invalid_bits ... ok
test hashing::tests::test_single_edge_hash ... ok
test hashing::tests::test_siphash_creation ... ok
test hashing::tests::test_siphash_custom_key ... ok
test timing::tests::test_measure_time ... ok
test timing::tests::test_benchmark_runner ... ok
test hashing::tests::test_generate_edges_function ... FAILED
test hashing::tests::test_edge_generation_small ... FAILED
test trimming::tests::test_edge_bitmap_creation ... ok
test trimming::tests::test_empty_edges ... ok
test trimming::tests::test_lean_trimmer_creation ... FAILED
test trimming::tests::test_leaf_node_detection ... ok
test trimming::tests::test_node_bitmap_creation ... ok
test trimming::tests::test_simple_trimming ... ok
test verification::tests::test_adjacency_list_building ... ok
test verification::tests::test_cycle_verification_not_enough_edges ... ok
test verification::tests::test_cycle_verifier_creation ... ok
test verification::tests::test_simple_cycle_verification ... ok
test verification::tests::test_optimized_cycle_verifier ... FAILED
test verification::tests::test_specific_cycle_verification ... FAILED
test timing::tests::test_measure_time_logged ... ok
test timing::tests::test_performance_timer ... FAILED
For verification purposes, could you please print out the siphash keys for each graph in which you found a cycle, as well as the cycle edge indices?
Edges 0 and 1 are not incident, since node 930 in partition V is a completely different node from node 930 in partition U. Furthermore, the endpoints of incident edges should differ in only their last bit.