SIGN IN SIGN UP

fix(cache): preserve a deliberate "Unlimited", and stop a bf16 vision embedding crashing the cache key

Two defects found while checking the SSD-first change against families and
runtimes it was NOT written for.

1. A deliberate Unlimited was about to be silently capped.

Shipped builds offered a GB slider whose "Unlimited" position stored 0. The new
buildArgs guard treats a stored 0 as "nobody chose a GB cap" and hands the
budget to the 10% default -- correct for the value this release seeds, but for
an UPGRADING user who deliberately chose unlimited it invents a cap on someone
who explicitly asked for none. The v17 migration now translates GB=0 into
percent=0, which means unlimited in the new world, so the intent survives the
GB->percent move exactly. Ordering is load-bearing and asserted: it must run
before the percent default, or the default overwrites the preserved intent.

Verified the same 0-means-unlimited reading holds downstream: the SSM companion
store inherits budget_bytes from the block store and skips eviction entirely at
`self._budget <= 0`, so percent=0 is coherent across both tiers rather than
being read as "no space" by one of them.

2. np.array() on a bfloat16 tensor RAISES on the pinned mlx.

paged_cache._hash_extra hashed vision-embedding tensors with
`np.array(obj).tobytes()`. Under mlx >= 0.32 the PEP-3118 shim is gone and that
raises "'bfloat16' is not a valid PEP 3118 buffer format string" -- verified
live on mlx 0.32.1, which is what uv.lock pins. A bf16 embedding reaching that
path would throw inside cache-key hashing rather than merely miss the cache.
Now reinterpreted as uint16 before hashing; numpy needs no bfloat16 support to
hash bytes, and the dtype is already folded into the key on the preceding line,
so a genuine uint16 input cannot collide.

Neither change alters behaviour for any family that was already working:
openPangu never enters the block-disk branch at all, ZAYA and openPangu are
exempt from the v17 flip, and the non-bf16 hashing path is untouched.

Engine 478 cache/prefix/block tests pass; panel 11 budget-behaviour tests pass.
J
Jinho Jang committed
e5b3319d8c9cab085e3947cc9207fac477cafcdc
Parent: 41035e7