<commit_before>/* include/n/h.h
**
** This file is in the public domain.
*/
  /**  Data structures.
  **/
    /**  Straightforward implementation of the classic Bagwell
    ***  HAMT (hash array mapped trie), using a mug hash.
    ***
    ***  Because a mug is 31 bits, the root table has 64 slots.
    ***  The 31 bits of a mug are divided into the first lookup,
    ***  which is 6 bits (corresponding to the 64 entries in the
    ***  root table), followed by 5 more branchings of 5 bits each,
    ***  corresponding to the 32-slot nodes for everything under
    ***  the root node.
    ***
    ***  We store an extra "freshly warm" bit for a simple
    ***  clock-algorithm reclamation policy, not yet implemented.
    ***  Search "clock algorithm" to figure it out.
    **/
      /* u3h_slot: map slot.
      **
      **   Either a key-value cell or a loom offset, decoded as a pointer
      **   to a u3h_node, or a u3h_buck at the bottom.  Matches the u3_noun
      **   format - coordinate with allocate.h.  The top two bits are:
      **
      **     00 - empty (in the root table only)
      **     01 - table
      **     02 - entry, stale
      **     03 - entry, fresh
      */
        typedef c3_w u3h_slot;

      /* u3h_node: map node.
      */
        typedef struct {
          c3_w     map_w;     // bitmap for [sot_w]
          u3h_slot sot_w[0];  // filled slots
        } u3h_node;

      /* u3h_root: hash root table
      */
        typedef struct {
          c3_w     max_w;     // number of cache lines (0 for no trimming)
          c3_w     use_w;     // number of lines currently filled
          struct {
            c3_w  mug_w;      // current hash
            c3_w  inx_w;      // index into current hash bucket
          } arm_u;            // clock arm
          u3h_slot sot_w[64]; // slots
        } u3h_root;

      /* u3h_buck: bottom bucket.
      */
        typedef struct {
          c3_w     len_w;     // length of [sot_w]<commit_msg>u3: restore hashtable root struct layout for compatibility<commit_after>/* include/n/h.h
**
** This file is in the public domain.
*/
  /**  Data structures.
  **/
    /**  Straightforward implementation of the classic Bagwell
    ***  HAMT (hash array mapped trie), using a mug hash.
    ***
    ***  Because a mug is 31 bits, the root table has 64 slots.
    ***  The 31 bits of a mug are divided into the first lookup,
    ***  which is 6 bits (corresponding to the 64 entries in the
    ***  root table), followed by 5 more branchings of 5 bits each,
    ***  corresponding to the 32-slot nodes for everything under
    ***  the root node.
    ***
    ***  We store an extra "freshly warm" bit for a simple
    ***  clock-algorithm reclamation policy, not yet implemented.
    ***  Search "clock algorithm" to figure it out.
    **/
      /* u3h_slot: map slot.
      **
      **   Either a key-value cell or a loom offset, decoded as a pointer
      **   to a u3h_node, or a u3h_buck at the bottom.  Matches the u3_noun
      **   format - coordinate with allocate.h.  The top two bits are:
      **
      **     00 - empty (in the root table only)
      **     01 - table
      **     02 - entry, stale
      **     03 - entry, fresh
      */
        typedef c3_w u3h_slot;

      /* u3h_node: map node.
      */
        typedef struct {
          c3_w     map_w;     // bitmap for [sot_w]
          u3h_slot sot_w[0];  // filled slots
        } u3h_node;

      /* u3h_root: hash root table
      */
        typedef struct {
          c3_w     max_w;     // number of cache lines (0 for no trimming)
          c3_w     use_w;     // number of lines currently filled
          struct {
            c3_w  mug_w;      // current hash
            c3_w  inx_w;      // index into current hash bucket
            c3_o  buc_o;      // XX remove
          } arm_u;            // clock arm
          u3h_slot sot_w[64]; // slots
        } u3h_root;

      /* u3h_buck: bottom bucket.
      */
        typedef struct {
          c3_w     len_w;     // length of [sot_w]
{'fraction_non_alphanumeric': 0.09450766947055914, 'fraction_numerical': 0.022266204849084613, 'mean_word_length': 1.644211903204709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '228375', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1243, 'n_words': 464}