CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / evidence / FLASH-NEXT-MOE-SHAPES-20261118 / run-receipts.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | # Reruns the short checks of the Flash-Next MoE slice at the checked-out head and saves, per step, the command (.cmd), exit code (.rc) and |
| 4 | # complete output (.out) under receipts/. Host only: every command runs through the device-free wrapper (the namespace hides /dev/nvidia*); |
| 5 | # nothing opens a device, takes the chip lock or touches a service. Chip status is NOT_RUN. The long runs (the exhaustive C-oracle |
| 6 | # differential, the whole host suite, the mutant runners) have their own logs next to this file. |
| 7 | # STEPS='02-base-legacy-run 13-real-expert' reruns only the named steps. |
| 8 | # Needs: OMEGA_OMC / OMEGA_BRIDGE = the om/units.sh pins (see receipts/01-toolchain.out), build/libomega_gpu.a built at this head. |
| 9 | set -u |
| 10 | ROOT=${ROOT:-$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)} # ROOT may name a separate clone at the head under test |
| 11 | cd "$ROOT" |
| 12 | OUT=${RECEIPTS_OUT:-$ROOT/evidence/FLASH-NEXT-MOE-SHAPES-20261118/receipts} |
| 13 | mkdir -p "$OUT" |
| 14 | CORES=${CORES:-15-19} |
| 15 | W="bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c $CORES nice -n 10" |
| 16 | # bash -o pipefail: the recorded exit code is the first failing stage of a pipeline, not the last stage's (tail and grep would hide a failure) |
| 17 | rec() { [ -z "${STEPS:-}" ] || case " $STEPS " in *" $1 "*) ;; *) return 0 ;; esac; n=$1; shift; printf '%s\n' "$*" > "$OUT/$n.cmd"; bash -o pipefail -c "$*" > "$OUT/$n.out" 2>&1; echo $? > "$OUT/$n.rc"; printf '%s rc=%s\n' "$n" "$(cat "$OUT/$n.rc")"; } |
| 18 | BASE=997e105086353120d6e41805ae4973cefec7fb74 |
| 19 | ROOTS="QUANT_ROOT=$ROOT CACHE_ROOT=$ROOT COMPOSE_ROOT=$ROOT PIPELINE_ROOT=$ROOT" |
| 20 | PINOMC=${PINOMC:-$HOME/work/lanes/flash-next/moe-tools/omc-64d6} |
| 21 | |
| 22 | rec 00-head "git rev-parse HEAD; git log -1 --format='%H %s'; git status --short | grep -v '^?? evidence/' ; date -u +%FT%TZ; uname -m; hostname" |
| 23 | rec 01-toolchain "echo OMEGA_OMC=\$OMEGA_OMC; sha256sum \$OMEGA_OMC; echo OMEGA_BRIDGE=\$OMEGA_BRIDGE; git -C \$OMEGA_BRIDGE rev-parse HEAD; sha256sum \$OMEGA_BRIDGE/src/toc.om \$OMEGA_BRIDGE/tools/bridge-seeded \$OMEGA_BRIDGE/src/freest.om \$OMEGA_BRIDGE/tools/bridge-freest; echo '--- om/units.sh pins'; grep -n '^OMC_PIN\|^CONVERTER_PIN\|^FRONTEND_PIN\|^FREEST_' om/units.sh; echo '--- PIN file (scope: backend/amd/kfd/launch only, REPIN)'; cat PIN; sha256sum $PINOMC; echo '--- the bridge frontend refuses the PIN compiler'; OMEGA_SEEDED_OMC=$PINOMC sh \$OMEGA_BRIDGE/tools/bridge-seeded c om/moe/moe_plan_wide.om >/dev/null; echo bridge-seeded-with-PIN-omc rc=\$?" |
| 24 | rec 02-base-legacy-run "d=\$(mktemp -d); git archive $BASE | tar -x -C \$d; cd \$d; $W env $ROOTS sh tests/moe/run.sh > \$d/out 2>&1; rc=\$?; grep -v '^generating' \$d/out | tail -12; echo \"base-run-exit=\$rc (expected non-zero: the baseline run.sh does not link, omega_mg_group; the one-line unit-list fix is in this branch)\"; exit \$rc" |
| 25 | rec 03-before-after-probe "d=/tmp/flash-moe-base; [ -d \$d/build ] || { mkdir -p \$d; git archive $BASE | tar -x -C \$d; (cd \$d && $W make -j4 build/libomega_gpu.a >/dev/null 2>&1); }; echo '=== BEFORE: base $BASE (legacy units only)'; (cd \$d && cc -std=gnu11 -DBASE -Isrc -o /tmp/shape_probe_base $ROOT/evidence/FLASH-NEXT-MOE-SHAPES-20261118/shape_probe.c src/cudapp_om_moe_*.c build/libomega_gpu.a -lpthread -lm && $W /tmp/shape_probe_base); echo '=== AFTER: this head'; cc -std=gnu11 -Isrc -o /tmp/shape_probe_head evidence/FLASH-NEXT-MOE-SHAPES-20261118/shape_probe.c src/cudapp_om_moe_*.c build/libomega_gpu.a -lpthread -lm && $W /tmp/shape_probe_head" |
| 26 | rec 04-generated-code-identity "d=/tmp/flash-moe-base; cc -std=gnu11 -O1 -Isrc -o /tmp/identity_head evidence/FLASH-NEXT-MOE-SHAPES-20261118/identity_probe.c build/libomega_gpu.a -lpthread -lm && (cd \$d && cc -std=gnu11 -O1 -Isrc -o /tmp/identity_base $ROOT/evidence/FLASH-NEXT-MOE-SHAPES-20261118/identity_probe.c build/libomega_gpu.a -lpthread -lm) && $W /tmp/identity_base > /tmp/identity_base.txt && $W /tmp/identity_head > /tmp/identity_head.txt; sha256sum /tmp/identity_base.txt /tmp/identity_head.txt; wc -l /tmp/identity_head.txt; cmp /tmp/identity_base.txt /tmp/identity_head.txt && echo IDENTICAL: base and head give the same return code, instruction count, encoded-SASS hash, steps and shared bytes for every spec of the grid" |
| 27 | rec 05-legacy-untouched "git diff --stat $BASE HEAD -- om/moe/moe_plan.om om/moe/moe_group.om om/moe/moe_ids32.om om/moe/moe_maps32.om om/moe/moe_segs32.om om/moe/moe_windows.om om/moe/moe_admit.om src/cudapp_om_moe_plan.c src/cudapp_om_moe_group.c src/cudapp_om_moe_ids32.c src/cudapp_om_moe_maps32.c src/cudapp_om_moe_segs32.c src/cudapp_om_moe_windows.c src/cudapp_om_moe_admission.c tests/moe/caller.c tests/moe/moe_verify.om tests/moe/admit-caller.om tests/moe/incumbent.c tests/codegen_moe_diff_test.c tests/codegen_moe_sim_test.c tests/codegen_moe_oracle.c tests/codegen_moe2_oracle.c tests/gpu_fp8_api_test.c tests/api_hostrest_test.c tests/api_hostrest_check.py; echo 'legacy and existing-test files changed: (empty list above = none)'; git diff --exit-code --quiet $BASE HEAD -- om/moe/moe_plan.om om/moe/moe_group.om om/moe/moe_ids32.om om/moe/moe_maps32.om om/moe/moe_segs32.om om/moe/moe_windows.om om/moe/moe_admit.om src/cudapp_om_moe_plan.c src/cudapp_om_moe_group.c src/cudapp_om_moe_ids32.c src/cudapp_om_moe_maps32.c src/cudapp_om_moe_segs32.c src/cudapp_om_moe_windows.c src/cudapp_om_moe_admission.c tests/moe/caller.c tests/moe/moe_verify.om tests/moe/admit-caller.om tests/moe/incumbent.c tests/codegen_moe_diff_test.c tests/codegen_moe_sim_test.c tests/codegen_moe_oracle.c tests/codegen_moe2_oracle.c tests/gpu_fp8_api_test.c tests/api_hostrest_test.c tests/api_hostrest_check.py && echo UNTOUCHED; echo '--- every existing test file this branch changed:'; git diff --name-status $BASE HEAD -- tests | grep -v '^A'" |
| 28 | rec 06-moe-legacy "$W env $ROOTS sh tests/moe/run.sh | grep -v '^generating\|^[0-9a-f]\{64\} '" |
| 29 | rec 07-moe-wide "$W env $ROOTS sh tests/moe/run_wide.sh | grep -v '^generating\|^[0-9a-f]\{64\} '" |
| 30 | rec 08-moe-wide-mutants "$W env $ROOTS python3 tests/moe/wide_mutants.py" |
| 31 | rec 09-ragged-builder-sim "$W make -j4 build/codegen_moe_ragged_test >/dev/null 2>&1; $W ./build/codegen_moe_ragged_test" |
| 32 | rec 10-ragged-api-op25 "$W make -j4 build/fp8_ragged_api_test >/dev/null 2>&1; $W ./build/fp8_ragged_api_test" |
| 33 | rec 11-group-sim "$W make -j4 build/codegen_dec_group_sim_test >/dev/null 2>&1; $W ./build/codegen_dec_group_sim_test" |
| 34 | rec 12-existing-moe-sim "$W make -j4 build/codegen_moe_sim_test >/dev/null 2>&1; $W ./build/codegen_moe_sim_test" |
| 35 | rec 13-real-expert "$W make -j4 build/flash_expert_real_test >/dev/null 2>&1; FLASH_EXPERT_OUT=\$(mktemp -d); export FLASH_EXPERT_OUT; $W sh tests/flash_expert/run.sh; t=\$?; echo '--- independent read of the same bytes with dd (not Python):'; M=\$HOME/models/qwen3.8-flash-next-fp8-7fb48d70; for spec in 'model-00002-of-00131.safetensors 731214008 1638400 gate_proj.weight' 'model-00002-of-00131.safetensors 732852408 1638400 up_proj.weight' 'model-00003-of-00131.safetensors 520403536 1638400 down_proj.weight' 'model-00002-of-00131.safetensors 372008 200 gate_proj.weight_scale_inv' 'model-00002-of-00131.safetensors 372208 200 up_proj.weight_scale_inv' 'model-00003-of-00131.safetensors 189128 200 down_proj.weight_scale_inv'; do set -- \$spec; printf '%s ' \$4; dd if=\$M/\$1 bs=1 skip=\$2 count=\$3 2>/dev/null | sha256sum | cut -c1-64; done; ls \$M/*.aria2 2>/dev/null || echo 'no .aria2 file beside any shard'; sha256sum \$M/config.json; exit \$t" |
| 36 | rec 14-units-check "OMEGA_OMC=\${OMEGA_OMC_GIT:-\$HOME/workspace/omega-review/seed/out/omc} $W sh om/units.sh --check | tail -3" |
| 37 | rec 15-gates "$W make test-runtime-api test-drift test-pin-sync 2>&1 | grep -E 'RESULT|PASS|FAIL|Error'" |
| 38 | rec 16-gpu-fp8-host-and-sim "$W make test-gpu-fp8 2>&1 | tail -4" |
| 39 | rec 17-pin-compiler-programs "d=\$(mktemp -d); cat om/quant/quant.om om/components/realize.om om/cache/digest.om om/cache/residency.om om/pipeline/select.om om/pipeline/graph.om om/moe/moe_group_wide.om om/moe/moe_admit_wide.om tests/pipeline/fixture.om tests/moe/admit-caller-wide.om > \$d/admit_wide.om; cat om/codegen/cg_moe_emit.om om/codegen/cg_moe_core.om om/codegen/cg_moe.om tests/moe/ragged_pin_driver.om > \$d/driver.om; sed 's/rp_check view a 119/rp_check view a 120/' \$d/driver.om > \$d/driver_broken.om; bad=0; for omc in \$OMEGA_OMC $PINOMC; do n=\$(sha256sum \$omc | cut -c1-8); for f in admit_wide driver driver_broken; do \$omc < \$d/\$f.om > \$d/\$f.\$n 2>\$d/err; c=\$?; chmod +x \$d/\$f.\$n 2>/dev/null; if [ \$c = 0 ]; then $W \$d/\$f.\$n; r=\$?; echo \"omc \$n \$f: compile rc=0 run rc=\$r\"; want=0; [ \$f = driver_broken ] && want=11; [ \$r = \$want ] || bad=1; else echo \"omc \$n \$f: compile rc=\$c\"; bad=1; fi; done; done; echo 'expected: admit_wide and driver run rc=0 under both compilers; driver_broken (expected count 120 instead of 119) run rc=11 under both: the driver sees a changed count'; exit \$bad" |
| 40 | cd "$OUT" && sha256sum *.cmd *.rc *.out > SHA256SUMS |
| 41 | echo done |