Next set of tests
This commit is contained in:
parent
75d3ff6863
commit
f8746f4a35
195
compress.c
195
compress.c
|
@ -1,19 +1,14 @@
|
|||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright © 2021 by Brett Kuntz. All rights reserved.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
#include "compress.h"
|
||||
#define SAMPLES_PER_TEST 8000
|
||||
static u64 * global_total;
|
||||
static sem_t csoutput;
|
||||
static const u64 BLAKE_IV = UINT64_C(0xA54FF53A5F1D36F1);
|
||||
#define CUTS_LENGTH 8
|
||||
static ui CHAIN_CUTS[CUTS_LENGTH] = { 37, 23, 17, 14, 11, 9, 8, -1 };
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
//#include <windows.h>
|
||||
#include <windows.h>
|
||||
si main(si argc, s8 ** argv)
|
||||
{
|
||||
/*if (SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS))
|
||||
if (SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS))
|
||||
{
|
||||
printf("Low priority set\n");
|
||||
}*/
|
||||
}
|
||||
|
||||
if (sem_init(&csoutput, 1, 1) == -1)
|
||||
{
|
||||
|
@ -27,42 +22,31 @@ si main(si argc, s8 ** argv)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
// BRETT: DID YOU CONFIRM THE SUB-BLOCKS ARE CORRECT???
|
||||
if (argc != 3) return EXIT_FAILURE;
|
||||
|
||||
if (argc != 2) return EXIT_FAILURE;
|
||||
const ui CUTOFF = 7 + atoi(argv[1]);
|
||||
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
// BRETT: How about the printf's?
|
||||
const ui CUTOFF = atol(argv[1]);
|
||||
const ul SAMPLES = atol(argv[2]);
|
||||
|
||||
// Start
|
||||
printf("Starting\n");
|
||||
|
||||
const ui threads = get_nprocs();
|
||||
|
||||
printf("CUTOFF: %u\n", CUTOFF);
|
||||
printf("SAMPLES_PER_TEST: %lu\n", (ul)SAMPLES_PER_TEST);
|
||||
SAMPLES_PER_TEST = round((r64)SAMPLES / threads);
|
||||
|
||||
printf("CUTOFF we're testing: %u\n", CUTOFF);
|
||||
printf("SAMPLES: %lu\n", SAMPLES);
|
||||
printf("threads: %u\n", threads);
|
||||
printf("SAMPLES per thread: %lu\n", (ul)SAMPLES_PER_TEST);
|
||||
fflush(0);
|
||||
|
||||
CHAIN_CUTS[CUTS_LENGTH - 1] = CUTOFF;
|
||||
|
||||
for (ui t=0;t<threads;t++)
|
||||
{
|
||||
if (!fork())
|
||||
{
|
||||
check(37, 23, 17, 14, 11, 9, CUTOFF);
|
||||
check();
|
||||
|
||||
printf("Child Exiting\n");
|
||||
fflush(0);
|
||||
|
@ -73,20 +57,16 @@ si main(si argc, s8 ** argv)
|
|||
|
||||
cwait;
|
||||
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
// Change below
|
||||
|
||||
s8 buf[2048];
|
||||
const u64 total_samples = SAMPLES_PER_TEST * threads;
|
||||
const r64 avg_distance = (r64)*global_total / total_samples;
|
||||
sprintf(buf, "Test Params: find_hash20, find_p_hash20.%u, find_p_hash20.%u, find_p_hash20.%u, find_p_hash20.%u, find_p_hash20.%u, find_p_hash20.%u, find_p_hash20.%u\n", 37, 23, 17, 14, 11, 9, CUTOFF);
|
||||
sprintf(&buf[strlen(buf)], "n=%"PRIu64"\n", total_samples);
|
||||
const r64 avg_distance = (r64)*global_total / SAMPLES;
|
||||
sprintf(buf, "Test Params: ");
|
||||
for (ui i=0;i<CUTS_LENGTH;i++)
|
||||
{
|
||||
sprintf(&buf[strlen(buf)], "%u, ", CHAIN_CUTS[i]);
|
||||
}
|
||||
buf[strlen(buf) - 2] = 0;
|
||||
sprintf(&buf[strlen(buf)], "n=%lu\n", SAMPLES);
|
||||
sprintf(&buf[strlen(buf)], "CUTS_LENGTH: %u\n", CUTS_LENGTH);
|
||||
sprintf(&buf[strlen(buf)], "Average Distance: %.4f\n\n", avg_distance);
|
||||
FILE * fout = fopen("output_results.txt", "ab");
|
||||
fputs(buf, fout);
|
||||
|
@ -97,7 +77,7 @@ si main(si argc, s8 ** argv)
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void check(const u8 p2, const u8 p3, const u8 p4, const u8 p5, const u8 p6, const u8 p7, const u8 p8)
|
||||
static void check(void)
|
||||
{
|
||||
FILE * frand = fopen("/dev/urandom", "rb");
|
||||
|
||||
|
@ -107,7 +87,6 @@ void check(const u8 p2, const u8 p3, const u8 p4, const u8 p5, const u8 p6, cons
|
|||
|
||||
for (u64 i=0;i<SAMPLES_PER_TEST;i++)
|
||||
{
|
||||
//if (i && !(i & 3))
|
||||
if (i)
|
||||
{
|
||||
const r64 m = (tick() - start) / 60000.;
|
||||
|
@ -127,47 +106,13 @@ void check(const u8 p2, const u8 p3, const u8 p4, const u8 p5, const u8 p6, cons
|
|||
u64 v[16], m[16];
|
||||
const u64 sub_block = i * 32;
|
||||
|
||||
find_hash(0, output_block, input_block, v, m, input_iv, sub_block + 0, 20);
|
||||
find_hash(0, output_block, input_block, v, m, input_iv, sub_block, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 1, p2, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 2, p3, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 3, p4, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 4, p5, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 5, p6, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
|
||||
find_p_hash(0, output_block, input_block, v, m, input_iv, sub_block + 6, p7, 20);
|
||||
|
||||
memcpy(input_block, output_block, 128);
|
||||
|
||||
find_p_hash(&distance, output_block, input_block, v, m, input_iv, sub_block + 7, p8, 20);
|
||||
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
// BE CAREFUL HERE
|
||||
for (ui j=0;j<CUTS_LENGTH;j++)
|
||||
{
|
||||
memcpy(input_block, output_block, 128);
|
||||
find_p_hash(&distance, output_block, input_block, v, m, input_iv, sub_block + 1 + j, CHAIN_CUTS[j], 20);
|
||||
}
|
||||
|
||||
total += distance;
|
||||
}
|
||||
|
@ -182,7 +127,7 @@ void check(const u8 p2, const u8 p3, const u8 p4, const u8 p5, const u8 p6, cons
|
|||
sem_post(&csoutput);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u64 find_p_hash(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const u8 cutoff, const ui limit)
|
||||
static u64 find_p_hash(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const u8 cutoff, const ui limit)
|
||||
{
|
||||
u64 best_n = 0;
|
||||
ui best_distance = 0;
|
||||
|
@ -253,7 +198,7 @@ u64 find_p_hash(ui * const restrict distance, u8 * const restrict output_block,
|
|||
return best_n;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void p_hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, const u8 cutoff, u8 const * const restrict input_block)
|
||||
static void p_hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, const u8 cutoff, u8 const * const restrict input_block)
|
||||
{
|
||||
u8 const * const restrict vp = (u8 *)v;
|
||||
|
||||
|
@ -287,7 +232,7 @@ void p_hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * c
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u64 find_hash2(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const r64 lbit_p, const r64 rbit_p, const ui limit)
|
||||
static u64 find_hash2(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const r64 lbit_p, const r64 rbit_p, const ui limit)
|
||||
{
|
||||
u64 best_n = 0;
|
||||
ui best_distance = 0;
|
||||
|
@ -358,7 +303,7 @@ u64 find_hash2(ui * const restrict distance, u8 * const restrict output_block, u
|
|||
return best_n;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void hash2(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, const r64 lbit_p, const r64 rbit_p, u8 const * const restrict input_block)
|
||||
static void hash2(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, const r64 lbit_p, const r64 rbit_p, u8 const * const restrict input_block)
|
||||
{
|
||||
u8 const * const restrict vp = (u8 *)v;
|
||||
|
||||
|
@ -400,7 +345,7 @@ void hash2(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * co
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void shuffle(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const restrict v, u64 const * const restrict m, u8 const * const restrict input_block)
|
||||
static void shuffle(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const restrict v, u64 const * const restrict m, u8 const * const restrict input_block)
|
||||
{
|
||||
memcpy(v, RO_IV, 128);
|
||||
|
||||
|
@ -422,7 +367,7 @@ void shuffle(u8 * const restrict block, u64 const * const restrict RO_IV, u64 *
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u64 find_shuffle(u32 * const restrict score, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const ui limit)
|
||||
static u64 find_shuffle(u32 * const restrict score, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const ui limit)
|
||||
{
|
||||
u64 RO_IV[16];
|
||||
memcpy(RO_IV, input_iv, 128);
|
||||
|
@ -497,7 +442,7 @@ u64 find_shuffle(u32 * const restrict score, u8 * const restrict output_block, u
|
|||
return best_n;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u64 find_hash(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const ui limit)
|
||||
static u64 find_hash(ui * const restrict distance, u8 * const restrict output_block, u8 const * const restrict input_block, u64 * const restrict v, u64 * const restrict m, u8 const * const restrict input_iv, const u64 block_n, const ui limit)
|
||||
{
|
||||
u64 best_n = 0;
|
||||
ui best_distance = 0;
|
||||
|
@ -568,7 +513,7 @@ u64 find_hash(ui * const restrict distance, u8 * const restrict output_block, u8
|
|||
return best_n;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, u8 const * const restrict input_block)
|
||||
static void hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * const v, u64 const * const restrict m, u8 const * const restrict input_block)
|
||||
{
|
||||
u8 const * const restrict vp = (u8 *)v;
|
||||
|
||||
|
@ -582,7 +527,7 @@ void hash(u8 * const restrict block, u64 const * const restrict RO_IV, u64 * con
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
si get_hash_score(void const * const block)
|
||||
static si get_hash_score(void const * const block)
|
||||
{
|
||||
u8 const * const restrict vp = (u8 *)block;
|
||||
|
||||
|
@ -598,7 +543,7 @@ si get_hash_score(void const * const block)
|
|||
return 512 - population;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
s32 get_shuffle_score(void const * const restrict block)
|
||||
static s32 get_shuffle_score(void const * const restrict block)
|
||||
{
|
||||
s32 score = 0, mscore = 0;
|
||||
|
||||
|
@ -618,7 +563,7 @@ s32 get_shuffle_score(void const * const restrict block)
|
|||
return score > mscore ? score : -mscore ;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void blake2b(u64 * const restrict v, u64 const * const restrict m)
|
||||
static void blake2b(u64 * const restrict v, u64 const * const restrict m)
|
||||
{
|
||||
#define G(x, y, a, b, c, d) \
|
||||
do { \
|
||||
|
@ -644,14 +589,14 @@ void blake2b(u64 * const restrict v, u64 const * const restrict m)
|
|||
#undef G
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u64 tick(void)
|
||||
static u64 tick(void)
|
||||
{
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
return ((u64)now.tv_sec * 1000) + ((u64)now.tv_nsec / 1000000);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u16 rng(u64 * const restrict v, u64 const * const restrict m, const u16 n, ui * const restrict p)
|
||||
static u16 rng(u64 * const restrict v, u64 const * const restrict m, const u16 n, ui * const restrict p)
|
||||
{
|
||||
u16 mask = n - 1;
|
||||
|
||||
|
@ -669,7 +614,7 @@ u16 rng(u64 * const restrict v, u64 const * const restrict m, const u16 n, ui *
|
|||
return r;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
u16 rng_word(u64 * const v, u64 const * const restrict m, ui * const restrict p)
|
||||
static u16 rng_word(u64 * const v, u64 const * const restrict m, ui * const restrict p)
|
||||
{
|
||||
u8 const * const restrict vp = (u8 *)v;
|
||||
|
||||
|
@ -684,18 +629,18 @@ u16 rng_word(u64 * const v, u64 const * const restrict m, ui * const restrict p)
|
|||
return temp;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
ui get_bit(void const * const restrict stream, const ui address)
|
||||
static ui get_bit(void const * const restrict stream, const ui address)
|
||||
{
|
||||
return (((u8 *)stream)[address / CHAR_BIT] >> ((CHAR_BIT - 1) - (address % CHAR_BIT))) & 1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void set_bit(void * const restrict stream, const ui address, const ui bit)
|
||||
static void set_bit(void * const restrict stream, const ui address, const ui bit)
|
||||
{
|
||||
if (bit) ((u8 *)stream)[address / CHAR_BIT] |= (1 << ((CHAR_BIT - 1) - (address % CHAR_BIT)));
|
||||
else ((u8 *)stream)[address / CHAR_BIT] &= ~(1 << ((CHAR_BIT - 1) - (address % CHAR_BIT)));
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void print_bytes(s8 const * const restrict label, void const * const p, const ui l)
|
||||
static void print_bytes(s8 const * const restrict label, void const * const p, const ui l)
|
||||
{
|
||||
printf("%s: ", label);
|
||||
for (ui i=0;i<l;i++)
|
||||
|
@ -706,7 +651,7 @@ void print_bytes(s8 const * const restrict label, void const * const p, const ui
|
|||
printf("\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void print_population(s8 const * const restrict label, void const * const p)
|
||||
static void print_population(s8 const * const restrict label, void const * const p)
|
||||
{
|
||||
u8 const * const restrict s = (u8 *)p;
|
||||
ui pop = 0;
|
||||
|
@ -723,4 +668,44 @@ void print_population(s8 const * const restrict label, void const * const p)
|
|||
}
|
||||
printf("] %u %.2f%% %lu\n", pop, (pop * 100.) / 1024, labs(get_shuffle_score(p)));
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
static void gen_test_file(s8 const * const restrict filename, const r64 p)
|
||||
{
|
||||
u64 v[16], m[16];
|
||||
|
||||
FILE * frand = fopen("/dev/urandom", "rb");
|
||||
|
||||
fread(v, sizeof(u64), 16, frand);
|
||||
fread(m, sizeof(u64), 16, frand);
|
||||
|
||||
fclose(frand);
|
||||
|
||||
const u16 cutoff = round(p * 65536);
|
||||
|
||||
FILE * f = fopen(filename, "wb");
|
||||
|
||||
for (u64 x=0;x<131072;x++)
|
||||
{
|
||||
u64 out = 0;
|
||||
|
||||
for (u64 i=1;i;i<<=1)
|
||||
{
|
||||
blake2b(v, m);
|
||||
memcpy(m, v, 64);
|
||||
blake2b(v, m);
|
||||
|
||||
u16 n;
|
||||
memcpy(&n, v, sizeof(u16));
|
||||
|
||||
if (n < cutoff)
|
||||
{
|
||||
out |= i;
|
||||
}
|
||||
}
|
||||
|
||||
fwrite(&out, sizeof(u64), 1, f);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
51
compress.h
51
compress.h
|
@ -1,6 +1,4 @@
|
|||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// Copyright © 2021 by Brett Kuntz. All rights reserved.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
//--NOV-26-2018---------------------------------------------------------------------------------------------------------
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
static_assert(CHAR_BIT == 8, "This code requires [char] to be exactly 8 bits.");
|
||||
|
@ -20,14 +18,14 @@ typedef float r32 ; typedef double r64 ;
|
|||
#define halt do { fflush(0); while (1) sleep(-1); } while (0)
|
||||
#define cwait do { fflush(0); sleep(1); do errno = 0, wait(0); while (errno != ECHILD); sleep(1); } while(0)
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// 1st cut is 128 (p0.50)
|
||||
// 2nd cut is 37 (p0.14453125)
|
||||
// 3rd cut is 23 (p0.08984375)
|
||||
// 4th cut is 17 (p0.06640625)
|
||||
// 5th cut is 14 (p0.05468750)
|
||||
// 6th cut is 11 (p0.04296875)
|
||||
// 7th cut is 9 (p0.03515625)
|
||||
// 8th cut is ?? 8 ??
|
||||
// 8th cut is 8 (p0.03125000)
|
||||
// 9th cut is ???
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -43,23 +41,28 @@ typedef float r32 ; typedef double r64 ;
|
|||
#include <sys/wait.h>
|
||||
#include <sys/mman.h>
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
void check(const u8, const u8, const u8, const u8, const u8, const u8, const u8);
|
||||
u64 find_hash(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const ui);
|
||||
u64 find_hash2(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const r64, const r64, const ui);
|
||||
u64 find_p_hash(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const u8, const ui);
|
||||
u64 find_shuffle(u32 * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const ui);
|
||||
void hash(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, u8 const * const restrict);
|
||||
void hash2(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, const r64, const r64, u8 const * const restrict);
|
||||
void p_hash(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, const u8, u8 const * const restrict);
|
||||
void shuffle(u8 * const restrict, u64 const * const restrict, u64 * const restrict, u64 const * const restrict, u8 const * const restrict);
|
||||
si get_hash_score(void const * const);
|
||||
void blake2b(u64 * const restrict, u64 const * const restrict);
|
||||
u64 tick(void);
|
||||
void set_bit(void * const restrict, const ui, const ui);
|
||||
ui get_bit(void const * const restrict, const ui);
|
||||
u16 rng_word(u64 * const, u64 const * const restrict, ui * const restrict);
|
||||
u16 rng(u64 * const restrict, u64 const * const restrict, const u16, ui * const restrict);
|
||||
s32 get_shuffle_score(void const * const restrict);
|
||||
void print_bytes(s8 const * const restrict, void const * const, const ui);
|
||||
void print_population(s8 const * const restrict, void const * const);
|
||||
static u64 * global_total, SAMPLES_PER_TEST;
|
||||
static sem_t csoutput;
|
||||
static const u64 BLAKE_IV = UINT64_C(0xA54FF53A5F1D36F1);
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
static void check(void);
|
||||
static u64 find_hash(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const ui);
|
||||
static u64 find_hash2(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const r64, const r64, const ui);
|
||||
static u64 find_p_hash(ui * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const u8, const ui);
|
||||
static u64 find_shuffle(u32 * const restrict, u8 * const restrict, u8 const * const restrict, u64 * const restrict, u64 * const restrict, u8 const * const restrict, const u64, const ui);
|
||||
static void hash(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, u8 const * const restrict);
|
||||
static void hash2(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, const r64, const r64, u8 const * const restrict);
|
||||
static void p_hash(u8 * const restrict, u64 const * const restrict, u64 * const, u64 const * const restrict, const u8, u8 const * const restrict);
|
||||
static void shuffle(u8 * const restrict, u64 const * const restrict, u64 * const restrict, u64 const * const restrict, u8 const * const restrict);
|
||||
static si get_hash_score(void const * const);
|
||||
static void blake2b(u64 * const restrict, u64 const * const restrict);
|
||||
static u64 tick(void);
|
||||
static void set_bit(void * const restrict, const ui, const ui);
|
||||
static ui get_bit(void const * const restrict, const ui);
|
||||
static u16 rng_word(u64 * const, u64 const * const restrict, ui * const restrict);
|
||||
static u16 rng(u64 * const restrict, u64 const * const restrict, const u16, ui * const restrict);
|
||||
static s32 get_shuffle_score(void const * const restrict);
|
||||
static void print_bytes(s8 const * const restrict, void const * const, const ui);
|
||||
static void print_population(s8 const * const restrict, void const * const);
|
||||
static void gen_test_file(s8 const * const restrict, const r64);
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
4
make.sh
4
make.sh
|
@ -2,5 +2,5 @@
|
|||
|
||||
# Copyright © 2021 by Brett Kuntz. All rights reserved.
|
||||
|
||||
#clang compress.c -o compute -pthread -lm -Wall -Werror -Wfatal-errors -pipe -O3 -flto -fomit-frame-pointer -march=native -mtune=native
|
||||
clang compress.c -o compute.exe -pthread -lm -Wall -Werror -Wfatal-errors -pipe -O3 -fomit-frame-pointer -march=native -mtune=native
|
||||
#clang compress.c -o compute -pthread -lm -Wall -Werror -Wfatal-errors -Wno-unused-function -pipe -O3 -flto -fomit-frame-pointer -march=native -mtune=native
|
||||
clang compress.c -o compute.exe -pthread -lm -Wall -Werror -Wfatal-errors -Wno-unused-function -pipe -O3 -fomit-frame-pointer -march=native -mtune=native
|
|
@ -1,28 +0,0 @@
|
|||
Test Params: find_hash20, find_p_hash20.37, find_p_hash20.23, find_p_hash20.17, find_p_hash20.14, find_p_hash20.11, find_p_hash20.9, find_p_hash20.6
|
||||
n=36000
|
||||
Average Distance: 211.27952222
|
||||
|
||||
Test Params: find_hash20, find_p_hash20.37, find_p_hash20.23, find_p_hash20.17, find_p_hash20.14, find_p_hash20.11, find_p_hash20.9, find_p_hash20.7
|
||||
n=100000
|
||||
Average Distance: 211.437228
|
||||
|
||||
Test Params: find_hash20, find_p_hash20.37, find_p_hash20.23, find_p_hash20.17, find_p_hash20.14, find_p_hash20.11, find_p_hash20.9, find_p_hash20.8
|
||||
n=102000
|
||||
Average Distance: 211.54525294
|
||||
|
||||
Test Params: find_hash20, find_p_hash20.37, find_p_hash20.23, find_p_hash20.17, find_p_hash20.14, find_p_hash20.11, find_p_hash20.9, find_p_hash20.9
|
||||
n=102000
|
||||
Average Distance: 211.48000588
|
||||
|
||||
Test Params: find_hash20, find_p_hash20.37, find_p_hash20.23, find_p_hash20.17, find_p_hash20.14, find_p_hash20.11, find_p_hash20.9, find_p_hash20.10
|
||||
n=53000
|
||||
Average Distance: 211.35135692
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue