From 9dbdf1880e6a47f071d821aac48fd9d9cb1d78a8 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 5 Jan 2024 10:50:28 +1000 Subject: [PATCH] Add commented-out prints of solution candidates for debugging --- components/equihash/src/tromp.rs | 20 ++++++++++++++++++++ components/equihash/tromp/equi_miner.c | 11 +++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/components/equihash/src/tromp.rs b/components/equihash/src/tromp.rs index 47da99ee3d..a0ac90eef5 100644 --- a/components/equihash/src/tromp.rs +++ b/components/equihash/src/tromp.rs @@ -44,6 +44,7 @@ extern "C" { /// /// This function uses unsafe code for FFI into the tromp solver. #[allow(unsafe_code)] +#[allow(clippy::print_stdout)] unsafe fn worker(eq: *mut CEqui, p: verify::Params, curr_state: &State) -> Vec> { // SAFETY: caller must supply a valid `eq` instance. // @@ -70,6 +71,7 @@ unsafe fn worker(eq: *mut CEqui, p: verify::Params, curr_state: &State) -> Vec Vec Vec>() + ); + */ + solutions } diff --git a/components/equihash/tromp/equi_miner.c b/components/equihash/tromp/equi_miner.c index c86d767553..43ffe2a91e 100644 --- a/components/equihash/tromp/equi_miner.c +++ b/components/equihash/tromp/equi_miner.c @@ -353,8 +353,15 @@ typedef struct equi equi; listindices1(eq, WK, t, prf); // assume WK odd qsort(prf, PROOFSIZE, sizeof(u32), &compu32); for (u32 i=1; i proof[%d], actual: %d <= %d\n", + i, i-1, prf[i], prf[i-1] + ); + */ return; + } #ifdef EQUIHASH_TROMP_ATOMIC u32 soli = std::atomic_fetch_add_explicit(&eq->nsols, 1U, std::memory_order_relaxed); #else @@ -674,7 +681,7 @@ nc++, candidate(eq, tree_from_bid(bucketid, s0, s1)); } } } -//printf(" %d candidates ", nc); +//printf(" %d candidates\n", nc); } size_t equi_nsols(const equi *eq) {