◂ BACK TO LEADERBOARD
▚ MODEL AUDIT // MLX

// KAT-Coder v2.5 Dev XL

CRIT — Critical Bugs 65/100 tests: CRASH
tok/sec65.26
tokens6172
TTFT7.42s

▮ PILLAR BREAKDOWN

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

✓ WENT RIGHT

  • Concurrency / Races (16/20)
  • Tx Isolation (16/20)

✗ WENT WRONG

  • Memory & Edges (13/20)
  • Test Integrity (5/20)

▮ CRITICAL BUGS

▮ RECOMMENDED USE

Promising code-design instincts (cleanest abstractions and best transaction isolation design in the set) but undone by a single fatal one-line bug that stops it running. With the bug fixed it would likely score 80+; as-is, only useful as a structural reference.

▮ REFACTORED PATCH

# FIX 1 (the fatal one-liner): use the helper that already exists.
# line 305, in _put_internal, new-key branch:
- self._freq_map[1].push_front(dll_node)
+ self._ensure_freq_list(1).push_front(dll_node)
# (This single change makes the cache and transactions functional.)

# FIX 2: replace the O(F) min() scan with an incremental bump:
# in _evict_node, when the min-tier bucket empties, min_freq is the
# lowest remaining tier. Since freq only ever increments by 1, the
# next min is almost always min_freq+1; track it incrementally rather
# than scanning. Or, since this only happens on full eviction, accept
# O(F) but only on the empty-cache edge — document it.

# FIX 3: add __slots__ to all internal classes:
class _CacheNode:
    __slots__ = ('key','value','ttl_seconds','expiry_time','freq','dll_node')
    ...

# FIX 4: wrap commit applies in try/except so a mid-commit exception
# does not leave a half-applied global state; consider abort semantics.
# FIX 5: add node.version; in tx commit, abort if the global node for
# a key is not the one seen at tx.get() time.