◂ BACK TO LEADERBOARD
▚ MODEL AUDIT // 4-bit MLX

// Qwen 3.6 35B-A3B

CRIT — Critical Bugs 57/100 tests: CRASH
tok/sec83.31
tokens13278
TTFT0.73s

▮ PILLAR BREAKDOWN

Complexity (O(1))
15/20
Concurrency / Races
15/20
Tx Isolation
13/20
Memory & Edges
10/20
Test Integrity
4/20

✓ WENT RIGHT

  • No pillar reached 16+ — no standout strengths.

✗ WENT WRONG

  • Tx Isolation (13/20)
  • Memory & Edges (10/20)
  • Test Integrity (4/20)

▮ CRITICAL BUGS

▮ RECOMMENDED USE

Not recommended for systems code as-is. The 4-bit quant degrades logic sharply vs the 6-bit sibling (82->57) — usable only for boilerplate/scaffolding drafts that a human will heavily rewrite.

▮ REFACTORED PATCH

# FIX 1 (the crash): _evict double-removes. pop() already unlinks,
# so do NOT call _remove_node on a popped node. Either:
#   (a) pop and then only delete the key_map entry + min_freq bookkeeping:
def _evict(self):
    if not self.freq_to_list:
        return
    evict_list = self.freq_to_list[self.min_freq]
    if evict_list.size == 0:        # guard against empty
        del self.freq_to_list[self.min_freq]
        return
    node = evict_list.pop()         # pop() unlinks + nulls prev/next
    del self.key_to_node[node.key]  # DON'T call _remove_node again
    if self.freq_to_list[self.min_freq].size == 0:
        del self.freq_to_list[self.min_freq]
        self.min_freq += 1

# FIX 2: _FreqList.pop empty-guard
def pop(self) -> _Node:
    if self.size == 0:
        raise IndexError('pop from empty _FreqList')
    node = self.head.next
    self.remove(node)
    return node

# FIX 3: kill the O(N) scan in background sweep — maintain a separate
# set of keys that have a TTL, and iterate that set in batches:
async with self.lock:
    batch = list(self._ttl_keys)[:50]
    for k in batch:
        node = self.key_to_node.get(k)
        if node and 0 < node.expires_at <= time.monotonic():
            self._remove_node(node)

# FIX 4: time.time() -> time.monotonic() everywhere.
# FIX 5: add node.version; in tx._apply_put, abort/refresh if
# cache.key_to_node[key] is a different node than original_node.