Routes, distributions, and moved-key sets are recomputed before rendering.

highlighted = computed this step

Honest by construction

The lesson author supplies schemes, keys, and optional expected checks. The engine recomputes routes, distributions, and rebalances before rendering. Note: expected values can only reject a mismatch.

recompute boundary\text{recompute boundary}

Compiled facts

The guarded routing has 4 routes, the guarded distribution has 4 partitions, and the guarded rebalance has moved count 1.

routes=4,partitions=4,moved=1\text{routes}=4,\quad \text{partitions}=4,\quad \text{moved}=1

Range and hash sharding are exact routing functions on tiny pinned key sets; real sharding adds consistent hashing, skew, hot partitions, and rebalancing cost, which are empirical and operational concerns beyond this model - no product claims.

Guarded routing - hash:mod 4keypartitiontrace3P33 mod 4 = 34P04 mod 4 = 07P37 mod 4 = 38P08 mod 4 = 0
Guarded distribution - range:10,20,30partitioncountkeysP014P1114P2124P3134
Guarded rebalance - moved: 28; stayed: 2,12,24,26keyfromtostatus2P0P0stayed12P1P1stayed24P2P2stayed26P2P2stayed28P2P3moved

Tamper guards

The self-test rejects wrong authored routing, wrong authored distribution, wrong authored rebalance, and a derived routes sidecar. Note: the bad facts are never rendered.

expected guards only reject\text{expected guards only reject}

Summary

The trust boundary is recompute first, then render. Note: exact tiny routing functions do not claim to model operational sharding cost.

honest sharding render\text{honest sharding render}