Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/evidence/motor-chip-20261021/scripts/expert-union.sh # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / evidence / motor-chip-20261021 / scripts / expert-union.sh` 19 lines ยท 1172 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # Expert union per layer across N host goldens (qwen38_check generate: routes[step][layer][k expert ids]). 3 # Step 0 of a golden is the prefill (every prompt token's k ids flattened); the union uses the decode steps 1.. only, 4 # aligned by decode index. For every such step where all N goldens have a route and every layer: |union of the N rows' experts|. 5 # Prints per-N mean union (over steps x layers), the independent-draw expectation 256*(1-(1-8/256)^N), and per-layer means. 6 # usage: expert-union.sh gen-a.json gen-b.json ... 7 set -eu 8 jq -s ' 9 (map(.routes | length) | min) as $steps 10 | (.[0].routes[0] | length) as $layers 11 | length as $n 12 | [range(1; $steps) as $s | range(0; $layers) as $l 13 | {s: $s, l: $l, u: ([.[] | .routes[$s][$l][]] | unique | length)}] as $cells 14 | {n: $n, decode_steps: ($steps - 1), layers: $layers, 15 mean_union: (($cells | map(.u) | add) / ($cells | length)), 16 min_union: ($cells | map(.u) | min), max_union: ($cells | map(.u) | max), 17 independent_draws: (256 * (1 - pow(1 - 8/256; $n))), 18 per_layer_mean: [range(0; $layers) as $l | ($cells | map(select(.l == $l) | .u) | add / length)]} 19 ' "$@"