#pragma once

#include <stdint.h>

typedef struct {
    uint64_t key;
    uint16_t pairs;
    uint16_t depth;
} HashEntry;

typedef struct {
    HashEntry *entries;
    uint64_t mask;
} HashTable;

/* cap should be power of two; returns 0 on success */
int ht_init(HashTable *ht, uint64_t capacity);
void ht_free(HashTable *ht);
/* returns 1 to prune (seen better/equal), 0 to keep */
int ht_should_prune(HashTable *ht, uint64_t key, uint16_t pairs, uint16_t depth);
