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/omega-mv/blob/main/mk/omega-gpu-wait.mk # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / mk / omega-gpu-wait.mk` 43 lines ยท 3376 bytes Raw Blame History 1 # Shared GPU completion wait primitive (src/omega_gpu_wait.c, linked by the C GPU paths): host unit 2 # test with fake memory and a fake clock, plus a naive wall-clock mutant that must be caught. The same 3 # test runs on the live C primitive and on its pure OM-2 port src/omega_gpu_wait.om. Picked up by 4 # `-include mk/*.mk`. Host only: opens no device, needs no physics headers, takes no chip lock. 5 GPU_WAIT_OMC ?= seed/out/omc 6 GPU_WAIT_OM_SRCS := src/omega_gpu_wait.om tests/test_omega_gpu_wait.om 7 .PHONY: test-gpu-wait 8 $(OUT_DIR)/test_omega_gpu_wait: tests/test_omega_gpu_wait.c src/omega_gpu_wait.c src/omega_gpu_wait.h 9 @mkdir -p $(OUT_DIR) 10 $(CC) -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -Isrc -o $@ tests/test_omega_gpu_wait.c src/omega_gpu_wait.c 11 $(OUT_DIR)/test_omega_gpu_wait_om: $(GPU_WAIT_OM_SRCS) $(GPU_WAIT_OMC) 12 @mkdir -p $(OUT_DIR) 13 (printf 'om2\n'; sed '/^om2$$/d' $(GPU_WAIT_OM_SRCS)) | $(GPU_WAIT_OMC) > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ 14 test-gpu-wait: $(OUT_DIR)/test_omega_gpu_wait $(OUT_DIR)/test_omega_gpu_wait_om 15 ./$(OUT_DIR)/test_omega_gpu_wait 16 ./$(OUT_DIR)/test_omega_gpu_wait_om 17 18 # Real-code mutants: src/omega_gpu_wait.c carries one-line compile-flag mutants and 19 # src/omega_gpu_wait.om the same three as one-line constants. Each flagged C build and each .om copy 20 # with one constant set to 1 must FAIL the suite; the unflagged builds must PASS. A mutant that does 21 # not compile, or an .om edit that changes nothing, is an error, not a kill. 22 GPU_WAIT_MUTANTS := OMEGA_GPU_WAIT_MUTANT_STALL_NO_RESET OMEGA_GPU_WAIT_MUTANT_PROGRESS_EXTENDS_HARD OMEGA_GPU_WAIT_MUTANT_NO_READ_BARRIER 23 .PHONY: test-gpu-wait-mutants 24 test-gpu-wait-mutants: $(OUT_DIR)/test_omega_gpu_wait $(OUT_DIR)/test_omega_gpu_wait_om 25 @./$(OUT_DIR)/test_omega_gpu_wait >/dev/null || { echo "unflagged build FAILED"; exit 1; } 26 @echo "unflagged: PASS" 27 @set -e; for m in $(GPU_WAIT_MUTANTS); do \ 28 $(CC) -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -D$$m -Isrc -o $(OUT_DIR)/test_omega_gpu_wait_$$m tests/test_omega_gpu_wait.c src/omega_gpu_wait.c; \ 29 if ./$(OUT_DIR)/test_omega_gpu_wait_$$m >$(OUT_DIR)/test_omega_gpu_wait_$$m.log 2>&1; then echo "MUTANT SURVIVED: $$m"; exit 1; fi; \ 30 echo "$$m: killed ($$(grep -c 'FAIL' $(OUT_DIR)/test_omega_gpu_wait_$$m.log) failing checks)"; \ 31 done 32 @./$(OUT_DIR)/test_omega_gpu_wait_om >/dev/null || { echo "OM unedited build FAILED"; exit 1; } 33 @echo "OM unedited: PASS" 34 @set -e; for m in $(GPU_WAIT_MUTANTS); do \ 35 sed "s/^const $$m int 0$$/const $$m int 1/" src/omega_gpu_wait.om > $(OUT_DIR)/omega_gpu_wait_om_$$m.om; \ 36 if cmp -s $(OUT_DIR)/omega_gpu_wait_om_$$m.om src/omega_gpu_wait.om; then echo "MUTANT BROKEN: OM $$m edit changed nothing"; exit 1; fi; \ 37 (printf 'om2\n'; sed '/^om2$$/d' $(OUT_DIR)/omega_gpu_wait_om_$$m.om tests/test_omega_gpu_wait.om) | $(GPU_WAIT_OMC) > $(OUT_DIR)/test_omega_gpu_wait_om_$$m.tmp.$$$$; \ 38 chmod +x $(OUT_DIR)/test_omega_gpu_wait_om_$$m.tmp.$$$$; \ 39 mv -f $(OUT_DIR)/test_omega_gpu_wait_om_$$m.tmp.$$$$ $(OUT_DIR)/test_omega_gpu_wait_om_$$m; \ 40 if ./$(OUT_DIR)/test_omega_gpu_wait_om_$$m >$(OUT_DIR)/test_omega_gpu_wait_om_$$m.log 2>&1; then echo "MUTANT SURVIVED: OM $$m"; exit 1; fi; \ 41 echo "OM $$m: killed ($$(grep -c 'FAIL' $(OUT_DIR)/test_omega_gpu_wait_om_$$m.log) failing checks)"; \ 42 done 43 @echo "OMEGA_GPU_WAIT_MUTANTS PASS"