⚠ SPEED CAVEAT: This model 'thought' for 12m48s before producing output and ran at 12.29 tok/sec — anomalously slow for an 8-bit MLX on M3 Max. Likely an inference/quant issue worth investigating; the slow generation is NOT representative of normal 27B-8bit throughput.
tok/sec12.29
tokens12790
TTFT2.90s
▮ PILLAR BREAKDOWN
Complexity (O(1))
17/20
Concurrency / Races
16/20
Tx Isolation
14/20
Memory & Edges
15/20
Test Integrity
16/20
✓ WENT RIGHT
Complexity (O(1)) (17/20)
Concurrency / Races (16/20)
Test Integrity (16/20)
✗ WENT WRONG
No pillar fell below 14 — solid across the board.
▮ CRITICAL BUGS
Isolation leak: Transaction.get falls back to the PUBLIC cache.get (line 78), which calls _update_freq — so reading a key inside a transaction mutates GLOBAL frequency state before commit, leaking uncommitted access patterns into global eviction order.
Uses time.time() (system clock) throughout instead of time.monotonic() — NTP adjustments corrupt TTL eviction.
No __slots__ on Node/DoublyLinkedList/LFUCache/Transaction — rubric required it for memory efficiency.
Background _evict_loop materializes list(self.nodes.keys()) (O(N)) before checking only batch_size keys — the break caps work but not the snapshot cost, a hidden O(N) per sweep.
Commit re-implements put+evict inline (lines 102-118) duplicating the public path = duplicated bug surface; not wrapped in try/except so a mid-commit exception leaves partial state. No MVCC version check (lost-update possible).
▮ RECOMMENDED USE
Clean, correct, runnable — same tier as Gemma 4 31B (78). Good O(1) structure and concurrency granularity. Reliable for everyday async/caching work after a monotonic-clock + __slots__ + isolation pass. Caveat: was anomalously slow to generate.
▮ REFACTORED PATCH
# FIX 1 (isolation leak): add a read-only global lookup (no freq bump)
# and use it in tx.get instead of the public cache.get:
async def _read_raw(self, key):
async with self.lock:
node = self.nodes.get(key)
if node is None: return None
if time.monotonic() > node.expires_at:
self._remove_node(key); return None
return node.value
# then: return await self._cache._read_raw(key)
# FIX 2: time.time() -> time.monotonic() everywhere.
# FIX 3: add __slots__ to Node, DoublyLinkedList, LFUCache, Transaction.
# FIX 4: maintain a _ttl_keys set; iterate IT (batched) in the bg loop
# instead of list(self.nodes.keys()).
# FIX 5: factor commit's put/evict to reuse the internal helpers; wrap
# the commit loop in try/except with rollback-on-failure.