11. MoE Architecture
Router/expert mapping and adversarial dispatch verifiedThe compiler permutes router rows and physical experts using one mapping, then applies independent FFN permutations and contragredient scales to each expert. Tests verify that the transformed router selects the corresponding transformed expert.
Constant-load dispatch
For top-k selection, each expert receives a fixed-capacity buffer. Real locations carry token indices and softmax weights; remaining locations are dummy and have exactly zero combine weight. If any expert exceeds capacity, dispatch fails instead of dropping tokens. Combined output matches the unprotected reference. MoELayerWeights and execute_moe_layer integrate this dispatch into the stage runner; tests/models/test_moe_stage.py verifies transformed-versus-original layers and executes a compiled MoE checkpoint through an actual encrypted remote stage and the public SDK.
Fortress also replaces the fused 3D expert modules used by Qwen3, Gemma4, and DeepSeek V3. FortressExperts executes each compiled gate/up/down matrix and combines real contributions through the same zero-dummy constant-load plan. Actual miniature Qwen3 MoE and DeepSeek V3 MLA+MoE models match Fortress quantized reference execution exactly and pass a 0.02 FP32 original-model tolerance. Multi-head Latent Attention rotates the compressed KV cache and uses query/output absorption to preserve scores. Operator-supplied per-layer saliency can prune experts before sharing; retained matrices are read selectively, remapped contiguously, and official/client routers are restricted consistently. Incomplete scores fail closed, and original unpruned output quality remains a separate measurement. Full official-checkpoint quality and physical kernel behavior remain hardware validation.
Constant loads hide network volume, not every side channel. TLB, cache, power, timing, and co-residency can still leak information. The MoE simulator displays real loads and dummy slots while explicitly labeling those residual risks.