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
omega-mv / Makefile
| 1 | CC ?= gcc |
| 2 | .DEFAULT_GOAL := all |
| 3 | PHYSICS_DIR ?= ../physics |
| 4 | OUT_DIR ?= build |
| 5 | # aienos.lock is code-adjacent input: parse it as data before mk/*.mk or any recipe sees it. |
| 6 | # Exactly one lowercase 40-hex commit line (final newline optional), else make stops; |
| 7 | # `override` so a command-line or environment AIENOS_LOCK cannot replace the parsed value. |
| 8 | override AIENOS_LOCK := $(shell LC_ALL=C awk 'NR == 1 && length($$0) == 40 && $$0 ~ /^[0-9a-f]+$$/ { commit = $$0; next } { invalid = 1 } END { if (!invalid && NR == 1) print commit; else exit 1 }' aienos.lock 2>/dev/null) |
| 9 | ifneq ($(words $(AIENOS_LOCK)),1) |
| 10 | $(error aienos.lock must contain exactly one lowercase 40-hex commit) |
| 11 | endif |
| 12 | -include mk/*.mk |
| 13 | PHYSICS_LOCK_CHECK ?= 1 |
| 14 | |
| 15 | CFLAGS ?= -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc \ |
| 16 | -I$(PHYSICS_DIR)/m16 -I$(PHYSICS_DIR)/nvrm \ |
| 17 | -I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc \ |
| 18 | -I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/common/inc \ |
| 19 | -I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm \ |
| 20 | -I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include |
| 21 | |
| 22 | # sm_121 instruction encoder (twin of aien-dev/CUDApp#79): om (default) = om/encoder/bw_enc_sm121.om through the |
| 23 | # generated binding src/omega_om_units.c; c = the migration-pending C encoder, the differential oracle; diff = both on |
| 24 | # every call, abort on any difference (mk/om-encoder.mk). Use a separate OUT_DIR per value. The macro names keep |
| 25 | # CUDApp's spelling so src/omega_blackwell_codegen.c stays the same file in both repositories. |
| 26 | CUDAPP_ENCODER ?= om |
| 27 | CUDAPP_ENCODER_DEFS_om := |
| 28 | CUDAPP_ENCODER_DEFS_c := -DCUDAPP_MIGRATION_PENDING_C_ENCODER |
| 29 | CUDAPP_ENCODER_DEFS_diff := -DCUDAPP_MIGRATION_PENDING_ENCODER_DIFF |
| 30 | CUDAPP_ENCODER_DEFS = $(CUDAPP_ENCODER_DEFS_$(CUDAPP_ENCODER)) |
| 31 | ifeq ($(filter om c diff,$(CUDAPP_ENCODER)),) |
| 32 | $(error CUDAPP_ENCODER must be om, c or diff) |
| 33 | endif |
| 34 | |
| 35 | SRCS = src/omega_om_units.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 36 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_exec.c \ |
| 37 | src/omega_self_host.c src/omega_verify.c src/omega_program.c src/omega_synthesis.c \ |
| 38 | src/omega_library.c src/omega_discovery.c src/omega_machine.c src/omega_realize_synth.c \ |
| 39 | src/omega_matvec.c src/omega_accelerator.c src/omega_accelerator_world.c \ |
| 40 | src/omega_vector.c src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 41 | src/omega_blackwell_realize.c src/omega_blackwell_submit.c src/omega_blackwell_engine.c src/omega_gpu_engine.c src/omega_blackwell_gates.c src/omega_blackwell_matmul.c src/omega_blackwell_codegen.c src/omega_gpu_session.c src/omega_gpu_platform.c src/omega_gpu_platform_linux.c src/omega_gpu_fmt.c src/omega_gpu_matmul_api.c src/omega_gpu_elementwise_api.c src/omega_gpu_attention_api.c src/omega_gpu_serving.c src/omega_world_gates.c src/omega_gpu_wait.c \ |
| 42 | src/omega_evidence.c src/omega_clean_clone.c \ |
| 43 | $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \ |
| 44 | tools/omegatool.c |
| 45 | # OWN-30B cut 2 (2026-10-13): column windows over a resident bf16 tensor for the MoE path. New file, |
| 46 | # adds exports only (8B decode-speed lane collision rule: no existing GPU source moves). |
| 47 | SRCS += src/omega_gpu_moe_api.c |
| 48 | |
| 49 | # OWN-30B Cut 6 / Cut 5 (2026-10-13): FP8 e4m3 GEMV kernel family, new files only (omega_gpu_fp8_api.h) |
| 50 | SRCS += src/omega_blackwell_codegen_moe.c src/omega_gpu_fp8_pack.c src/omega_gpu_fp8_api.c |
| 51 | # OWN-30B W-L2c (2026-10-14): FP8 GEMV variant 2, row-pipelined (omega_blackwell_codegen_moe2.h), selectable, variant 1 untouched |
| 52 | SRCS += src/omega_blackwell_codegen_moe2.c |
| 53 | # Expert Ribbon P1 (aienix#4 / omega#533, 2026-10-18): versioned replaceable FP8 expert slots, new files only |
| 54 | SRCS += src/omega_fp8_slot_table.c src/omega_gpu_fp8_slots.c |
| 55 | # OWN-30B cut 8 (2026-10-13): one-launch decode attention (omega_gpu_decode_attn_api.h), new files only |
| 56 | SRCS += src/omega_blackwell_codegen_attn.c src/omega_gpu_decode_attn_api.c |
| 57 | # Qwen3.8-27B (omega-mv#544, 2026-10-18): decode attention head_dim 256, new files only |
| 58 | SRCS += src/omega_blackwell_codegen_attn256.c src/omega_gpu_decode_attn256_api.c |
| 59 | # Qwen3.8-27B (omega-mv#545, 2026-10-18): prefill attention head_dim 256 on the decode cache, new files only |
| 60 | SRCS += src/omega_blackwell_codegen_pattn256.c src/omega_gpu_prefill_attn256_api.c |
| 61 | # OWN-30B (2026-10-13): libm-free host math (omega_gpu_hostmath.h) so libomega_gpu.a links without -lm |
| 62 | SRCS += src/omega_gpu_hostmath.c |
| 63 | # OWN-30B cut 8 item 2 (2026-10-13): one-launch MoE router (omega_gpu_router_api.h), new files only |
| 64 | SRCS += src/omega_blackwell_codegen_router.c src/omega_gpu_router_api.c |
| 65 | # Qwen3.8-27B Gated DeltaNet decode step (omega#542, 2026-10-18): one launch per layer (omega_gpu_gdn_api.h), new files only |
| 66 | SRCS += src/omega_blackwell_codegen_gdn.c src/omega_gpu_gdn_api.c |
| 67 | # OWN-30B W-L2 (2026-10-13): decode launch collapse, new files only: command list (N launches, one submit) + glue kernels |
| 68 | SRCS += src/omega_gpu_cmdlist.c src/omega_blackwell_codegen_dec.c |
| 69 | # C3 (docs/OMEGA.md): reductions and prefix sums of any length, bit-exact against the frozen-order host reference. |
| 70 | SRCS += src/omega_gpu_scan.c src/omega_gpu_scan_ref.c |
| 71 | # C3: matrix multiply of any shape, BF16 and FP8, both layouts, on the tensor cores (pack kernels + one multiply kernel). |
| 72 | SRCS += src/omega_gpu_gemm.c |
| 73 | SRCS += src/omega_gpu_mem_cached.c |
| 74 | SRCS += src/omega_gpu_decode_graph.c |
| 75 | # sc #642 (2026-10-18): one Qwen3.8-27B decode token as one command list (GDN + hd256 attention layers, dense MLP) |
| 76 | SRCS += src/omega_gpu_q38_graph.c |
| 77 | SRCS += src/omega_gpu_q36_graph.c |
| 78 | # C6 (L386): Omega's own sm_121 disassembler; the listing checks in tests/ call it instead of nvdisasm |
| 79 | SRCS += src/omega_sm121_disasm.c |
| 80 | # OWN-30B (2026-10-13): bf16 streaming GEMV for the lm_head (omega_gpu_bf16_gemv_api.h), new files only |
| 81 | SRCS += src/omega_blackwell_codegen_bf16.c src/omega_gpu_bf16_gemv_api.c |
| 82 | # OWN-30B prefill (2026-10-13): FP8 grouped GEMM, each expert streamed once per pass (omega_gpu_fp8gemm_api.h), new files only |
| 83 | SRCS += src/omega_blackwell_codegen_gemm.c src/omega_gpu_fp8gemm_api.c |
| 84 | # OWN-30B T3 (2026-10-13): tensor-core prefill kernels (omega_blackwell_codegen_tc.h), new files only |
| 85 | SRCS += src/omega_blackwell_codegen_tc.c |
| 86 | SRCS += src/omega_gpu_tcgemm_api.c |
| 87 | # OWN-30B L1 attention (2026-10-13): tensor-core causal prefill attention (omega_gpu_prefill_attn_api.h), new files only |
| 88 | SRCS += src/omega_blackwell_codegen_pattn.c src/omega_gpu_prefill_attn_api.c |
| 89 | # OWN-30B T3b (2026-10-13): device-resident prefill (omega_gpu_prefill.h), new files only |
| 90 | SRCS += src/omega_blackwell_codegen_pf.c src/omega_gpu_prefill.c src/omega_blackwell_codegen_tc2.c src/omega_gpu_pfgemm.c |
| 91 | # trainer lane E1 (2026-10-16): device-resident bf16 training GEMM (omega_gpu_tgemm_api.h), new files only |
| 92 | SRCS += src/omega_blackwell_codegen_tgemm.c src/omega_gpu_tgemm_api.c |
| 93 | # OWN-30B L1 GEMM (W-L1G, 2026-10-14): native FP8 QMMA, new files only |
| 94 | SRCS += src/omega_blackwell_codegen_qmma.c src/omega_blackwell_codegen_qg.c |
| 95 | # OWN-30B W-L1G-D (2026-10-14): router logits + MoE combine for the whole-prompt prefill, new files only |
| 96 | SRCS += src/omega_blackwell_codegen_pfhost.c src/omega_gpu_pfhost.c src/omega_gpu_moe_plan.c |
| 97 | # Ternary engine T0 (2026-10-15): KT1, the W2A8 ternary GEMV (omega_gpu_tern_api.h), new files only |
| 98 | SRCS += src/omega_blackwell_codegen_tern.c src/omega_gpu_tern_api.c |
| 99 | OBJS = $(patsubst %.c,$(OUT_DIR)/%.o,$(notdir $(SRCS))) |
| 100 | DEPS = $(OBJS:.o=.d) |
| 101 | -include $(DEPS) |
| 102 | TARGET = $(OUT_DIR)/omegatool |
| 103 | |
| 104 | # Crumbline learner: a separate executable linked ONLY from learner-side code |
| 105 | # Crumbline learner: pure seeded OM-2 binary (src/crumbline/crumbline.om + |
| 106 | # tools/crumbline_learner.om). Links no physics, no C, no gate suites and no |
| 107 | # sealed-side code; the sealed side lives in the crumbs crate. |
| 108 | LEARNER = $(OUT_DIR)/crumbline-learner |
| 109 | |
| 110 | .PHONY: all clean check-physics-lock crumbline-learner test-crumbline test-m19 test test-m5 test-m6 test-m7 test-m8 test-m9 test-m10 test-m11 test-m12 test-m13 test-m14 test-m15 test-m17 test-r3 test-i11-wake-merge test-action-graph test-state-projection test-capability-query test-capability-graph test-skillroute-compose test-semantic-comm test-cognitive-routing test-sem-incremental test-branch-reuse test-jspace-prod test-plan-reuse test-cortex |
| 111 | |
| 112 | all: check-physics-lock $(TARGET) |
| 113 | |
| 114 | check-physics-lock: |
| 115 | @if [ "$(PHYSICS_LOCK_CHECK)" != "0" ]; then \ |
| 116 | if [ ! -f physics.lock ]; then \ |
| 117 | echo "error: physics.lock not found at repo root" >&2; exit 1; \ |
| 118 | fi; \ |
| 119 | locked=$$(tr -d '[:space:]' < physics.lock); \ |
| 120 | case "$$locked" in \ |
| 121 | [0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ;; \ |
| 122 | *) echo "error: physics.lock must contain exactly one lowercase 40-hex commit" >&2; exit 1 ;; \ |
| 123 | esac; \ |
| 124 | if ! tools/pinned_checkout.sh verify "$(PHYSICS_DIR)" "$$locked" >/dev/null; then \ |
| 125 | printf '%s\n' "error: PHYSICS_DIR=$(PHYSICS_DIR) is not an exact worktree of physics.lock ($$locked)." >&2; \ |
| 126 | echo " Use an unmodified checkout at the pin, or override with PHYSICS_LOCK_CHECK=0." >&2; \ |
| 127 | exit 1; \ |
| 128 | fi; \ |
| 129 | fi |
| 130 | |
| 131 | $(OUT_DIR): |
| 132 | mkdir -p $(OUT_DIR) |
| 133 | |
| 134 | $(OUT_DIR)/%.o: src/%.c | $(OUT_DIR) |
| 135 | $(CC) $(CFLAGS) $(CUDAPP_ENCODER_DEFS) -c $< -o $@ |
| 136 | |
| 137 | # Objects that read the physics tree: the two compiled from it, and the sources that include |
| 138 | # m16_native.h or nvrm.h from it (directly or through src/*.h; `gcc -MM` lists a $(PHYSICS_DIR) |
| 139 | # path for exactly these). They must be rebuilt when PHYSICS_DIR points at another tree, not only |
| 140 | # when a file there is newer, and none may compile before check-physics-lock passes (#488). |
| 141 | # The stamp records the resolved PHYSICS_DIR and its git HEAD and is rewritten only when that |
| 142 | # text changes, so an unchanged PHYSICS_DIR rebuilds nothing. Its phony prerequisite proves the |
| 143 | # commit, every tree/blob and the raw worktree bytes and modes first: when that proof refuses, |
| 144 | # the stamp is not made and no physics object compiles. |
| 145 | # The other objects take nothing from PHYSICS_DIR and are shared with physics-free builds |
| 146 | # (crumbline-learner, omega, test-program-id), so they stay ungated. |
| 147 | PHYSICS_STAMP = $(OUT_DIR)/physics.stamp |
| 148 | PHYSICS_OBJS = $(addprefix $(OUT_DIR)/,m16_native.o nvrm.o omegatool.o omega_accelerator_world.o \ |
| 149 | omega_blackwell_submit.o omega_blackwell_engine.o omega_blackwell_gates.o \ |
| 150 | omega_gpu_platform_linux.o omega_world_gates.o omega_evidence.o) |
| 151 | $(PHYSICS_STAMP): check-physics-lock | $(OUT_DIR) |
| 152 | @new="$$(cd '$(PHYSICS_DIR)' 2>/dev/null && pwd -P || echo '$(PHYSICS_DIR)') $$(git -C '$(PHYSICS_DIR)' rev-parse HEAD 2>/dev/null || echo nogit)"; \ |
| 153 | if [ "$$(cat $@ 2>/dev/null)" != "$$new" ]; then printf '%s\n' "$$new" > $@; fi |
| 154 | $(PHYSICS_OBJS): $(PHYSICS_STAMP) |
| 155 | |
| 156 | $(OUT_DIR)/m16_native.o: $(PHYSICS_DIR)/m16/m16_native.c | $(OUT_DIR) |
| 157 | $(CC) $(CFLAGS) -c $< -o $@ |
| 158 | |
| 159 | $(OUT_DIR)/nvrm.o: $(PHYSICS_DIR)/nvrm/nvrm.c | $(OUT_DIR) |
| 160 | $(CC) $(CFLAGS) -c $< -o $@ |
| 161 | |
| 162 | crumbline-learner: $(LEARNER) |
| 163 | |
| 164 | test-crumbline: $(LEARNER) |
| 165 | ./tests/crumbline/run_conformance.sh $(LEARNER) tests/crumbline/vectors |
| 166 | ./tests/crumbline/run_crb1_conformance.sh $(LEARNER) tests/crumbline/crb1 tests/crumbline/crb1_findings.txt |
| 167 | |
| 168 | $(LEARNER): src/crumbline/crumbline.om tools/crumbline_learner.om seed/out/omc | $(OUT_DIR) |
| 169 | cat src/crumbline/crumbline.om tools/crumbline_learner.om | seed/out/omc > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ |
| 170 | |
| 171 | $(OUT_DIR)/omegatool.o: tools/omegatool.c | $(OUT_DIR) |
| 172 | $(CC) $(CFLAGS) -c $< -o $@ |
| 173 | |
| 174 | $(TARGET): $(OBJS) | check-physics-lock |
| 175 | $(CC) $(CFLAGS) -o $@.tmp.$$$$ $(OBJS) && mv -f $@.tmp.$$$$ $@ |
| 176 | |
| 177 | test: $(TARGET) |
| 178 | ./$(TARGET) --run-gates |
| 179 | ./$(TARGET) --reference-demonstrate-arithmetic |
| 180 | ./$(TARGET) --reference-demonstrate-physics |
| 181 | |
| 182 | test-m5: $(TARGET) |
| 183 | ./$(TARGET) --run-m5-gates |
| 184 | ./$(TARGET) --reference-demonstrate-realization |
| 185 | |
| 186 | test-m6: $(TARGET) |
| 187 | ./$(TARGET) --run-m6-gates |
| 188 | ./$(TARGET) --reference-demonstrate-self-host |
| 189 | |
| 190 | test-m7: $(TARGET) |
| 191 | ./$(TARGET) --run-m7-gates |
| 192 | ./$(TARGET) --reference-demonstrate-verify |
| 193 | |
| 194 | test-m8: $(TARGET) |
| 195 | ./$(TARGET) --run-m8-gates |
| 196 | ./$(TARGET) --reference-demonstrate-program |
| 197 | |
| 198 | test-m9: $(TARGET) |
| 199 | ./$(TARGET) --run-m9-gates |
| 200 | ./$(TARGET) --reference-demonstrate-synthesis |
| 201 | |
| 202 | test-m10: $(TARGET) |
| 203 | ./$(TARGET) --run-m10-gates |
| 204 | ./$(TARGET) --reference-demonstrate-library |
| 205 | |
| 206 | test-m11: $(TARGET) |
| 207 | ./$(TARGET) --run-m11-gates |
| 208 | ./$(TARGET) --reference-demonstrate-discovery |
| 209 | |
| 210 | test-m12: $(TARGET) |
| 211 | ./$(TARGET) --run-m12-gates |
| 212 | ./$(TARGET) --legacy-oracle-living-matvec |
| 213 | |
| 214 | test-m13: $(TARGET) |
| 215 | ./$(TARGET) --run-m13-gates |
| 216 | ./$(TARGET) --reference-demonstrate-machine |
| 217 | |
| 218 | test-m14: $(TARGET) |
| 219 | ./$(TARGET) --run-m14-gates |
| 220 | ./$(TARGET) --reference-demonstrate-realization-synthesis |
| 221 | |
| 222 | test-m15: $(TARGET) |
| 223 | ./$(TARGET) --run-m15-gates |
| 224 | ./$(TARGET) --reference-demonstrate-accelerator |
| 225 | |
| 226 | test-m17: $(TARGET) |
| 227 | ./$(TARGET) --run-m17-gates |
| 228 | ./$(TARGET) --reference-demonstrate-blackwell-vector |
| 229 | |
| 230 | clean: |
| 231 | rm -rf $(OUT_DIR) |
| 232 | |
| 233 | test-m19: $(TARGET) |
| 234 | ./$(TARGET) --run-m19-gates |
| 235 | |
| 236 | # Host-only tests of the M19R qualifier (tools/m19r_qualify.sh) and its |
| 237 | # canonical-JSON helper (tools/json_canon.c). No GPU. |
| 238 | .PHONY: test-m19r-qualify |
| 239 | test-m19r-qualify: |
| 240 | tools/test_m19r_qualify.sh |
| 241 | |
| 242 | # Host-only tests of the chipwait campaign runner (tools/chipwait_campaign.sh) |
| 243 | # against a stub qualifier. No GPU. |
| 244 | .PHONY: test-chipwait-campaign |
| 245 | test-chipwait-campaign: |
| 246 | tools/test_chipwait_campaign.sh |
| 247 | |
| 248 | # Host-only tests of the Gate 14 combiner (tools/gate14_combine.sh). No GPU. |
| 249 | .PHONY: test-gate14-combine |
| 250 | test-gate14-combine: |
| 251 | tools/test_gate14_combine.sh |
| 252 | |
| 253 | # Host-only self-test of the gate physics pins (omega#523): every tests/gates/run.sh step |
| 254 | # that builds against physics takes physics.lock, and its gate lists physics.lock as an input. |
| 255 | .PHONY: test-gate-physics-pin |
| 256 | test-gate-physics-pin: |
| 257 | tools/test_gate_physics_pin.sh |
| 258 | tools/test_pinned_checkout.sh |
| 259 | |
| 260 | # Host-only self-test of exact pinned-checkout materialization and verification: |
| 261 | # dirty sources and replace refs cannot affect output; byte, mode and extra-path mutants refuse. |
| 262 | .PHONY: test-pinned-checkout |
| 263 | test-pinned-checkout: |
| 264 | tools/test_pinned_checkout.sh |
| 265 | |
| 266 | # Host-only self-test of the E1 closure combiner (tools/e1_combine.sh): good |
| 267 | # synthetic constituent set accepted, every hostile mutant refused. No GPU. |
| 268 | .PHONY: test-e1-combine |
| 269 | test-e1-combine: |
| 270 | tools/test_e1_combine.sh |
| 271 | |
| 272 | # Host-only self-test of the shared chip-run module (tools/chip_run.sh): every |
| 273 | # refusal path with fake binaries. No GPU. |
| 274 | .PHONY: test-chip-run |
| 275 | test-chip-run: |
| 276 | tests/test_chip_run.sh |
| 277 | |
| 278 | # Host-only check of the unwritten-trap manifest and its wrapper. No GPU. |
| 279 | .PHONY: test-chip-run-trap-manifest |
| 280 | test-chip-run-trap-manifest: |
| 281 | tests/test_chip_run_trap_manifest.sh |
| 282 | |
| 283 | # Host-only check of the transcendental-gate manifest and its wrapper (fake chip, old-vs-new receipt keys). No GPU. |
| 284 | .PHONY: test-chip-run-transc-manifest |
| 285 | test-chip-run-transc-manifest: |
| 286 | tests/test_chip_run_transc_manifest.sh |
| 287 | |
| 288 | # Gate 5 (OMEGA-NUMERIC-0), CPU tiers only: reference, CPU parity, provenance |
| 289 | # and negative tests. Opens no device. The GB10 tier and the receipt come |
| 290 | # from tests/run_numeric_gates.sh on the chip. Exits nonzero while any gate |
| 291 | # item fails. |
| 292 | .PHONY: test-numeric-cpu test-numeric-qualify |
| 293 | NUMERIC_CPU_SRCS = tests/test_omega_numeric.c src/omega_numeric.c src/omega_numeric_provenance.c src/omega_numeric_divsqrt_gb10.c \ |
| 294 | $(NUMERIC_BW_SRCS) |
| 295 | NUMERIC_CPU_HDRS = src/omega_numeric.h src/omega_numeric_provenance.h src/omega_numeric_divsqrt_gb10.h tests/numeric_oracle.h \ |
| 296 | $(NUMERIC_BW_HDRS) |
| 297 | build/test_omega_numeric_cpu: $(NUMERIC_CPU_SRCS) $(NUMERIC_CPU_HDRS) |
| 298 | @mkdir -p build |
| 299 | gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(NUMERIC_CPU_SRCS) |
| 300 | # test-numeric-cpu exit status: 0 means no host test failed and the only SKIPs |
| 301 | # are the five declared chip-only IDs (CHIP_ONLY_IDS in the test; the last line |
| 302 | # prints "Gate 5 Verdict: PASS_EXCEPT_DECLARED_CHIP_ONLY"). Nonzero means a real |
| 303 | # host regression (verdict HOST_REGRESSION) or a SKIP nobody declared |
| 304 | # (UNDECLARED_SKIP). The chip build allows no SKIP at all. |
| 305 | test-numeric-cpu: build/test_omega_numeric_cpu |
| 306 | ./build/test_omega_numeric_cpu |
| 307 | |
| 308 | # Host-only tests of the Gate 5 qualifier and receipt writer. No GPU. |
| 309 | test-numeric-qualify: build/test_omega_numeric_cpu |
| 310 | tools/test_numeric_qualify.sh |
| 311 | |
| 312 | # Deletes each CHECK-marked pre-submission check in src/omega_numeric.c in a |
| 313 | # scratch copy and proves a Gate 5 host test then fails. No GPU. |
| 314 | # Then applies each arithmetic mutation in tools/numeric_oracle_mutations.sh |
| 315 | # (broken EXP/LOG coefficients, wrong host instruction, wrong LDS index, an |
| 316 | # undeclared SKIP) and proves the CPU-only run exits nonzero. No GPU. |
| 317 | .PHONY: test-numeric-sweep |
| 318 | test-numeric-sweep: |
| 319 | tools/numeric_check_sweep.sh |
| 320 | tools/numeric_oracle_mutations.sh |
| 321 | |
| 322 | # E1 scalar contract, exhaustive: every 2^32 input of each unary E1 op through |
| 323 | # the reference, the CPU tier and the integer oracle (one process per op, |
| 324 | # docs/numeric/E1_SCALAR_CONTRACT.md). Not part of Gate 5. No GPU. |
| 325 | .PHONY: test-numeric-e1-exhaustive |
| 326 | test-numeric-e1-exhaustive: build/test_omega_numeric_cpu |
| 327 | ./build/test_omega_numeric_cpu --e1-exhaustive |
| 328 | |
| 329 | # E1 WP-D general reductions (docs/numeric/E1_REDUCTION_CONTRACT.md), CPU |
| 330 | # tiers only: reference, CPU realization, oracles, negative order test and the |
| 331 | # GB10 pre-submission checks. Opens no device. The chip parity run is |
| 332 | # tests/run_reduce_chip.sh. Last line: "E1 Reduce Verdict: PASS_EXCEPT_DECLARED_CHIP_ONLY". |
| 333 | .PHONY: test-numeric-reduce-cpu |
| 334 | REDUCE_CPU_SRCS = tests/test_omega_reduce.c src/omega_numeric_reduce.c src/omega_numeric_reduce_gb10.c \ |
| 335 | src/omega_numeric.c src/omega_numeric_provenance.c src/omega_numeric_divsqrt_gb10.c \ |
| 336 | $(NUMERIC_BW_SRCS) |
| 337 | build/test_omega_reduce_cpu: $(REDUCE_CPU_SRCS) src/omega_numeric_reduce.h $(NUMERIC_CPU_HDRS) |
| 338 | @mkdir -p build |
| 339 | gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(REDUCE_CPU_SRCS) |
| 340 | test-numeric-reduce-cpu: build/test_omega_reduce_cpu |
| 341 | ./build/test_omega_reduce_cpu |
| 342 | |
| 343 | # E1 WP-B: FP32 transcendental sequences (SIGMOID TANH RSQRT EXP2 LOG2 ERF SIN |
| 344 | # COS GELU), CPU tier, bounded contract (docs/numeric/E1_TRANSCENDENTAL_CONTRACT.md). |
| 345 | # No libm, no GPU. test-numeric-transc: special values, oracle self-checks, |
| 346 | # about 1.1M sampled inputs per op against the binary128 oracle, determinism, |
| 347 | # then one build per perturbed coefficient (OMEGA_TRANSC_MUTATE=1..10) which |
| 348 | # must FAIL. test-numeric-transc-full: all 2^32 inputs of every op (long; run |
| 349 | # it detached). test-numeric-transc-digest: full-domain outputs against the |
| 350 | # frozen digests. |
| 351 | .PHONY: test-numeric-transc test-numeric-transc-full test-numeric-transc-digest |
| 352 | TRANSC_SRCS = tests/test_omega_transc.c src/omega_numeric_transc.c src/omega_om_units.c |
| 353 | TRANSC_HDRS = src/omega_numeric_transc.h src/omega_numeric.h src/sha256.h |
| 354 | TRANSC_CC = gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -fno-fast-math -pthread -Isrc |
| 355 | TRANSC_MUTANTS = 1 2 3 4 5 6 7 8 9 10 |
| 356 | build/test_omega_transc: $(TRANSC_SRCS) $(TRANSC_HDRS) |
| 357 | @mkdir -p build |
| 358 | $(TRANSC_CC) -o $@ $(TRANSC_SRCS) |
| 359 | test-numeric-transc: build/test_omega_transc |
| 360 | ./build/test_omega_transc fast |
| 361 | @for m in $(TRANSC_MUTANTS); do \ |
| 362 | $(TRANSC_CC) -DOMEGA_TRANSC_MUTATE=$$m -o build/test_omega_transc_mut$$m $(TRANSC_SRCS) || exit 1; \ |
| 363 | if ./build/test_omega_transc_mut$$m fast > build/test_omega_transc_mut$$m.log 2>&1; then \ |
| 364 | echo "MUTANT $$m SURVIVED (bound check did not fail)"; exit 1; \ |
| 365 | else echo "mutant $$m killed: $$(grep -m1 '^FAIL' build/test_omega_transc_mut$$m.log)"; fi; \ |
| 366 | done |
| 367 | @echo "test-numeric-transc: PASS (all $(words $(TRANSC_MUTANTS)) mutants killed)" |
| 368 | test-numeric-transc-full: build/test_omega_transc |
| 369 | ./build/test_omega_transc full |
| 370 | test-numeric-transc-digest: build/test_omega_transc |
| 371 | ./build/test_omega_transc digest |
| 372 | |
| 373 | # Offline provenance of the GB10 MAX/MIN warp patch: Omega's own disassembler (sm121dis, |
| 374 | # C6; it agrees with nvdisasm on every library kernel) must decode every word to the text the |
| 375 | # patch table records. No device opened. Last line: "E1 Reduce nvdisasm: PASS" (name kept for receipts). |
| 376 | .PHONY: test-numeric-reduce-nvdisasm |
| 377 | REDUCE_NVDISASM ?= build/sm121dis |
| 378 | test-numeric-reduce-nvdisasm: build/test_omega_reduce_cpu build/sm121dis |
| 379 | @set -e; t=$$(mktemp -d); trap 'rm -rf "$$t"' EXIT; ./build/test_omega_reduce_cpu --dump "$$t"; \ |
| 380 | for op in max min; do \ |
| 381 | "$(REDUCE_NVDISASM)" -b SM121 "$$t/$$op.bin" > "$$t/$$op.raw" || { echo "E1 Reduce nvdisasm: FAIL ($$op: disassembler error)"; exit 1; }; \ |
| 382 | sed -n 's|^[[:space:]]*/\*\([0-9a-f]\{4\}\)\*/[[:space:]]*\(.*;\).*$$|\1 \2|p' "$$t/$$op.raw" \ |
| 383 | | sed 's/[[:space:]]\{1,\}/ /g' > "$$t/$$op.got"; \ |
| 384 | diff -u "$$t/$$op.lst" "$$t/$$op.got" || { echo "E1 Reduce nvdisasm: FAIL ($$op)"; exit 1; }; echo "$$op: $$(wc -l < "$$t/$$op.lst") words decode to the recorded text"; \ |
| 385 | done; echo "E1 Reduce nvdisasm: PASS ($$("$(REDUCE_NVDISASM)" --version))" |
| 386 | |
| 387 | # Resident reaction runtime heartbeat (ADR 0016, R3/R4 host reference). |
| 388 | # CPU only; links no PHYSICS/NVRM code (omega_evidence.c needs only the header). |
| 389 | RX_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 390 | src/omega_om_units.c src/omega_evidence.c tests/runtime/rx_heartbeat_test.c |
| 391 | RX_TEST = $(OUT_DIR)/rx_heartbeat_test |
| 392 | |
| 393 | $(RX_TEST): $(RX_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 394 | src/runtime/omega_shared_world_abi.h | $(OUT_DIR) |
| 395 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_SRCS) |
| 396 | |
| 397 | test-r3: $(RX_TEST) |
| 398 | ./$(RX_TEST) |
| 399 | |
| 400 | # HD-09 resource contract v0, first enforcement cut: a declared deadline is |
| 401 | # enforced before publishing (late reaction cancelled, nothing published, |
| 402 | # charge refunded once). CPU only, same links as R3 minus the heartbeat test. |
| 403 | RX_DEADLINE_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 404 | src/omega_om_units.c src/omega_evidence.c tests/runtime/rx_deadline_cancel.c |
| 405 | RX_DEADLINE_TEST = $(OUT_DIR)/rx_deadline_cancel |
| 406 | |
| 407 | $(RX_DEADLINE_TEST): $(RX_DEADLINE_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 408 | src/runtime/omega_shared_world_abi.h | $(OUT_DIR) |
| 409 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_DEADLINE_SRCS) |
| 410 | |
| 411 | .PHONY: test-rx-deadline-cancel |
| 412 | test-rx-deadline-cancel: $(RX_DEADLINE_TEST) |
| 413 | ./$(RX_DEADLINE_TEST) |
| 414 | |
| 415 | # I11: a dependent popped while a writer of its inputs is still computing is |
| 416 | # held so the writer's wake merges into it (one commit per stimulus, as with |
| 417 | # one worker). Deterministic forced interleaving; the mutant build has no hold |
| 418 | # and must FAIL. CPU only, same links as R3. |
| 419 | RX_I11_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 420 | src/omega_om_units.c src/omega_evidence.c tests/runtime/rx_i11_wake_merge.c |
| 421 | RX_I11_TEST = $(OUT_DIR)/rx_i11_wake_merge |
| 422 | RX_I11_MUTANT = $(OUT_DIR)/rx_i11_wake_merge_mutant |
| 423 | |
| 424 | $(RX_I11_TEST): $(RX_I11_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 425 | src/runtime/omega_shared_world_abi.h | $(OUT_DIR) |
| 426 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_I11_SRCS) |
| 427 | |
| 428 | $(RX_I11_MUTANT): $(RX_I11_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 429 | src/runtime/omega_shared_world_abi.h | $(OUT_DIR) |
| 430 | $(CC) $(CFLAGS) -DRX_WORLD_MUTATE_NO_UPSTREAM_HOLD -pthread -o $@ $(RX_I11_SRCS) |
| 431 | |
| 432 | test-i11-wake-merge: $(RX_I11_TEST) $(RX_I11_MUTANT) |
| 433 | ./$(RX_I11_TEST) |
| 434 | @if ./$(RX_I11_MUTANT); then \ |
| 435 | echo "MUTANT SURVIVED (no upstream hold, test still passed)"; exit 1; \ |
| 436 | else echo "test-i11-wake-merge: PASS (mutant killed)"; fi |
| 437 | |
| 438 | # Omega semantic variables and incremental recomputation |
| 439 | # (gate OMEGA_INCREMENTAL_SEMANTICS_PASS). CPU only, same links as R3. |
| 440 | RX_SEM_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 441 | src/runtime/rx_semantic.c src/omega_om_units.c src/omega_evidence.c \ |
| 442 | tests/runtime/rx_sem_incremental.c |
| 443 | RX_SEM_TEST = $(OUT_DIR)/rx_sem_incremental_test |
| 444 | |
| 445 | $(RX_SEM_TEST): $(RX_SEM_SRCS) src/runtime/rx_semantic.h src/runtime/rx_caproot.h \ |
| 446 | src/runtime/rx_world.h src/runtime/omega_shared_world_abi.h | $(OUT_DIR) |
| 447 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_SEM_SRCS) |
| 448 | |
| 449 | test-sem-incremental: $(RX_SEM_TEST) |
| 450 | ./$(RX_SEM_TEST) |
| 451 | |
| 452 | # R7: native Aienux authority versus the Linux oracle, then the world view. |
| 453 | # The authority source is the FULL commit in aienos.lock, proven by |
| 454 | # tools/aienos_lock_source.sh from git objects (a directory name, a short SHA or an |
| 455 | # override is not proof). Default: extracted with `git archive` from a repository holding |
| 456 | # that commit (AIENOS_LOCK_REPO, or the repository around AIENOS_R7_DIR) into |
| 457 | # $(OUT_DIR)/aienos-authority/<full lock>. An AIENOS_R7_DIR override is used only after |
| 458 | # the same proof: every tracked file under the subpaths built from has the locked blob |
| 459 | # and no unignored extra file sits beside them. The proof runs on every build (phony |
| 460 | # prerequisite), so a source edited after extraction stops the build. |
| 461 | AIENOS_LOCK_REPO ?= ../aienos-argus-cap |
| 462 | # AIENOS_LOCK is the validated commit parsed at the top of this Makefile. |
| 463 | AIENOS_R7_DEFAULT = $(OUT_DIR)/aienos-authority/$(AIENOS_LOCK) |
| 464 | AIENOS_R7_DIR ?= $(AIENOS_R7_DEFAULT) |
| 465 | AIENOS_CAP_LIB ?= $(OUT_DIR)/aienos-cap/libaienos_capability_om2.a |
| 466 | # $(call aienos_source,<subpaths>): materialize into the default cache, or prove the override. |
| 467 | aienos_source = if [ "$(AIENOS_R7_DIR)" = "$(AIENOS_R7_DEFAULT)" ]; then \ |
| 468 | AIENOS_LOCK_REPO="$(AIENOS_LOCK_REPO)" AIENOS_LOCK='$(AIENOS_LOCK)' AIENOS_R7_DIR= bash tools/aienos_lock_source.sh materialize "$(AIENOS_R7_DIR)" $(1); \ |
| 469 | else \ |
| 470 | AIENOS_LOCK_REPO="$(AIENOS_LOCK_REPO)" AIENOS_LOCK='$(AIENOS_LOCK)' AIENOS_R7_DIR="$(AIENOS_R7_DIR)" bash tools/aienos_lock_source.sh verify-dir "$(AIENOS_R7_DIR)" $(1); \ |
| 471 | fi || { echo 'error: the aienos authority source is not the aienos.lock commit $(AIENOS_LOCK) (see above).'; \ |
| 472 | echo " pass AIENOS_LOCK_REPO=<an aienos clone holding that commit>, or AIENOS_R7_DIR=<a clean tree of it inside such a clone>;"; \ |
| 473 | echo " a modified default cache under $(OUT_DIR)/aienos-authority must be deleted, not reused."; exit 1; } |
| 474 | RX_R7_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 475 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 476 | tests/runtime/rx_r7_native.c |
| 477 | RX_R7_TEST = $(OUT_DIR)/rx_r7_native_test |
| 478 | |
| 479 | .PHONY: aienos-authority-capability |
| 480 | aienos-authority-capability: |
| 481 | @$(call aienos_source,native/capability) |
| 482 | |
| 483 | # Pure seeded OM-2 capability authority (seed/authority/cap_table_om2.om via |
| 484 | # src/runtime/aienos_cap_om2.c). Severs the external libaienos_capability.a / aienos.lock dependency. |
| 485 | AIENOS_CAP_LIB ?= $(OUT_DIR)/aienos-cap/libaienos_capability_om2.a |
| 486 | $(AIENOS_CAP_LIB): src/runtime/aienos_cap_om2.c src/runtime/aienos_cap.h src/runtime/rx_caproot.h src/omega_native.h | $(OUT_DIR) |
| 487 | @mkdir -p $(dir $@) |
| 488 | $(CC) $(CFLAGS) -c -o $(dir $@)/aienos_cap_om2.o src/runtime/aienos_cap_om2.c |
| 489 | $(AR) rcs $@ $(dir $@)/aienos_cap_om2.o |
| 490 | |
| 491 | # OMEGA_EFFECT_CAP64 (spec/effect-cap64-migration.md): effect objects carry the |
| 492 | # full 64-bit Aienux capability generation. Physics-free: the Omega core, the |
| 493 | # Visor effect-request adapter, and the pinned Aienux header + library |
| 494 | # (aienos.lock) used directly. Prints OMEGA_EFFECT_CAP64_{ROUNDTRIP,IDENTITY, |
| 495 | # STALE_REJECT,AUTHORITY}_PASS gate lines. |
| 496 | EFFECT_CAP64_CAP_LIB ?= $(AIENOS_CAP_LIB) |
| 497 | EFFECT_CAP64_CAP_INC ?= $(AIENOS_R7_DIR)/native/capability |
| 498 | EFFECT_CAP64_TEST = $(OUT_DIR)/tests-effect/test_effect_cap64 |
| 499 | EFFECT_CAP64_OBJS = $(addprefix $(OUT_DIR)/,omega_om_units.o omega_canonical.o omega_validate.o omega_core.o omega_codec.o) |
| 500 | |
| 501 | $(EFFECT_CAP64_TEST): tests/effect/test_effect_cap64.c $(EFFECT_CAP64_OBJS) \ |
| 502 | $(OUT_DIR)/visor/visor_effect_request.o src/visor/visor_effect_request.h \ |
| 503 | src/omega_core.h src/omega_canonical.h src/omega_types.h $(EFFECT_CAP64_CAP_LIB) |
| 504 | mkdir -p $(dir $@) |
| 505 | $(CC) $(VISOR_CFLAGS) -I$(EFFECT_CAP64_CAP_INC) -pthread -o $@ tests/effect/test_effect_cap64.c \ |
| 506 | $(OUT_DIR)/visor/visor_effect_request.o $(EFFECT_CAP64_OBJS) $(EFFECT_CAP64_CAP_LIB) -lm |
| 507 | |
| 508 | .PHONY: test-effect-cap64 |
| 509 | test-effect-cap64: $(EFFECT_CAP64_TEST) |
| 510 | ./$(EFFECT_CAP64_TEST) |
| 511 | |
| 512 | # OMEGA_AIENOS_CAP_ABI: src/runtime/aienos_cap.h, the copy the runtime compiles |
| 513 | # against, must match the pinned header $(EFFECT_CAP64_CAP_INC)/aienos_capability.h |
| 514 | # that $(AIENOS_CAP_LIB) is built from: struct layouts field by field (offset, size, |
| 515 | # kind, signedness), macro values, prototypes. Eight mutated copies must each be |
| 516 | # refused. Header only: nothing is linked against the library. |
| 517 | .PHONY: test-aienos-cap-abi |
| 518 | test-aienos-cap-abi: aienos-authority-capability |
| 519 | CC="$(CC)" CFLAGS="$(CFLAGS)" bash tests/runtime/aienos_cap_abi.sh "$(EFFECT_CAP64_CAP_INC)" |
| 520 | |
| 521 | $(RX_R7_TEST): $(RX_R7_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 522 | src/runtime/aienos_cap.h src/runtime/omega_shared_world_abi.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 523 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R7_SRCS) $(AIENOS_CAP_LIB) -lm |
| 524 | |
| 525 | test-r7: $(RX_R7_TEST) |
| 526 | ./$(RX_R7_TEST) |
| 527 | |
| 528 | # aienos#266/#272 at aienos.lock: the R16 operator control capability (the epoch |
| 529 | # right on RX_WORLD_RES_CONTROL) is refused by every authority operation, the office |
| 530 | # still operates the authority, and the world still accepts the capability for the halt |
| 531 | # check. Host only. |
| 532 | RX_OP_AUTH_MISUSE_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 533 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 534 | tests/runtime/rx_operator_authority_misuse.c |
| 535 | RX_OP_AUTH_MISUSE_TEST = $(OUT_DIR)/rx_operator_authority_misuse_test |
| 536 | $(RX_OP_AUTH_MISUSE_TEST): $(RX_OP_AUTH_MISUSE_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 537 | src/runtime/rx_operator.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 538 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_OP_AUTH_MISUSE_SRCS) $(AIENOS_CAP_LIB) -lm |
| 539 | |
| 540 | .PHONY: test-r16-operator-authority-misuse |
| 541 | test-r16-operator-authority-misuse: $(RX_OP_AUTH_MISUSE_TEST) |
| 542 | ./$(RX_OP_AUTH_MISUSE_TEST) |
| 543 | |
| 544 | # R9: generation barrier. The candidate is prepared beside the live world. |
| 545 | # A stop after each persistence step must recover one whole generation. |
| 546 | RX_R9_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 547 | src/runtime/rx_generation.c src/omega_om_units.c src/omega_evidence.c \ |
| 548 | tests/runtime/rx_r9_barrier.c |
| 549 | RX_R9_TEST = $(OUT_DIR)/rx_r9_barrier_test |
| 550 | |
| 551 | $(RX_R9_TEST): $(RX_R9_SRCS) src/runtime/rx_generation.h src/runtime/rx_caproot.h \ |
| 552 | src/runtime/rx_world.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 553 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R9_SRCS) $(AIENOS_CAP_LIB) -lm |
| 554 | |
| 555 | test-r9: $(RX_R9_TEST) |
| 556 | ./$(RX_R9_TEST) |
| 557 | |
| 558 | # R12 host rules against the native Aienux authority. The graphics processor is |
| 559 | # not started. A pass here does not claim the resident-seat gate. |
| 560 | RX_R12_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 561 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 562 | tests/runtime/rx_r12_resident.c |
| 563 | RX_R12_TEST = $(OUT_DIR)/rx_r12_resident_test |
| 564 | |
| 565 | $(RX_R12_TEST): $(RX_R12_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 566 | src/runtime/aienos_cap.h src/runtime/omega_shared_world_abi.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 567 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R12_SRCS) $(AIENOS_CAP_LIB) -lm |
| 568 | |
| 569 | test-r12: $(RX_R12_TEST) |
| 570 | ./$(RX_R12_TEST) |
| 571 | |
| 572 | # R16 G6 operator emergency stop (spec/r16-operator-emergency-stop.md). Host only, |
| 573 | # real capability root: authority refusals, in-flight and racing stops, the |
| 574 | # generation store under a stop, the durable mark across a restart, and resume. |
| 575 | # The mutant script then removes each guard in turn from a temporary copy and |
| 576 | # requires the test to fail against every one. The resident-seat case lives in |
| 577 | # test-r12 (t_emergency_stop, native Aienux authority). |
| 578 | RX_EMERGENCY_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 579 | src/runtime/rx_generation.c src/omega_om_units.c tests/runtime/rx_emergency.c |
| 580 | RX_EMERGENCY_TEST = $(OUT_DIR)/rx_emergency_test |
| 581 | |
| 582 | $(RX_EMERGENCY_TEST): $(RX_EMERGENCY_SRCS) src/runtime/rx_caproot.h src/runtime/rx_world.h \ |
| 583 | src/runtime/rx_generation.h src/runtime/rx_caller.h | $(OUT_DIR) |
| 584 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_EMERGENCY_SRCS) -lm |
| 585 | |
| 586 | .PHONY: test-rx-emergency |
| 587 | test-rx-emergency: $(RX_EMERGENCY_TEST) |
| 588 | ./$(RX_EMERGENCY_TEST) |
| 589 | CC="$(CC)" bash tests/runtime/rx_emergency_mutants.sh |
| 590 | |
| 591 | # R10: Omega as a resident realization faculty. Omega's native AArch64 matvec |
| 592 | # realizations become ready from cost evidence, are verified in a sandbox, |
| 593 | # measured, and recorded; production picks the record up. AArch64 hosts only. |
| 594 | RX_R10_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 595 | src/runtime/rx_native_bind.c src/runtime/rx_omega.c src/omega_om_units.c src/omega_evidence.c \ |
| 596 | src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 597 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c \ |
| 598 | src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c \ |
| 599 | tests/runtime/rx_r10_omega.c |
| 600 | RX_R10_TEST = $(OUT_DIR)/rx_r10_omega_test |
| 601 | |
| 602 | $(RX_R10_TEST): $(RX_R10_SRCS) src/runtime/rx_omega.h src/runtime/rx_caproot.h \ |
| 603 | src/runtime/rx_world.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 604 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R10_SRCS) $(AIENOS_CAP_LIB) -lm |
| 605 | |
| 606 | test-r10: $(RX_R10_TEST) |
| 607 | ./$(RX_R10_TEST) |
| 608 | |
| 609 | # R8: AEGIS resident authority. Capability slots in the world; AEGIS decides, |
| 610 | # only root.install mints, through the native Aienux authority. |
| 611 | RX_R8_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 612 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 613 | tests/runtime/rx_r8_aegis.c |
| 614 | RX_R8_TEST = $(OUT_DIR)/rx_r8_aegis_test |
| 615 | |
| 616 | $(RX_R8_TEST): $(RX_R8_SRCS) src/runtime/rx_aegis.h src/runtime/rx_caproot.h \ |
| 617 | src/runtime/rx_world.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 618 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R8_SRCS) $(AIENOS_CAP_LIB) -lm |
| 619 | |
| 620 | test-r8: $(RX_R8_TEST) |
| 621 | ./$(RX_R8_TEST) |
| 622 | |
| 623 | # R11: AIEN as a resident cognitive faculty. Part A drives AIEN alone on any |
| 624 | # host; part B is the living run with Omega, on hosts that have both Cortex-X925 |
| 625 | # and Cortex-A725 cores. rx_aien.o is built alone first and must not reference |
| 626 | # any Omega symbol: AIEN reaches Omega only through world objects. |
| 627 | RX_R11_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 628 | src/runtime/rx_native_bind.c src/runtime/rx_omega.c src/omega_om_units.c src/omega_evidence.c \ |
| 629 | src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 630 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c \ |
| 631 | src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c \ |
| 632 | tests/runtime/rx_r11_aien.c |
| 633 | RX_R11_TEST = $(OUT_DIR)/rx_r11_aien_test |
| 634 | RX_AIEN_OBJ = $(OUT_DIR)/rx_aien.o |
| 635 | |
| 636 | $(RX_AIEN_OBJ): src/runtime/rx_aien.c src/runtime/rx_aien.h src/runtime/rx_world.h | $(OUT_DIR) |
| 637 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_aien.c |
| 638 | @if nm -u $@ | grep -Ei 'omega' ; then \ |
| 639 | echo "rx_aien.o references Omega directly; AIEN must reach it only through the world"; \ |
| 640 | rm -f $@; exit 1; fi |
| 641 | |
| 642 | $(RX_R11_TEST): $(RX_R11_SRCS) $(RX_AIEN_OBJ) src/runtime/rx_omega.h src/runtime/rx_caproot.h \ |
| 643 | src/runtime/rx_world.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 644 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R11_SRCS) $(RX_AIEN_OBJ) $(AIENOS_CAP_LIB) -lm |
| 645 | |
| 646 | test-r11: $(RX_R11_TEST) |
| 647 | ./$(RX_R11_TEST) |
| 648 | |
| 649 | # R11 living run allowed inside its own quietlock hold, refused under any other. |
| 650 | .PHONY: test-r11-own-hold |
| 651 | test-r11-own-hold: $(RX_R11_TEST) |
| 652 | sh tests/runtime/r11_own_hold_test.sh ./$(RX_R11_TEST) |
| 653 | |
| 654 | # OMEGA_STATE_PROJECTION: cognition gets a compiled state projection from |
| 655 | # Cortex, not everything Cortex knows. Part B drives the real R11 AIEN faculty |
| 656 | # under the native Aienux authority. The projection objects are built alone |
| 657 | # first and may reference nothing but Cortex and SHA-256: no world, no faculty, |
| 658 | # no Omega realization code. |
| 659 | RX_SP_OBJS = $(OUT_DIR)/rx_cortex.o $(OUT_DIR)/rx_projection.o |
| 660 | RX_SP_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 661 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 662 | tests/runtime/rx_sp_workloads.c tests/runtime/rx_state_projection.c |
| 663 | RX_SP_TEST = $(OUT_DIR)/rx_state_projection_test |
| 664 | |
| 665 | $(OUT_DIR)/rx_cortex.o: src/runtime/rx_cortex.c src/runtime/rx_cortex.h | $(OUT_DIR) |
| 666 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_cortex.c |
| 667 | |
| 668 | $(OUT_DIR)/rx_projection.o: src/runtime/rx_projection.c src/runtime/rx_projection.h \ |
| 669 | src/runtime/rx_cortex.h | $(OUT_DIR) |
| 670 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_projection.c |
| 671 | @if nm -u $@ $(OUT_DIR)/rx_cortex.o | grep -E ' (rx_world|rx_aien|rx_omega|omega_)' ; then \ |
| 672 | echo "the projection references the world, a faculty or Omega realization code"; \ |
| 673 | rm -f $@; exit 1; fi |
| 674 | |
| 675 | $(RX_SP_TEST): $(RX_SP_SRCS) $(RX_SP_OBJS) $(RX_AIEN_OBJ) tests/runtime/rx_sp_workloads.h \ |
| 676 | src/runtime/rx_world.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 677 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_SP_SRCS) $(RX_SP_OBJS) $(RX_AIEN_OBJ) $(AIENOS_CAP_LIB) -lm |
| 678 | |
| 679 | test-state-projection: $(RX_SP_TEST) |
| 680 | ./$(RX_SP_TEST) |
| 681 | |
| 682 | # M20 Cortex canonicalization: canonical Cortex contract, journal, single |
| 683 | # writer, typed recall, and World execution recorded through rx_cortex_record. |
| 684 | RX_CX_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 685 | src/runtime/rx_cortex_record.c src/omega_om_units.c tests/runtime/rx_cortex_canon.c |
| 686 | RX_CX_TEST = $(OUT_DIR)/rx_cortex_canon_test |
| 687 | |
| 688 | $(RX_CX_TEST): $(RX_CX_SRCS) $(OUT_DIR)/rx_cortex.o src/runtime/rx_cortex_record.h \ |
| 689 | src/runtime/rx_world.h | $(OUT_DIR) |
| 690 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_CX_SRCS) $(OUT_DIR)/rx_cortex.o |
| 691 | |
| 692 | # Journal backend seam (native v1 P06 cut 1): rx_cortex.c built with |
| 693 | # CX_NO_POSIX must carry no file, lock or libc allocation symbol, and must |
| 694 | # pass the same append/replay/torn-tail contract over a memory backend. |
| 695 | RX_CX_FS_OBJ = $(OUT_DIR)/rx_cortex_freestanding.o |
| 696 | RX_CXJ_TEST = $(OUT_DIR)/rx_cortex_journal_test |
| 697 | RX_CX_FS_ALLOWED = memcpy|memmove|memset|memcmp|sha256_init|sha256_update|sha256_final|sha256_hash|cx_fs_alloc|cx_fs_realloc|cx_fs_free |
| 698 | |
| 699 | $(RX_CX_FS_OBJ): src/runtime/rx_cortex.c src/runtime/rx_cortex.h tests/runtime/cx_config_freestanding.h | $(OUT_DIR) |
| 700 | $(CC) $(CFLAGS) -ffreestanding -fno-builtin -DCX_NO_POSIX \ |
| 701 | -Itests/runtime -DCX_CONFIG_H='"cx_config_freestanding.h"' -c -o $@ src/runtime/rx_cortex.c |
| 702 | @bad=$$(nm -u $@ | awk '{print $$NF}' | grep -Ev '^(_GLOBAL_OFFSET_TABLE_|($(RX_CX_FS_ALLOWED)))$$' || true); \ |
| 703 | if [ -n "$$bad" ]; then echo "rx_cortex.c (CX_NO_POSIX) still needs: $$bad"; rm -f $@; exit 1; fi |
| 704 | @echo "rx_cortex.c (CX_NO_POSIX): no file, lock or libc allocation symbols" |
| 705 | |
| 706 | $(RX_CXJ_TEST): tests/runtime/rx_cortex_journal.c $(RX_CX_FS_OBJ) src/omega_om_units.c src/runtime/rx_cortex.h | $(OUT_DIR) |
| 707 | $(CC) $(CFLAGS) -o $@ tests/runtime/rx_cortex_journal.c $(RX_CX_FS_OBJ) src/omega_om_units.c |
| 708 | |
| 709 | test-cortex: $(RX_CX_TEST) $(RX_CXJ_TEST) |
| 710 | ./$(RX_CX_TEST) |
| 711 | ./$(RX_CXJ_TEST) |
| 712 | |
| 713 | # Physical graphics seat against the native Aienux authority. Not part of |
| 714 | # GitHub checks. A pass on this machine is the only run that may set |
| 715 | # silicon_observed. |
| 716 | RX_R12_SILICON_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c \ |
| 717 | src/runtime/rx_coherent.c src/runtime/rx_native_bind.c \ |
| 718 | src/runtime/rx_resident_gpu.c src/omega_om_units.c src/omega_evidence.c \ |
| 719 | src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \ |
| 720 | src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \ |
| 721 | $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \ |
| 722 | tests/runtime/rx_r12_silicon.c |
| 723 | RX_R12_SILICON = $(OUT_DIR)/rx_r12_silicon_test |
| 724 | |
| 725 | $(RX_R12_SILICON): $(RX_R12_SILICON_SRCS) src/runtime/rx_world.h \ |
| 726 | src/runtime/rx_resident_gpu.h src/runtime/rx_caproot.h src/runtime/aienos_cap.h \ |
| 727 | src/omega_blackwell_codegen.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 728 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R12_SILICON_SRCS) $(AIENOS_CAP_LIB) -ldl -lm |
| 729 | |
| 730 | test-r12-silicon: $(RX_R12_SILICON) |
| 731 | ./$(RX_R12_SILICON) |
| 732 | |
| 733 | # COMPOSITION-2 in the living system (WP-A): the composition modules are part |
| 734 | # of the canonical living build, so every R13/R14/R15/R16 binary links them. |
| 735 | # rx_graph.o, rx_capq.o and rx_skillroute.o keep their own no-mint symbol |
| 736 | # checks; the living host build depends on them so the checks run with it. |
| 737 | RX_COMPOSE_LIVING_SRCS = src/runtime/aien_machine_id.c src/runtime/rx_jspace.c \ |
| 738 | src/runtime/rx_cortex.c src/runtime/rx_cortex_record.c src/runtime/rx_graph.c \ |
| 739 | src/runtime/rx_capq.c src/runtime/rx_skillroute.c src/runtime/rx_compose.c |
| 740 | RX_COMPOSE_LIVING_CHECKS = $(OUT_DIR)/rx_graph.o $(OUT_DIR)/rx_capq.o $(OUT_DIR)/rx_skillroute.o \ |
| 741 | src/runtime/rx_compose.h |
| 742 | |
| 743 | # Lane 32: ONE test-build flag, AIEN_TEST_BUILD, off by default. It alone |
| 744 | # admits the test-only pieces: the Fabric F5-0 loopback transport, the HMAC |
| 745 | # stand-in authenticator and the in-process dispatcher (src/fabric, Lane 13), |
| 746 | # the Fabric living phase with its fixed test keys (tests/fabric/ |
| 747 | # fab_living_phase.h), the composition fixture and the rx_compose fault and |
| 748 | # rogue-candidate hooks (RXC_TEST_HOOKS, implied by the flag; alone it is an |
| 749 | # #error). Their headers refuse to compile without it. The PRODUCTION program |
| 750 | # (rx_r13_living_host/_silicon, test-r13-host/-silicon) never sets it, links |
| 751 | # ARGUS and is checked by test-prod-hygiene; the TEST BUILD variant |
| 752 | # (rx_r13_living_testbuild_*, test-r13-testbuild-*) carries the composition |
| 753 | # and Fabric phases and reports R13_LIVING_SYSTEM_TEST_BUILD, never the gate. |
| 754 | # docs/r16-production-entry-point.md has the table. |
| 755 | AIEN_TEST_FLAGS = -DAIEN_TEST_BUILD=1 |
| 756 | RX_FABRIC_TEST_SRCS = src/fabric/fabric.c src/fabric/fab_hmac.c src/fabric/fab_loopback.c \ |
| 757 | src/fabric/fab_dispatch.c |
| 758 | RX_R13_TEST_CHECKS = tests/runtime/rx_compose_fixture.h src/fabric/fab_dispatch.h \ |
| 759 | src/fabric/fab_loopback.h src/fabric/fab_hmac.h tests/fabric/fab_living_phase.h |
| 760 | # The production build refuses the flag outright. |
| 761 | RX_PROD_REFUSE_TEST = $(if $(findstring AIEN_TEST_BUILD,$(CFLAGS))$(findstring RXC_TEST_HOOKS,$(CFLAGS)),\ |
| 762 | $(error the production program never builds with AIEN_TEST_BUILD or RXC_TEST_HOOKS in CFLAGS)) |
| 763 | |
| 764 | # R13 host uses the R12 processor stand-in and cannot claim the silicon gate. |
| 765 | # R13 silicon runs the same world against the physical resident GB10 seat. |
| 766 | # RX_R13_SRCS is the PRODUCTION source set (no test piece); the R14/R15 rigs |
| 767 | # filter rx_r13_living.c out of it. |
| 768 | RX_R13_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c \ |
| 769 | src/runtime/rx_coherent.c src/runtime/rx_native_bind.c \ |
| 770 | src/runtime/rx_aegis.c src/runtime/rx_aien.c src/runtime/rx_omega.c \ |
| 771 | src/runtime/rx_generation.c src/runtime/rx_living.c \ |
| 772 | src/runtime/rx_operator.c \ |
| 773 | src/omega_om_units.c src/omega_evidence.c src/omega_canonical.c \ |
| 774 | src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 775 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c \ |
| 776 | src/omega_realize_synth.c src/omega_program.c src/omega_machine.c src/omega_exec.c \ |
| 777 | src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c \ |
| 778 | $(RX_COMPOSE_LIVING_SRCS) \ |
| 779 | tests/runtime/rx_r13_living.c |
| 780 | # librx_compose.a objects (mk/rx_compose_lib.mk) are compiled with -MMD; include their |
| 781 | # .d files HERE, after RX_R13_SRCS exists (the mk file is included at the top, where the |
| 782 | # list is still empty and an include there expands to nothing). Without this a header |
| 783 | # change (rx_cortex.h, omega#408) left rx_compose.o / rxc_host_abi.o stale in a reused |
| 784 | # OUT_DIR: the archive mixed two layouts of CxStore and rxc_host_run refused with |
| 785 | # RX_ERR_AUTHORITY (sovereign-core abi-qualify, 2026-10-12). |
| 786 | -include $(RXC_LIB_OBJS:.o=.d) |
| 787 | RX_R13_TEST_SRCS = $(RX_R13_SRCS) $(RX_FABRIC_TEST_SRCS) |
| 788 | RX_R13_SILICON_EXTRA = src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \ |
| 789 | src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \ |
| 790 | $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c |
| 791 | # Production program (rules after the ARGUS block below: they link ARGUS). |
| 792 | RX_R13_HOST = $(OUT_DIR)/rx_r13_living_host |
| 793 | RX_R13_SILICON = $(OUT_DIR)/rx_r13_living_silicon |
| 794 | # Test-build variant (no ARGUS). |
| 795 | RX_R13_TEST_HOST = $(OUT_DIR)/rx_r13_living_testbuild_host |
| 796 | RX_R13_TEST_SILICON = $(OUT_DIR)/rx_r13_living_testbuild_silicon |
| 797 | |
| 798 | $(RX_R13_TEST_HOST): $(RX_R13_TEST_SRCS) src/runtime/rx_living.h $(RX_COMPOSE_LIVING_CHECKS) \ |
| 799 | $(RX_R13_TEST_CHECKS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 800 | $(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -pthread -o $@ $(RX_R13_TEST_SRCS) $(AIENOS_CAP_LIB) -lm |
| 801 | |
| 802 | # Lane 17: the Fabric phase runs in the silicon test build too; its Fabric part |
| 803 | # is CPU-only loopback. The composition phase stays host-only. |
| 804 | $(RX_R13_TEST_SILICON): $(RX_R13_TEST_SRCS) $(RX_R13_SILICON_EXTRA) src/runtime/rx_living.h \ |
| 805 | $(RX_COMPOSE_LIVING_CHECKS) $(RX_R13_TEST_CHECKS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 806 | $(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -DR13_SILICON -pthread -o $@ $(RX_R13_TEST_SRCS) \ |
| 807 | $(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) -ldl -lm |
| 808 | |
| 809 | test-r13-host: $(RX_R13_HOST) |
| 810 | ./$(RX_R13_HOST) |
| 811 | |
| 812 | test-r13-silicon: $(RX_R13_SILICON) |
| 813 | ./$(RX_R13_SILICON) |
| 814 | |
| 815 | test-r13-testbuild-host: $(RX_R13_TEST_HOST) |
| 816 | ./$(RX_R13_TEST_HOST) |
| 817 | |
| 818 | test-r13-testbuild-silicon: $(RX_R13_TEST_SILICON) |
| 819 | ./$(RX_R13_TEST_SILICON) |
| 820 | |
| 821 | # OMEGA_BRANCH_STATE_REUSE: J-Space branches sharing one semantic prefix, |
| 822 | # shared-state realization versus independent recomputation, FORGE placement. |
| 823 | RX_BRANCH_REUSE_SRCS = src/runtime/rx_jspace.c src/omega_om_units.c src/omega_evidence.c \ |
| 824 | tests/runtime/rx_branch_reuse.c |
| 825 | RX_BRANCH_REUSE_TEST = $(OUT_DIR)/rx_branch_reuse |
| 826 | |
| 827 | $(RX_BRANCH_REUSE_TEST): $(RX_BRANCH_REUSE_SRCS) src/runtime/rx_jspace.h | $(OUT_DIR) |
| 828 | $(CC) $(CFLAGS) -o $@ $(RX_BRANCH_REUSE_SRCS) -lm |
| 829 | |
| 830 | test-branch-reuse: $(RX_BRANCH_REUSE_TEST) |
| 831 | ./$(RX_BRANCH_REUSE_TEST) |
| 832 | |
| 833 | # M20 production J-Space mechanics: slab/extent reclamation, generation-safe |
| 834 | # references, limits, concurrency, durable reopen/crash/torn metadata, World |
| 835 | # commit compatibility. Fast; runs in CI. |
| 836 | RX_JSPACE_PROD_SRCS = src/runtime/rx_jspace.c src/runtime/rx_caproot.c src/runtime/rx_world.c \ |
| 837 | src/runtime/rx_coherent.c src/omega_om_units.c src/omega_evidence.c tests/runtime/rx_jspace_prod.c |
| 838 | RX_JSPACE_PROD_TEST = $(OUT_DIR)/rx_jspace_prod |
| 839 | |
| 840 | $(RX_JSPACE_PROD_TEST): $(RX_JSPACE_PROD_SRCS) src/runtime/rx_jspace.h src/runtime/rx_world.h \ |
| 841 | src/runtime/rx_caproot.h | $(OUT_DIR) |
| 842 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_JSPACE_PROD_SRCS) -lm |
| 843 | |
| 844 | test-jspace-prod: $(RX_JSPACE_PROD_TEST) |
| 845 | ./$(RX_JSPACE_PROD_TEST) |
| 846 | |
| 847 | # R14: the R13 organism attacked while alive. Host uses the R12 processor |
| 848 | # stand-in and cannot claim the gate; silicon runs D and E on the GB10 seat. |
| 849 | RX_R14_SRCS = $(filter-out tests/runtime/rx_r13_living.c src/runtime/rx_operator.c,$(RX_R13_SRCS)) \ |
| 850 | tests/runtime/rx_r14_recovery.c |
| 851 | RX_R14_HOST = $(OUT_DIR)/rx_r14_recovery_host |
| 852 | RX_R14_SILICON = $(OUT_DIR)/rx_r14_recovery_silicon |
| 853 | |
| 854 | $(RX_R14_HOST): $(RX_R14_SRCS) src/runtime/rx_living.h $(RX_COMPOSE_LIVING_CHECKS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 855 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R14_SRCS) $(AIENOS_CAP_LIB) -lm |
| 856 | |
| 857 | $(RX_R14_SILICON): $(RX_R14_SRCS) src/runtime/rx_resident_gpu.c \ |
| 858 | src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \ |
| 859 | src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \ |
| 860 | $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \ |
| 861 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 862 | $(CC) $(CFLAGS) -DR14_SILICON -pthread -o $@ $(RX_R14_SRCS) \ |
| 863 | src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \ |
| 864 | src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 865 | src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \ |
| 866 | $(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB) -ldl -lm |
| 867 | |
| 868 | test-r14-host: $(RX_R14_HOST) |
| 869 | ./$(RX_R14_HOST) |
| 870 | |
| 871 | test-r14-silicon: $(RX_R14_SILICON) |
| 872 | ./$(RX_R14_SILICON) |
| 873 | |
| 874 | # R15: instrumentation checks (host). Every counter the R15 harness reduces |
| 875 | # is checked against a case whose true value is known in advance. |
| 876 | RX_R15_INSTR_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 877 | src/runtime/rx_generation.c src/omega_om_units.c src/omega_evidence.c \ |
| 878 | src/runtime/rx_seq_reference.c tests/runtime/rx_r15_instr.c |
| 879 | RX_R15_INSTR = $(OUT_DIR)/rx_r15_instr_test |
| 880 | |
| 881 | $(RX_R15_INSTR): $(RX_R15_INSTR_SRCS) src/runtime/rx_world.h src/runtime/rx_generation.h \ |
| 882 | src/runtime/rx_caproot.h src/runtime/rx_seq_reference.h | $(OUT_DIR) |
| 883 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R15_INSTR_SRCS) |
| 884 | |
| 885 | test-r15-instr: $(RX_R15_INSTR) |
| 886 | ./$(RX_R15_INSTR) |
| 887 | |
| 888 | # R15: SEQ semantic parity gate (spec §16 C1 item 9). The R13 body is built |
| 889 | # by tests/runtime/rx_r15_rig.c for RES-1 and for the sequential reference. |
| 890 | RX_R15_RIG_SRCS = $(filter-out tests/runtime/rx_r13_living.c src/runtime/rx_operator.c,$(RX_R13_SRCS)) \ |
| 891 | src/runtime/rx_seq_reference.c tests/runtime/rx_r15_rig.c |
| 892 | RX_R15_RIG_HDRS = src/runtime/rx_living.h src/runtime/rx_seq_reference.h \ |
| 893 | src/runtime/rx_world.h tests/runtime/rx_r15_rig.h |
| 894 | RX_R15_GPU_SRCS = src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \ |
| 895 | src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 896 | src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c |
| 897 | RX_R15_PARITY_HOST = $(OUT_DIR)/rx_r15_parity_host |
| 898 | RX_R15_PARITY_SILICON = $(OUT_DIR)/rx_r15_parity_silicon |
| 899 | |
| 900 | $(RX_R15_PARITY_HOST): $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_parity.c $(RX_R15_RIG_HDRS) \ |
| 901 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 902 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_parity.c \ |
| 903 | $(AIENOS_CAP_LIB) -lm |
| 904 | |
| 905 | $(RX_R15_PARITY_SILICON): $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_parity.c $(RX_R15_RIG_HDRS) \ |
| 906 | $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 907 | $(CC) $(CFLAGS) -DR15_SILICON -pthread -o $@ $(RX_R15_RIG_SRCS) \ |
| 908 | tests/runtime/rx_r15_parity.c $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) -ldl -lm |
| 909 | |
| 910 | test-r15-parity-host: $(RX_R15_PARITY_HOST) |
| 911 | ./$(RX_R15_PARITY_HOST) |
| 912 | |
| 913 | # R15 G7: production keeps its worker through a generation promotion; the R9 |
| 914 | # store's physical work runs on the store's durable executor (host seat). |
| 915 | RX_R15_G7_HOST = $(OUT_DIR)/rx_r15_g7_host |
| 916 | $(RX_R15_G7_HOST): $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_g7.c $(RX_R15_RIG_HDRS) \ |
| 917 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 918 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_g7.c \ |
| 919 | $(AIENOS_CAP_LIB) -lm |
| 920 | test-r15-g7-host: $(RX_R15_G7_HOST) |
| 921 | ./$(RX_R15_G7_HOST) |
| 922 | |
| 923 | # R15 C2 sensor validation: bounded GB10 load through the resident seat. |
| 924 | R15_GPU_LOAD = $(OUT_DIR)/r15_gpu_load |
| 925 | R15_GPU_LOAD_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 926 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 927 | tests/runtime/r15_gpu_load.c |
| 928 | |
| 929 | $(R15_GPU_LOAD): $(R15_GPU_LOAD_SRCS) $(RX_R15_GPU_SRCS) src/runtime/rx_world.h \ |
| 930 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 931 | $(CC) $(CFLAGS) -pthread -o $@ $(R15_GPU_LOAD_SRCS) $(RX_R15_GPU_SRCS) \ |
| 932 | $(AIENOS_CAP_LIB) -ldl -lm |
| 933 | |
| 934 | r15-gpu-load: $(R15_GPU_LOAD) |
| 935 | |
| 936 | test-r15-parity-silicon: $(RX_R15_PARITY_SILICON) |
| 937 | ./$(RX_R15_PARITY_SILICON) |
| 938 | |
| 939 | # R15 harness (spec §4, §5, §12). Four binaries from the same sources and |
| 940 | # flags: production and the RES-1-NODIGEST measurement build (§3), host |
| 941 | # stand-in seat and GB10 silicon. tools/r15_qualify.sh drives them and |
| 942 | # tools/r15_reduce.c reduces their raw output. |
| 943 | RX_R15_PERF_SRCS = $(RX_R15_RIG_SRCS) tests/runtime/r15_measure.c tests/runtime/rx_r15_perf.c |
| 944 | RX_R15_PERF_HDRS = $(RX_R15_RIG_HDRS) tests/runtime/r15_measure.h |
| 945 | RX_R15_PERF_HOST = $(OUT_DIR)/rx_r15_perf_host |
| 946 | RX_R15_PERF_HOST_ND = $(OUT_DIR)/rx_r15_perf_host_nodigest |
| 947 | RX_R15_PERF_SILICON = $(OUT_DIR)/rx_r15_perf_silicon |
| 948 | RX_R15_PERF_SILICON_ND = $(OUT_DIR)/rx_r15_perf_silicon_nodigest |
| 949 | R15_REDUCE = $(OUT_DIR)/r15_reduce |
| 950 | |
| 951 | $(RX_R15_PERF_HOST): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 952 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R15_PERF_SRCS) $(AIENOS_CAP_LIB) -ldl -lm |
| 953 | |
| 954 | $(RX_R15_PERF_HOST_ND): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 955 | $(CC) $(CFLAGS) -DRX_MEASURE_NO_CAUSAL_DIGEST -pthread -o $@ $(RX_R15_PERF_SRCS) \ |
| 956 | $(AIENOS_CAP_LIB) -ldl -lm |
| 957 | |
| 958 | $(RX_R15_PERF_SILICON): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(RX_R15_GPU_SRCS) \ |
| 959 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 960 | $(CC) $(CFLAGS) -DR15_SILICON -pthread -o $@ $(RX_R15_PERF_SRCS) $(RX_R15_GPU_SRCS) \ |
| 961 | $(AIENOS_CAP_LIB) -ldl -lm |
| 962 | |
| 963 | $(RX_R15_PERF_SILICON_ND): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(RX_R15_GPU_SRCS) \ |
| 964 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 965 | $(CC) $(CFLAGS) -DR15_SILICON -DRX_MEASURE_NO_CAUSAL_DIGEST -pthread -o $@ \ |
| 966 | $(RX_R15_PERF_SRCS) $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) -ldl -lm |
| 967 | |
| 968 | $(R15_REDUCE): tools/r15_reduce.om seed/out/omc | $(OUT_DIR) |
| 969 | seed/out/omc < tools/r15_reduce.om > $@ && chmod +x $@ |
| 970 | |
| 971 | r15-perf-host: $(RX_R15_PERF_HOST) $(RX_R15_PERF_HOST_ND) $(R15_REDUCE) |
| 972 | r15-perf-silicon: $(RX_R15_PERF_SILICON) $(RX_R15_PERF_SILICON_ND) $(R15_REDUCE) |
| 973 | |
| 974 | # R15 receipt writer (spec §12/§13/§14): tools/r15_receipt.sh turns one run |
| 975 | # directory (summary.json + machine.json + SHA256SUMS) into |
| 976 | # evidence/R15/<sha256>.json. The host test runs it on attempt 1 (a FAIL). |
| 977 | r15-receipt: |
| 978 | @test -n "$(RUN)" || { echo "usage: make r15-receipt RUN=evidence/R15/raw/<run-id> [CANDIDATE=<commit>] [RERUNS=<file>] [NOTES=<file>]"; exit 2; } |
| 979 | tools/r15_receipt.sh $(RUN) evidence/R15 "$(CANDIDATE)" "$(RERUNS)" "$(NOTES)" |
| 980 | |
| 981 | .PHONY: r15-receipt test-r15-receipt |
| 982 | test-r15-receipt: |
| 983 | tests/r15_receipt_test.sh |
| 984 | |
| 985 | # R15 preflight parser: counts only the CPU PMU cycles event (SMMU PMUs list |
| 986 | # "cycles" too on newer kernels). Host-only, fixtures, seconds. |
| 987 | .PHONY: test-r15-preflight |
| 988 | test-r15-preflight: |
| 989 | sh tests/r15_preflight_test.sh |
| 990 | sh tests/r15_energy_preflight_test.sh |
| 991 | |
| 992 | # G15 diagnostics: sampler lateness / not-live-run record, its reducer report, |
| 993 | # and the readable-kernel-log Xid scan. Host-only, no chip. |
| 994 | .PHONY: test-r15-g15-diag |
| 995 | test-r15-g15-diag: $(R15_REDUCE) | $(OUT_DIR) |
| 996 | $(CC) -std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined -Itests/runtime -o $(OUT_DIR)/r15_seat_diag_test tests/runtime/r15_seat_diag_test.c |
| 997 | $(OUT_DIR)/r15_seat_diag_test |
| 998 | R15_REDUCE=$(R15_REDUCE) sh tests/r15_g15_diag_test.sh |
| 999 | sh tests/seat_marker_uncached_test.sh |
| 1000 | |
| 1001 | # R16-G2 code-search gate (spec/r16-orchestrator-retirement.md). Host-only pure OM-2 tool, |
| 1002 | # seconds, no network. Scans the five repos (paths from R16_REPO_OMEGA, |
| 1003 | # R16_REPO_SOVEREIGN_CORE, R16_REPO_AEGIS_RUNTIME, R16_REPO_AIENOS, |
| 1004 | # R16_REPO_PHYSICS; defaults: this tree and ~/workspace/r16-survey/<repo>) and |
| 1005 | # joins every loop-shaped site with spec/r16-orchestrator-retirement-map.md. |
| 1006 | # Exit 0 only when every site is classified A-F, no omega class-A site is |
| 1007 | # still under a production name, and all five repos were scanned. |
| 1008 | R16_INVENTORY = $(OUT_DIR)/r16_loop_inventory |
| 1009 | $(R16_INVENTORY): tools/r16_loop_inventory.om seed/out/omc | $(OUT_DIR) |
| 1010 | seed/out/omc < tools/r16_loop_inventory.om > $@ && chmod +x $@ |
| 1011 | |
| 1012 | .PHONY: r16-inventory test-r16-inventory |
| 1013 | r16-inventory: $(R16_INVENTORY) |
| 1014 | $(R16_INVENTORY) --map spec/r16-orchestrator-retirement-map.md --json $(OUT_DIR)/r16-inventory.json |
| 1015 | |
| 1016 | test-r16-inventory: $(R16_INVENTORY) |
| 1017 | sh tests/r16_inventory/run.sh $(R16_INVENTORY) |
| 1018 | |
| 1019 | # Lane 32 follow-up: dry-mode self-test of tools/r16_qualify.sh (no chip, no build). |
| 1020 | .PHONY: test-r16-qualify-selftest |
| 1021 | test-r16-qualify-selftest: |
| 1022 | bash tests/r16_qualify/run.sh |
| 1023 | |
| 1024 | # The aienos.lock source proof (tools/aienos_lock_source.sh) and the authority build rule |
| 1025 | # that uses it: fixture repositories, host only. |
| 1026 | .PHONY: test-aienos-lock-source |
| 1027 | test-aienos-lock-source: |
| 1028 | bash tests/aienos_lock_source/run.sh |
| 1029 | |
| 1030 | # R16-G3: the authoritative path with the legacy orchestrators unavailable. |
| 1031 | # Link map, shared libraries, embedded names and an exec trace of the R13 |
| 1032 | # living system and the R14 recovery run, legacy programs stubbed on PATH. |
| 1033 | # The R13 binary is the PRODUCTION program (Lane 32: no test piece, ARGUS |
| 1034 | # linked); its source list includes the pinned ARGUS sources. |
| 1035 | # Host mode uses the processor stand-in and cannot claim the gate. The silicon |
| 1036 | # target starts the GB10 seat: run it only as part of the qualification |
| 1037 | # ladder, detached, never under `timeout` and never killed. |
| 1038 | R16_STAMP := $(shell date -u +%Y%m%dT%H%M%SZ) |
| 1039 | .PHONY: test-r16-authpath test-r16-authpath-silicon |
| 1040 | test-r16-authpath: $(RX_R13_HOST) $(RX_R14_HOST) |
| 1041 | sh tools/r16_authpath.sh host $(RX_R13_HOST) $(RX_R14_HOST) \ |
| 1042 | $(OUT_DIR)/r16/authpath/host-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) $(AIENOS_CAP_LIB) |
| 1043 | |
| 1044 | test-r16-authpath-silicon: $(RX_R13_SILICON) $(RX_R14_SILICON) |
| 1045 | sh tools/r16_authpath.sh silicon $(RX_R13_SILICON) $(RX_R14_SILICON) \ |
| 1046 | $(OUT_DIR)/r16/authpath/silicon-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) \ |
| 1047 | src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \ |
| 1048 | src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 1049 | src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \ |
| 1050 | $(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB) |
| 1051 | |
| 1052 | # R16-G3 checks 1-3 only (sources, link map, shared libraries, embedded names) |
| 1053 | # on the current living-system build, for CI runners. Nothing is executed, so |
| 1054 | # neither the GB10 seat nor the Spark core classes are needed; the gate line |
| 1055 | # stays NOT_RUN. The -silicon variant builds the silicon binaries and never |
| 1056 | # runs them. The gate itself is still test-r16-authpath(-silicon). |
| 1057 | .PHONY: test-r16-authpath-linkmap test-r16-authpath-linkmap-silicon |
| 1058 | test-r16-authpath-linkmap: $(RX_R13_HOST) $(RX_R14_HOST) |
| 1059 | R16_G3_STATIC_ONLY=1 sh tools/r16_authpath.sh host $(RX_R13_HOST) $(RX_R14_HOST) \ |
| 1060 | $(OUT_DIR)/r16/authpath/linkmap-host-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) $(AIENOS_CAP_LIB) |
| 1061 | |
| 1062 | test-r16-authpath-linkmap-silicon: $(RX_R13_SILICON) $(RX_R14_SILICON) |
| 1063 | R16_G3_STATIC_ONLY=1 sh tools/r16_authpath.sh silicon $(RX_R13_SILICON) $(RX_R14_SILICON) \ |
| 1064 | $(OUT_DIR)/r16/authpath/linkmap-silicon-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) \ |
| 1065 | src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \ |
| 1066 | src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 1067 | src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \ |
| 1068 | $(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB) |
| 1069 | |
| 1070 | # R16-G4: legacy paths cannot bypass authority. The R13 body (R15 rig, RES-4, |
| 1071 | # host seat) is started; a legacy context tries six acts and each must be |
| 1072 | # refused with no change to authoritative state. Host only; no chip. |
| 1073 | RX_R16_NEGATIVE = $(OUT_DIR)/rx_r16_negative |
| 1074 | $(RX_R16_NEGATIVE): $(RX_R15_RIG_SRCS) tests/runtime/rx_r16_negative.c $(RX_R15_RIG_HDRS) \ |
| 1075 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1076 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_R15_RIG_SRCS) tests/runtime/rx_r16_negative.c \ |
| 1077 | $(AIENOS_CAP_LIB) -lm |
| 1078 | |
| 1079 | .PHONY: test-r16-negative test-r16-negative-mutants |
| 1080 | test-r16-negative: $(RX_R16_NEGATIVE) |
| 1081 | ./$(RX_R16_NEGATIVE) |
| 1082 | |
| 1083 | # "Removing any one guard turns the test red": rebuilds the G4 test against |
| 1084 | # scratch copies with one guard removed at a time; each must FAIL. Minutes. |
| 1085 | test-r16-negative-mutants: $(RX_R16_NEGATIVE) |
| 1086 | R16_CAP_LIB="$(AIENOS_CAP_LIB)" sh tests/r16_negative/mutate.sh "$(CC)" "$(CFLAGS)" "$(AIENOS_R7_DIR)" \ |
| 1087 | $(RX_R15_RIG_SRCS) tests/runtime/rx_r16_negative.c |
| 1088 | |
| 1089 | # R16-G5 API/build surface: legacy modes only under explicit names, the SEQ |
| 1090 | # loop only in rx_seq_reference.*, no legacy default mode, production entry |
| 1091 | # point documented (docs/r16-production-entry-point.md). Host only, seconds. |
| 1092 | .PHONY: test-r16-surface |
| 1093 | test-r16-surface: $(TARGET) |
| 1094 | sh tests/r16_surface/run.sh ./$(TARGET) |
| 1095 | |
| 1096 | |
| 1097 | # OMEGA_ACTION_GRAPH_IR: goals compile to typed action graphs that run as |
| 1098 | # resident reactions by readiness alone. rx_graph.o is built alone first and |
| 1099 | # must not reference any Aienux admin operation: compilation can find that |
| 1100 | # authority is missing, never create it. |
| 1101 | RX_GRAPH_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1102 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1103 | src/omega_core.c src/omega_canonical.c tests/runtime/rx_action_graph.c |
| 1104 | RX_GRAPH_TEST = $(OUT_DIR)/rx_action_graph_test |
| 1105 | RX_GRAPH_OBJ = $(OUT_DIR)/rx_graph.o |
| 1106 | |
| 1107 | $(RX_GRAPH_OBJ): src/runtime/rx_graph.c src/runtime/rx_graph.h src/runtime/rx_world.h \ |
| 1108 | src/runtime/rx_aegis.h | $(OUT_DIR) |
| 1109 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_graph.c |
| 1110 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1111 | echo "rx_graph.o references an authority admin operation; compilation must not mint"; \ |
| 1112 | rm -f $@; exit 1; fi |
| 1113 | |
| 1114 | $(RX_GRAPH_TEST): $(RX_GRAPH_SRCS) $(RX_GRAPH_OBJ) src/runtime/rx_caproot.h \ |
| 1115 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1116 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_GRAPH_SRCS) $(RX_GRAPH_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1117 | |
| 1118 | test-action-graph: $(RX_GRAPH_TEST) |
| 1119 | ./$(RX_GRAPH_TEST) |
| 1120 | |
| 1121 | # OMEGA_CAPABILITY_QUERY: AIEN states a CapabilityNeed; Omega compiles it into |
| 1122 | # probes of the capability sources and returns a bounded list of candidates |
| 1123 | # ranked on explicit dimensions. rx_capq.o is built alone first and must not |
| 1124 | # reference any Aienux admin operation: a query can learn that authority is |
| 1125 | # held or missing, never create it. |
| 1126 | RX_CAPQ_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1127 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1128 | src/omega_core.c src/omega_canonical.c src/runtime/aien_machine_id.c \ |
| 1129 | tests/runtime/rx_capability_query.c |
| 1130 | RX_CAPQ_TEST = $(OUT_DIR)/rx_capability_query_test |
| 1131 | RX_CAPQ_OBJ = $(OUT_DIR)/rx_capq.o |
| 1132 | |
| 1133 | $(RX_CAPQ_OBJ): src/runtime/rx_capq.c src/runtime/rx_capq.h src/runtime/rx_graph.h \ |
| 1134 | src/runtime/rx_world.h src/runtime/aien_machine_id.h | $(OUT_DIR) |
| 1135 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_capq.c |
| 1136 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1137 | echo "rx_capq.o references an authority admin operation; a query must not mint"; \ |
| 1138 | rm -f $@; exit 1; fi |
| 1139 | |
| 1140 | $(RX_CAPQ_TEST): $(RX_CAPQ_SRCS) $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) src/runtime/rx_caproot.h \ |
| 1141 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1142 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_CAPQ_SRCS) $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) \ |
| 1143 | $(AIENOS_CAP_LIB) -lm |
| 1144 | |
| 1145 | test-capability-query: $(RX_CAPQ_TEST) |
| 1146 | ./$(RX_CAPQ_TEST) |
| 1147 | |
| 1148 | # M20 canonical Capability Graph and Skill Router: rx_capq promoted (keys, |
| 1149 | # update/withdraw, canonical machine identity, wire form) plus rx_skillroute. |
| 1150 | # Like rx_capq.o, rx_skillroute.o must not reference an authority admin |
| 1151 | # operation: routing discovers, it never authorizes. |
| 1152 | RX_CAPGRAPH_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1153 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1154 | src/omega_core.c src/omega_canonical.c src/runtime/aien_machine_id.c \ |
| 1155 | tests/runtime/rx_capability_graph.c |
| 1156 | RX_CAPGRAPH_TEST = $(OUT_DIR)/rx_capability_graph_test |
| 1157 | RX_SKILLROUTE_OBJ = $(OUT_DIR)/rx_skillroute.o |
| 1158 | |
| 1159 | $(RX_SKILLROUTE_OBJ): src/runtime/rx_skillroute.c src/runtime/rx_skillroute.h \ |
| 1160 | src/runtime/rx_capq.h src/runtime/aien_machine_id.h | $(OUT_DIR) |
| 1161 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_skillroute.c |
| 1162 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1163 | echo "rx_skillroute.o references an authority admin operation; routing must not mint"; \ |
| 1164 | rm -f $@; exit 1; fi |
| 1165 | |
| 1166 | $(RX_CAPGRAPH_TEST): $(RX_CAPGRAPH_SRCS) $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) \ |
| 1167 | src/runtime/rx_caproot.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1168 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_CAPGRAPH_SRCS) $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) \ |
| 1169 | $(RX_GRAPH_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1170 | |
| 1171 | test-capability-graph: $(RX_CAPGRAPH_TEST) |
| 1172 | ./$(RX_CAPGRAPH_TEST) |
| 1173 | |
| 1174 | # COMPOSITION-2 WP-D: Skill Router end to end (requirement -> graph -> Skill |
| 1175 | # -> bound action-graph node -> World run) and each failure mode failing |
| 1176 | # closed. Repeats the no-mint symbol check on the router object it links. |
| 1177 | RX_SRCOMPOSE_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1178 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1179 | src/omega_core.c src/omega_canonical.c src/runtime/aien_machine_id.c \ |
| 1180 | tests/runtime/rx_skillroute_compose_test.c |
| 1181 | RX_SRCOMPOSE_TEST = $(OUT_DIR)/rx_skillroute_compose_test |
| 1182 | |
| 1183 | $(RX_SRCOMPOSE_TEST): $(RX_SRCOMPOSE_SRCS) $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) \ |
| 1184 | src/runtime/rx_caproot.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1185 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_SRCOMPOSE_SRCS) $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) \ |
| 1186 | $(RX_GRAPH_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1187 | |
| 1188 | test-skillroute-compose: $(RX_SRCOMPOSE_TEST) |
| 1189 | @if nm -u $(RX_SKILLROUTE_OBJ) | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1190 | echo "rx_skillroute.o references an authority admin operation"; exit 1; fi |
| 1191 | @echo "SKILLROUTE_NO_MINT_PASS" |
| 1192 | ./$(RX_SRCOMPOSE_TEST) |
| 1193 | |
| 1194 | # OMEGA_PLAN_REUSE: plan IR and verified plan cache. rx_plan.o must not |
| 1195 | # reference any Aienux admin operation (the cache checks authority, never |
| 1196 | # creates it); rx_plan_arrange.o (AIEN's planner) must only read the World. |
| 1197 | RX_PLAN_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1198 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1199 | src/omega_core.c src/omega_canonical.c tests/runtime/rx_plan_reuse.c |
| 1200 | RX_PLAN_TEST = $(OUT_DIR)/rx_plan_reuse_test |
| 1201 | RX_PLAN_OBJS = $(OUT_DIR)/rx_plan.o $(OUT_DIR)/rx_plan_arrange.o |
| 1202 | |
| 1203 | $(OUT_DIR)/rx_plan.o: src/runtime/rx_plan.c src/runtime/rx_plan.h src/runtime/rx_graph.h \ |
| 1204 | src/runtime/rx_world.h | $(OUT_DIR) |
| 1205 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_plan.c |
| 1206 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1207 | echo "rx_plan.o references an authority admin operation; the plan cache must not mint"; \ |
| 1208 | rm -f $@; exit 1; fi |
| 1209 | |
| 1210 | $(OUT_DIR)/rx_plan_arrange.o: src/runtime/rx_plan_arrange.c src/runtime/rx_plan_arrange.h \ |
| 1211 | src/runtime/rx_plan.h | $(OUT_DIR) |
| 1212 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_plan_arrange.c |
| 1213 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_|rx_world_publish|rx_graph_lower|rx_graph_start' ; then \ |
| 1214 | echo "rx_plan_arrange.o must only read the World: the planner changes nothing"; \ |
| 1215 | rm -f $@; exit 1; fi |
| 1216 | |
| 1217 | $(RX_PLAN_TEST): $(RX_PLAN_SRCS) $(RX_PLAN_OBJS) $(RX_GRAPH_OBJ) src/runtime/rx_caproot.h \ |
| 1218 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1219 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_PLAN_SRCS) $(RX_PLAN_OBJS) $(RX_GRAPH_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1220 | |
| 1221 | test-plan-reuse: $(RX_PLAN_TEST) |
| 1222 | ./$(RX_PLAN_TEST) |
| 1223 | |
| 1224 | # OMEGA_SEMANTIC_COMMUNICATION: branches and workers receive the semantic |
| 1225 | # projection their InformationNeed selects, then only deltas, not full state. |
| 1226 | # rx_semcomm.o is built alone first. It enforces capability boundaries, so it |
| 1227 | # must not reference any authority admin operation, and it only reads the |
| 1228 | # World, so it must not reference a World write either. |
| 1229 | RX_SEMCOMM_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1230 | src/runtime/rx_native_bind.c src/omega_om_units.c src/omega_evidence.c \ |
| 1231 | src/omega_core.c src/omega_canonical.c tests/runtime/rx_semantic_comm.c |
| 1232 | RX_SEMCOMM_TEST = $(OUT_DIR)/rx_semantic_comm_test |
| 1233 | RX_SEMCOMM_OBJ = $(OUT_DIR)/rx_semcomm.o |
| 1234 | |
| 1235 | $(RX_SEMCOMM_OBJ): src/runtime/rx_semcomm.c src/runtime/rx_semcomm.h src/runtime/rx_world.h | $(OUT_DIR) |
| 1236 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_semcomm.c |
| 1237 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke|rx_world_publish|rx_world_create|rx_world_retire|rx_world_add_reaction' ; then \ |
| 1238 | echo "rx_semcomm.o references an authority admin operation or a World write; projection must only read"; \ |
| 1239 | rm -f $@; exit 1; fi |
| 1240 | |
| 1241 | $(RX_SEMCOMM_TEST): $(RX_SEMCOMM_SRCS) $(RX_SEMCOMM_OBJ) src/runtime/rx_caproot.h \ |
| 1242 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1243 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_SEMCOMM_SRCS) $(RX_SEMCOMM_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1244 | |
| 1245 | test-semantic-comm: $(RX_SEMCOMM_TEST) |
| 1246 | ./$(RX_SEMCOMM_TEST) |
| 1247 | |
| 1248 | # OMEGA_COGNITIVE_ROUTING: each cognitive step goes to the cheapest |
| 1249 | # realization the evidence says meets it, escalating only on insufficient |
| 1250 | # verification or calibrated confidence. rx_route.o is built alone first and |
| 1251 | # must not reference promotion or any Aienux admin operation: routing profiles |
| 1252 | # change only through a promoted generation. |
| 1253 | RX_ROUTE_SRCS = src/runtime/rx_generation.c src/omega_om_units.c src/omega_evidence.c \ |
| 1254 | tests/runtime/rx_cog_engines.c tests/runtime/rx_cognitive_routing.c |
| 1255 | RX_ROUTE_TEST = $(OUT_DIR)/rx_cognitive_routing_test |
| 1256 | RX_ROUTE_OBJ = $(OUT_DIR)/rx_route.o |
| 1257 | |
| 1258 | $(RX_ROUTE_OBJ): src/runtime/rx_route.c src/runtime/rx_route.h src/runtime/rx_generation.h | $(OUT_DIR) |
| 1259 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_route.c |
| 1260 | @if nm -u $@ | grep -E 'rx_gen_promote|aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1261 | echo "rx_route.o references promotion or an authority admin operation"; \ |
| 1262 | rm -f $@; exit 1; fi |
| 1263 | |
| 1264 | $(RX_ROUTE_TEST): $(RX_ROUTE_SRCS) $(RX_ROUTE_OBJ) tests/runtime/rx_cog_engines.h \ |
| 1265 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1266 | $(CC) $(CFLAGS) -Itests -o $@ $(RX_ROUTE_SRCS) $(RX_ROUTE_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1267 | |
| 1268 | test-cognitive-routing: $(RX_ROUTE_TEST) |
| 1269 | ./$(RX_ROUTE_TEST) |
| 1270 | |
| 1271 | # OMEGA_EMPIRICAL_OPTIMIZER: realization choice from a learned, calibrated cost |
| 1272 | # model. rx_costmodel.o is built alone first and must not reference the |
| 1273 | # generation store, any authority operation, or anything that maps or runs |
| 1274 | # code: the model is a calculator; durability comes only through promotion. |
| 1275 | .PHONY: test-costmodel test-empirical |
| 1276 | RX_CM_OBJ = $(OUT_DIR)/rx_costmodel.o |
| 1277 | |
| 1278 | $(RX_CM_OBJ): src/runtime/rx_costmodel.c src/runtime/rx_costmodel.h | $(OUT_DIR) |
| 1279 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_costmodel.c |
| 1280 | @if nm -u $@ | grep -E 'rx_gen_|aienos_cap_|rx_caproot_|rx_capadmin_|rx_world_|mmap|mprotect|fork|exec|dlopen|system' ; then \ |
| 1281 | echo "rx_costmodel.o references an operation a cost model must not have"; \ |
| 1282 | rm -f $@; exit 1; fi |
| 1283 | |
| 1284 | # Any host: synthetic measurements; fit, calibration, decisions, blob. |
| 1285 | RX_CM_UNIT = $(OUT_DIR)/rx_costmodel_unit |
| 1286 | $(RX_CM_UNIT): tests/runtime/rx_costmodel_unit.c $(RX_CM_OBJ) src/omega_om_units.c | $(OUT_DIR) |
| 1287 | $(CC) $(CFLAGS) -o $@ tests/runtime/rx_costmodel_unit.c $(RX_CM_OBJ) src/omega_om_units.c -lm |
| 1288 | |
| 1289 | test-costmodel: $(RX_CM_UNIT) |
| 1290 | ./$(RX_CM_UNIT) |
| 1291 | @set -eu; dir=$(OUT_DIR)/costmodel-mutant; rm -rf $$dir; mkdir -p $$dir; \ |
| 1292 | sed "/CM704:refuse-unsupported-op/c\\ uint32_t op = f && f->op < RX_CM_OPS ? f->op : RX_CM_OPS - 1u; /* CM704:refuse-unsupported-op */" \ |
| 1293 | src/runtime/rx_costmodel.c > $$dir/rx_costmodel.c; \ |
| 1294 | if cmp -s src/runtime/rx_costmodel.c $$dir/rx_costmodel.c; then \ |
| 1295 | echo "mutant restore-op-clamp: sed changed nothing"; exit 1; fi; \ |
| 1296 | $(CC) $(CFLAGS) -c -o $$dir/rx_costmodel.o $$dir/rx_costmodel.c; \ |
| 1297 | $(CC) $(CFLAGS) -o $$dir/unit tests/runtime/rx_costmodel_unit.c $$dir/rx_costmodel.o src/omega_om_units.c -lm; \ |
| 1298 | rc=0; $$dir/unit refuse > $$dir/out.txt 2> $$dir/err.txt || rc=$$?; \ |
| 1299 | if [ $$rc -eq 0 ] || ! grep -q unsupported-op-not-aliased-to-matvec $$dir/err.txt; then \ |
| 1300 | echo "mutant restore-op-clamp was not killed by unsupported-op-not-aliased-to-matvec (exit $$rc)"; \ |
| 1301 | cat $$dir/err.txt; exit 1; fi; \ |
| 1302 | echo "mutant restore-op-clamp: killed by unsupported-op-not-aliased-to-matvec (exit $$rc)" |
| 1303 | |
| 1304 | # Offline resource-DAG evaluator, imported verbatim from closed PR #590 |
| 1305 | # (commit 3bd56731). Host arithmetic on the numbers written in the fixtures. |
| 1306 | # Not a validated cost model and not a hardware measurement. |
| 1307 | # The seeded SHA-256 unit is AArch64 machine code; other hosts link |
| 1308 | # tests/dagsim/sha256_host.c, which aborts if a blob digest is requested. |
| 1309 | # dagsim.o keeps the #590 (3bd56731) nm guard: no generation store, authority, |
| 1310 | # world, or a call that maps or runs code. |
| 1311 | .PHONY: test-dagsim |
| 1312 | DS_LIB = tools/dagsim/dagsim.om |
| 1313 | DS_UNIT = $(OUT_DIR)/dagsim_unit |
| 1314 | DS_CLI = $(OUT_DIR)/dagsim |
| 1315 | |
| 1316 | $(DS_UNIT): $(DS_LIB) tests/dagsim/dagsim_unit.om seed/out/omc | $(OUT_DIR) |
| 1317 | cat $(DS_LIB) tests/dagsim/dagsim_unit.om | seed/out/omc > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ |
| 1318 | |
| 1319 | $(DS_CLI): $(DS_LIB) tools/dagsim/dagsim_cli.om seed/out/omc | $(OUT_DIR) |
| 1320 | cat $(DS_LIB) tools/dagsim/dagsim_cli.om | seed/out/omc > $@.tmp.$$$$ && chmod +x $@.tmp.$$$$ && mv -f $@.tmp.$$$$ $@ |
| 1321 | |
| 1322 | test-dagsim: $(DS_UNIT) $(DS_CLI) |
| 1323 | ./$(DS_UNIT) |
| 1324 | sh tests/dagsim/run_cli.sh $(DS_CLI) $(OUT_DIR)/dagsim-cli-out |
| 1325 | OMC="$(CURDIR)/seed/out/omc" sh tests/dagsim/mutant_lifetime.sh |
| 1326 | OMC="$(CURDIR)/seed/out/omc" sh tests/dagsim/mutant_predict.sh |
| 1327 | |
| 1328 | # AArch64 hosts: the gate. Real realizations, training, promotion through the |
| 1329 | # R9 barrier on the native authority, held-out workloads. |
| 1330 | RX_EMP_SRCS = src/runtime/rx_generation.c src/omega_om_units.c src/omega_evidence.c \ |
| 1331 | src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 1332 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c src/omega_program.c \ |
| 1333 | src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_matvec.c src/omega_matvec_quad.c \ |
| 1334 | tests/runtime/rx_empirical_optimizer.c |
| 1335 | RX_EMP_TEST = $(OUT_DIR)/rx_empirical_optimizer_test |
| 1336 | |
| 1337 | $(RX_EMP_TEST): $(RX_EMP_SRCS) $(RX_CM_OBJ) src/runtime/rx_generation.h src/runtime/aienos_cap.h \ |
| 1338 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1339 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_EMP_SRCS) $(RX_CM_OBJ) $(AIENOS_CAP_LIB) -lm |
| 1340 | |
| 1341 | test-empirical: $(RX_EMP_TEST) |
| 1342 | ./$(RX_EMP_TEST) |
| 1343 | |
| 1344 | # OMEGA_WORKFLOW_FUSION: repeated verified action-graph fragments become |
| 1345 | # MetaSkills; only a verified, measured, canaried, promoted (R9 barrier) and |
| 1346 | # published one replaces the steps. rx_fusion.o, like rx_graph.o, must not |
| 1347 | # reference any Aienux admin operation. |
| 1348 | .PHONY: test-workflow-fusion |
| 1349 | RX_FUSION_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1350 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/runtime/rx_generation.c src/omega_om_units.c \ |
| 1351 | src/omega_evidence.c src/omega_core.c src/omega_canonical.c tests/runtime/rx_workflow_fusion.c |
| 1352 | RX_FUSION_TEST = $(OUT_DIR)/rx_workflow_fusion_test |
| 1353 | RX_FUSION_OBJ = $(OUT_DIR)/rx_fusion.o |
| 1354 | |
| 1355 | $(RX_FUSION_OBJ): src/runtime/rx_fusion.c src/runtime/rx_fusion.h src/runtime/rx_graph.h \ |
| 1356 | src/runtime/rx_generation.h src/runtime/rx_world.h | $(OUT_DIR) |
| 1357 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_fusion.c |
| 1358 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1359 | echo "rx_fusion.o references an authority admin operation; fusion must not mint"; \ |
| 1360 | rm -f $@; exit 1; fi |
| 1361 | |
| 1362 | $(RX_FUSION_TEST): $(RX_FUSION_SRCS) $(RX_FUSION_OBJ) $(RX_GRAPH_OBJ) src/runtime/rx_caproot.h \ |
| 1363 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1364 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_FUSION_SRCS) $(RX_FUSION_OBJ) $(RX_GRAPH_OBJ) \ |
| 1365 | $(AIENOS_CAP_LIB) -lm |
| 1366 | |
| 1367 | test-workflow-fusion: $(RX_FUSION_TEST) |
| 1368 | ./$(RX_FUSION_TEST) |
| 1369 | |
| 1370 | # OMEGA_TYPED_RESULT_CONSTRAINTS: structured results of cognition are checked |
| 1371 | # against typed contracts; the publish gate is the only writer of what is |
| 1372 | # published. rx_contract.o is built alone first and must not reference any |
| 1373 | # Aienux admin operation: a contract can find that authority is missing, never |
| 1374 | # create it. |
| 1375 | RX_TYPED_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1376 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c src/omega_evidence.c \ |
| 1377 | src/omega_core.c src/omega_canonical.c tests/runtime/rx_typed_results.c |
| 1378 | RX_TYPED_TEST = $(OUT_DIR)/rx_typed_results_test |
| 1379 | RX_CONTRACT_OBJ = $(OUT_DIR)/rx_contract.o |
| 1380 | TYPED_RESULTS_N ?= 400 |
| 1381 | |
| 1382 | $(RX_CONTRACT_OBJ): src/runtime/rx_contract.c src/runtime/rx_contract.h src/runtime/rx_graph.h \ |
| 1383 | src/runtime/rx_world.h src/runtime/rx_aien.h | $(OUT_DIR) |
| 1384 | $(CC) $(CFLAGS) -c -o $@ src/runtime/rx_contract.c |
| 1385 | @if nm -u $@ | grep -E 'aienos_cap_|rx_caproot_mint|rx_caproot_revoke' ; then \ |
| 1386 | echo "rx_contract.o references an authority admin operation; a contract must not mint"; \ |
| 1387 | rm -f $@; exit 1; fi |
| 1388 | |
| 1389 | $(RX_TYPED_TEST): $(RX_TYPED_SRCS) $(RX_CONTRACT_OBJ) $(RX_GRAPH_OBJ) src/runtime/rx_caproot.h \ |
| 1390 | src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1391 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_TYPED_SRCS) $(RX_CONTRACT_OBJ) $(RX_GRAPH_OBJ) \ |
| 1392 | $(AIENOS_CAP_LIB) -lm |
| 1393 | |
| 1394 | .PHONY: test-typed-results |
| 1395 | test-typed-results: $(RX_TYPED_TEST) |
| 1396 | ./$(RX_TYPED_TEST) $(TYPED_RESULTS_N) |
| 1397 | |
| 1398 | # ---- ARGUS producer (feat/argus-producer, lanes H/H2 of ARGUS-0) --------- |
| 1399 | # The runtime feeds ARGUS (src/runtime/rx_argus.{c,h}, ABI v1.1: per-thread |
| 1400 | # rings, use tables flushed as CAPABILITY_USE_SUMMARY, full events only on |
| 1401 | # transitions). Default builds are unchanged (RX_ARGUS undefined = 0: the |
| 1402 | # hooks compile to nothing). This block builds the AEGIS/promotion suites with |
| 1403 | # RX_ARGUS=$(RX_ARGUS) against ARGUS pinned by argus.lock, extracted with |
| 1404 | # `git archive` from ARGUS_REPO (never built in place). ARGUS's sha256.c is |
| 1405 | # Omega's src/omega_om_units.c copied unchanged; Omega's is linked, not both. |
| 1406 | # |
| 1407 | # Grant source (ARGUS_AUTH): |
| 1408 | # observer (default) the authority announces its own mints/revokes |
| 1409 | # (aienos_cap_set_observer, aienos 12add16, native in the authority |
| 1410 | # pinned by aienos.lock, d39dd5b); the observer is installed by a link |
| 1411 | # wrap of aienos_cap_start, which also announces the office (cap 0). |
| 1412 | # aegis GRANTED/REVOKED only where rx_aegis mints/revokes (harness mints |
| 1413 | # are unseen and show up as FORGED). |
| 1414 | # Every ARGUS target links the aienos.lock authority, $(AIENOS_CAP_LIB), the |
| 1415 | # same library as the default targets (with no observer set it |
| 1416 | # costs one NULL check per admin operation), RX_ARGUS=0 included. |
| 1417 | ARGUS_REPO ?= ../aienos-argus |
| 1418 | # The lock is code-adjacent input: parse it as data and expose only validated |
| 1419 | # lowercase commit text to recipes. The second field is derived in the same |
| 1420 | # parser so no lock content is ever interpolated into another shell command. |
| 1421 | # Pin: aien-dev/aienux native/argus (ARGUS-0, ABI v1.1), feat/argus-0 integrator |
| 1422 | # round 3. argus_abi.h is byte-identical at 398cfb9, 03b9f06, be2814d and |
| 1423 | # b375dca. Branch head a64bc55 differs from b375dca in native/argus only by docs. |
| 1424 | override ARGUS_LOCK_FIELDS := $(shell LC_ALL=C awk 'NR == 1 && length($$0) == 40 && $$0 ~ /^[0-9a-f]+$$/ { commit = $$0; next } { invalid = 1 } END { if (!invalid && NR == 1) printf "%s %s\n", commit, substr(commit, 1, 7); else exit 1 }' argus.lock 2>/dev/null) |
| 1425 | ifneq ($(words $(ARGUS_LOCK_FIELDS)),2) |
| 1426 | $(error argus.lock must contain exactly one lowercase 40-hex commit) |
| 1427 | endif |
| 1428 | override ARGUS_COMMIT := $(word 1,$(ARGUS_LOCK_FIELDS)) |
| 1429 | override ARGUS_SHORT := $(word 2,$(ARGUS_LOCK_FIELDS)) |
| 1430 | ARGUS_SRC = $(OUT_DIR)/argus-src/$(ARGUS_SHORT)/native/argus |
| 1431 | ARGUS_STAMP = $(OUT_DIR)/argus-src/$(ARGUS_SHORT)/.extracted |
| 1432 | ARGUS_LIB_SRCS = $(addprefix $(ARGUS_SRC)/,argus_event.c argus_ring.c argus_core.c argus_detect.c) |
| 1433 | RX_ARGUS ?= 2 |
| 1434 | ARGUS_AUTH ?= observer |
| 1435 | ARGUS_CAP_LIB = $(AIENOS_CAP_LIB) |
| 1436 | comma := , |
| 1437 | ARGUS_AUTH_FLAGS = $(if $(filter observer,$(ARGUS_AUTH)),-DRX_ARGUS_AUTHORITY_OBSERVER -Wl$(comma)--wrap=aienos_cap_start,) |
| 1438 | ARGUS_VARIANT = $(if $(filter observer,$(ARGUS_AUTH)),,-$(ARGUS_AUTH)) |
| 1439 | ARGUS_OUT = $(OUT_DIR)/argus$(RX_ARGUS)$(ARGUS_VARIANT) |
| 1440 | ARGUS_CFLAGS = $(CFLAGS) -DRX_ARGUS=$(RX_ARGUS) -I$(ARGUS_SRC) |
| 1441 | ARGUS_STREAMS ?= $(HOME)/workspace/argus-runtime-streams |
| 1442 | ARGUS_RUN_ID = $(shell git rev-parse --short HEAD 2>/dev/null)-argus$(ARGUS_SHORT) |
| 1443 | |
| 1444 | .PHONY: check-argus-lock test-argus-lock |
| 1445 | check-argus-lock: |
| 1446 | @: |
| 1447 | |
| 1448 | test-argus-lock: |
| 1449 | bash tests/argus_lock_validation.sh |
| 1450 | |
| 1451 | # aienos.lock is parsed at the top of this Makefile; this prints the parsed commit |
| 1452 | # (hostile shapes: tests/aienos_lock_source/run.sh section 4). |
| 1453 | .PHONY: check-aienos-lock |
| 1454 | check-aienos-lock: |
| 1455 | @printf '%s\n' '$(AIENOS_LOCK)' |
| 1456 | |
| 1457 | $(ARGUS_STAMP): |
| 1458 | mkdir -p "$(OUT_DIR)/argus-src/$(ARGUS_SHORT)" |
| 1459 | git -C "$(ARGUS_REPO)" archive "$(ARGUS_COMMIT)" -- native/argus | tar -x -C "$(OUT_DIR)/argus-src/$(ARGUS_SHORT)" |
| 1460 | touch "$@" |
| 1461 | |
| 1462 | $(ARGUS_LIB_SRCS): $(ARGUS_STAMP) |
| 1463 | |
| 1464 | # RX_ARGUS=0 links no ARGUS code at all. |
| 1465 | ARGUS_RX = $(if $(filter 0,$(RX_ARGUS)),,src/runtime/rx_argus.c $(ARGUS_LIB_SRCS)) |
| 1466 | ARGUS_LINK_FLAGS = $(if $(filter 0,$(RX_ARGUS)),,$(ARGUS_AUTH_FLAGS)) |
| 1467 | |
| 1468 | # ---- Lane 32: the PRODUCTION R13 program, ARGUS linked ---------------------- |
| 1469 | # Built without AIEN_TEST_BUILD (RX_PROD_REFUSE_TEST) and with ARGUS pinned by |
| 1470 | # argus.lock, the way the ARGUS suites build it, in the mode the ARGUS-1 |
| 1471 | # decisions intend: observe and record. RX_ARGUS=2 (consumer thread ingesting |
| 1472 | # into argus_core), authority observer (the authority announces its own |
| 1473 | # mints/revokes through the aienos_cap_start link wrap). ARGUS holds no |
| 1474 | # capability and the pinned ARGUS has no response path, so it never blocks a |
| 1475 | # request and never expands its own authority. These flags are fixed here, not |
| 1476 | # taken from the overridable RX_ARGUS/ARGUS_AUTH. The program refuses to run |
| 1477 | # unobserved (rx_r13_living.c argus_check_start). |
| 1478 | RX_PROD_ARGUS_FLAGS = -DRX_ARGUS=2 -DRX_ARGUS_AUTHORITY_OBSERVER -I$(ARGUS_SRC) \ |
| 1479 | -Wl$(comma)--wrap=aienos_cap_start |
| 1480 | RX_PROD_ARGUS_SRCS = src/runtime/rx_argus.c $(ARGUS_LIB_SRCS) |
| 1481 | |
| 1482 | $(RX_R13_HOST): $(RX_R13_SRCS) src/runtime/rx_living.h src/runtime/rx_argus.h $(RX_COMPOSE_LIVING_CHECKS) \ |
| 1483 | $(ARGUS_STAMP) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1484 | $(RX_PROD_REFUSE_TEST) |
| 1485 | $(CC) $(CFLAGS) $(RX_PROD_ARGUS_FLAGS) -pthread -o $@ $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) \ |
| 1486 | $(AIENOS_CAP_LIB) -lm |
| 1487 | |
| 1488 | # G1: the R13 living body journals one episode into Cortex (CxStore). Same |
| 1489 | # production recipe as test-r13-host; the program is the R13 rig plus tests/runtime/rx_r13_cortex_episode.c. |
| 1490 | RX_R13_CORTEX = $(OUT_DIR)/rx_r13_cortex_episode |
| 1491 | RX_R13_CORTEX_SRCS = $(filter-out tests/runtime/rx_r13_living.c,$(RX_R13_SRCS)) tests/runtime/rx_r13_cortex_episode.c |
| 1492 | $(RX_R13_CORTEX): $(RX_R13_CORTEX_SRCS) tests/runtime/rx_r13_living.c src/runtime/rx_living.h src/runtime/rx_argus.h \ |
| 1493 | $(RX_COMPOSE_LIVING_CHECKS) $(ARGUS_STAMP) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1494 | $(RX_PROD_REFUSE_TEST) |
| 1495 | $(CC) $(CFLAGS) $(RX_PROD_ARGUS_FLAGS) -pthread -o $@ $(RX_R13_CORTEX_SRCS) $(RX_PROD_ARGUS_SRCS) \ |
| 1496 | $(AIENOS_CAP_LIB) -lm |
| 1497 | |
| 1498 | test-r13-cortex-episode: $(RX_R13_CORTEX) |
| 1499 | ./$(RX_R13_CORTEX) |
| 1500 | |
| 1501 | # ADAPTIVE-M4: bounded resource regulation (src/runtime/rx_regulate.c) on the |
| 1502 | # R11 host recipe. The regulator closes a loop on the World's admission budget |
| 1503 | # inside a fixed envelope; the test measures deferrals per burst as the objective. |
| 1504 | RX_REGULATE_TEST = $(OUT_DIR)/rx_regulate_test |
| 1505 | RX_REGULATE_SRCS = $(filter-out tests/runtime/rx_r11_aien.c,$(RX_R11_SRCS)) \ |
| 1506 | src/runtime/rx_regulate.c tests/runtime/rx_regulate_test.c |
| 1507 | $(RX_REGULATE_TEST): $(RX_REGULATE_SRCS) src/runtime/rx_regulate.h src/runtime/rx_world.h \ |
| 1508 | $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1509 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_REGULATE_SRCS) $(AIENOS_CAP_LIB) -lm |
| 1510 | |
| 1511 | .PHONY: test-regulate |
| 1512 | test-regulate: $(RX_REGULATE_TEST) |
| 1513 | ./$(RX_REGULATE_TEST) |
| 1514 | |
| 1515 | $(RX_R13_SILICON): $(RX_R13_SRCS) $(RX_R13_SILICON_EXTRA) src/runtime/rx_living.h src/runtime/rx_argus.h \ |
| 1516 | $(RX_COMPOSE_LIVING_CHECKS) $(ARGUS_STAMP) $(AIENOS_CAP_LIB) | $(OUT_DIR) |
| 1517 | $(RX_PROD_REFUSE_TEST) |
| 1518 | $(CC) $(CFLAGS) $(RX_PROD_ARGUS_FLAGS) -DR13_SILICON -pthread -o $@ $(RX_R13_SRCS) \ |
| 1519 | $(RX_PROD_ARGUS_SRCS) $(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) -ldl -lm |
| 1520 | |
| 1521 | # Production hygiene (link map + strings + ARGUS present; host run of the |
| 1522 | # ARGUS probe where the binary can run) and the negative build test: compiling |
| 1523 | # the production program with any test piece must FAIL (tools/r16_prod_hygiene.sh). |
| 1524 | .PHONY: test-prod-hygiene test-prod-hygiene-silicon test-prod-refuses-test-pieces |
| 1525 | test-prod-hygiene: $(RX_R13_HOST) |
| 1526 | sh tools/r16_prod_hygiene.sh host $(RX_R13_HOST) |
| 1527 | |
| 1528 | test-prod-hygiene-silicon: $(RX_R13_SILICON) |
| 1529 | sh tools/r16_prod_hygiene.sh silicon $(RX_R13_SILICON) |
| 1530 | |
| 1531 | test-prod-refuses-test-pieces: $(ARGUS_STAMP) $(AIENOS_CAP_LIB) $(RX_R13_HOST) |
| 1532 | CC="$(CC)" CFLAGS="$(CFLAGS)" ARGUS_SRC="$(ARGUS_SRC)" OUT="$(OUT_DIR)/prod-refuses" MAKE="$(MAKE)" PROD_BIN="$(RX_R13_HOST)" \ |
| 1533 | sh tools/r16_prod_refuses.sh |
| 1534 | |
| 1535 | # R16 G6 operator control by execution (docs/r16-operator-control.md): the |
| 1536 | # production program driven from outside through its operator entry point. |
| 1537 | # Host: the production host binary (R12 processor stand-in). Silicon: the |
| 1538 | # production GB10 binary on the resident seat, needs the quiet lock, never |
| 1539 | # killed (no SIGKILL phase). The mutants rebuild the production host program |
| 1540 | # from mutated copies; the test must fail against each. |
| 1541 | RX_OPERATOR_CLI = $(OUT_DIR)/rx_operator |
| 1542 | $(RX_OPERATOR_CLI): tools/rx_operator.om seed/out/omc | $(OUT_DIR) |
| 1543 | seed/out/omc < tools/rx_operator.om > $@ && chmod +x $@ |
| 1544 | |
| 1545 | .PHONY: test-r16-operator-host test-r16-operator-silicon test-r16-operator-mutants |
| 1546 | test-r16-operator-host: $(RX_R13_HOST) $(RX_OPERATOR_CLI) |
| 1547 | bash tests/runtime/rx_operator_host.sh host $(RX_R13_HOST) $(RX_OPERATOR_CLI) |
| 1548 | |
| 1549 | test-r16-operator-silicon: $(RX_R13_SILICON) $(RX_OPERATOR_CLI) |
| 1550 | bash tests/runtime/rx_operator_host.sh silicon $(RX_R13_SILICON) $(RX_OPERATOR_CLI) |
| 1551 | |
| 1552 | .PHONY: test-r16-operator-mutants-evidence test-r13-first-failure test-window-lane-guard |
| 1553 | test-r16-operator-mutants-evidence: |
| 1554 | bash tests/runtime/rx_operator_mutants_evidence_test.sh |
| 1555 | |
| 1556 | # Builds the R13 host test build twice into a scratch OUT_DIR and runs it (host only, no GPU). |
| 1557 | test-r13-first-failure: |
| 1558 | bash tests/runtime/rx_r13_first_failure_test.sh |
| 1559 | |
| 1560 | test-window-lane-guard: |
| 1561 | bash tests/window_lane_guard_test.sh |
| 1562 | |
| 1563 | test-r16-operator-mutants: $(RX_R13_HOST) $(RX_OPERATOR_CLI) |
| 1564 | CC="$(CC)" CFLAGS="$(CFLAGS)" RX_PROD_ARGUS_FLAGS="$(RX_PROD_ARGUS_FLAGS)" \ |
| 1565 | RX_R13_SRCS="$(RX_R13_SRCS)" RX_PROD_ARGUS_SRCS="$(RX_PROD_ARGUS_SRCS)" \ |
| 1566 | AIENOS_CAP_LIB="$(AIENOS_CAP_LIB)" bash tests/runtime/rx_operator_mutants.sh $(RX_OPERATOR_CLI) |
| 1567 | |
| 1568 | ARGUS_R7 = $(ARGUS_OUT)/rx_r7_native_test |
| 1569 | ARGUS_R8 = $(ARGUS_OUT)/rx_r8_aegis_test |
| 1570 | ARGUS_R9 = $(ARGUS_OUT)/rx_r9_barrier_test |
| 1571 | ARGUS_BENCH = $(ARGUS_OUT)/bench_rx_argus |
| 1572 | ARGUS_BENCH_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \ |
| 1573 | src/runtime/rx_native_bind.c src/runtime/rx_aegis.c src/omega_om_units.c tests/bench_rx_argus.c |
| 1574 | |
| 1575 | $(ARGUS_OUT): |
| 1576 | mkdir -p $@ |
| 1577 | |
| 1578 | $(ARGUS_R7): $(RX_R7_SRCS) src/runtime/rx_argus.h $(ARGUS_RX) $(ARGUS_STAMP) $(ARGUS_CAP_LIB) | $(ARGUS_OUT) |
| 1579 | $(CC) $(ARGUS_CFLAGS) $(ARGUS_LINK_FLAGS) -pthread -o $@ $(RX_R7_SRCS) $(ARGUS_RX) $(ARGUS_CAP_LIB) -lm |
| 1580 | $(ARGUS_R8): $(RX_R8_SRCS) src/runtime/rx_argus.h $(ARGUS_RX) $(ARGUS_STAMP) $(ARGUS_CAP_LIB) | $(ARGUS_OUT) |
| 1581 | $(CC) $(ARGUS_CFLAGS) $(ARGUS_LINK_FLAGS) -pthread -o $@ $(RX_R8_SRCS) $(ARGUS_RX) $(ARGUS_CAP_LIB) -lm |
| 1582 | $(ARGUS_R9): $(RX_R9_SRCS) src/runtime/rx_argus.h $(ARGUS_RX) $(ARGUS_STAMP) $(ARGUS_CAP_LIB) | $(ARGUS_OUT) |
| 1583 | $(CC) $(ARGUS_CFLAGS) $(ARGUS_LINK_FLAGS) -pthread -o $@ $(RX_R9_SRCS) $(ARGUS_RX) $(ARGUS_CAP_LIB) -lm |
| 1584 | # The bench mints directly and announces its one grant itself: no observer wrap. |
| 1585 | $(ARGUS_BENCH): $(ARGUS_BENCH_SRCS) src/runtime/rx_argus.h $(ARGUS_RX) $(ARGUS_STAMP) $(ARGUS_CAP_LIB) | $(ARGUS_OUT) |
| 1586 | $(CC) $(ARGUS_CFLAGS) -pthread -o $@ $(ARGUS_BENCH_SRCS) $(ARGUS_RX) $(ARGUS_CAP_LIB) -lm |
| 1587 | |
| 1588 | # ARGUS_RUNTIME_INTEGRATION: run each suite with the consumer ingesting into |
| 1589 | # the real argus_core; keep the raw 128-byte stream (consumer ingest order) |
| 1590 | # and a JSON summary: $(ARGUS_STREAMS)/<argus>-<suite>-v11.bin/.json |
| 1591 | .PHONY: test-argus-runtime bench-rx-argus |
| 1592 | test-argus-runtime: $(ARGUS_R7) $(ARGUS_R8) $(ARGUS_R9) |
| 1593 | mkdir -p $(ARGUS_STREAMS) |
| 1594 | @set -e; for s in r7:$(ARGUS_R7) r8:$(ARGUS_R8) r9:$(ARGUS_R9); do \ |
| 1595 | n=$${s%%:*}; b=$${s#*:}; \ |
| 1596 | echo "== ARGUS runtime integration $$n"; \ |
| 1597 | RX_ARGUS_CONSUMER=ingest RX_ARGUS_RUN_ID=$(ARGUS_RUN_ID)-$$n RX_ARGUS_SUITE=$$n \ |
| 1598 | RX_ARGUS_STREAM=$(ARGUS_STREAMS)/$(ARGUS_SHORT)-$$n$(ARGUS_VARIANT)-v11.bin \ |
| 1599 | RX_ARGUS_SUMMARY=$(ARGUS_STREAMS)/$(ARGUS_SHORT)-$$n$(ARGUS_VARIANT)-v11.json ./$$b > $(ARGUS_OUT)/$$n.log 2>&1 \ |
| 1600 | || { tail -20 $(ARGUS_OUT)/$$n.log; exit 1; }; \ |
| 1601 | tail -2 $(ARGUS_OUT)/$$n.log; \ |
| 1602 | done |
| 1603 | |
| 1604 | bench-rx-argus: $(ARGUS_BENCH) |
| 1605 | ./$(ARGUS_BENCH) |
| 1606 | |
| 1607 | ARGUS_REPLAY = $(OUT_DIR)/argus_replay-$(ARGUS_SHORT) |
| 1608 | $(ARGUS_REPLAY): tools/argus_replay.c src/omega_om_units.c $(ARGUS_STAMP) | $(OUT_DIR) |
| 1609 | $(CC) $(CFLAGS) -I$(ARGUS_SRC) -o $@ tools/argus_replay.c src/omega_om_units.c $(ARGUS_LIB_SRCS) |
| 1610 | .PHONY: argus-replay |
| 1611 | argus-replay: $(ARGUS_REPLAY) |
| 1612 | |
| 1613 | # --------------------------------------------------------------------------- |
| 1614 | # OMEGA MIXED ALGEBRA (spec/mixed-algebra-reference.md): correctness-first CPU |
| 1615 | # reference ("parity oracle") for balanced trits, Z3, packing and absmean |
| 1616 | # quantization. Plain C11, no runtime or physics dependencies. |
| 1617 | # test-algebra-asan reruns the same suite under address+undefined sanitizers. |
| 1618 | .PHONY: test-algebra test-algebra-asan |
| 1619 | OMA_BIND = $(OUT_DIR)/tests-algebra/native.o |
| 1620 | OMA_BIND_ASAN = $(OUT_DIR)/tests-algebra/native_asan.o |
| 1621 | $(OMA_BIND) $(OMA_BIND_ASAN): src/omega_om_units.c src/omega_native.h src/omega_api_decl.h |
| 1622 | @mkdir -p $(dir $@) |
| 1623 | $(CC) $(OMA_CFLAGS) -Wno-pedantic $(OMA_BIND_FLAGS) -c $< -o $@ |
| 1624 | $(OMA_BIND_ASAN): OMA_BIND_FLAGS = -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all |
| 1625 | |
| 1626 | OMA_CFLAGS = -std=c11 -Wall -Wextra -Werror -pedantic -O2 -Isrc |
| 1627 | OMA_OM_LIB = src/algebra/oma_lib.om |
| 1628 | OMA_TEST = $(OUT_DIR)/tests-algebra/test_oma |
| 1629 | OMA_FAILURE_TEST = $(OUT_DIR)/tests-algebra/test_oma_native_failure |
| 1630 | |
| 1631 | $(OMA_TEST): $(OMA_OM_LIB) tests/algebra/test_oma.om seed/out/omc |
| 1632 | @mkdir -p $(dir $@) |
| 1633 | cat $(OMA_OM_LIB) tests/algebra/test_oma.om | seed/out/omc > $@ && chmod +x $@ |
| 1634 | |
| 1635 | $(OMA_FAILURE_TEST): $(OMA_OM_LIB) tests/algebra/test_oma_native_failure.om seed/out/omc |
| 1636 | @mkdir -p $(dir $@) |
| 1637 | cat $(OMA_OM_LIB) tests/algebra/test_oma_native_failure.om | seed/out/omc > $@ && chmod +x $@ |
| 1638 | |
| 1639 | test-algebra: $(OMA_TEST) $(OMA_FAILURE_TEST) |
| 1640 | ./$(OMA_TEST) |
| 1641 | ./$(OMA_FAILURE_TEST) |
| 1642 | |
| 1643 | test-algebra-asan: $(OMA_TEST) |
| 1644 | ./$(OMA_TEST) |
| 1645 | |
| 1646 | # --------------------------------------------------------------------------- |
| 1647 | # OMEGA MIXED ALGEBRA MA-2 (spec/mixed-algebra-ma2.md): one exact operation |
| 1648 | # (ternary W x int8 x -> int32 y) with several verified realizations on the |
| 1649 | # Grace CPU, a measured cost table and the MA-2 selector. The selector |
| 1650 | # (oma_select) is RETIRED for new decisions (TURING K.6/K.7): it is kept only |
| 1651 | # to reproduce ma2_select_receipt.json; new selections use src/turing |
| 1652 | # turing_rank_min_cost and are recorded as turing.decision.v1. |
| 1653 | # test-realize: bit-exact gate vs the naive oracle (plain and ASan+UBSan). |
| 1654 | # bench-mixed-algebra: two benchmark runs on one pinned Cortex-X925 core, |
| 1655 | # then the selector with its reproducibility check. Every run writes NEW |
| 1656 | # files under evidence/MIXED_ALGEBRA/runs/$(MA2_RUN_ID)/ (default: UTC |
| 1657 | # timestamp; an existing run directory is refused). Committed evidence |
| 1658 | # (ma3_bench_run{1,2}.json, ma2_select_receipt.json) is never rewritten: |
| 1659 | # check-mixed-algebra-evidence fails if a committed evidence/MIXED_ALGEBRA |
| 1660 | # file is modified or deleted, and runs before and after the bench. |
| 1661 | .PHONY: test-realize bench-mixed-algebra check-mixed-algebra-evidence |
| 1662 | OMA_RZ_ARCH = -march=armv8.6-a+dotprod+i8mm+sve |
| 1663 | OMA_RZ_CFLAGS = -std=c11 -Wall -Wextra -Werror -pedantic -O2 $(OMA_RZ_ARCH) -Isrc |
| 1664 | OMA_RZ_SRCS = src/algebra/realize_common.c src/algebra/realize_binary.c \ |
| 1665 | src/algebra/realize_bitplane.c src/algebra/realize_sparse.c \ |
| 1666 | src/algebra/realize_rns.c src/algebra/realize_dense.c |
| 1667 | OMA_RZ_HDRS = src/algebra/realize_common.h |
| 1668 | OMA_SEL_SRCS = src/algebra/oma_select.c |
| 1669 | OMA_SEL_HDRS = src/algebra/oma_select.h |
| 1670 | OMA_RZ_TEST = $(OUT_DIR)/tests-algebra/test_realize |
| 1671 | OMA_RZ_TEST_ASAN = $(OUT_DIR)/tests-algebra/test_realize_asan |
| 1672 | OMA_RZ_BENCH = $(OUT_DIR)/tests-algebra/bench_mixed_algebra |
| 1673 | OMA_RZ_SELECT = $(OUT_DIR)/tests-algebra/bench_select |
| 1674 | MA2_EVIDENCE = evidence/MIXED_ALGEBRA |
| 1675 | MA2_RUN_ID ?= $(shell date -u +%Y%m%dT%H%M%SZ) |
| 1676 | MA2_RUN_ID := $(MA2_RUN_ID) |
| 1677 | MA2_RUN_DIR = $(MA2_EVIDENCE)/runs/$(MA2_RUN_ID) |
| 1678 | |
| 1679 | $(OMA_RZ_TEST): $(OMA_OM_LIB) src/algebra/realize.om tests/algebra/test_realize.om seed/out/omc |
| 1680 | @mkdir -p $(dir $@) |
| 1681 | cat $(OMA_OM_LIB) src/algebra/realize.om tests/algebra/test_realize.om | seed/out/omc > $@ && chmod +x $@ |
| 1682 | |
| 1683 | $(OMA_RZ_BENCH): tests/algebra/bench_mixed_algebra.c $(OMA_RZ_SRCS) $(OMA_RZ_HDRS) |
| 1684 | @mkdir -p $(dir $@) |
| 1685 | $(CC) $(OMA_RZ_CFLAGS) -o $@ tests/algebra/bench_mixed_algebra.c $(OMA_RZ_SRCS) -lm |
| 1686 | |
| 1687 | $(OMA_RZ_SELECT): tests/algebra/bench_select.c $(OMA_SEL_SRCS) $(OMA_SEL_HDRS) $(OMA_RZ_SRCS) $(OMA_RZ_HDRS) $(OMA_BIND) |
| 1688 | @mkdir -p $(dir $@) |
| 1689 | $(CC) $(OMA_RZ_CFLAGS) -o $@ tests/algebra/bench_select.c $(OMA_SEL_SRCS) $(OMA_RZ_SRCS) $(OMA_BIND) -lm |
| 1690 | |
| 1691 | test-realize: $(OMA_RZ_TEST) |
| 1692 | ./$(OMA_RZ_TEST) |
| 1693 | |
| 1694 | # Fails if any committed evidence/MIXED_ALGEBRA file is modified or deleted |
| 1695 | # (staged or not). New, untracked files are allowed. |
| 1696 | check-mixed-algebra-evidence: |
| 1697 | @changed="$$(git diff --name-status HEAD -- $(MA2_EVIDENCE))"; \ |
| 1698 | if [ -n "$$changed" ]; then \ |
| 1699 | echo "FAIL: committed mixed-algebra evidence would be modified:"; \ |
| 1700 | echo "$$changed"; exit 1; \ |
| 1701 | fi; \ |
| 1702 | echo "check-mixed-algebra-evidence: PASS (committed evidence unchanged)" |
| 1703 | |
| 1704 | bench-mixed-algebra: $(OMA_RZ_BENCH) $(OMA_RZ_SELECT) |
| 1705 | @$(MAKE) --no-print-directory check-mixed-algebra-evidence |
| 1706 | @if [ -e $(MA2_RUN_DIR) ]; then echo "FAIL: $(MA2_RUN_DIR) exists; choose a new MA2_RUN_ID"; exit 1; fi |
| 1707 | @mkdir -p $(MA2_RUN_DIR) |
| 1708 | OMA_BENCH_COMMIT=$$(git rev-parse HEAD) OMA_BENCH_DIRTY=$$(git status --porcelain -- src tests Makefile | grep -c .) \ |
| 1709 | OMA_BENCH_BIN_SHA=$$(sha256sum $(OMA_RZ_BENCH) | cut -c1-64) \ |
| 1710 | ./$(OMA_RZ_BENCH) $(MA2_RUN_DIR)/ma2_bench_run1.json |
| 1711 | OMA_BENCH_COMMIT=$$(git rev-parse HEAD) OMA_BENCH_DIRTY=$$(git status --porcelain -- src tests Makefile | grep -c .) \ |
| 1712 | OMA_BENCH_BIN_SHA=$$(sha256sum $(OMA_RZ_BENCH) | cut -c1-64) \ |
| 1713 | ./$(OMA_RZ_BENCH) $(MA2_RUN_DIR)/ma2_bench_run2.json |
| 1714 | ./$(OMA_RZ_SELECT) $(MA2_RUN_DIR)/ma2_select_receipt.json \ |
| 1715 | $(MA2_RUN_DIR)/ma2_bench_run1.json $(MA2_RUN_DIR)/ma2_bench_run2.json |
| 1716 | @$(MAKE) --no-print-directory check-mixed-algebra-evidence |
| 1717 | @echo "bench-mixed-algebra: new receipts in $(MA2_RUN_DIR)" |
| 1718 | |
| 1719 | # --------------------------------------------------------------------------- |
| 1720 | # OMEGA MIXED ALGEBRA, ADR 0019 MA-8 step 0 (spec/mixed-algebra-phase-twin.md): |
| 1721 | # phase-domain Z3 digital twin. SIMULATED_DEVELOPMENT only: a software model |
| 1722 | # of Z3 addition carried as tone phase, checked against oma_z3. No runtime, |
| 1723 | # no selection, no digest. C11 + libm. |
| 1724 | # test-phase-twin: full run -> $(OUT_DIR) receipt (never into evidence/); |
| 1725 | # quick run plain and under ASan+UBSan, receipts must be byte-identical; |
| 1726 | # if a committed receipt exists, the full run must reproduce it (all fields |
| 1727 | # except git_commit / tree_dirty / run_id / toolchain). |
| 1728 | # phase-twin-receipt: from a clean committed tree only, copies the full |
| 1729 | # receipt to evidence/MIXED_ALGEBRA/phase_twin_receipt.<sha256>.json. |
| 1730 | .PHONY: test-phase-twin phase-twin-receipt |
| 1731 | PT_OUT = $(OUT_DIR)/tests-algebra |
| 1732 | PT_TEST = $(PT_OUT)/test_phase_twin |
| 1733 | |
| 1734 | $(PT_TEST): $(OMA_OM_LIB) src/algebra/phase_twin.om tests/algebra/test_phase_twin.om seed/out/omc |
| 1735 | @mkdir -p $(dir $@) |
| 1736 | cat $(OMA_OM_LIB) src/algebra/phase_twin.om tests/algebra/test_phase_twin.om | seed/out/omc > $@ && chmod +x $@ |
| 1737 | |
| 1738 | test-phase-twin: $(PT_TEST) |
| 1739 | ./$(PT_TEST) $(PT_OUT)/phase_twin_receipt.json |
| 1740 | ./$(PT_TEST) --quick $(PT_OUT)/phase_twin_quick_1.json |
| 1741 | ./$(PT_TEST) --quick $(PT_OUT)/phase_twin_quick_2.json |
| 1742 | cmp $(PT_OUT)/phase_twin_quick_1.json $(PT_OUT)/phase_twin_quick_2.json |
| 1743 | @echo "test-phase-twin: quick receipts byte-identical across deterministic pure OM-2 runs" |
| 1744 | |
| 1745 | phase-twin-receipt: test-phase-twin |
| 1746 | @test "$$(git status --porcelain -- src tests Makefile spec | grep -c .)" = 0 || \ |
| 1747 | { echo "phase-twin-receipt: tree not clean, refusing"; exit 1; } |
| 1748 | @mkdir -p evidence/MIXED_ALGEBRA |
| 1749 | @h=$$(sha256sum $(PT_OUT)/phase_twin_receipt.json | cut -c1-64); \ |
| 1750 | cp $(PT_OUT)/phase_twin_receipt.json evidence/MIXED_ALGEBRA/phase_twin_receipt.$$h.json; \ |
| 1751 | echo "phase-twin-receipt: evidence/MIXED_ALGEBRA/phase_twin_receipt.$$h.json" |
| 1752 | |
| 1753 | # --------------------------------------------------------------------------- |
| 1754 | # TURING Wave 1 (docs/turing/TURING_W0_PROPOSAL.md): Field v1 records (K.7) + |
| 1755 | # control-arm selector, post hoc over evidence/MIXED_ALGEBRA receipts. |
| 1756 | # Reads src/algebra (registry) without modifying it; no runtime, no timed runs. |
| 1757 | # test-turing: plain + ASan/UBSan suites, then a rebuild check (spec ids from |
| 1758 | # two different builds must be byte-identical). |
| 1759 | .PHONY: test-turing turing-field |
| 1760 | TURING_SRCS = src/turing/field.c src/turing/field_select.c src/turing/field_select_v0_retired.c src/turing/history_selector.c \ |
| 1761 | src/turing/replay.c src/omega_canonical.c src/omega_om_units.c $(OMA_RZ_SRCS) |
| 1762 | TURING_HDRS = src/turing/field.h src/turing/select.h src/omega_canonical.h src/omega_types.h src/sha256.h $(OMA_RZ_HDRS) |
| 1763 | TURING_ASAN = -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all |
| 1764 | # -Wno-pedantic: these rules link the generated binding src/omega_om_units.c, whose runtime entry |
| 1765 | # table uses GNU range designators, which ISO C forbids (-Werror=pedantic). Only that one diagnostic |
| 1766 | # is waived; the handwritten sources in the same commands stay under the strict set. See |
| 1767 | # mk/estimation.mk for the same waiver on the other suites. Generator fix: omega-bridge #17. |
| 1768 | TURING_CFLAGS = $(OMA_RZ_CFLAGS) -Wno-pedantic |
| 1769 | TURING_TEST = $(OUT_DIR)/tests-turing/test_turing |
| 1770 | TURING_TEST_ASAN = $(OUT_DIR)/tests-turing/test_turing_asan |
| 1771 | TURING_TOOL = $(OUT_DIR)/tests-turing/turing-field |
| 1772 | TURING_TOOL_ASAN = $(OUT_DIR)/tests-turing/turing-field_asan |
| 1773 | |
| 1774 | $(TURING_TEST): tests/turing/test_turing.c $(TURING_SRCS) $(TURING_HDRS) |
| 1775 | @mkdir -p $(dir $@) |
| 1776 | $(CC) $(TURING_CFLAGS) -o $@ tests/turing/test_turing.c $(TURING_SRCS) -lm |
| 1777 | |
| 1778 | $(TURING_TEST_ASAN): tests/turing/test_turing.c $(TURING_SRCS) $(TURING_HDRS) |
| 1779 | @mkdir -p $(dir $@) |
| 1780 | $(CC) $(TURING_CFLAGS) $(TURING_ASAN) -o $@ tests/turing/test_turing.c $(TURING_SRCS) -lm |
| 1781 | |
| 1782 | $(TURING_TOOL): tools/turing_field.c $(TURING_SRCS) $(TURING_HDRS) |
| 1783 | @mkdir -p $(dir $@) |
| 1784 | $(CC) $(TURING_CFLAGS) -o $@ tools/turing_field.c $(TURING_SRCS) -lm |
| 1785 | |
| 1786 | $(TURING_TOOL_ASAN): tools/turing_field.c $(TURING_SRCS) $(TURING_HDRS) |
| 1787 | @mkdir -p $(dir $@) |
| 1788 | $(CC) $(TURING_CFLAGS) $(TURING_ASAN) -o $@ tools/turing_field.c $(TURING_SRCS) -lm |
| 1789 | |
| 1790 | turing-field: $(TURING_TOOL) |
| 1791 | ./$(TURING_TOOL) |
| 1792 | |
| 1793 | test-turing: $(TURING_TEST) $(TURING_TEST_ASAN) $(TURING_TOOL) $(TURING_TOOL_ASAN) |
| 1794 | ./$(TURING_TEST) |
| 1795 | ./$(TURING_TEST_ASAN) |
| 1796 | ./$(TURING_TOOL) --spec-ids > $(OUT_DIR)/tests-turing/spec_ids_plain.txt |
| 1797 | ./$(TURING_TOOL_ASAN) --spec-ids > $(OUT_DIR)/tests-turing/spec_ids_asan.txt |
| 1798 | cmp $(OUT_DIR)/tests-turing/spec_ids_plain.txt $(OUT_DIR)/tests-turing/spec_ids_asan.txt |
| 1799 | ./$(TURING_TOOL_ASAN) > $(OUT_DIR)/tests-turing/turing_field_asan.txt |
| 1800 | @echo "test-turing: spec ids identical across plain and ASan builds; turing-field runs clean under ASan/UBSan" |
| 1801 | |
| 1802 | # --------------------------------------------------------------------------- |
| 1803 | # MIXED_ALGEBRA_DIGITAL_V1 closure gate (spec/mixed-algebra-digital-v1.md, |
| 1804 | # pre-registered). test-ma-digital-bottom: realization-layer ⊥ coverage |
| 1805 | # (plain + ASan/UBSan). gate-mixed-algebra-digital-v1: correctness leg, one |
| 1806 | # bench-mixed-algebra run under ~/workspace/.spark-quiet (or reuse with |
| 1807 | # MA_DV1_REUSE_RUN=<run id>), TURING Field v1 selection for the |
| 1808 | # pre-registered queries, separate-process digest reproduction, and a |
| 1809 | # digest-named wrapper receipt in evidence/MIXED_ALGEBRA/digital_v1/. |
| 1810 | .PHONY: test-ma-digital-bottom gate-mixed-algebra-digital-v1 |
| 1811 | DV1_BOTTOM = $(OUT_DIR)/tests-algebra/test_ma_digital_bottom |
| 1812 | DV1_GATE_BIN = $(OUT_DIR)/tests-algebra/ma_digital_v1_gate |
| 1813 | DV1_GATE_BIN_ASAN = $(OUT_DIR)/tests-algebra/ma_digital_v1_gate_asan |
| 1814 | |
| 1815 | $(DV1_BOTTOM): $(OMA_OM_LIB) src/algebra/realize.om tests/algebra/test_ma_digital_bottom.om seed/out/omc |
| 1816 | @mkdir -p $(dir $@) |
| 1817 | cat $(OMA_OM_LIB) src/algebra/realize.om tests/algebra/test_ma_digital_bottom.om | seed/out/omc > $@ && chmod +x $@ |
| 1818 | |
| 1819 | $(DV1_GATE_BIN): tests/algebra/ma_digital_v1_gate.c $(TURING_SRCS) $(TURING_HDRS) |
| 1820 | @mkdir -p $(dir $@) |
| 1821 | $(CC) $(TURING_CFLAGS) -o $@ tests/algebra/ma_digital_v1_gate.c $(TURING_SRCS) -lm |
| 1822 | |
| 1823 | $(DV1_GATE_BIN_ASAN): tests/algebra/ma_digital_v1_gate.c $(TURING_SRCS) $(TURING_HDRS) |
| 1824 | @mkdir -p $(dir $@) |
| 1825 | $(CC) $(TURING_CFLAGS) $(TURING_ASAN) -o $@ tests/algebra/ma_digital_v1_gate.c $(TURING_SRCS) -lm |
| 1826 | |
| 1827 | test-ma-digital-bottom: $(DV1_BOTTOM) |
| 1828 | ./$(DV1_BOTTOM) |
| 1829 | |
| 1830 | gate-mixed-algebra-digital-v1: $(DV1_GATE_BIN) $(DV1_GATE_BIN_ASAN) $(DV1_BOTTOM) |
| 1831 | DV1_GATE=./$(DV1_GATE_BIN) DV1_GATE_ASAN=./$(DV1_GATE_BIN_ASAN) MAKE="$(MAKE)" \ |
| 1832 | sh tests/algebra/ma_digital_v1_gate.sh |
| 1833 | |
| 1834 | # Content check (post-run addenda 2026-09-29): every digital_v1 wrapper |
| 1835 | # re-hashes to its file name and every receipt it cites re-hashes to the |
| 1836 | # digest recorded in the wrapper. Catches edits that were committed. |
| 1837 | .PHONY: check-mixed-algebra-digital-v1-evidence |
| 1838 | check-mixed-algebra-digital-v1-evidence: |
| 1839 | sh tests/algebra/ma_digital_v1_check_evidence.sh |
| 1840 | |
| 1841 | # PATH-1 (spec/path-semantic-object.md section 15). Pure seeded OM-2 oracle |
| 1842 | # and test harness; no runtime, physics, C or GPU links. |
| 1843 | PATH1_TEST_BIN := $(OUT_DIR)/tests-path/test_path_identity |
| 1844 | .PHONY: test-path |
| 1845 | $(PATH1_TEST_BIN): src/path/rx_path.om tests/path/test_path_identity.om seed/out/omc |
| 1846 | mkdir -p $(dir $@) |
| 1847 | cat src/path/rx_path.om tests/path/test_path_identity.om | seed/out/omc > $@ |
| 1848 | chmod +x $@ |
| 1849 | |
| 1850 | test-path: $(PATH1_TEST_BIN) |
| 1851 | sh tests/path/check_path_boundary.sh |
| 1852 | ./$(PATH1_TEST_BIN) |
| 1853 | OMC="$(CURDIR)/seed/out/omc" sh tests/path/mutate.sh |
| 1854 | |
| 1855 | # COMPOSITION-2: one World, one causal path (rx_compose). test-composition |
| 1856 | # runs every fault point in process and as a crashed child, the OLD-or-NEW |
| 1857 | # recovery, authority refusals and the Cortex record (WP-B, WP-C). |
| 1858 | # test-composition-gate runs the 14-step gate in fresh directories; the |
| 1859 | # receipt is written by tools/composition_gate.sh from a clean tree (WP-E). |
| 1860 | RX_COMPOSE_SRCS = src/runtime/rx_compose.c src/runtime/rx_jspace.c src/runtime/rx_caproot.c \ |
| 1861 | src/runtime/rx_world.c src/runtime/rx_coherent.c src/runtime/rx_native_bind.c \ |
| 1862 | src/runtime/rx_aegis.c src/runtime/rx_cortex_record.c src/runtime/aien_machine_id.c \ |
| 1863 | src/omega_om_units.c src/omega_evidence.c src/omega_core.c src/omega_canonical.c |
| 1864 | RX_COMPOSE_DEPS = $(RX_COMPOSE_SRCS) $(OUT_DIR)/rx_cortex.o $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) \ |
| 1865 | $(RX_GRAPH_OBJ) src/runtime/rx_compose.h tests/runtime/rx_compose_fixture.h \ |
| 1866 | src/runtime/rx_world.h src/runtime/rx_jspace.h src/runtime/aienos_cap.h $(AIENOS_CAP_LIB) |
| 1867 | RX_COMPOSE_LINK = $(OUT_DIR)/rx_cortex.o $(RX_SKILLROUTE_OBJ) $(RX_CAPQ_OBJ) $(RX_GRAPH_OBJ) \ |
| 1868 | $(AIENOS_CAP_LIB) -lm |
| 1869 | # Test build ($(AIEN_TEST_FLAGS), Lane 32): the composition fault points and |
| 1870 | # rogue-candidate hook (rx_compose.h, RXC_TEST_HOOKS) exist only in the unit |
| 1871 | # tests and the R13 test-build variant; the gate, the production program and |
| 1872 | # every other build compile them out. |
| 1873 | RX_COMPOSE_TEST = $(OUT_DIR)/rx_compose_test |
| 1874 | RX_COMPOSE_GATE = $(OUT_DIR)/rx_composition_gate |
| 1875 | # Attach hygiene (one per World, close waits for its own steps, inert |
| 1876 | # reactions + table bound); its ASan build is test-composition-attach-asan. |
| 1877 | RX_COMPOSE_ATTACH_TEST = $(OUT_DIR)/rx_compose_attach_test |
| 1878 | RX_COMPOSE_ATTACH_ASAN = $(OUT_DIR)/rx_compose_attach_test_asan |
| 1879 | |
| 1880 | $(RX_COMPOSE_TEST): $(RX_COMPOSE_DEPS) tests/runtime/rx_compose_test.c | $(OUT_DIR) |
| 1881 | $(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -pthread -o $@ $(RX_COMPOSE_SRCS) tests/runtime/rx_compose_test.c \ |
| 1882 | $(RX_COMPOSE_LINK) |
| 1883 | |
| 1884 | $(RX_COMPOSE_GATE): $(RX_COMPOSE_DEPS) tests/runtime/rx_composition_gate.c | $(OUT_DIR) |
| 1885 | $(CC) $(CFLAGS) -pthread -o $@ $(RX_COMPOSE_SRCS) tests/runtime/rx_composition_gate.c \ |
| 1886 | $(RX_COMPOSE_LINK) |
| 1887 | |
| 1888 | $(RX_COMPOSE_ATTACH_TEST): $(RX_COMPOSE_DEPS) tests/runtime/rx_compose_attach_test.c | $(OUT_DIR) |
| 1889 | $(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -pthread -o $@ $(RX_COMPOSE_SRCS) \ |
| 1890 | tests/runtime/rx_compose_attach_test.c $(RX_COMPOSE_LINK) |
| 1891 | |
| 1892 | $(RX_COMPOSE_ATTACH_ASAN): $(RX_COMPOSE_DEPS) tests/runtime/rx_compose_attach_test.c | $(OUT_DIR) |
| 1893 | $(CC) $(CFLAGS) -DROUNDS=200 -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all $(AIEN_TEST_FLAGS) \ |
| 1894 | -pthread -o $@ $(RX_COMPOSE_SRCS) tests/runtime/rx_compose_attach_test.c $(RX_COMPOSE_LINK) |
| 1895 | |
| 1896 | test-composition: $(RX_COMPOSE_TEST) $(RX_COMPOSE_ATTACH_TEST) |
| 1897 | ./$(RX_COMPOSE_TEST) |
| 1898 | ./$(RX_COMPOSE_ATTACH_TEST) |
| 1899 | |
| 1900 | test-composition-attach-asan: $(RX_COMPOSE_ATTACH_ASAN) |
| 1901 | ./$(RX_COMPOSE_ATTACH_ASAN) |
| 1902 | |
| 1903 | test-composition-gate: $(RX_COMPOSE_GATE) |
| 1904 | ./$(RX_COMPOSE_GATE) "$$(git rev-parse HEAD)" $(OUT_DIR)/composition_gate_receipt.json |
| 1905 | |
| 1906 | composition-gate-bin: $(RX_COMPOSE_GATE) |
| 1907 | |
| 1908 | print-composition-gate-bin: |
| 1909 | @echo $(RX_COMPOSE_GATE) |
| 1910 | |
| 1911 | .PHONY: test-composition test-composition-gate test-composition-attach-asan composition-gate-bin print-composition-gate-bin |
| 1912 | |
| 1913 | # C4 (Convergence plan item 4): requalification of the local runtime with |
| 1914 | # interruption and recovery (crash at every stage boundary, SIGKILL sweep, on-disk |
| 1915 | # corruption). Test build only (crash points). Receipt: tools/c4_requal.sh. |
| 1916 | RX_C4_REQUAL = $(OUT_DIR)/rx_c4_requal |
| 1917 | |
| 1918 | $(RX_C4_REQUAL): $(RX_COMPOSE_DEPS) tests/runtime/rx_c4_requal.c | $(OUT_DIR) |
| 1919 | $(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -pthread -o $@ $(RX_COMPOSE_SRCS) tests/runtime/rx_c4_requal.c \ |
| 1920 | $(RX_COMPOSE_LINK) |
| 1921 | |
| 1922 | test-c4-requal: $(RX_C4_REQUAL) |
| 1923 | ./$(RX_C4_REQUAL) $(OUT_DIR)/c4_requal_receipt.json |
| 1924 | |
| 1925 | c4-requal-bin: $(RX_C4_REQUAL) |
| 1926 | |
| 1927 | print-c4-requal-bin: |
| 1928 | @echo $(RX_C4_REQUAL) |
| 1929 | |
| 1930 | .PHONY: test-c4-requal c4-requal-bin print-c4-requal-bin |
| 1931 | |
| 1932 | # COMPOSITION-2 GPU tier: the same 14-step gate with both Skills executed on |
| 1933 | # the GB10 through the sovereign M16 native path (no CUDA); see |
| 1934 | # tests/runtime/rx_compose_gpu_skill.h. A chip run: take the quiet flag and |
| 1935 | # use tools/composition_gate.sh --gpu (clean tree, content-addressed receipt). |
| 1936 | RX_COMPOSE_GATE_GPU = $(OUT_DIR)/rx_composition_gate_gpu |
| 1937 | RX_COMPOSE_GPU_SRCS = src/omega_blackwell_submit.c src/omega_blackwell_engine.c src/omega_gpu_engine.c src/omega_blackwell_matmul.c \ |
| 1938 | src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \ |
| 1939 | src/omega_blackwell_realize.c src/omega_vector.c src/omega_validate.c src/omega_gpu_wait.c \ |
| 1940 | $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c |
| 1941 | |
| 1942 | $(RX_COMPOSE_GATE_GPU): $(RX_COMPOSE_DEPS) $(RX_COMPOSE_GPU_SRCS) tests/runtime/rx_composition_gate.c \ |
| 1943 | tests/runtime/rx_compose_gpu_skill.h | check-physics-lock $(OUT_DIR) |
| 1944 | $(CC) $(CFLAGS) -DRXC_GATE_GPU -Itests/runtime -pthread -o $@ $(RX_COMPOSE_SRCS) \ |
| 1945 | $(RX_COMPOSE_GPU_SRCS) tests/runtime/rx_composition_gate.c $(RX_COMPOSE_LINK) -ldl |
| 1946 | |
| 1947 | test-composition-gate-gpu: $(RX_COMPOSE_GATE_GPU) |
| 1948 | ./$(RX_COMPOSE_GATE_GPU) "$$(git rev-parse HEAD)" $(OUT_DIR)/composition_gate_gpu_receipt.json |
| 1949 | |
| 1950 | composition-gate-gpu-bin: $(RX_COMPOSE_GATE_GPU) |
| 1951 | |
| 1952 | print-composition-gate-gpu-bin: |
| 1953 | @echo $(RX_COMPOSE_GATE_GPU) |
| 1954 | |
| 1955 | .PHONY: test-composition-gate-gpu composition-gate-gpu-bin print-composition-gate-gpu-bin |
| 1956 | |
| 1957 | # E1 row 7: correctly rounded FP32 DIV and SQRT on the GB10 |
| 1958 | # (docs/numeric/E1_DIVSQRT_GB10.md). Host tier, offline nvdisasm provenance |
| 1959 | # and the CHECK mutation sweep need no device; the chip run is |
| 1960 | # tools/run_divsqrt_gate.sh only (quiet flag, detached, receipt). |
| 1961 | DIVSQRT_SRCS = tests/test_omega_divsqrt_gb10.c src/omega_numeric_divsqrt_gb10.c src/omega_numeric.c \ |
| 1962 | src/omega_numeric_provenance.c $(NUMERIC_BW_SRCS) |
| 1963 | DIVSQRT_HDRS = src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h src/omega_blackwell_encoder.h \ |
| 1964 | src/omega_blackwell_qmd.h src/sha256.h |
| 1965 | .PHONY: test-divsqrt-host test-divsqrt-nvdisasm test-divsqrt-sweep |
| 1966 | build/test_omega_divsqrt_gb10_cpu: $(DIVSQRT_SRCS) $(DIVSQRT_HDRS) |
| 1967 | @mkdir -p build |
| 1968 | gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(DIVSQRT_SRCS) |
| 1969 | test-divsqrt-host: build/test_omega_divsqrt_gb10_cpu |
| 1970 | ./build/test_omega_divsqrt_gb10_cpu |
| 1971 | test-divsqrt-nvdisasm: |
| 1972 | tools/divsqrt_nvdisasm_check.sh |
| 1973 | test-divsqrt-sweep: |
| 1974 | tools/divsqrt_check_sweep.sh |
| 1975 | |
| 1976 | # E1 row 10: GB10 realizations of the frozen transcendental sequences (EXP2 |
| 1977 | # LOG2 SIGMOID TANH SIN COS ERF GELU RSQRT, bit-identical to |
| 1978 | # src/omega_numeric_transc.c; natural EXP and LOG, bit-identical to |
| 1979 | # omega_math_exp / omega_math_log of src/omega_numeric.c). Kernels live in |
| 1980 | # src/omega_numeric_divsqrt_gb10.c (same frame as DIV/SQRT; nvdisasm |
| 1981 | # provenance via test-divsqrt-nvdisasm). Host tier needs no device; the chip |
| 1982 | # run (all 2^32 inputs per op) is tools/run_numeric_transc_gate.sh only. |
| 1983 | # test-numeric-transc-gb10-mutants: OMEGA_DS_MUTATE=1 (EXP c2 +1 ulp) and 2 |
| 1984 | # (LOG c1 +1 ulp) must each fail a host-model check, not only the digest one. |
| 1985 | TRANSC_GB10_SRCS = tests/test_omega_numeric_transc_gb10.c src/omega_numeric_divsqrt_gb10.c \ |
| 1986 | src/omega_numeric_transc.c src/omega_numeric.c src/omega_numeric_provenance.c \ |
| 1987 | $(NUMERIC_BW_SRCS) |
| 1988 | TRANSC_GB10_CC = gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -fno-fast-math -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread |
| 1989 | TRANSC_GB10_MUTANTS = 1:EXP 2:LOG |
| 1990 | .PHONY: test-numeric-transc-gb10-host test-numeric-transc-gb10-mutants |
| 1991 | build/test_omega_numeric_transc_gb10_cpu: $(TRANSC_GB10_SRCS) $(DIVSQRT_HDRS) src/omega_numeric_transc.h |
| 1992 | @mkdir -p build |
| 1993 | $(TRANSC_GB10_CC) -o $@ $(TRANSC_GB10_SRCS) |
| 1994 | test-numeric-transc-gb10-host: build/test_omega_numeric_transc_gb10_cpu |
| 1995 | ./build/test_omega_numeric_transc_gb10_cpu |
| 1996 | test-numeric-transc-gb10-mutants: $(TRANSC_GB10_SRCS) $(DIVSQRT_HDRS) src/omega_numeric_transc.h |
| 1997 | @mkdir -p build |
| 1998 | @for mo in $(TRANSC_GB10_MUTANTS); do m=$${mo%%:*}; op=$${mo#*:}; \ |
| 1999 | $(TRANSC_GB10_CC) -DOMEGA_DS_MUTATE=$$m -o build/test_omega_numeric_transc_gb10_mut$$m $(TRANSC_GB10_SRCS) || exit 1; \ |
| 2000 | ./build/test_omega_numeric_transc_gb10_mut$$m > build/test_omega_numeric_transc_gb10_mut$$m.log 2>&1; \ |
| 2001 | if grep -q "^\[FAIL\] TG_$${op}_HOST_MODEL_" build/test_omega_numeric_transc_gb10_mut$$m.log; then \ |
| 2002 | echo "mutant $$m ($$op) killed: $$(grep -m1 "^\[FAIL\] TG_$${op}_HOST_MODEL_" build/test_omega_numeric_transc_gb10_mut$$m.log)"; \ |
| 2003 | else echo "MUTANT $$m ($$op) SURVIVED (no host-model check failed)"; exit 1; fi; \ |
| 2004 | done |
| 2005 | @echo "test-numeric-transc-gb10-mutants: PASS (all $(words $(TRANSC_GB10_MUTANTS)) mutants killed)" |
| 2006 | |
| 2007 | # C3: host-only detector for the intermittent unwritten-output event, with its |
| 2008 | # own unit test on synthetic buffers. The GB10 harness is |
| 2009 | # tests/test_omega_unwritten_trap_gb10.c (chip: forge queue only, see |
| 2010 | # tools/run_unwritten_trap.sh). |
| 2011 | .PHONY: test-unwritten-trap-host |
| 2012 | build/test_omega_unwritten_trap: tests/test_omega_unwritten_trap.c src/omega_unwritten_trap.c src/omega_unwritten_trap.h |
| 2013 | @mkdir -p build |
| 2014 | gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $@ tests/test_omega_unwritten_trap.c src/omega_unwritten_trap.c |
| 2015 | test-unwritten-trap-host: build/test_omega_unwritten_trap |
| 2016 | ./build/test_omega_unwritten_trap |
| 2017 | |
| 2018 | # E1 row 2: general global load/store on the GB10 (src/omega_numeric_ldst_gb10.h, |
| 2019 | # docs/numeric/E1_LDST_GB10.md). test-ldst-host needs no device; test-ldst-nvdisasm |
| 2020 | # decodes every table kernel offline; the chip run is tools/run_numeric_ldst_chip.sh. |
| 2021 | LDST_SRCS = tests/test_omega_ldst_gb10.c src/omega_numeric_ldst_gb10.c src/omega_numeric_divsqrt_gb10.c src/omega_numeric.c \ |
| 2022 | src/omega_numeric_provenance.c src/omega_blackwell_encoder.c src/omega_blackwell_codegen.c \ |
| 2023 | src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c |
| 2024 | LDST_HDRS = src/omega_numeric_ldst_gb10.h src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h src/omega_blackwell_encoder.h \ |
| 2025 | src/omega_blackwell_qmd.h src/sha256.h |
| 2026 | .PHONY: test-ldst-host test-ldst-nvdisasm |
| 2027 | build/test_omega_ldst_gb10_cpu: $(LDST_SRCS) $(LDST_HDRS) |
| 2028 | @mkdir -p build |
| 2029 | gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(LDST_SRCS) |
| 2030 | test-ldst-host: build/test_omega_ldst_gb10_cpu |
| 2031 | ./build/test_omega_ldst_gb10_cpu |
| 2032 | test-ldst-nvdisasm: |
| 2033 | tools/ldst_nvdisasm_check.sh |
| 2034 | |
| 2035 | # VC1-LIB: unit test for the library admission gate (receipt required, bootstrap kind, |
| 2036 | # dependencies must exist, no truncation) plus mutation proof. Each mutant is a copy of |
| 2037 | # src/omega_library.c with one tagged guard line (VC1:<tag>) deleted or weakened; the test |
| 2038 | # must exit 1 (KILLED) for every one. A mutant whose sed did not change the file fails the build. |
| 2039 | # Physics-free; CPU only. |
| 2040 | # Precompiled stacks (here and in test-resolve, test-genesis, test-vc-bridge): the unmutated |
| 2041 | # objects are compiled fresh into an emptied objs/ on every run and each background compile is |
| 2042 | # waited on by pid, so a failed compile fails the target. A bare `wait` returns 0 whatever the |
| 2043 | # jobs did, which let a leftover object from an earlier run be linked into the mutants. |
| 2044 | .PHONY: test-library |
| 2045 | LIBTEST_CORE = src/omega_om_units.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \ |
| 2046 | src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_realize_synth.c \ |
| 2047 | src/omega_machine.c src/omega_exec.c src/omega_verify.c src/omega_program.c src/omega_synthesis.c |
| 2048 | LIBTEST_FLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc |
| 2049 | LIBTEST_DIR = $(OUT_DIR)/library-test |
| 2050 | test-library: tests/test_omega_library.c src/omega_library.c src/omega_library.h |
| 2051 | @mkdir -p $(LIBTEST_DIR) |
| 2052 | $(CC) $(LIBTEST_FLAGS) -o $(LIBTEST_DIR)/test_omega_library tests/test_omega_library.c src/omega_library.c $(LIBTEST_CORE) |
| 2053 | $(LIBTEST_DIR)/test_omega_library |
| 2054 | @set -eu; rm -rf $(LIBTEST_DIR)/objs $(LIBTEST_DIR)/stack.o; mkdir -p $(LIBTEST_DIR)/objs; pids=""; \ |
| 2055 | for c in tests/test_omega_library.c $(LIBTEST_CORE); do \ |
| 2056 | o=$(LIBTEST_DIR)/objs/$$(echo $$c | tr '/' '_').o; \ |
| 2057 | $(CC) $(LIBTEST_FLAGS) -c -o $$o $$c & pids="$$pids $$!"; \ |
| 2058 | done; for p in $$pids; do wait $$p; done; ld -r -o $(LIBTEST_DIR)/stack.o $(LIBTEST_DIR)/objs/*.o; \ |
| 2059 | build_mutant() { name=$$1; tag=$$2; repl=$$3; \ |
| 2060 | sed "/VC1:$$tag/c\\$$repl" src/omega_library.c > $(LIBTEST_DIR)/mut_$$name.c; \ |
| 2061 | if cmp -s src/omega_library.c $(LIBTEST_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2062 | $(CC) $(LIBTEST_FLAGS) -o $(LIBTEST_DIR)/mut_$$name $(LIBTEST_DIR)/mut_$$name.c $(LIBTEST_DIR)/stack.o; \ |
| 2063 | rc=0; $(LIBTEST_DIR)/mut_$$name $$name > $(LIBTEST_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2064 | if [ $$rc -ne 1 ] || ! grep -q "^MUTANT $$name KILLED" $(LIBTEST_DIR)/mut_$$name.out; then \ |
| 2065 | echo "mutant $$name NOT killed (exit $$rc)"; cat $(LIBTEST_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2066 | echo "mutant $$name: killed (exit 1)"; }; \ |
| 2067 | . ./tools/mutpool.sh; mp_init; mp_run build_mutant allow-null-receipt null-receipt ' if (!receipt_hash) receipt_hash = (const uint8_t *)"0123456789abcdef0123456789abcdef";'; \ |
| 2068 | mp_run build_mutant allow-zero-receipt zero-receipt ' ;'; \ |
| 2069 | mp_run build_mutant bootstrap-null-audit bootstrap-null-audit ' if (!audit_hash) audit_hash = (const uint8_t *)"0123456789abcdef0123456789abcdef";'; \ |
| 2070 | mp_run build_mutant bootstrap-zero-audit bootstrap-zero-audit ' ;'; \ |
| 2071 | mp_run build_mutant allow-unverified verified-gate ' ;'; \ |
| 2072 | mp_run build_mutant allow-duplicate duplicate ' ;'; \ |
| 2073 | mp_run build_mutant allow-unknown-dep dep-unknown ' ;'; \ |
| 2074 | mp_run build_mutant truncate-deps dep-overflow ' if (dep_count > OMEGA_LIB_MAX_DEPS) dep_count = OMEGA_LIB_MAX_DEPS;'; \ |
| 2075 | mp_run build_mutant max-deps-off-by-one dep-overflow ' if (dep_count >= OMEGA_LIB_MAX_DEPS) return -1;'; \ |
| 2076 | mp_run build_mutant digest-ignores-kind digest-kind ' uint8_t kind = 0;'; \ |
| 2077 | mp_run build_mutant bootstrap-as-verified kind-bootstrap ' return lib_admit(lib, prog, deps, dep_count, audit_hash, OMEGA_LIB_ADMISSION_VERIFIED);'; \ |
| 2078 | mp_run build_mutant refuse-valid capacity ' if (prog->name[3] == (char)55) return -1;'; \ |
| 2079 | mp_run build_mutant refuse-deps dep-null ' if (dep_count > 0) return -1;'; mp_wait |
| 2080 | @echo "test-library: PASS (all checks, all mutants killed)" |
| 2081 | |
| 2082 | # omega-mv#574: omega_exec_native_f3 keeps executable pages for the last OMEGA_EXEC_CACHE_SLOTS distinct code |
| 2083 | # byte strings. test-exec-native-cache: reuse (hits), invalidation (same length or same address with new bytes |
| 2084 | # never runs a stale mapping), LRU eviction, capacity. Then each mutant of src/omega_exec.c must make the test fail. |
| 2085 | .PHONY: test-exec-native-cache |
| 2086 | EXECCACHE_CORE = $(filter-out src/omega_exec.c,$(LIBTEST_CORE)) |
| 2087 | EXECCACHE_DIR = $(OUT_DIR)/exec-cache-test |
| 2088 | test-exec-native-cache: tests/exec/test_exec_native_cache.c src/omega_exec.c src/omega_exec.h |
| 2089 | @mkdir -p $(EXECCACHE_DIR) |
| 2090 | $(CC) $(LIBTEST_FLAGS) -o $(EXECCACHE_DIR)/test_exec_native_cache tests/exec/test_exec_native_cache.c src/omega_exec.c $(EXECCACHE_CORE) -lpthread |
| 2091 | $(EXECCACHE_DIR)/test_exec_native_cache |
| 2092 | @set -eu; for m in 'identity-by-length|s/ \&\& memcmp(s->code, real->code_bytes, real->code_len) == 0//' \ |
| 2093 | 'evict-most-recent|s/s->last_use < lru->last_use/s->last_use > lru->last_use/' \ |
| 2094 | 'hit-not-touched|/^ *s->last_use = ++g_tick;$$/d'; do \ |
| 2095 | name=$${m%%|*}; expr=$${m#*|}; mut=$(EXECCACHE_DIR)/mut_$$name.c; \ |
| 2096 | sed "$$expr" src/omega_exec.c > $$mut; \ |
| 2097 | if cmp -s src/omega_exec.c $$mut; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2098 | $(CC) $(LIBTEST_FLAGS) -o $(EXECCACHE_DIR)/mut_$$name tests/exec/test_exec_native_cache.c $$mut $(EXECCACHE_CORE) -lpthread; \ |
| 2099 | rc=0; $(EXECCACHE_DIR)/mut_$$name > $(EXECCACHE_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2100 | if [ $$rc -ne 1 ] || ! grep -q '^EXEC_NATIVE_CACHE: FAIL' $(EXECCACHE_DIR)/mut_$$name.out; then \ |
| 2101 | echo "mutant $$name NOT killed (exit $$rc)"; cat $(EXECCACHE_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2102 | echo "mutant $$name: killed ($$(grep -c '^FAIL' $(EXECCACHE_DIR)/mut_$$name.out) failing checks)"; \ |
| 2103 | done |
| 2104 | @echo "test-exec-native-cache: PASS (all checks, all mutants killed)" |
| 2105 | |
| 2106 | # VC1-STORE (VC1 stage 3): unit test for the Verified Crumb Store (omega_vcstore): golden |
| 2107 | # vectors from aien-protocols (tests/vcstore/golden, PIN names the commit), immutability, |
| 2108 | # dependency closure, insert-order-independent digest, name index, save/load. Plus a mutation |
| 2109 | # proof: each mutant is a copy of src/omega_vcstore.c with one tagged line (VC1S:<tag>) deleted or |
| 2110 | # weakened; the test must exit 1 (KILLED) for every one. A mutant whose sed changed nothing |
| 2111 | # fails the build. Physics-free; CPU only; needs only src/omega_om_units.c. |
| 2112 | .PHONY: test-vcstore |
| 2113 | VCSTEST_FLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc |
| 2114 | VCSTEST_DIR = $(OUT_DIR)/vcstore-test |
| 2115 | test-vcstore: tests/test_omega_vcstore.c src/omega_vcstore.c src/omega_vcstore.h src/omega_om_units.c |
| 2116 | @mkdir -p $(VCSTEST_DIR) |
| 2117 | $(CC) $(VCSTEST_FLAGS) -o $(VCSTEST_DIR)/test_omega_vcstore tests/test_omega_vcstore.c src/omega_vcstore.c src/omega_om_units.c |
| 2118 | $(VCSTEST_DIR)/test_omega_vcstore |
| 2119 | @set -eu; $(CC) $(VCSTEST_FLAGS) -c -o $(VCSTEST_DIR)/test_omega_vcstore.o tests/test_omega_vcstore.c; \ |
| 2120 | $(CC) $(VCSTEST_FLAGS) -c -o $(VCSTEST_DIR)/omega_om_units.o src/omega_om_units.c; \ |
| 2121 | ld -r -o $(VCSTEST_DIR)/stack.o $(VCSTEST_DIR)/test_omega_vcstore.o $(VCSTEST_DIR)/omega_om_units.o; \ |
| 2122 | build_mutant() { name=$$1; tag=$$2; repl=$$3; \ |
| 2123 | sed "/VC1S:$$tag/c\\$$repl" src/omega_vcstore.c > $(VCSTEST_DIR)/mut_$$name.c; \ |
| 2124 | if cmp -s src/omega_vcstore.c $(VCSTEST_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2125 | $(CC) $(VCSTEST_FLAGS) -o $(VCSTEST_DIR)/mut_$$name $(VCSTEST_DIR)/mut_$$name.c $(VCSTEST_DIR)/stack.o; \ |
| 2126 | rc=0; $(VCSTEST_DIR)/mut_$$name $$name > $(VCSTEST_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2127 | if [ $$rc -ne 1 ] || ! grep -q "^MUTANT $$name KILLED by " $(VCSTEST_DIR)/mut_$$name.out; then \ |
| 2128 | echo "mutant $$name NOT killed (exit $$rc)"; tail -5 $(VCSTEST_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2129 | echo "mutant $$name: killed (exit 1)"; }; \ |
| 2130 | . ./tools/mutpool.sh; mp_init; mp_run build_mutant refuse-valid dec-trailing ' if (!c.err && c.pos == c.n) cfail(&c, OMEGA_VCS_TRAILING_BYTES);'; \ |
| 2131 | mp_run build_mutant refuse-existing-dep dep-exists ' if (vcs_find(s, dep, &di)) { rc = OMEGA_VCS_UNVERIFIED_DEPENDENCY; break; } else continue;'; \ |
| 2132 | mp_run build_mutant caps-reversed dec-caps-order ' if (!c.err && i > 0 && str_cmp(&v->capabilities[i - 1], &v->capabilities[i]) <= 0) cfail(&c, OMEGA_VCS_NONCANONICAL_SET);'; \ |
| 2133 | mp_run build_mutant kind-source-only dec-kind ' if (v->digest_kind != OMEGA_VC_DIGEST_SOURCE) cfail(&c, OMEGA_VCS_BAD_DIGEST_KIND);'; \ |
| 2134 | mp_run build_mutant id-hash id-hash ' sha256_hash(bytes + (len >= 22 ? 22 : 0), len >= 22 ? len - 22 : len, out);'; \ |
| 2135 | mp_run build_mutant dec-dep-dup dec-dep-dup ' ;'; \ |
| 2136 | mp_run build_mutant dec-dep-order dec-dep-order ' ;'; \ |
| 2137 | mp_run build_mutant dec-receipt dec-receipt ' ;'; \ |
| 2138 | mp_run build_mutant dec-dep-self dec-dep-self ' ;'; \ |
| 2139 | mp_run build_mutant dec-trailing dec-trailing ' ;'; \ |
| 2140 | mp_run build_mutant dec-version dec-version ' ;'; \ |
| 2141 | mp_run build_mutant dec-truncated dec-truncated ' if (c->n - c->pos < k) return 0;'; \ |
| 2142 | mp_run build_mutant dec-tag dec-tag ' ;'; \ |
| 2143 | mp_run build_mutant dec-exports-order dec-exports-order ' ;'; \ |
| 2144 | mp_run build_mutant dec-kind dec-kind ' ;'; \ |
| 2145 | mp_run build_mutant dec-zero-ids dec-zero-ids ' ;'; \ |
| 2146 | mp_run build_mutant dec-string-char dec-string-char ' (void)ch;'; \ |
| 2147 | mp_run build_mutant dec-count dec-count ' ;'; \ |
| 2148 | mp_run build_mutant dec-real-order dec-real-order ' (void)prev;'; \ |
| 2149 | mp_run build_mutant dec-caps-order dec-caps-order ' ;'; \ |
| 2150 | mp_run build_mutant dec-dep-zero dec-dep-zero ' (void)req;'; \ |
| 2151 | mp_run build_mutant dec-evroot dec-evroot ' ;'; \ |
| 2152 | mp_run build_mutant dec-string-empty dec-string-len ' if (len > OMEGA_VC_MAX_STRING) { cfail(c, OMEGA_VCS_BAD_STRING); return; }'; \ |
| 2153 | mp_run build_mutant dec-string-max dec-string-len ' if (len == 0) { cfail(c, OMEGA_VCS_BAD_STRING); return; }'; \ |
| 2154 | mp_run build_mutant claimed-required claimed-required ' if (!claimed) { static uint8_t zz[32]; omega_vc_compute_id(canon, len, zz); claimed = zz; }'; \ |
| 2155 | mp_run build_mutant insert-idcheck insert-idcheck ' if (0) { free(rec); return OMEGA_VCS_VCSTORE_ID_MISMATCH; }'; \ |
| 2156 | mp_run build_mutant idempotent idempotent ' (void)o;'; \ |
| 2157 | mp_run build_mutant idempotent-ignores-kind idempotent ' if (o->len == len && memcmp(o->bytes, canon, len) == 0) return OMEGA_VCS_OK;'; \ |
| 2158 | mp_run build_mutant immutable immutable ' return OMEGA_VCS_OK;'; \ |
| 2159 | mp_run build_mutant dep-exists dep-exists ' if (!vcs_find(s, dep, &di)) continue;'; \ |
| 2160 | mp_run build_mutant dep-contract dep-contract ' ;'; \ |
| 2161 | mp_run build_mutant no-cap no-cap ' if (s->count >= 128) return OMEGA_VCS_VCSTORE_CAPACITY;'; \ |
| 2162 | mp_run build_mutant sorted-insert sorted-insert ' size_t at = s->count;'; \ |
| 2163 | mp_run build_mutant kind-bootstrap kind-bootstrap ' return vcs_insert(s, canonical, len, claimed_vc_id, OMEGA_VCS_ADMISSION_VERIFIED);'; \ |
| 2164 | mp_run build_mutant get-recompute get-recompute ' ;'; \ |
| 2165 | mp_run build_mutant get-key get-key ' ;'; \ |
| 2166 | mp_run build_mutant receipt-of receipt-of ' if (rc == OMEGA_VCS_OK) memcpy(out_receipt, rec->vc.evidence_root, 32);'; \ |
| 2167 | mp_run build_mutant walk-order walk-order ' const uint8_t *dep = f->deps + 64 * (size_t)(f->n_dep - 1 - f->next++);'; \ |
| 2168 | mp_run build_mutant walk-visited walk-visited ' ;'; \ |
| 2169 | mp_run build_mutant walk-capacity walk-capacity ' ;'; \ |
| 2170 | mp_run build_mutant walk-dep-exists walk-dep-exists ' if (!vcs_find(s, dep, &di)) continue;'; \ |
| 2171 | mp_run build_mutant walk-contract walk-contract ' ;'; \ |
| 2172 | mp_run build_mutant walk-cycle walk-cycle ' if (state[di] == 1) continue;'; \ |
| 2173 | mp_run build_mutant walk-names walk-names ' if (s->n_names) return OMEGA_VCS_UNVERIFIED_DEPENDENCY;'; \ |
| 2174 | mp_run build_mutant digest-magic digest-magic ' sha256_update(&ctx, (const uint8_t *)"VCS2", 4);'; \ |
| 2175 | mp_run build_mutant digest-kind digest-kind ' uint8_t kind = 0;'; \ |
| 2176 | mp_run build_mutant digest-bytes digest-bytes ' sha256_update(&ctx, o->bytes, 0);'; \ |
| 2177 | mp_run build_mutant digest-names digest-names ' u64be(&ctx, (uint64_t)s->n_names);'; \ |
| 2178 | mp_run build_mutant namedigest-id namedigest-id ' sha256_update(&ctx, nm->id, 0);'; \ |
| 2179 | mp_run build_mutant name-sorted name-sorted ' return name_insert_at(s, s->n_names, name, id);'; \ |
| 2180 | mp_run build_mutant name-many name-many ' for (size_t k = 0; k < s->n_names; k++) if (memcmp(s->names[k].id, id, 32) == 0) return OMEGA_VCS_VCSTORE_NAME_EXISTS;'; \ |
| 2181 | mp_run build_mutant name-no-silent-rebind name-no-silent-rebind ' { memcpy(s->names[np].id, id, 32); return OMEGA_VCS_OK; }'; \ |
| 2182 | mp_run build_mutant rebind-write rebind-write ' ;'; \ |
| 2183 | mp_run build_mutant rebind-exists rebind-exists ' if (!name_find(s, name, &np)) np = 0;'; \ |
| 2184 | mp_run build_mutant rebind-id-exists rebind-id-exists ' (void)vcs_find(s, id, &di);'; \ |
| 2185 | mp_run build_mutant name-id-exists name-id-exists ' (void)vcs_find(s, id, &di);'; \ |
| 2186 | mp_run build_mutant name-valid name-valid ' ;'; \ |
| 2187 | mp_run build_mutant resolve resolve ' memset(out_id, 0, 32);'; \ |
| 2188 | mp_run build_mutant load-names load-names ' ;'; \ |
| 2189 | mp_run build_mutant load-fail load-fail ' omega_vcstore_destroy(s);'; \ |
| 2190 | mp_run build_mutant load-magic load-magic ' if (!m) return OMEGA_VCS_VCSTORE_MALFORMED;'; \ |
| 2191 | mp_run build_mutant load-digest-obj load-digest-obj ' ;'; \ |
| 2192 | mp_run build_mutant load-digest-names load-digest-names ' ;'; \ |
| 2193 | mp_run build_mutant load-trailing load-trailing ' ;'; \ |
| 2194 | mp_run build_mutant load-kind load-kind ' ;'; \ |
| 2195 | mp_run build_mutant load-order load-order ' ;'; \ |
| 2196 | mp_run build_mutant load-graph load-graph ' (void)vcs_graph_check;'; \ |
| 2197 | mp_run build_mutant load-graph-missing load-graph ' (void)vcs_graph_check;'; \ |
| 2198 | mp_run build_mutant load-name-id load-name-id ' (void)vcs_find(t, id, &di);'; \ |
| 2199 | mp_run build_mutant save-verify save-verify ' int rc = 0;'; mp_wait |
| 2200 | @echo "test-vcstore: PASS (all checks, all mutants killed)" |
| 2201 | |
| 2202 | # VC1-RESOLVE (VC1 stage 4): import resolution in the Omega OSC compiler. `import NAME;` resolves |
| 2203 | # only through omega.lock -> semantic id -> Verified Crumb Store -> receipt check -> transitive |
| 2204 | # verified closure (src/omega_resolve.c), with a C reader of the aien-proof receipt wire contract |
| 2205 | # (src/omega_receipt.c, BLAKE3 in om/blake3/b3unit.om behind src/omega_blake3.c). oscv is the verified |
| 2206 | # driver. Test inputs: tests/resolve/ (official BLAKE3 vectors, three receipts written by the Rust |
| 2207 | # implementation). Mutation proof: each mutant is a copy of ONE source file with one tagged line |
| 2208 | # (VC1R:<tag> in omega_resolve.c / omega_receipt.c) replaced; the test must exit 1 with "MUTANT <name> |
| 2209 | # KILLED by <check>" for the check named here, every time. A mutant whose sed changed nothing, did not |
| 2210 | # compile, or survived fails the build. The BLAKE3 mutants (merge, root) act on the Omega source and |
| 2211 | # need omc, so they run in om/blake3/parity/run.sh. CPU only; no physics; no chip. |
| 2212 | .PHONY: test-resolve oscv |
| 2213 | RESOLVE_FLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc -Isrc/compiler -Isrc/compiler/model |
| 2214 | RESOLVE_DIR = $(OUT_DIR)/resolve-test |
| 2215 | RESOLVE_OSC_LIB = $(filter-out src/compiler/oscc_main.c,$(wildcard src/compiler/*.c)) |
| 2216 | RESOLVE_SRC = src/omega_resolve.c src/omega_receipt.c src/omega_blake3.c |
| 2217 | RESOLVE_REST = src/omega_resolve_osc.c src/omega_vcstore.c $(RESOLVE_OSC_LIB) src/omega_om_units.c |
| 2218 | RESOLVE_HDRS = $(wildcard src/compiler/*.h) src/omega_resolve.h src/omega_receipt.h src/omega_blake3.h src/omega_resolve_osc.h src/omega_vcstore.h src/sha256.h |
| 2219 | $(OUT_DIR)/compiler/oscv: src/oscv_main.c $(RESOLVE_SRC) $(RESOLVE_REST) $(RESOLVE_HDRS) |
| 2220 | @mkdir -p $(OUT_DIR)/compiler |
| 2221 | $(CC) $(RESOLVE_FLAGS) -o $@ src/oscv_main.c $(RESOLVE_SRC) $(RESOLVE_REST) |
| 2222 | oscv: $(OUT_DIR)/compiler/oscv |
| 2223 | test-resolve: tests/test_omega_resolve.c $(OUT_DIR)/compiler/oscv $(RESOLVE_SRC) $(RESOLVE_REST) $(RESOLVE_HDRS) |
| 2224 | @mkdir -p $(RESOLVE_DIR) |
| 2225 | $(CC) $(RESOLVE_FLAGS) -DOSCV_PATH='"$(OUT_DIR)/compiler/oscv"' -o $(RESOLVE_DIR)/test_omega_resolve tests/test_omega_resolve.c $(RESOLVE_SRC) $(RESOLVE_REST) |
| 2226 | $(RESOLVE_DIR)/test_omega_resolve |
| 2227 | $(CC) $(RESOLVE_FLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -DOSCV_PATH='"$(OUT_DIR)/compiler/oscv"' -o $(RESOLVE_DIR)/test_omega_resolve_asan tests/test_omega_resolve.c $(RESOLVE_SRC) $(RESOLVE_REST) |
| 2228 | $(RESOLVE_DIR)/test_omega_resolve_asan |
| 2229 | @set -eu; rm -rf $(RESOLVE_DIR)/objs $(RESOLVE_DIR)/src_objs $(RESOLVE_DIR)/rest_stack.o; mkdir -p $(RESOLVE_DIR)/objs $(RESOLVE_DIR)/src_objs; \ |
| 2230 | $(CC) $(RESOLVE_FLAGS) -DOSCV_PATH='"$(OUT_DIR)/compiler/oscv"' -c -o $(RESOLVE_DIR)/objs/test_omega_resolve.o tests/test_omega_resolve.c & pids="$$!"; \ |
| 2231 | for c in $(RESOLVE_REST); do \ |
| 2232 | o=$(RESOLVE_DIR)/objs/$$(echo $$c | tr '/' '_').o; \ |
| 2233 | $(CC) $(RESOLVE_FLAGS) -c -o $$o $$c & pids="$$pids $$!"; \ |
| 2234 | done; \ |
| 2235 | for c in $(RESOLVE_SRC); do \ |
| 2236 | o=$(RESOLVE_DIR)/src_objs/$$(basename $$c .c).o; \ |
| 2237 | $(CC) $(RESOLVE_FLAGS) -c -o $$o $$c & pids="$$pids $$!"; \ |
| 2238 | done; for p in $$pids; do wait $$p; done; ld -r -o $(RESOLVE_DIR)/rest_stack.o $(RESOLVE_DIR)/objs/*.o; \ |
| 2239 | build_mutant() { name=$$1; tag=$$2; which=$$3; chk=$$4; repl=$$5; \ |
| 2240 | case $$which in resolve) f=src/omega_resolve.c; pfx=VC1R;; receipt) f=src/omega_receipt.c; pfx=VC1R;; *) echo "bad mutant file $$which"; exit 1;; esac; \ |
| 2241 | sed "/$$pfx:$$tag/c\\$$repl" $$f > $(RESOLVE_DIR)/mut_$$name.c; \ |
| 2242 | if cmp -s $$f $(RESOLVE_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2243 | objs=""; for s in $(RESOLVE_SRC); do if [ "$$s" = "$$f" ]; then objs="$$objs $(RESOLVE_DIR)/mut_$$name.c"; else objs="$$objs $(RESOLVE_DIR)/src_objs/$$(basename $$s .c).o"; fi; done; \ |
| 2244 | $(CC) $(RESOLVE_FLAGS) -DOSCV_PATH='"$(OUT_DIR)/compiler/oscv"' -o $(RESOLVE_DIR)/mut_$$name $$objs $(RESOLVE_DIR)/rest_stack.o; \ |
| 2245 | rc=0; $(RESOLVE_DIR)/mut_$$name $$name > $(RESOLVE_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2246 | if [ $$rc -ne 1 ] || ! grep -q "^MUTANT $$name KILLED by $$chk\$$" $(RESOLVE_DIR)/mut_$$name.out; then \ |
| 2247 | echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(RESOLVE_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2248 | echo "mutant $$name: killed by $$chk (exit 1)"; }; \ |
| 2249 | . ./tools/mutpool.sh; mp_init; mp_run build_mutant profile-known profile-known resolve profile-unknown-refused ' if (!p) p = table;'; \ |
| 2250 | mp_run build_mutant profile-version profile-version resolve profile-version-too-old-refused ' if (cmp < -1)'; \ |
| 2251 | mp_run build_mutant lock-bytes-tab lock-bytes resolve lock-refuses-tab-in-comment ' if (text[i] == 13 || text[i] == 0) return lock_bad(err, 1, "CR or NUL byte");'; \ |
| 2252 | mp_run build_mutant lock-bytes-cr lock-bytes resolve lock-refuses-cr-in-comment ' if (text[i] == 9 || text[i] == 0) return lock_bad(err, 1, "tab or NUL byte");'; \ |
| 2253 | mp_run build_mutant lock-bytes-nul lock-bytes resolve lock-refuses-nul-in-comment ' if (text[i] == 9 || text[i] == 13) return lock_bad(err, 1, "tab or CR byte");'; \ |
| 2254 | mp_run build_mutant lock-header lock-header resolve lock-refuses-wrong-header ' if (ll != 13) { free(ents); return lock_bad(err, line, "header"); }'; \ |
| 2255 | mp_run build_mutant lock-unknown-line lock-unknown-line resolve lock-refuses-bad-name-start ' if (0) { free(ents); return lock_bad(err, line, "unknown line"); }'; \ |
| 2256 | mp_run build_mutant lock-hex lock-hex resolve lock-refuses-uppercase-hex ' if (unhex32(h1, en.semantic) || unhex32(h2, en.receipt)) { memset(en.semantic, 1, 32); memset(en.receipt, 1, 32); }'; \ |
| 2257 | mp_run build_mutant lock-order-duplicate lock-order resolve lock-refuses-duplicate-name ' if (n > 0 && strcmp(ents[n - 1].name, en.name) > 0) {'; \ |
| 2258 | mp_run build_mutant lock-order-sorted lock-order resolve lock-refuses-unsorted ' if (n > 0 && strcmp(ents[n - 1].name, en.name) == 0) {'; \ |
| 2259 | mp_run build_mutant missing-receipt missing-receipt resolve refuse-missing-receipt ' if (fr != 0) return fail(err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "receipt unavailable");'; \ |
| 2260 | mp_run build_mutant rule1-name rule1-name resolve refuse-receipt-file-holds-another-receipt ' if (0) {'; \ |
| 2261 | mp_run build_mutant rule-clean rule-clean resolve refuse-dirty-receipt-in-build ' if (0) {'; \ |
| 2262 | mp_run build_mutant rule-clean-admit rule-clean resolve admit-refuses-dirty-receipt-in-build ' if (0) {'; \ |
| 2263 | mp_run build_mutant rule4-semantic rule4-semantic resolve refuse-receipt-does-not-name-program ' if (0) {'; \ |
| 2264 | mp_run build_mutant rule4-source rule4-source resolve refuse-stale-receipt ' if (0) {'; \ |
| 2265 | mp_run build_mutant rule3 rule3 resolve refuse-receipt-output-digest-is-not-evidence-root ' if (0) {'; \ |
| 2266 | mp_run build_mutant rule5 rule5 resolve refuse-receipt-kind-is-not-profile ' if (0) {'; \ |
| 2267 | mp_run build_mutant rule6 rule6 resolve refuse-receipt-has-extra-dependency ' if ((a != nrd || (a && memcmp(deps, rdeps, a * 32) != 0)) && 0) {'; \ |
| 2268 | mp_run build_mutant rule2-pass rule2-pass resolve refuse-receipt-result-is-not-pass ' if (0) {'; \ |
| 2269 | mp_run build_mutant rule2-assert rule2-assert resolve refuse-receipt-assertion-failed ' if (0) {'; \ |
| 2270 | mp_run build_mutant rule2-testonly rule2-testonly resolve refuse-receipt-test-only-trust ' if (0) {'; \ |
| 2271 | mp_run build_mutant rule2-tier rule2-tier resolve refuse-receipt-tier-below-profile ' if (!omega_tier_satisfies(need_rank, rcpt.tier_rank) && 0) {'; \ |
| 2272 | mp_run build_mutant closure-receipt closure-receipt resolve closure-digest-matches-reference ' (void)e[i].receipt_id;'; \ |
| 2273 | mp_run build_mutant cycle cycle resolve refuse-dependency-cycle ' if (0) return 0;'; \ |
| 2274 | mp_run build_mutant lock-receipt lock-receipt resolve refuse-lock-pins-another-receipt ' if (0) {'; \ |
| 2275 | mp_run build_mutant lock-receipt-visited visited-lock-receipt resolve refuse-lock-pins-another-receipt-for-visited-node ' if (0)'; \ |
| 2276 | mp_run build_mutant genesis-gate genesis-gate resolve refuse-genesis-record-without-permission ' if (0) {'; \ |
| 2277 | mp_run build_mutant taint-cap taint-cap resolve refuse-tainted-record-in-build-domain ' 0) {'; \ |
| 2278 | mp_run build_mutant verified-needs-receipt verified-needs-receipt resolve refuse-missing-receipt ' if (0) {'; \ |
| 2279 | mp_run build_mutant edge-contract edge-contract resolve refuse-edge-contract-mismatch ' if (memcmp(w->nodes[di].contract, req, 32) != 0 && 0) {'; \ |
| 2280 | mp_run build_mutant boot-dep-verified boot-dep-verified resolve refuse-genesis-record-depending-on-verified ' if (0) {'; \ |
| 2281 | mp_run build_mutant not-pinned not-pinned resolve refuse-not-pinned-without-lock ' if (0 && !omega_lock_find(lock, names[i]))'; \ |
| 2282 | mp_run build_mutant undeclared undeclared resolve refuse-undeclared-lock-line-without-import ' if (!used && 0)'; \ |
| 2283 | mp_run build_mutant closure-sort closure-sort resolve closure-sorted-ascending-by-semantic-id ' (void)cmp_entry;'; \ |
| 2284 | mp_run build_mutant build-domain build-domain resolve build-id-matches-reference ' uint8_t db = (uint8_t)d & 0;'; \ |
| 2285 | mp_run build_mutant build-closure build-closure resolve build-id-matches-reference ' (void)closure_digest;'; \ |
| 2286 | mp_run build_mutant taint-mark taint-mark resolve artifact-dev-is-tainted-build-is-not ' m->tainted = 0;'; \ |
| 2287 | mp_run build_mutant meta-taint-consistent meta-taint-consistent resolve artifact-refuses-dev-header-marked-untainted ' if (0)'; \ |
| 2288 | mp_run build_mutant meta-build-id meta-build-id resolve artifact-refuses-edited-build-id ' if (0)'; \ |
| 2289 | mp_run build_mutant admit-origin admit-origin resolve admit-refuses-record-from-tainted-origin ' if (origin && (origin->tainted || origin->domain == OMEGA_DOMAIN_DEV) && 0)'; \ |
| 2290 | mp_run build_mutant admit-cap admit-cap resolve admit-refuses-taint-capability ' if (0) {'; \ |
| 2291 | mp_run build_mutant admit-receipt admit-receipt resolve admit-refuses-mismatched-receipt ' rc = 0; (void)rr;'; \ |
| 2292 | mp_run build_mutant genesis-dep genesis-dep resolve admit-genesis-refuses-verified-dependency ' if ((omega_vcstore_admission_kind(s, view->dependencies + 64 * (size_t)i, &k) != 0 || k != OMEGA_VCS_ADMISSION_BOOTSTRAP) && 0) {'; \ |
| 2293 | mp_run build_mutant blob-digest blob-digest resolve refuse-blob-does-not-hash-to-digest ' if (0) {'; \ |
| 2294 | mp_run build_mutant json-dup-key json-dup-key receipt receipt-refuses-duplicate-key ' if (0) { free(key); jfree(j); return jfail(p, "duplicate key"); }'; \ |
| 2295 | mp_run build_mutant deny-unknown deny-unknown receipt receipt-refuses-unknown-field ' if (!all_known_key(root) && 0) { ef(&e, "receipt: unknown field%s", ""); goto done; }'; \ |
| 2296 | mp_run build_mutant schema schema receipt receipt-refuses-unknown-schema ' if (strcmp(schema, SCHEMA) != 0 && 0) { ef(&e, "receipt: unknown receipt schema%s", ""); goto done; }'; \ |
| 2297 | mp_run build_mutant version version receipt receipt-refuses-unknown-version ' if (r->version != 1 && 0) { ef(&e, "receipt: unsupported receipt version%s", ""); goto done; }'; \ |
| 2298 | mp_run build_mutant feature feature receipt receipt-refuses-unknown-feature ' if (0) { ef(&e, "receipt: unknown required receipt feature%s", ""); goto done; }'; \ |
| 2299 | mp_run build_mutant reserved reserved receipt receipt-refuses-reserved-field ' if (reserved[0] && 0) { ef(&e, "receipt: reserved field must be empty%s", ""); goto done; }'; \ |
| 2300 | mp_run build_mutant env-class env-class receipt receipt-refuses-env-class-mismatch ' if (strcmp(r->env_class, r->tier) != 0 && 0) { ef(&e, "receipt: env_class contradicts tier%s", ""); goto done; }'; \ |
| 2301 | mp_run build_mutant mutation-order mutation-order receipt receipt-refuses-observed-over-declared ' if (MUTS[r->observed_mutation].sev > MUTS[r->declared_mutation].sev && 0) { ef(&e, "receipt: observed mutation exceeds declared mutation%s", ""); goto done; }'; \ |
| 2302 | mp_run build_mutant canon-sort canon-sort receipt receipt-canon-order-independent ' (void)cmp_str;'; \ |
| 2303 | mp_run build_mutant id-compare id-compare receipt receipt-refuses-wrong-id ' if (0) {'; \ |
| 2304 | mp_run build_mutant max-depth-removed max-depth resolve refuse-dependency-chain-too-deep ' if (0 && depth >= MAX_DEPTH) return fail(w->err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "dependency chain deeper than %d", MAX_DEPTH);'; \ |
| 2305 | mp_run build_mutant max-depth-one-too-many max-depth resolve refuse-dependency-chain-too-deep ' if (depth > MAX_DEPTH) return fail(w->err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "dependency chain deeper than %d", MAX_DEPTH);'; \ |
| 2306 | mp_run build_mutant max-depth-one-too-few max-depth resolve accept-dependency-chain-at-the-limit ' if (depth >= MAX_DEPTH - 1) return fail(w->err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "dependency chain deeper than %d", MAX_DEPTH);'; \ |
| 2307 | mp_run build_mutant dup-import dup-import resolve refuse-duplicate-import-names-through-the-api ' if (0) return fail(err, OMEGA_RES_BAD_ARGUMENT, 0, names[i], "import listed twice");'; \ |
| 2308 | mp_run build_mutant pass-needs-assertion pass-needs-assertion receipt receipt-refuses-pass-without-assertion ' if (r->n_assertions == 0 && r->result == OMEGA_RECEIPT_PASS && 0) { ef(&e, "receipt: PASS receipts must carry at least one assertion%s", ""); goto done; }'; \ |
| 2309 | mp_run build_mutant prod-authority-empty prod-authority receipt receipt-refuses-production-blank-authority ' if (a == b && 0) { ef(&e, "receipt: PRODUCTION receipts require an authority reference%s", ""); goto done; }'; \ |
| 2310 | mp_run build_mutant prod-authority-trim prod-authority receipt receipt-refuses-production-blank-authority ' if (b == 0) { ef(&e, "receipt: PRODUCTION receipts require an authority reference%s", ""); goto done; }'; \ |
| 2311 | mp_run build_mutant prod-spelling prod-spelling receipt receipt-refuses-production-test-only-authority ' int bad = strstr(low, "test-only") || strstr(low, "testonly");'; \ |
| 2312 | mp_run build_mutant prod-bad-refused prod-bad-refused receipt receipt-refuses-production-test-only-authority ' if (bad && 0) { ef(&e, "receipt: a TEST_ONLY signer cannot produce a PRODUCTION receipt%s", ""); goto done; }'; mp_wait |
| 2313 | @echo "test-resolve: PASS (all checks, ASan/UBSan clean, all 64 mutants killed; the 2 BLAKE3 mutants run in om/blake3/parity/run.sh)" |
| 2314 | |
| 2315 | # VC1-GENESIS (VC1 stage 6): the pinned Genesis Set, the private store doors, the mandatory |
| 2316 | # source/IR recheck in the build domain. The resolver and the store now rebuild the program from |
| 2317 | # its IR (src/omega_program_ir.c), so the resolver link set grows by the program stack. These |
| 2318 | # additions are at the end on purpose: `+=` on a recursive variable is read by every recipe above. |
| 2319 | RESOLVE_PROGRAM_STACK = src/omega_program_ir.c src/omega_program.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_exec.c src/omega_verify.c src/omega_realize_synth.c src/omega_machine.c |
| 2320 | RESOLVE_REST += $(RESOLVE_PROGRAM_STACK) |
| 2321 | RESOLVE_HDRS += src/omega_genesis.h src/omega_vcstore_priv.h src/omega_program_ir.h tests/vc_fixture.h |
| 2322 | |
| 2323 | # test-genesis: the LISTED-member behavior of VC-GENESIS-1, which the empty real set cannot show. |
| 2324 | # The variant header is GENERATED from src/omega_genesis.h (same functions, byte for byte; only the |
| 2325 | # count, the set name and one table row differ), and omega_vcstore.c and omega_resolve.c are copied |
| 2326 | # with ONE rewritten include line so they read it. A quote include looks in the including file's own |
| 2327 | # directory first, which is why -I cannot swap the real header and why the copy is made. Nothing in |
| 2328 | # production source can select the variant. Mutants below break one guard each in the copies. |
| 2329 | .PHONY: test-genesis |
| 2330 | GENESIS_DIR = $(OUT_DIR)/genesis-test |
| 2331 | GENESIS_STACK = src/omega_receipt.c src/omega_blake3.c src/omega_om_units.c $(RESOLVE_PROGRAM_STACK) |
| 2332 | GENESIS_CFLAGS = $(RESOLVE_FLAGS) -I$(GENESIS_DIR) -Itests |
| 2333 | test-genesis: tests/test_omega_genesis_set.c tests/genesis_variant/member.inc src/omega_vcstore.c src/omega_resolve.c src/omega_genesis.h $(RESOLVE_HDRS) |
| 2334 | @set -eu; mkdir -p $(GENESIS_DIR)/genesis_variant; \ |
| 2335 | sed -e 's|^#define OMEGA_GENESIS_1_COUNT 0u|#define OMEGA_GENESIS_1_COUNT 1u|' -e 's|^#define OMEGA_GENESIS_SET_NAME "VC-GENESIS-1"|#define OMEGA_GENESIS_SET_NAME "VC-GENESIS-1-TEST-VARIANT"|' src/omega_genesis.h \ |
| 2336 | | awk -v f=tests/genesis_variant/member.inc '/^ \{ 0 \}$$/ { while ((getline l < f) > 0) print l } { print }' > $(GENESIS_DIR)/genesis_variant/omega_genesis.h; \ |
| 2337 | grep -q '^#define OMEGA_GENESIS_1_COUNT 1u' $(GENESIS_DIR)/genesis_variant/omega_genesis.h; \ |
| 2338 | grep -q 'TEST-VARIANT' $(GENESIS_DIR)/genesis_variant/omega_genesis.h; \ |
| 2339 | [ "$$(grep -c '0x8f, 0x0b' $(GENESIS_DIR)/genesis_variant/omega_genesis.h)" = 1 ]; \ |
| 2340 | for f in omega_vcstore omega_resolve; do \ |
| 2341 | sed 's|#include "omega_genesis.h"|#include "genesis_variant/omega_genesis.h"|' src/$$f.c > $(GENESIS_DIR)/$$f.c; \ |
| 2342 | if cmp -s src/$$f.c $(GENESIS_DIR)/$$f.c; then echo "test-genesis: include line not found in $$f.c"; exit 1; fi; done |
| 2343 | $(CC) $(GENESIS_CFLAGS) -o $(GENESIS_DIR)/test_omega_genesis_set tests/test_omega_genesis_set.c $(GENESIS_DIR)/omega_vcstore.c $(GENESIS_DIR)/omega_resolve.c $(GENESIS_STACK) |
| 2344 | $(GENESIS_DIR)/test_omega_genesis_set |
| 2345 | $(CC) $(GENESIS_CFLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -o $(GENESIS_DIR)/test_omega_genesis_set_asan tests/test_omega_genesis_set.c $(GENESIS_DIR)/omega_vcstore.c $(GENESIS_DIR)/omega_resolve.c $(GENESIS_STACK) |
| 2346 | $(GENESIS_DIR)/test_omega_genesis_set_asan |
| 2347 | @set -eu; rm -rf $(GENESIS_DIR)/objs $(GENESIS_DIR)/stack.o $(GENESIS_DIR)/omega_vcstore.o $(GENESIS_DIR)/omega_resolve.o; mkdir -p $(GENESIS_DIR)/objs; pids=""; \ |
| 2348 | for c in tests/test_omega_genesis_set.c $(GENESIS_STACK); do \ |
| 2349 | o=$(GENESIS_DIR)/objs/$$(echo $$c | tr '/' '_').o; \ |
| 2350 | $(CC) $(GENESIS_CFLAGS) -c -o $$o $$c & pids="$$pids $$!"; \ |
| 2351 | done; \ |
| 2352 | $(CC) $(GENESIS_CFLAGS) -c -o $(GENESIS_DIR)/omega_vcstore.o $(GENESIS_DIR)/omega_vcstore.c & pids="$$pids $$!"; \ |
| 2353 | $(CC) $(GENESIS_CFLAGS) -c -o $(GENESIS_DIR)/omega_resolve.o $(GENESIS_DIR)/omega_resolve.c & pids="$$pids $$!"; \ |
| 2354 | for p in $$pids; do wait $$p; done; ld -r -o $(GENESIS_DIR)/stack.o $(GENESIS_DIR)/objs/*.o; \ |
| 2355 | gmut() { name=$$1; which=$$2; tag=$$3; chk=$$4; repl=$$5; \ |
| 2356 | f=$(GENESIS_DIR)/$$which.c; sed "/$$tag/c\\$$repl" $$f > $(GENESIS_DIR)/mut_$$name.c; \ |
| 2357 | if cmp -s $$f $(GENESIS_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2358 | if [ $$which = omega_vcstore ]; then a=$(GENESIS_DIR)/mut_$$name.c; b=$(GENESIS_DIR)/omega_resolve.o; else a=$(GENESIS_DIR)/omega_vcstore.o; b=$(GENESIS_DIR)/mut_$$name.c; fi; \ |
| 2359 | $(CC) $(GENESIS_CFLAGS) -o $(GENESIS_DIR)/mut_$$name $$a $$b $(GENESIS_DIR)/stack.o; \ |
| 2360 | rc=0; $(GENESIS_DIR)/mut_$$name > $(GENESIS_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2361 | if [ $$rc -eq 0 ] || ! grep -q "^FAIL $$chk\$$" $(GENESIS_DIR)/mut_$$name.out; then echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(GENESIS_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2362 | echo "mutant $$name: killed by $$chk (exit $$rc)"; }; \ |
| 2363 | . ./tools/mutpool.sh; mp_init; \ |
| 2364 | mp_run gmut gv-insert-refuses-listed omega_vcstore VC1S:insert-genesis store-inserts-a-listed-bootstrap-record ' if (kind == OMEGA_VCS_ADMISSION_BOOTSTRAP) { free(rec); return OMEGA_VCS_GENESIS_NOT_LISTED; }'; \ |
| 2365 | mp_run gmut gv-insert-accepts-unlisted omega_vcstore VC1S:insert-genesis store-refuses-an-unlisted-bootstrap-record ' if (0) { free(rec); return OMEGA_VCS_GENESIS_NOT_LISTED; }'; \ |
| 2366 | mp_run gmut gv-load-refuses-listed omega_vcstore VC1S:load-genesis store-saves-listed-bootstrap-and-verified-and-loads-them ' if (kind == OMEGA_VCS_ADMISSION_BOOTSTRAP) { rc = OMEGA_VCS_GENESIS_NOT_LISTED; break; }'; \ |
| 2367 | mp_run gmut gv-load-accepts-unlisted omega_vcstore VC1S:load-genesis store-load-refuses-a-file-with-an-unlisted-bootstrap-record ' if (0) { rc = OMEGA_VCS_GENESIS_NOT_LISTED; break; }'; \ |
| 2368 | mp_run gmut gv-gate-refuses-listed omega_resolve VC1R:genesis-gate resolver-lets-a-listed-bootstrap-record-satisfy-an-import-in-the-build-domain ' if (rec->admission_kind == OMEGA_VCS_ADMISSION_BOOTSTRAP) {'; \ |
| 2369 | mp_run gmut gv-gate-accepts-unlisted omega_resolve VC1R:genesis-gate resolver-refuses-an-unlisted-bootstrap-record-even-with-the-list-non-empty ' if (0) {'; \ |
| 2370 | mp_run gmut gv-admit-refuses-listed omega_resolve VC1R:admit-genesis-list admit-genesis-admits-a-listed-member ' if (1) {'; \ |
| 2371 | mp_run gmut gv-admit-accepts-unlisted omega_resolve VC1R:admit-genesis-list admit-genesis-refuses-a-record-that-is-not-a-member ' if (0) {'; mp_wait |
| 2372 | @echo "test-genesis: PASS (listed and unlisted at every door, ASan/UBSan clean, 8 mutants killed)" |
| 2373 | |
| 2374 | # test-program-ir: the canonical program IR (src/omega_program_ir.c). Each VC1I-tagged guard is |
| 2375 | # broken in a copy and the named check must FAIL. |
| 2376 | .PHONY: test-program-ir |
| 2377 | PIR_DIR = $(OUT_DIR)/program-ir-test |
| 2378 | PIR_STACK = src/omega_om_units.c $(filter-out src/omega_program_ir.c,$(RESOLVE_PROGRAM_STACK)) |
| 2379 | test-program-ir: tests/test_omega_program_ir.c src/omega_program_ir.c src/omega_program_ir.h |
| 2380 | @mkdir -p $(PIR_DIR) |
| 2381 | $(CC) $(RESOLVE_FLAGS) -Wno-pedantic -o $(PIR_DIR)/test_omega_program_ir tests/test_omega_program_ir.c src/omega_program_ir.c $(PIR_STACK) |
| 2382 | $(PIR_DIR)/test_omega_program_ir |
| 2383 | $(CC) $(RESOLVE_FLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -o $(PIR_DIR)/test_omega_program_ir_asan tests/test_omega_program_ir.c src/omega_program_ir.c $(PIR_STACK) |
| 2384 | $(PIR_DIR)/test_omega_program_ir_asan |
| 2385 | @set -eu; pmut() { name=$$1; tag=$$2; chk=$$3; repl=$$4; \ |
| 2386 | sed "/VC1I:$$tag/c\\$$repl" src/omega_program_ir.c > $(PIR_DIR)/mut_$$name.c; \ |
| 2387 | if cmp -s src/omega_program_ir.c $(PIR_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2388 | $(CC) $(RESOLVE_FLAGS) -Isrc -o $(PIR_DIR)/mut_$$name tests/test_omega_program_ir.c $(PIR_DIR)/mut_$$name.c $(PIR_STACK); \ |
| 2389 | rc=0; $(PIR_DIR)/mut_$$name > $(PIR_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2390 | if [ $$rc -eq 0 ] || ! grep -q "^FAIL $$chk\$$" $(PIR_DIR)/mut_$$name.out; then echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(PIR_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2391 | echo "mutant $$name: killed by $$chk (exit $$rc)"; }; \ |
| 2392 | pmut ir-tag tag ir-refuses-wrong-tag ' if (!tag) return -1;'; \ |
| 2393 | pmut ir-trailing trailing ir-refuses-trailing-bytes ' if (r.bad) { memset(out, 0, sizeof *out); return -1; }'; \ |
| 2394 | pmut ir-id id ir-refuses-a-type-the-program-id-cannot-take ' (void)0;' |
| 2395 | @set -eu; sed '/VC1I:truncated/c\ if (r->bad) { r->bad = 1; return NULL; }' src/omega_program_ir.c > $(PIR_DIR)/mut_ir-truncated.c; \ |
| 2396 | if cmp -s src/omega_program_ir.c $(PIR_DIR)/mut_ir-truncated.c; then echo "mutant ir-truncated: sed changed nothing"; exit 1; fi; \ |
| 2397 | $(CC) $(RESOLVE_FLAGS) -Isrc -O1 -g -fsanitize=address -o $(PIR_DIR)/mut_ir-truncated tests/test_omega_program_ir.c $(PIR_DIR)/mut_ir-truncated.c $(PIR_STACK); \ |
| 2398 | rc=0; $(PIR_DIR)/mut_ir-truncated > $(PIR_DIR)/mut_ir-truncated.out 2>&1 || rc=$$?; \ |
| 2399 | if [ $$rc -eq 0 ] || ! grep -q 'AddressSanitizer: heap-buffer-overflow' $(PIR_DIR)/mut_ir-truncated.out; then echo "mutant ir-truncated NOT killed (exit $$rc)"; tail -5 $(PIR_DIR)/mut_ir-truncated.out; exit 1; fi; \ |
| 2400 | echo "mutant ir-truncated: killed by AddressSanitizer heap-buffer-overflow on a truncated blob (exit $$rc)" |
| 2401 | @set -eu; sed '/VC1I:steps/c\ if (r.bad) { memset(out, 0, sizeof *out); return -1; }' src/omega_program_ir.c > $(PIR_DIR)/mut_ir-steps.c; \ |
| 2402 | if cmp -s src/omega_program_ir.c $(PIR_DIR)/mut_ir-steps.c; then echo "mutant ir-steps: sed changed nothing"; exit 1; fi; \ |
| 2403 | $(CC) $(RESOLVE_FLAGS) -Isrc -O1 -g -fsanitize=address -o $(PIR_DIR)/mut_ir-steps tests/test_omega_program_ir.c $(PIR_DIR)/mut_ir-steps.c $(PIR_STACK); \ |
| 2404 | rc=0; $(PIR_DIR)/mut_ir-steps > $(PIR_DIR)/mut_ir-steps.out 2>&1 || rc=$$?; \ |
| 2405 | if [ $$rc -eq 0 ] || ! grep -q 'AddressSanitizer: heap-buffer-overflow' $(PIR_DIR)/mut_ir-steps.out; then echo "mutant ir-steps NOT killed (exit $$rc)"; tail -5 $(PIR_DIR)/mut_ir-steps.out; exit 1; fi; \ |
| 2406 | echo "mutant ir-steps: killed by AddressSanitizer heap-buffer-overflow on a huge step count (exit $$rc)" |
| 2407 | @echo "test-program-ir: PASS (round trip, refusals, ASan/UBSan clean, 5 mutants killed)" |
| 2408 | |
| 2409 | # The resolver mutants for the VC1 stage 6 guards (genesis list at admission, mandatory blob store |
| 2410 | # in the build domain, program-id recompute, IR-only digest kind in the build domain), plus the two |
| 2411 | # genesis guards in the store. Same method as test-resolve and test-vcstore: copy ONE source file, |
| 2412 | # break ONE tagged line, require the named check to fail. Run after the two main targets. |
| 2413 | .PHONY: test-resolve-genesis test-vcstore-genesis |
| 2414 | test-resolve-genesis: test-resolve |
| 2415 | @set -eu; build_mutant() { name=$$1; tag=$$2; chk=$$3; repl=$$4; f=src/omega_resolve.c; \ |
| 2416 | sed "/VC1R:$$tag/c\\$$repl" $$f > $(RESOLVE_DIR)/mut_$$name.c; \ |
| 2417 | if cmp -s $$f $(RESOLVE_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2418 | objs=""; for s in $(RESOLVE_SRC); do if [ "$$s" = "$$f" ]; then objs="$$objs $(RESOLVE_DIR)/mut_$$name.c"; else objs="$$objs $(RESOLVE_DIR)/src_objs/$$(basename $$s .c).o"; fi; done; \ |
| 2419 | $(CC) $(RESOLVE_FLAGS) -DOSCV_PATH='"$(OUT_DIR)/compiler/oscv"' -o $(RESOLVE_DIR)/mut_$$name $$objs $(RESOLVE_DIR)/rest_stack.o; \ |
| 2420 | rc=0; $(RESOLVE_DIR)/mut_$$name $$name > $(RESOLVE_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2421 | if [ $$rc -ne 1 ] || ! grep -q "^MUTANT $$name KILLED by $$chk\$$" $(RESOLVE_DIR)/mut_$$name.out; then \ |
| 2422 | echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(RESOLVE_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2423 | echo "mutant $$name: killed by $$chk (exit 1)"; }; \ |
| 2424 | . ./tools/mutpool.sh; mp_init; mp_run build_mutant admit-genesis-list admit-genesis-list admit-genesis-refuses-unlisted-record ' if (0) { /* VC1R:admit-genesis-list */'; \ |
| 2425 | mp_run build_mutant build-needs-blobs build-needs-blobs refuse-build-domain-without-blob-store ' if (0 && !r->fetch_blob) { /* VC1R:build-needs-blobs */'; \ |
| 2426 | mp_run build_mutant program-id program-id refuse-ir-that-does-not-recompute-to-semantic-id ' if (omega_program_ir_recompute_id(bb, bl, pid) != 0) { /* VC1R:program-id */'; \ |
| 2427 | mp_run build_mutant ir-kind ir-kind refuse-source-digest-record-in-build-domain ' } else if (0) { /* VC1R:ir-kind */'; mp_wait |
| 2428 | @echo "test-resolve-genesis: PASS (4 mutants killed)" |
| 2429 | test-vcstore-genesis: test-vcstore |
| 2430 | @set -eu; build_mutant() { name=$$1; tag=$$2; chk=$$3; repl=$$4; \ |
| 2431 | sed "/VC1S:$$tag/c\\$$repl" src/omega_vcstore.c > $(VCSTEST_DIR)/mut_$$name.c; \ |
| 2432 | if cmp -s src/omega_vcstore.c $(VCSTEST_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2433 | $(CC) $(VCSTEST_FLAGS) -o $(VCSTEST_DIR)/mut_$$name $(VCSTEST_DIR)/mut_$$name.c $(VCSTEST_DIR)/stack.o; \ |
| 2434 | rc=0; $(VCSTEST_DIR)/mut_$$name $$name > $(VCSTEST_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2435 | if [ $$rc -ne 1 ] || ! grep -q "^MUTANT $$name KILLED by $$chk\$$" $(VCSTEST_DIR)/mut_$$name.out; then \ |
| 2436 | echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(VCSTEST_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2437 | echo "mutant $$name: killed by $$chk (exit 1)"; }; \ |
| 2438 | . ./tools/mutpool.sh; mp_init; mp_run build_mutant insert-genesis insert-genesis insert-bootstrap-unlisted-refused ' if (0) { free(rec); return OMEGA_VCS_GENESIS_NOT_LISTED; }'; \ |
| 2439 | mp_run build_mutant load-genesis load-genesis load-bootstrap-unlisted-refused ' if (0) { rc = OMEGA_VCS_GENESIS_NOT_LISTED; break; }'; mp_wait |
| 2440 | @echo "test-vcstore-genesis: PASS (2 mutants killed)" |
| 2441 | |
| 2442 | # VC1 stage 6: library admissions in Crumbline and in omegatool go through the Verified Crumb bridge |
| 2443 | # (src/omega_vc_bridge.c), so both link the bridge, the resolver, the receipt reader and the store. |
| 2444 | # `+=` at the end is read by the recipes above (they use the variables lazily); the extra |
| 2445 | # prerequisite rules below make sure the new objects are built first. |
| 2446 | VC_BRIDGE_CORE = omega_program_ir omega_vc_bridge omega_resolve omega_receipt omega_blake3 omega_vcstore |
| 2447 | VC_BRIDGE_OBJS = $(addprefix $(OUT_DIR)/,$(addsuffix .o,$(VC_BRIDGE_CORE))) |
| 2448 | LEARNER_CORE += $(VC_BRIDGE_CORE) |
| 2449 | $(LEARNER): $(VC_BRIDGE_OBJS) |
| 2450 | SRCS += $(patsubst %,src/%.c,$(VC_BRIDGE_CORE)) |
| 2451 | $(TARGET): $(VC_BRIDGE_OBJS) |
| 2452 | -include $(VC_BRIDGE_OBJS:.o=.d) |
| 2453 | |
| 2454 | # test-genesis-real: the REAL VC-GENESIS-1 (src/omega_genesis.h) pinned against its audit record |
| 2455 | # docs/osc/VC-GENESIS-1.md. Two mutants of the real header must be caught. |
| 2456 | .PHONY: test-genesis-real |
| 2457 | GENREAL_DIR = $(OUT_DIR)/genesis-real-test |
| 2458 | GENREAL_STACK = src/omega_om_units.c $(RESOLVE_PROGRAM_STACK) |
| 2459 | test-genesis-real: tests/test_omega_genesis.c src/omega_genesis.h docs/osc/VC-GENESIS-1.md tests/vc_fixture.h |
| 2460 | @mkdir -p $(GENREAL_DIR) |
| 2461 | $(CC) $(RESOLVE_FLAGS) -o $(GENREAL_DIR)/test_omega_genesis tests/test_omega_genesis.c $(GENREAL_STACK) |
| 2462 | $(GENREAL_DIR)/test_omega_genesis |
| 2463 | @set -eu; gmut() { name=$$1; chk=$$2; expr=$$3; \ |
| 2464 | mkdir -p $(GENREAL_DIR)/$$name; sed "$$expr" src/omega_genesis.h > $(GENREAL_DIR)/$$name/omega_genesis.h; \ |
| 2465 | if cmp -s src/omega_genesis.h $(GENREAL_DIR)/$$name/omega_genesis.h; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2466 | $(CC) -I$(GENREAL_DIR)/$$name $(RESOLVE_FLAGS) -o $(GENREAL_DIR)/mut_$$name tests/test_omega_genesis.c $(GENREAL_STACK); \ |
| 2467 | rc=0; $(GENREAL_DIR)/mut_$$name > $(GENREAL_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2468 | if [ $$rc -ne 1 ] || ! grep -q "^FAIL $$chk\$$" $(GENREAL_DIR)/mut_$$name.out; then echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(GENREAL_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2469 | echo "mutant $$name: killed by $$chk (exit 1)"; }; \ |
| 2470 | gmut gr-count-one member-count-is-the-pinned-audit-result 's|^#define OMEGA_GENESIS_1_COUNT 0u|#define OMEGA_GENESIS_1_COUNT 1u|'; \ |
| 2471 | gmut gr-contains-everything no-program-we-know-and-no-junk-id-is-a-member 's|if (!id \|\| memcmp(id, zero, 32) == 0) return 0;|(void)zero; return 1;|'; \ |
| 2472 | gmut gr-name-changed set-name-is-vc-genesis-1 's|#define OMEGA_GENESIS_SET_NAME "VC-GENESIS-1"|#define OMEGA_GENESIS_SET_NAME "VC-GENESIS-2"|' |
| 2473 | @echo "test-genesis-real: PASS (pinned set and audit record agree, 3 mutants killed)" |
| 2474 | |
| 2475 | # test-vc-bridge (VC1 stage 6 fix): the bridge verifies and recomputes the id itself, and what it |
| 2476 | # mints cannot satisfy a build import. Each VC1B-tagged guard is broken in a copy and the named |
| 2477 | # check must FAIL. The tag lines are single lines, so sed replaces whole lines. |
| 2478 | .PHONY: test-vc-bridge |
| 2479 | VCB_DIR = $(OUT_DIR)/vc-bridge-test |
| 2480 | VCB_STACK = src/omega_library.c src/omega_receipt.c src/omega_blake3.c src/omega_om_units.c src/omega_vcstore.c $(RESOLVE_PROGRAM_STACK) |
| 2481 | test-vc-bridge: tests/test_omega_vc_bridge.c src/omega_vc_bridge.c src/omega_vc_bridge.h src/omega_resolve.c src/omega_resolve.h |
| 2482 | @mkdir -p $(VCB_DIR) |
| 2483 | $(CC) $(RESOLVE_FLAGS) -o $(VCB_DIR)/test_omega_vc_bridge tests/test_omega_vc_bridge.c src/omega_vc_bridge.c src/omega_resolve.c $(VCB_STACK) |
| 2484 | $(VCB_DIR)/test_omega_vc_bridge |
| 2485 | $(CC) $(RESOLVE_FLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -o $(VCB_DIR)/test_omega_vc_bridge_asan tests/test_omega_vc_bridge.c src/omega_vc_bridge.c src/omega_resolve.c $(VCB_STACK) |
| 2486 | $(VCB_DIR)/test_omega_vc_bridge_asan |
| 2487 | @set -eu; rm -rf $(VCB_DIR)/objs $(VCB_DIR)/stack.o $(VCB_DIR)/omega_vc_bridge.o $(VCB_DIR)/omega_resolve.o; mkdir -p $(VCB_DIR)/objs; pids=""; \ |
| 2488 | for c in tests/test_omega_vc_bridge.c $(VCB_STACK); do \ |
| 2489 | o=$(VCB_DIR)/objs/$$(echo $$c | tr '/' '_').o; \ |
| 2490 | $(CC) $(RESOLVE_FLAGS) -c -o $$o $$c & pids="$$pids $$!"; \ |
| 2491 | done; \ |
| 2492 | $(CC) $(RESOLVE_FLAGS) -c -o $(VCB_DIR)/omega_vc_bridge.o src/omega_vc_bridge.c & pids="$$pids $$!"; \ |
| 2493 | $(CC) $(RESOLVE_FLAGS) -c -o $(VCB_DIR)/omega_resolve.o src/omega_resolve.c & pids="$$pids $$!"; \ |
| 2494 | for p in $$pids; do wait $$p; done; ld -r -o $(VCB_DIR)/stack.o $(VCB_DIR)/objs/*.o; \ |
| 2495 | vmut() { name=$$1; which=$$2; chk=$$3; repl=$$4; \ |
| 2496 | sed "/VC1B:$$name/c\\$$repl" src/$$which.c > $(VCB_DIR)/mut_$$name.c; \ |
| 2497 | if cmp -s src/$$which.c $(VCB_DIR)/mut_$$name.c; then echo "mutant $$name: sed changed nothing"; exit 1; fi; \ |
| 2498 | if [ $$which = omega_vc_bridge ]; then a=$(VCB_DIR)/mut_$$name.c; b=$(VCB_DIR)/omega_resolve.o; else a=$(VCB_DIR)/omega_vc_bridge.o; b=$(VCB_DIR)/mut_$$name.c; fi; \ |
| 2499 | $(CC) $(RESOLVE_FLAGS) -o $(VCB_DIR)/mut_$$name $$a $$b $(VCB_DIR)/stack.o; \ |
| 2500 | rc=0; $(VCB_DIR)/mut_$$name > $(VCB_DIR)/mut_$$name.out 2>&1 || rc=$$?; \ |
| 2501 | if [ $$rc -eq 0 ] || ! grep -q "^FAIL $$chk\$$" $(VCB_DIR)/mut_$$name.out; then echo "mutant $$name NOT killed by $$chk (exit $$rc)"; tail -5 $(VCB_DIR)/mut_$$name.out; exit 1; fi; \ |
| 2502 | echo "mutant $$name: killed by $$chk (exit $$rc)"; }; \ |
| 2503 | . ./tools/mutpool.sh; mp_init; \ |
| 2504 | mp_run vmut verify omega_vc_bridge refuse-corrupted-program-even-with-flags-set ' (void)rep;'; \ |
| 2505 | mp_run vmut id omega_vc_bridge refuse-forged-program-id-at-admit ' (void)rid_;'; \ |
| 2506 | mp_run vmut cap omega_vc_bridge refuse-bridge-record-in-build-domain ' ou32(&o, 0);'; \ |
| 2507 | mp_run vmut build-refuses-selfminted omega_resolve refuse-bridge-record-in-build-domain ' (void)lists_selfminted_cap;'; mp_wait |
| 2508 | @echo "test-vc-bridge: PASS (bridge verifies and recomputes the id, bridge records refused in build, ASan/UBSan clean, 4 mutants killed)" |
| 2509 | |
| 2510 | # FB-1 cut 1: native (no CUDA) matmul entry point for the inference stack. |
| 2511 | # libomega_gpu.a = everything the tool links except its main; the Rust FFI crate |
| 2512 | # (cut 2) links it. test-gpu-matmul-api runs the host-only refusals; the chip |
| 2513 | # sweep is `./build/gpu_matmul_api_test --out receipt.json` through the heavy queue. |
| 2514 | .PHONY: libomega_gpu test-gpu-matmul-api |
| 2515 | # The two gate-runner objects (omegatool's M17/M18/M19 and World gates) are NOT part of the |
| 2516 | # library: nothing in the library or in the Rust FFI crate calls them (checked with nm), and |
| 2517 | # they compile the physics checkout path into the object (-DOMEGA_PHYSICS_DIR), which made the |
| 2518 | # archive digest depend on where physics was checked out. Without them libomega_gpu.a is |
| 2519 | # byte-identical for any PHYSICS_DIR and any omega checkout directory. |
| 2520 | GPU_API_OBJS = $(filter-out $(OUT_DIR)/omegatool.o $(OUT_DIR)/omega_blackwell_gates.o $(OUT_DIR)/omega_world_gates.o $(OUT_DIR)/omega_clean_clone.o,$(OBJS)) |
| 2521 | GPU_API_TEST = $(OUT_DIR)/gpu_matmul_api_test |
| 2522 | GPU_R4_RECEIPT = $(OUT_DIR)/gpu_matmul_r4_receipt |
| 2523 | $(OUT_DIR)/libomega_gpu.a: $(GPU_API_OBJS) | check-physics-lock |
| 2524 | ar rcs $@ $(GPU_API_OBJS) |
| 2525 | libomega_gpu: $(OUT_DIR)/libomega_gpu.a |
| 2526 | # omega-mv#471: the archive must link without -lm (omegatool, the Rust FFI crate and Aienux link it bare). Fails if any symbol |
| 2527 | # the archive leaves undefined is one libm exports (the export list is read from this toolchain's libm.so.6). |
| 2528 | .PHONY: test-gpu-libm-free |
| 2529 | test-gpu-libm-free: $(OUT_DIR)/libomega_gpu.a |
| 2530 | @export LC_ALL=C; libm="$$($(CC) -print-file-name=libm.so.6)"; test -f "$$libm" || { echo "libm-free: no libm.so.6 from $(CC)"; exit 1; }; \ |
| 2531 | nm -D --defined-only "$$libm" | awk '{print $$3}' | sed 's/@.*//' | sort -u > $(OUT_DIR)/libm.syms; \ |
| 2532 | nm -u $(OUT_DIR)/libomega_gpu.a | awk '{print $$2}' | sort -u | comm -12 - $(OUT_DIR)/libm.syms > $(OUT_DIR)/libm-refs.txt; \ |
| 2533 | n=$$(wc -l < $(OUT_DIR)/libm-refs.txt); echo "libm-free: $$n libm symbols referenced by libomega_gpu.a ($$(wc -l < $(OUT_DIR)/libm.syms) libm exports checked)"; \ |
| 2534 | if [ "$$n" -ne 0 ]; then sed 's/^/ /' $(OUT_DIR)/libm-refs.txt; echo "FAIL: libomega_gpu.a is not libm-free"; exit 1; fi; echo "PASS: libomega_gpu.a is libm-free" |
| 2535 | $(GPU_API_TEST): tests/gpu_matmul_api_test.c src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a |
| 2536 | $(CC) $(CFLAGS) -o $@ tests/gpu_matmul_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2537 | test-gpu-matmul-api: $(GPU_API_TEST) $(GPU_R4_RECEIPT) |
| 2538 | ./$(GPU_API_TEST) --host-only |
| 2539 | ./$(GPU_R4_RECEIPT) --host-only |
| 2540 | |
| 2541 | # omega #473 R4: the sealed CTA-budget receipt (full-output comparison at the training shapes, |
| 2542 | # every budget, repeats, I42 stale-output check, negative controls). Host-only self-test above; the |
| 2543 | # chip receipt is `quietlock run -- ./build/gpu_matmul_r4_receipt --out receipt.json`. |
| 2544 | $(GPU_R4_RECEIPT): tests/gpu_matmul_r4_receipt.c src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a |
| 2545 | $(CC) $(CFLAGS) -o $@ tests/gpu_matmul_r4_receipt.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2546 | |
| 2547 | # FB-1 cut 4: native rmsnorm / rope / swiglu (+ EX2 and shared-exchange probes). |
| 2548 | # test-gpu-elementwise is host-only (refusals, codegen, word fixtures, nvdisasm |
| 2549 | # listing); the chip gate is `./build/gpu_elementwise_test --out receipt.json` |
| 2550 | # through the heavy queue. -ffp-contract=off keeps the f32 oracle free of FMA. |
| 2551 | .PHONY: test-gpu-elementwise |
| 2552 | GPU_EW_TEST = $(OUT_DIR)/gpu_elementwise_test |
| 2553 | $(GPU_EW_TEST): tests/gpu_elementwise_test.c tests/bw_mufu_ftz.h src/omega_gpu_elementwise_api.h $(OUT_DIR)/libomega_gpu.a |
| 2554 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_elementwise_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2555 | test-gpu-elementwise: $(GPU_EW_TEST) |
| 2556 | ./$(GPU_EW_TEST) --host-only |
| 2557 | |
| 2558 | # omega-mv#545: every opcode the encoder accepts carries the emitter's control word (stall, scoreboards, wait mask) |
| 2559 | # into instruction word 3. Host only; the golden-word checks compare words 0..2, so this is the check for word 3. |
| 2560 | .PHONY: test-bw-encode-control |
| 2561 | BW_ENCODE_CONTROL_TEST = $(OUT_DIR)/bw_encode_control_test |
| 2562 | $(BW_ENCODE_CONTROL_TEST): tests/bw_encode_control_test.c src/omega_blackwell_codegen.h $(OUT_DIR)/libomega_gpu.a |
| 2563 | $(CC) $(CFLAGS) -o $@ tests/bw_encode_control_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2564 | test-bw-encode-control: $(BW_ENCODE_CONTROL_TEST) |
| 2565 | ./$(BW_ENCODE_CONTROL_TEST) |
| 2566 | |
| 2567 | # omega #308: structured warp reconvergence (BSSY/BSYNC regions). test-gpu-reconv is |
| 2568 | # host-only (encoder goldens, region bookkeeping, refusals, nvdisasm listing, every probe |
| 2569 | # kernel through the SIMT warp simulator tests/bw_warp_sim.h against the oracle, mutation |
| 2570 | # controls); the chip gate is tools/run_gpu_reconv_chip.sh. |
| 2571 | .PHONY: test-gpu-reconv |
| 2572 | GPU_RECONV_TEST = $(OUT_DIR)/gpu_reconv_test |
| 2573 | $(GPU_RECONV_TEST): tests/gpu_reconv_test.c tests/bw_warp_sim.h src/omega_gpu_elementwise_api.h src/omega_bw_reconv.h $(OUT_DIR)/libomega_gpu.a |
| 2574 | $(CC) $(CFLAGS) -Itests -o $@ tests/gpu_reconv_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2575 | test-gpu-reconv: $(GPU_RECONV_TEST) |
| 2576 | ./$(GPU_RECONV_TEST) --host-only |
| 2577 | |
| 2578 | # omega #492: IMAD.HI.U32 with a register Rc. The chip reads Rc as a 64-bit register pair (nvcc 13.0 |
| 2579 | # sm_121 oracle, evidence/IMADHI-RC-ORACLE-nvcc13.0-20261016; chip probe pending), so the four warp |
| 2580 | # simulators model an even Rc as the pair Rc+1:Rc and refuse an odd Rc, and replay the PR #487 |
| 2581 | # odd-column pack (it must come out wrong, as on the chip). One binary per simulator header. |
| 2582 | .PHONY: test-gpu-imadhi-rc |
| 2583 | GPU_IMADHI_SIMS = bw_warp_sim bw_warp_sim_tc bw_warp_sim_k bw_warp_sim_pa |
| 2584 | GPU_IMADHI_TESTS = $(GPU_IMADHI_SIMS:%=$(OUT_DIR)/gpu_imadhi_rc_test_%) |
| 2585 | $(OUT_DIR)/gpu_imadhi_rc_test_%: tests/gpu_imadhi_rc_test.c tests/%.h $(OUT_DIR)/libomega_gpu.a |
| 2586 | $(CC) $(CFLAGS) -Itests -DSIM_HEADER='"$*.h"' -o $@ tests/gpu_imadhi_rc_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2587 | test-gpu-imadhi-rc: $(GPU_IMADHI_TESTS) |
| 2588 | @for t in $(GPU_IMADHI_TESTS); do ./$$t || exit 1; done |
| 2589 | |
| 2590 | # FB-1 cut 5: native gqa_attention (f32 KV) and paged_attention (bf16 KV, + batch). |
| 2591 | # head_dim 128 (Qwen3-4B): the same battery with --hd 128 through both host simulators; GB10 parity PASS 126/0 |
| 2592 | # at 7dd92dc (evidence/FB1-CUT5-HD128-7dd92dc). |
| 2593 | # test-gpu-attention runs host-only (refusals, codegen, nvdisasm listing) and then the |
| 2594 | # whole parity battery through the host IR simulator (--sim, no chip); the chip |
| 2595 | # gate is `./build/gpu_attention_test --out receipt.json` through the heavy queue |
| 2596 | # (tools/run_gpu_attention_chip.sh). -ffp-contract=off keeps the oracle free of FMA. |
| 2597 | .PHONY: test-gpu-attention |
| 2598 | GPU_ATTN_TEST = $(OUT_DIR)/gpu_attention_test |
| 2599 | $(GPU_ATTN_TEST): tests/gpu_attention_test.c tests/bw_warp_sim.h src/omega_gpu_attention_api.h $(OUT_DIR)/libomega_gpu.a |
| 2600 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_attention_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2601 | test-gpu-attention: $(GPU_ATTN_TEST) |
| 2602 | ./$(GPU_ATTN_TEST) --host-only |
| 2603 | ./$(GPU_ATTN_TEST) --sim |
| 2604 | ./$(GPU_ATTN_TEST) --sweep --sim --out $(OUT_DIR)/gpu_attention_sweep_sim.json |
| 2605 | ./$(GPU_ATTN_TEST) --hd 128 --host-only |
| 2606 | ./$(GPU_ATTN_TEST) --hd 128 --sim |
| 2607 | ./$(GPU_ATTN_TEST) --hd 128 --divergent --sim |
| 2608 | |
| 2609 | # FB-1 cut 4b: fresh-process device-open probe (flake investigation, tools/probe_gpu_open.sh) |
| 2610 | $(OUT_DIR)/gpu_session_probe: tests/gpu_session_probe.c src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a |
| 2611 | $(CC) $(CFLAGS) -o $@ tests/gpu_session_probe.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2612 | |
| 2613 | # OWN-30B cut 2: window matmul gate (tests/gpu_moe_window_test.c). test-gpu-moe-window runs the host-only |
| 2614 | # refusals and the packed-window byte rule; the chip gate is `./build/gpu_moe_window_test --out r.json` |
| 2615 | # under /tmp/aien-gb10.lock (equivalence to the whole-tensor columns, mutants, window timing). |
| 2616 | GPU_MOE_TEST = $(OUT_DIR)/gpu_moe_window_test |
| 2617 | $(GPU_MOE_TEST): tests/gpu_moe_window_test.c src/omega_gpu_moe_api.h src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a |
| 2618 | $(CC) $(CFLAGS) -o $@ tests/gpu_moe_window_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2619 | .PHONY: test-gpu-moe-window |
| 2620 | test-gpu-moe-window: $(GPU_MOE_TEST) |
| 2621 | ./$(GPU_MOE_TEST) --host-only |
| 2622 | |
| 2623 | # OWN-30B Cut 6 / Cut 5 (2026-10-13): FP8 e4m3 block-scaled GEMV (omega_gpu_fp8_api.h). test-gpu-fp8 is host-only |
| 2624 | # (exhaustive conversion, pack refusals, codegen budgets, nvdisasm listing) then the warp-simulator battery |
| 2625 | # (parity, grouped experts, mutants, both fragment orders); the chip gate is tools/run_gpu_fp8_chip.sh. |
| 2626 | # -ffp-contract=off keeps the double oracle free of FMA. |
| 2627 | .PHONY: test-gpu-fp8 |
| 2628 | GPU_FP8_TEST = $(OUT_DIR)/gpu_fp8_api_test |
| 2629 | $(GPU_FP8_TEST): tests/gpu_fp8_api_test.c tests/bw_warp_sim.h src/omega_gpu_fp8_api.h src/omega_blackwell_codegen_moe.h $(OUT_DIR)/libomega_gpu.a |
| 2630 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_fp8_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2631 | test-gpu-fp8: $(GPU_FP8_TEST) |
| 2632 | ./$(GPU_FP8_TEST) --host-only |
| 2633 | AIEN_OMEGA_FP8_COAL=0 ./$(GPU_FP8_TEST) --coal-default |
| 2634 | AIEN_OMEGA_FP8_DEEP=0 ./$(GPU_FP8_TEST) --deep-default |
| 2635 | ./$(GPU_FP8_TEST) --sim |
| 2636 | |
| 2637 | # omega #457 (2026-10-15): host rewrite of a GPU-cached buffer must be visible to the next launch. Chip only; the gate |
| 2638 | # is tools/run_gpu_l2_stale_chip.sh. |
| 2639 | GPU_L2_STALE_TEST = $(OUT_DIR)/gpu_l2_stale_test |
| 2640 | $(GPU_L2_STALE_TEST): tests/gpu_l2_stale_test.c src/omega_gpu_fp8_api.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a |
| 2641 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_stale_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2642 | |
| 2643 | # OWN-30B cut 8 (2026-10-13): one-launch decode attention (omega_gpu_decode_attn_api.h). test-gpu-decode-attn is |
| 2644 | # host-only + simulator; the chip gate is tools/run_gpu_decode_attn_chip.sh. |
| 2645 | .PHONY: test-gpu-decode-attn |
| 2646 | GPU_DATTN_TEST = $(OUT_DIR)/gpu_decode_attn_test |
| 2647 | $(GPU_DATTN_TEST): tests/gpu_decode_attn_test.c tests/bw_warp_sim_k.h src/omega_gpu_decode_attn_api.h src/omega_blackwell_codegen_attn.h $(OUT_DIR)/libomega_gpu.a |
| 2648 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2649 | test-gpu-decode-attn: $(GPU_DATTN_TEST) test-gpu-decode-attn-maxpos |
| 2650 | $(GPU_DATTN_TEST) --host-only |
| 2651 | $(GPU_DATTN_TEST) --sim |
| 2652 | |
| 2653 | # omega #535: the 128k position bound (OMEGA_GPU_DATTN_MAX_POS 131072) on a fake platform, no device. A sanitized copy |
| 2654 | # of src/omega_gpu_decode_attn_api.c is linked ahead of the library, so cache writes, the RoPE fill and launch staging |
| 2655 | # are ASan/UBSan checked against the fake's exact-size buffers. Each mutant breaks one bound in a copy of that file; |
| 2656 | # the test must FAIL on it. |
| 2657 | .PHONY: test-gpu-decode-attn-maxpos |
| 2658 | GPU_DATTN_MAXPOS_TEST = $(OUT_DIR)/test_omega_gpu_decode_attn_maxpos |
| 2659 | GPU_DATTN_MAXPOS_MUT = $(OUT_DIR)/dattn_maxpos_mut |
| 2660 | GPU_DATTN_MAXPOS_SAN = -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all |
| 2661 | $(GPU_DATTN_MAXPOS_TEST): tests/test_omega_gpu_decode_attn_maxpos.c src/omega_gpu_decode_attn_api.c src/omega_gpu_decode_attn_api.h src/omega_blackwell_codegen_attn.h $(OUT_DIR)/libomega_gpu.a |
| 2662 | $(CC) $(filter-out -MMD -MP -O2,$(CFLAGS)) $(GPU_DATTN_MAXPOS_SAN) -o $@ tests/test_omega_gpu_decode_attn_maxpos.c \ |
| 2663 | src/omega_gpu_decode_attn_api.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2664 | test-gpu-decode-attn-maxpos: $(GPU_DATTN_MAXPOS_TEST) |
| 2665 | $(GPU_DATTN_MAXPOS_TEST) |
| 2666 | @mkdir -p $(GPU_DATTN_MAXPOS_MUT) |
| 2667 | @set -e; \ |
| 2668 | tmut() { name=$$1; script=$$2; \ |
| 2669 | sed -e "$$script" src/omega_gpu_decode_attn_api.c > $(GPU_DATTN_MAXPOS_MUT)/$$name.c; \ |
| 2670 | if cmp -s src/omega_gpu_decode_attn_api.c $(GPU_DATTN_MAXPOS_MUT)/$$name.c; then echo "mutant $$name: pattern not found"; exit 1; fi; \ |
| 2671 | $(CC) $(filter-out -MMD -MP -O2,$(CFLAGS)) $(GPU_DATTN_MAXPOS_SAN) -o $(GPU_DATTN_MAXPOS_MUT)/$$name \ |
| 2672 | tests/test_omega_gpu_decode_attn_maxpos.c $(GPU_DATTN_MAXPOS_MUT)/$$name.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm; \ |
| 2673 | if $(GPU_DATTN_MAXPOS_MUT)/$$name > $(GPU_DATTN_MAXPOS_MUT)/$$name.log 2>&1; then echo "mutant $$name SURVIVED"; exit 1; fi; \ |
| 2674 | if ! grep -q '^FAIL ' $(GPU_DATTN_MAXPOS_MUT)/$$name.log; then \ |
| 2675 | echo "mutant $$name: no FAIL case (did not run?)"; cat $(GPU_DATTN_MAXPOS_MUT)/$$name.log; exit 1; fi; \ |
| 2676 | echo "mutant $$name killed"; }; \ |
| 2677 | tmut cap-off-by-one 's/max_pos > OMEGA_GPU_DATTN_MAX_POS ||/max_pos >= OMEGA_GPU_DATTN_MAX_POS ||/'; \ |
| 2678 | tmut cap-one-chunk-over 's/max_pos > OMEGA_GPU_DATTN_MAX_POS ||/max_pos > OMEGA_GPU_DATTN_MAX_POS + 256u ||/'; \ |
| 2679 | tmut write-pos-bound 's/kv_head >= 4 || pos >= c->max_pos || count == 0/kv_head >= 4 || count == 0/'; \ |
| 2680 | tmut write-count-bound 's/count > c->max_pos - pos ||/count > c->max_pos - pos + 1u ||/'; \ |
| 2681 | tmut read-pos-bound 's/kv_head >= 4 || pos >= c->max_pos || !k/kv_head >= 4 || pos > c->max_pos || !k/'; \ |
| 2682 | tmut step-pos-bound 's/layer >= c->layers || pos >= c->max_pos || (rec/layer >= c->layers || pos > c->max_pos || (rec/'; \ |
| 2683 | tmut rope-table-short 's/(size_t)max_pos \* OMEGA_DATTN_ROPE_ROW_BYTES/(size_t)(max_pos - 8u) * OMEGA_DATTN_ROPE_ROW_BYTES/'; \ |
| 2684 | echo "test-gpu-decode-attn-maxpos: 7 of 7 mutants killed" |
| 2685 | |
| 2686 | # Qwen3.8-27B (omega-mv#544, 2026-10-18): decode attention head_dim 256, 24 q / 4 kv heads, partial RoPE by permutation |
| 2687 | # (omega_gpu_decode_attn256_api.h). test-gpu-decode-attn256 is host-only + simulator; the chip gate is |
| 2688 | # tools/run_gpu_decode_attn256_chip.sh. |
| 2689 | .PHONY: test-gpu-decode-attn256 |
| 2690 | GPU_DATTN256_TEST = $(OUT_DIR)/gpu_decode_attn256_test |
| 2691 | $(GPU_DATTN256_TEST): tests/gpu_decode_attn256_test.c tests/bw_warp_sim_k.h src/omega_gpu_decode_attn256_api.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a |
| 2692 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn256_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2693 | test-gpu-decode-attn256: $(GPU_DATTN256_TEST) |
| 2694 | $(GPU_DATTN256_TEST) --host-only |
| 2695 | $(GPU_DATTN256_TEST) --sim |
| 2696 | |
| 2697 | # OWN-30B cut 8 item 2 (2026-10-13): one-launch MoE router (omega_gpu_router_api.h). test-gpu-router is host-only |
| 2698 | # (oracle, budgets) plus the warp simulator; the chip gate is tools/run_gpu_router_chip.sh under the GB10 lock. |
| 2699 | .PHONY: test-gpu-router |
| 2700 | GPU_ROUTER_TEST = $(OUT_DIR)/gpu_router_test |
| 2701 | $(GPU_ROUTER_TEST): tests/gpu_router_test.c tests/bw_warp_sim_k.h src/omega_gpu_router_api.h src/omega_blackwell_codegen_router.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a |
| 2702 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_router_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2703 | test-gpu-router: $(GPU_ROUTER_TEST) |
| 2704 | ./$(GPU_ROUTER_TEST) --host-only |
| 2705 | ./$(GPU_ROUTER_TEST) --sim |
| 2706 | |
| 2707 | # Qwen3.8-27B Gated DeltaNet decode step (omega#542, 2026-10-18): one launch per layer (omega_gpu_gdn_api.h). |
| 2708 | # test-gpu-gdn is host-only plus the warp simulator over the whole grid; the chip run is ./build/gpu_gdn_test under the GB10 lock. |
| 2709 | .PHONY: test-gpu-gdn |
| 2710 | GPU_GDN_TEST = $(OUT_DIR)/gpu_gdn_test |
| 2711 | $(GPU_GDN_TEST): tests/gpu_gdn_test.c tests/bw_warp_sim_k.h src/omega_gpu_gdn_api.h src/omega_blackwell_codegen_gdn.h $(OUT_DIR)/libomega_gpu.a |
| 2712 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2713 | # L369: the multi-token GDN decode == T decode steps bit for bit (--sim: simulator; default: the chip, under the GB10 lock) |
| 2714 | GPU_GDN_MULTI_TEST = $(OUT_DIR)/gpu_gdn_multi_test |
| 2715 | $(GPU_GDN_MULTI_TEST): tests/gpu_gdn_multi_test.c tests/bw_warp_sim_k.h src/omega_gpu_gdn_api.h src/omega_blackwell_codegen_gdn.h $(OUT_DIR)/libomega_gpu.a |
| 2716 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_multi_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2717 | GPU_DATTN256_MULTI_TEST = $(OUT_DIR)/gpu_dattn256_multi_test |
| 2718 | $(GPU_DATTN256_MULTI_TEST): tests/gpu_dattn256_multi_test.c src/omega_gpu_decode_attn256_api.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a |
| 2719 | $(CC) $(CFLAGS) -Itests -o $@ tests/gpu_dattn256_multi_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2720 | test-gpu-gdn: $(GPU_GDN_TEST) |
| 2721 | ./$(GPU_GDN_TEST) --host-only |
| 2722 | ./$(GPU_GDN_TEST) --sim |
| 2723 | |
| 2724 | # OWN-30B (2026-10-13): bf16 streaming GEMV, the lm_head (omega_gpu_bf16_gemv_api.h). test-gpu-bf16-gemv is host-only |
| 2725 | # (emulation, budgets) plus the warp simulator (bit-identical to the host f32 emulation, mutants 1-3 caught); the chip |
| 2726 | # gate is tools/run_gpu_bf16_gemv_chip.sh under the GB10 lock. |
| 2727 | .PHONY: test-gpu-bf16-gemv |
| 2728 | GPU_BF16_TEST = $(OUT_DIR)/gpu_bf16_gemv_test |
| 2729 | $(GPU_BF16_TEST): tests/gpu_bf16_gemv_test.c tests/bw_warp_sim_k.h src/omega_gpu_bf16_gemv_api.h src/omega_blackwell_codegen_bf16.h $(OUT_DIR)/libomega_gpu.a |
| 2730 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_bf16_gemv_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2731 | test-gpu-bf16-gemv: $(GPU_BF16_TEST) |
| 2732 | $(GPU_BF16_TEST) --host-only |
| 2733 | $(GPU_BF16_TEST) --sim |
| 2734 | |
| 2735 | # Ternary engine T0 (2026-10-15): KT1 W2A8 ternary GEMV (omega_gpu_tern_api.h). test-gpu-tern is host-only (word |
| 2736 | # arithmetic, packing, segments, budgets, refusals) plus the warp simulator (bit-equal to oma_rz_oracle, f32 segment |
| 2737 | # epilogue, three warp orders, mutants 1 to 5 caught); the chip gate is tools/run_gpu_tern_chip.sh with the quiet flag held. |
| 2738 | .PHONY: test-gpu-tern |
| 2739 | GPU_TERN_TEST = $(OUT_DIR)/gpu_tern_test |
| 2740 | $(GPU_TERN_TEST): tests/gpu_tern_test.c tests/bw_warp_sim_k.h src/omega_gpu_tern_api.h src/omega_blackwell_codegen_tern.h $(OMA_RZ_SRCS) $(OMA_RZ_HDRS) $(OUT_DIR)/libomega_gpu.a |
| 2741 | $(CC) $(CFLAGS) -ffp-contract=off $(OMA_RZ_ARCH) -Itests -o $@ tests/gpu_tern_test.c $(OMA_RZ_SRCS) $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2742 | test-gpu-tern: $(GPU_TERN_TEST) |
| 2743 | $(GPU_TERN_TEST) --host-only |
| 2744 | $(GPU_TERN_TEST) --sim |
| 2745 | |
| 2746 | # OWN-30B (2026-10-13): report-only lm_head study, fp8 vs bf16 argmax agreement on the real checkpoint (chip, GB10 lock). |
| 2747 | $(OUT_DIR)/gpu_lmhead_fp8_study: tests/gpu_lmhead_fp8_study.c src/omega_gpu_bf16_gemv_api.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a |
| 2748 | $(CC) $(CFLAGS) -O2 -o $@ tests/gpu_lmhead_fp8_study.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2749 | |
| 2750 | # OWN-30B prefill (2026-10-13): FP8 grouped GEMM (omega_gpu_fp8gemm_api.h). test-gpu-fp8gemm is host-only (emulation, |
| 2751 | # permutation, budgets) plus the warp simulator (512 threads); the chip gate is tools/run_gpu_fp8gemm_chip.sh under the GB10 lock. |
| 2752 | .PHONY: test-gpu-fp8gemm |
| 2753 | GPU_FP8GEMM_TEST = $(OUT_DIR)/gpu_fp8gemm_test |
| 2754 | $(GPU_FP8GEMM_TEST): tests/gpu_fp8gemm_test.c tests/bw_warp_sim_k.h src/omega_gpu_fp8gemm_api.h src/omega_blackwell_codegen_gemm.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a |
| 2755 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_fp8gemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2756 | |
| 2757 | # Qwen3.6-35B (sc L306 / L312) host-only simulator checks of the decode glue kernels, and the codegen hash pin |
| 2758 | Q36_DEC_SIM_TEST = $(OUT_DIR)/q36_dec_sim_test |
| 2759 | $(Q36_DEC_SIM_TEST): tests/q36_dec_sim_test.c tests/bw_warp_sim_k.h src/omega_blackwell_codegen_dec.h $(OUT_DIR)/libomega_gpu.a |
| 2760 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/q36_dec_sim_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2761 | Q36_CODEGEN_HASH = $(OUT_DIR)/q36_codegen_hash |
| 2762 | $(Q36_CODEGEN_HASH): tests/q36_codegen_hash.c $(OUT_DIR)/libomega_gpu.a |
| 2763 | $(CC) $(CFLAGS) -Itests -o $@ tests/q36_codegen_hash.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2764 | test-gpu-fp8gemm: $(GPU_FP8GEMM_TEST) |
| 2765 | $(GPU_FP8GEMM_TEST) --host-only |
| 2766 | $(GPU_FP8GEMM_TEST) --sim |
| 2767 | |
| 2768 | # OWN-30B (2026-10-13): host-only audit that every launcher declares peak + 2 registers (the chip hung at peak + 1). |
| 2769 | .PHONY: test-gpu-gpr-boundary |
| 2770 | GPU_GPR_BOUNDARY_TEST = $(OUT_DIR)/gpu_gpr_boundary_test |
| 2771 | $(GPU_GPR_BOUNDARY_TEST): tests/gpu_gpr_boundary_test.c src/omega_blackwell_codegen.h $(OUT_DIR)/libomega_gpu.a |
| 2772 | $(CC) $(CFLAGS) -o $@ tests/gpu_gpr_boundary_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2773 | test-gpu-gpr-boundary: $(GPU_GPR_BOUNDARY_TEST) |
| 2774 | $(GPU_GPR_BOUNDARY_TEST) |
| 2775 | |
| 2776 | # omega-mv#554: static scoreboard hazard checker (RAW / WAR / WAW) over the encoded bytes of every kernel the generators |
| 2777 | # build, after the launchers' patch steps. Host only: decoder vs encoder, the pre-#553 attend red receipt |
| 2778 | # (tests/fixtures/bw_hazard), negative controls, then the sweep. test-bw-hazard-nvdisasm (the name it had when it |
| 2779 | # called nvdisasm) adds the decoder cross-check against Omega's own sm_121 disassembler, in process, on every distinct |
| 2780 | # kernel (bar C6: every check that called nvdisasm calls ours; test-sm121dis checks that disassembler against the oracle). |
| 2781 | .PHONY: test-bw-hazard test-bw-hazard-nvdisasm |
| 2782 | BW_HAZARD_TEST = $(OUT_DIR)/bw_hazard_test |
| 2783 | $(BW_HAZARD_TEST): tests/bw_hazard_test.c src/omega_bw_hazard.c src/omega_bw_hazard.h src/omega_sm121_disasm.h $(OUT_DIR)/libomega_gpu.a |
| 2784 | $(CC) $(CFLAGS) -o $@ tests/bw_hazard_test.c src/omega_bw_hazard.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2785 | test-bw-hazard: $(BW_HAZARD_TEST) |
| 2786 | $(BW_HAZARD_TEST) |
| 2787 | test-bw-hazard-nvdisasm: $(BW_HAZARD_TEST) |
| 2788 | $(BW_HAZARD_TEST) --disasm |
| 2789 | |
| 2790 | # OWN-30B T3 (2026-10-13): HMMA arithmetic probe (host model self-checks; chip run under the GB10 lock). |
| 2791 | GPU_TC_PROBE_TEST = $(OUT_DIR)/gpu_tc_probe_test |
| 2792 | $(GPU_TC_PROBE_TEST): tests/gpu_tc_probe_test.c tests/bw_hmma_model.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a |
| 2793 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_tc_probe_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2794 | |
| 2795 | GPU_TCGEMM_TEST = $(OUT_DIR)/gpu_tcgemm_test |
| 2796 | $(GPU_TCGEMM_TEST): tests/gpu_tcgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a |
| 2797 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tcgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2798 | |
| 2799 | GPU_TC_PEAK_TEST = $(OUT_DIR)/gpu_tc_peak_test |
| 2800 | $(GPU_TC_PEAK_TEST): tests/gpu_tc_peak_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a |
| 2801 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tc_peak_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2802 | |
| 2803 | # Training R5 part 2 (2026-10-15): f32 global atomic add probe. --host-only is the simulator; the chip run is one short window. |
| 2804 | GPU_ATOMF32_PROBE_TEST = $(OUT_DIR)/gpu_atomf32_probe_test |
| 2805 | $(GPU_ATOMF32_PROBE_TEST): tests/gpu_atomf32_probe_test.c tests/bw_warp_sim_tc.h src/omega_bw_em.h src/omega_blackwell_codegen.h $(OUT_DIR)/libomega_gpu.a |
| 2806 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_atomf32_probe_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2807 | .PHONY: test-atomf32-probe-host |
| 2808 | test-atomf32-probe-host: $(GPU_ATOMF32_PROBE_TEST) |
| 2809 | $(GPU_ATOMF32_PROBE_TEST) --host-only |
| 2810 | |
| 2811 | # OWN-30B L1 attention (2026-10-13): tensor-core causal prefill attention. --host-only and --sim are host proofs; |
| 2812 | # the chip gate is tools/run_gpu_prefill_attn_chip.sh. |
| 2813 | GPU_PATTN_TEST = $(OUT_DIR)/gpu_prefill_attn_test |
| 2814 | $(GPU_PATTN_TEST): tests/gpu_prefill_attn_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h src/omega_gpu_prefill_attn_api.h src/omega_blackwell_codegen_pattn.h $(OUT_DIR)/libomega_gpu.a |
| 2815 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2816 | # Qwen3.8-27B (omega-mv#545, 2026-10-18): head_dim 256 prefill attention on the decode cache. --host-only and --sim |
| 2817 | # are host proofs; the chip run is the default mode (under the GB10 lock). |
| 2818 | GPU_PATTN256_TEST = $(OUT_DIR)/gpu_prefill_attn256_test |
| 2819 | $(GPU_PATTN256_TEST): tests/gpu_prefill_attn256_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h src/omega_gpu_prefill_attn256_api.h src/omega_blackwell_codegen_pattn256.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a |
| 2820 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn256_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2821 | # OWN-30B T3b (2026-10-13): device-resident prefill module tests (host sim first; chip parts under the GB10 lock) |
| 2822 | GPU_PF_MEM_TEST = $(OUT_DIR)/gpu_pf_mem_test |
| 2823 | $(GPU_PF_MEM_TEST): tests/gpu_pf_mem_test.c tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_pf.h $(OUT_DIR)/libomega_gpu.a |
| 2824 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pf_mem_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2825 | GPU_PFGEMM_TEST = $(OUT_DIR)/gpu_pfgemm_test |
| 2826 | $(GPU_PFGEMM_TEST): tests/gpu_pfgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_tc2.h $(OUT_DIR)/libomega_gpu.a |
| 2827 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pfgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2828 | # trainer lane E1 (2026-10-16): bf16 training GEMM. --host-only and --sim are host proofs; the chip gate is tools/run_gpu_tgemm_chip.sh |
| 2829 | GPU_TGEMM_TEST = $(OUT_DIR)/gpu_tgemm_test |
| 2830 | $(GPU_TGEMM_TEST): tests/gpu_tgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_gpu_tgemm_api.h src/omega_blackwell_codegen_tgemm.h $(OUT_DIR)/libomega_gpu.a |
| 2831 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2832 | test-gpu-tgemm: $(GPU_TGEMM_TEST) |
| 2833 | $(GPU_TGEMM_TEST) --host-only && $(GPU_TGEMM_TEST) --sim |
| 2834 | GPU_QMMA_PROBE_TEST = $(OUT_DIR)/gpu_qmma_probe_test |
| 2835 | $(GPU_QMMA_PROBE_TEST): tests/gpu_qmma_probe_test.c tests/bw_qmma_model.h src/omega_blackwell_codegen_qmma.h $(OUT_DIR)/libomega_gpu.a |
| 2836 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_qmma_probe_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2837 | GPU_QGEMM_TEST = $(OUT_DIR)/gpu_qgemm_test |
| 2838 | $(GPU_QGEMM_TEST): tests/gpu_qgemm_test.c tests/bw_qmma_model.h tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_qg.h $(OUT_DIR)/libomega_gpu.a |
| 2839 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_qgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2840 | GPU_PFHOST_TEST = $(OUT_DIR)/gpu_pfhost_test |
| 2841 | $(GPU_PFHOST_TEST): tests/gpu_pfhost_test.c tests/bw_warp_sim_tc.h src/omega_gpu_pfhost.h src/omega_blackwell_codegen_pfhost.h $(OUT_DIR)/libomega_gpu.a |
| 2842 | $(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_pfhost_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2843 | |
| 2844 | GPU_MOE_PLAN_TEST = $(OUT_DIR)/gpu_moe_plan_test |
| 2845 | $(GPU_MOE_PLAN_TEST): tests/gpu_moe_plan_test.c src/omega_gpu_moe_plan.h src/omega_gpu_pfhost.h $(OUT_DIR)/libomega_gpu.a |
| 2846 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_moe_plan_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2847 | # omega#456: the prefill tests above, host model and warp simulator only. Every run names --host-only or --sim, the two |
| 2848 | # modes that never open the device (each test's main returns before its chip part); chip runs stay under the GB10 lock. |
| 2849 | .PHONY: test-gpu-prefill-host |
| 2850 | test-gpu-prefill-host: $(GPU_TC_PROBE_TEST) $(GPU_TCGEMM_TEST) $(GPU_PATTN_TEST) $(GPU_PF_MEM_TEST) $(GPU_PFGEMM_TEST) \ |
| 2851 | $(GPU_QMMA_PROBE_TEST) $(GPU_QGEMM_TEST) $(GPU_PFHOST_TEST) |
| 2852 | ./$(GPU_TC_PROBE_TEST) --host-only |
| 2853 | ./$(GPU_QMMA_PROBE_TEST) --host-only |
| 2854 | ./$(GPU_PF_MEM_TEST) --host-only |
| 2855 | ./$(GPU_TCGEMM_TEST) --host-only |
| 2856 | ./$(GPU_TCGEMM_TEST) --sim |
| 2857 | ./$(GPU_PATTN_TEST) --host-only |
| 2858 | ./$(GPU_PATTN_TEST) --sim |
| 2859 | ./$(GPU_PFGEMM_TEST) --host-only |
| 2860 | ./$(GPU_PFGEMM_TEST) --sim |
| 2861 | ./$(GPU_QGEMM_TEST) --host-only |
| 2862 | ./$(GPU_QGEMM_TEST) --sim |
| 2863 | ./$(GPU_PFHOST_TEST) --host-only |
| 2864 | ./$(GPU_PFHOST_TEST) --sim |
| 2865 | @echo "test-gpu-prefill-host: PASS (8 prefill tests, host model + warp simulator, no device)" |
| 2866 | # omega-mv#1032 (review REJECT 2026-11-06, Linear DRA-127): the REQUIRED prefill gate runs first-party cases only. |
| 2867 | # gpu_tcgemm_test and gpu_qgemm_test (Qwen3.8-27B widths), pattn/pfgemm/pfhost (Qwen3-30B-A3B shapes, Reviewer 2026-11-15), |
| 2868 | # and tools/own30b_decode_profile.c (the OWN-30B build) all stay out of it: six items, all in the |
| 2869 | # optional model-shape lane below (OMEGA-GPU-PREFILL-MODELSHAPES, requires: operator). The required lane is host-only. |
| 2870 | # Refuse a non-empty inherited MAKEFILES when these gates are the goal. A MAKEFILES file containing |
| 2871 | # `.IGNORE:` would otherwise turn a failing recipe into PASS (Reviewer 2026-11-15 v2). Parse-time |
| 2872 | # $(error) is not subject to `.IGNORE`. run.sh also unsets MAKEFILES before it invokes make. |
| 2873 | ifneq ($(filter test-gpu-prefill-host-fp test-gpu-prefill-modelshapes check-own30b-decode-profile,$(MAKECMDGOALS)),) |
| 2874 | ifneq ($(strip $(MAKEFILES)),) |
| 2875 | $(error MAKEFILES must be empty for the prefill gates; inherited $(MAKEFILES) can ignore recipe failures) |
| 2876 | endif |
| 2877 | endif |
| 2878 | .PHONY: test-gpu-prefill-host-fp |
| 2879 | test-gpu-prefill-host-fp: $(GPU_TC_PROBE_TEST) $(GPU_QMMA_PROBE_TEST) $(GPU_PF_MEM_TEST) |
| 2880 | ./$(GPU_TC_PROBE_TEST) --host-only |
| 2881 | ./$(GPU_QMMA_PROBE_TEST) --host-only |
| 2882 | ./$(GPU_PF_MEM_TEST) --host-only |
| 2883 | @echo "test-gpu-prefill-host-fp: PASS (3 first-party prefill tests, host model, no device)" |
| 2884 | # omega-mv#1032: the optional model-shape lane (not required): the five prefill tests with outside model-family shapes. |
| 2885 | .PHONY: test-gpu-prefill-modelshapes |
| 2886 | test-gpu-prefill-modelshapes: $(GPU_TCGEMM_TEST) $(GPU_QGEMM_TEST) $(GPU_PATTN_TEST) $(GPU_PFGEMM_TEST) $(GPU_PFHOST_TEST) |
| 2887 | ./$(GPU_TCGEMM_TEST) --host-only |
| 2888 | ./$(GPU_TCGEMM_TEST) --sim |
| 2889 | ./$(GPU_QGEMM_TEST) --host-only |
| 2890 | ./$(GPU_QGEMM_TEST) --sim |
| 2891 | ./$(GPU_PATTN_TEST) --host-only |
| 2892 | ./$(GPU_PATTN_TEST) --sim |
| 2893 | ./$(GPU_PFGEMM_TEST) --host-only |
| 2894 | ./$(GPU_PFGEMM_TEST) --sim |
| 2895 | ./$(GPU_PFHOST_TEST) --host-only |
| 2896 | ./$(GPU_PFHOST_TEST) --sim |
| 2897 | @echo "test-gpu-prefill-modelshapes: PASS (5 model-shape prefill tests, host model + warp simulator, no device)" |
| 2898 | # omega#456: tools/own30b_decode_profile.c is a link-only recorder built by hand on the Spark; compile it with the |
| 2899 | # project's -Werror flags so a warning cannot land unseen. |
| 2900 | .PHONY: check-own30b-decode-profile |
| 2901 | check-own30b-decode-profile: tools/own30b_decode_profile.c |
| 2902 | @mkdir -p $(OUT_DIR) |
| 2903 | $(CC) $(CFLAGS) -c -o $(OUT_DIR)/own30b_decode_profile.o tools/own30b_decode_profile.c |
| 2904 | @echo "check-own30b-decode-profile: PASS (compiles with -Werror)" |
| 2905 | # OWN-30B W-L2 (2026-10-13): command list (many launches, one submission) + decode glue kernels. test-gpu-cmdlist is |
| 2906 | # host-only + warp simulator; the chip gate is tools/run_gpu_cmdlist_chip.sh under the GB10 lock. |
| 2907 | .PHONY: test-gpu-cmdlist |
| 2908 | GPU_CMDLIST_TEST = $(OUT_DIR)/gpu_cmdlist_test |
| 2909 | $(GPU_CMDLIST_TEST): tests/gpu_cmdlist_test.c tests/bw_warp_sim_k.h src/omega_gpu_cmdlist.h src/omega_blackwell_codegen_dec.h $(OUT_DIR)/libomega_gpu.a |
| 2910 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_cmdlist_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2911 | test-gpu-cmdlist: $(GPU_CMDLIST_TEST) |
| 2912 | ./$(GPU_CMDLIST_TEST) --host-only |
| 2913 | ./$(GPU_CMDLIST_TEST) --sim |
| 2914 | |
| 2915 | # C4 streams (docs/OMEGA.md row C4): two queues of the same half-chip work side by side, an event (cmdlist wait_for) |
| 2916 | # between them, both with red checks. test-gpu-streams is host + warp simulator; the chip tier is "$(GPU_STREAMS_TEST)" |
| 2917 | # with no flag, under the GB10 lock (timings need an exclusive window). |
| 2918 | .PHONY: test-gpu-streams |
| 2919 | GPU_STREAMS_TEST = $(OUT_DIR)/gpu_streams_test |
| 2920 | $(GPU_STREAMS_TEST): tests/gpu_streams_test.c tests/bw_warp_sim.h src/omega_gpu_cmdlist.h src/omega_bw_em.h $(OUT_DIR)/libomega_gpu.a |
| 2921 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_streams_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2922 | test-gpu-streams: $(GPU_STREAMS_TEST) |
| 2923 | ./$(GPU_STREAMS_TEST) --sim |
| 2924 | |
| 2925 | # C5 isolation (docs/OMEGA.md row C5): a never-ending kernel times out, omega_gpu_session_recover, a correct launch in the |
| 2926 | # same process; two processes on one GPU; a hang beside a working process. test-gpu-isolation is host + simulator; |
| 2927 | # the chip tier is "$(GPU_ISOLATION_TEST)" with no flag, under the GB10 lock. |
| 2928 | .PHONY: test-gpu-isolation |
| 2929 | GPU_ISOLATION_TEST = $(OUT_DIR)/gpu_isolation_test |
| 2930 | $(GPU_ISOLATION_TEST): tests/gpu_isolation_test.c tests/bw_warp_sim.h src/omega_gpu_session.h src/omega_bw_em.h $(OUT_DIR)/libomega_gpu.a |
| 2931 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_isolation_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2932 | test-gpu-isolation: $(GPU_ISOLATION_TEST) |
| 2933 | ./$(GPU_ISOLATION_TEST) --host-only |
| 2934 | |
| 2935 | # OWN-30B W-L2a (2026-10-13): one decode token as one command list (omega_gpu_decode_graph). test-gpu-decode-graph is |
| 2936 | # host-only; the chip gate is tools/run_gpu_decode_graph_chip.sh under the GB10 lock. |
| 2937 | .PHONY: test-gpu-decode-graph |
| 2938 | GPU_DECODE_GRAPH_TEST = $(OUT_DIR)/gpu_decode_graph_test |
| 2939 | GPU_DGRAPH_ABORT_TEST = $(OUT_DIR)/test_omega_gpu_decode_graph_abort |
| 2940 | $(GPU_DECODE_GRAPH_TEST): tests/gpu_decode_graph_test.c src/omega_gpu_decode_graph.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a |
| 2941 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_decode_graph_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2942 | test-gpu-decode-graph: $(GPU_DECODE_GRAPH_TEST) $(GPU_DGRAPH_ABORT_TEST) test-gpu-decode-graph-abort-mutants test-gpu-decode-graph-timeline |
| 2943 | ./$(GPU_DECODE_GRAPH_TEST) --host-only |
| 2944 | ./$(GPU_DGRAPH_ABORT_TEST) |
| 2945 | |
| 2946 | # omega #518: lock and token-state recovery of the split API (failed begin_token, abort_token, end_token after a failed |
| 2947 | # record, latched session) on a fake platform whose lock refuses a second acquisition. Host only, opens no device. |
| 2948 | # Each mutant breaks one rule in a copy of omega_gpu_decode_graph.c linked ahead of the library; the test must FAIL on it. |
| 2949 | .PHONY: test-gpu-decode-graph-abort-mutants |
| 2950 | GPU_DGRAPH_MUT_DIR = $(OUT_DIR)/dgraph_mut |
| 2951 | $(GPU_DGRAPH_ABORT_TEST): tests/test_omega_gpu_decode_graph_abort.c src/omega_gpu_decode_graph.h src/omega_gpu_platform.h $(OUT_DIR)/libomega_gpu.a |
| 2952 | $(CC) $(CFLAGS) -o $@ tests/test_omega_gpu_decode_graph_abort.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2953 | test-gpu-decode-graph-abort-mutants: $(OUT_DIR)/libomega_gpu.a |
| 2954 | @mkdir -p $(GPU_DGRAPH_MUT_DIR) |
| 2955 | @set -e; killed=0; \ |
| 2956 | dmut() { name=$$1; script=$$2; \ |
| 2957 | sed -e "$$script" src/omega_gpu_decode_graph.c > $(GPU_DGRAPH_MUT_DIR)/$$name.c; \ |
| 2958 | if cmp -s src/omega_gpu_decode_graph.c $(GPU_DGRAPH_MUT_DIR)/$$name.c; then echo "mutant $$name: pattern not found"; exit 1; fi; \ |
| 2959 | $(CC) $(filter-out -MMD -MP,$(CFLAGS)) -c -o $(GPU_DGRAPH_MUT_DIR)/$$name.o $(GPU_DGRAPH_MUT_DIR)/$$name.c; \ |
| 2960 | $(CC) $(filter-out -MMD -MP,$(CFLAGS)) -o $(GPU_DGRAPH_MUT_DIR)/$$name tests/test_omega_gpu_decode_graph_abort.c \ |
| 2961 | $(GPU_DGRAPH_MUT_DIR)/$$name.o $(OUT_DIR)/libomega_gpu.a -lpthread -lm; \ |
| 2962 | if ./$(GPU_DGRAPH_MUT_DIR)/$$name > $(GPU_DGRAPH_MUT_DIR)/$$name.log 2>&1; then echo "mutant $$name SURVIVED"; exit 1; fi; \ |
| 2963 | nfail=$$(grep -c '^FAIL' $(GPU_DGRAPH_MUT_DIR)/$$name.log || true); \ |
| 2964 | if [ "$$nfail" -eq 0 ]; then echo "mutant $$name: nonzero exit but no FAIL case (did not run?)"; cat $(GPU_DGRAPH_MUT_DIR)/$$name.log; exit 1; fi; \ |
| 2965 | echo "mutant $$name killed: $$nfail case(s) failed"; killed=$$((killed+1)); }; \ |
| 2966 | dmut begin-fail-keeps-lock 's| omega_gpu_session_unlock(); /\* begin_fail releases \*/| ;|'; \ |
| 2967 | dmut begin-fail-stays-in-token 's| g->in_token = 0; g->failed = 1;| g->failed = 1;|'; \ |
| 2968 | dmut oneshot-old-bad-args-only 's|if (brc != OMEGA_GPU_DGRAPH_OK) {|if (brc == OMEGA_GPU_DGRAPH_BAD_ARGS) {|'; \ |
| 2969 | dmut abort-keeps-lock 's|g->n_stamp = 0; /\* no timeline for an abandoned token \*/|&\n return OMEGA_GPU_DGRAPH_OK;|'; \ |
| 2970 | dmut abort-submits 's|^int omega_gpu_decode_graph_abort_token(OmegaGpuDecodeGraph \*g) {$$|&\n if (g \&\& g->in_token) return omega_gpu_decode_graph_end_token(g, NULL, NULL);|'; \ |
| 2971 | echo "test-gpu-decode-graph-abort-mutants: $$killed of 5 mutants killed" |
| 2972 | |
| 2973 | # omega #456: the per-token timeline (set_stamps) never writes past stamp[]: 4096 stamped launches fill it, the 4097th |
| 2974 | # (flush_each, one submission per launch) fails the token and leaves no timeline. Fake platform that completes every |
| 2975 | # submission; no device. Each mutant breaks one rule in a copy of omega_gpu_decode_graph.c linked ahead of the library; |
| 2976 | # the overflow case must FAIL on it. |
| 2977 | .PHONY: test-gpu-decode-graph-timeline |
| 2978 | GPU_DGRAPH_TL_TEST = $(OUT_DIR)/test_omega_gpu_decode_graph_timeline |
| 2979 | GPU_DGRAPH_TL_MUT = $(OUT_DIR)/dgraph_tl_mut |
| 2980 | $(GPU_DGRAPH_TL_TEST): tests/test_omega_gpu_decode_graph_timeline.c src/omega_gpu_decode_graph.h src/omega_gpu_platform.h $(OUT_DIR)/libomega_gpu.a |
| 2981 | $(CC) $(CFLAGS) -o $@ tests/test_omega_gpu_decode_graph_timeline.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 2982 | test-gpu-decode-graph-timeline: $(GPU_DGRAPH_TL_TEST) |
| 2983 | ./$(GPU_DGRAPH_TL_TEST) |
| 2984 | @mkdir -p $(GPU_DGRAPH_TL_MUT) |
| 2985 | @set -e; \ |
| 2986 | tmut() { name=$$1; script=$$2; \ |
| 2987 | sed -e "$$script" src/omega_gpu_decode_graph.c > $(GPU_DGRAPH_TL_MUT)/$$name.c; \ |
| 2988 | if cmp -s src/omega_gpu_decode_graph.c $(GPU_DGRAPH_TL_MUT)/$$name.c; then echo "mutant $$name: pattern not found"; exit 1; fi; \ |
| 2989 | $(CC) $(filter-out -MMD -MP,$(CFLAGS)) -o $(GPU_DGRAPH_TL_MUT)/$$name tests/test_omega_gpu_decode_graph_timeline.c \ |
| 2990 | $(GPU_DGRAPH_TL_MUT)/$$name.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm; \ |
| 2991 | if ./$(GPU_DGRAPH_TL_MUT)/$$name > $(GPU_DGRAPH_TL_MUT)/$$name.log 2>&1; then echo "mutant $$name SURVIVED"; exit 1; fi; \ |
| 2992 | if ! grep -q '^FAIL one launch past the timeline' $(GPU_DGRAPH_TL_MUT)/$$name.log; then \ |
| 2993 | echo "mutant $$name: no FAIL case (did not run?)"; cat $(GPU_DGRAPH_TL_MUT)/$$name.log; exit 1; fi; \ |
| 2994 | echo "mutant $$name killed"; }; \ |
| 2995 | tmut room-off-by-one 's|(uint32_t)(cnt - from) > room) {|(uint32_t)(cnt - from) > room + 1u) {|'; \ |
| 2996 | tmut timeline-after-failure 's#if (!g->stamps || g->failed || #if (!g->stamps || #'; \ |
| 2997 | echo "test-gpu-decode-graph-timeline: 2 of 2 mutants killed" |
| 2998 | |
| 2999 | # OWN-30B W-L2c (2026-10-14): per-launch fixed cost inside a command list (tests/gpu_launch_cost_test.c, chip only, GB10 lock). |
| 3000 | GPU_LAUNCH_COST_TEST = $(OUT_DIR)/gpu_launch_cost_test |
| 3001 | $(GPU_LAUNCH_COST_TEST): tests/gpu_launch_cost_test.c src/omega_gpu_fp8_api.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a |
| 3002 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_launch_cost_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3003 | |
| 3004 | # OWN-30B W-L2d (2026-10-14): L2 reuse of FP8 GEMV weights between two launches of one list (tests/gpu_l2_reuse_test.c, chip only, GB10 lock). |
| 3005 | GPU_L2_REUSE_TEST = $(OUT_DIR)/gpu_l2_reuse_test |
| 3006 | $(GPU_L2_REUSE_TEST): tests/gpu_l2_reuse_test.c src/omega_gpu_fp8_api.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a |
| 3007 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_reuse_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3008 | |
| 3009 | # sc #642 (2026-10-18): Qwen3.8-27B decode graph (one token = one command list), chip test vs the APIs one call at a time |
| 3010 | .PHONY: test-gpu-q38-graph-host |
| 3011 | GPU_Q38_GRAPH_TEST = $(OUT_DIR)/gpu_q38_graph_test |
| 3012 | GPU_Q38_GRAPH_HOST_TEST = $(OUT_DIR)/test_omega_gpu_q38_graph_host |
| 3013 | GPU_Q38_STROKE_EXACT_TEST = $(OUT_DIR)/gpu_q38_stroke_exact_test |
| 3014 | $(GPU_Q38_GRAPH_TEST): tests/gpu_q38_graph_test.c src/omega_gpu_q38_graph.h $(OUT_DIR)/libomega_gpu.a |
| 3015 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_q38_graph_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3016 | $(GPU_Q38_GRAPH_HOST_TEST): tests/test_omega_gpu_q38_graph_host.c src/omega_gpu_q38_graph.h $(OUT_DIR)/libomega_gpu.a |
| 3017 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/test_omega_gpu_q38_graph_host.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3018 | $(GPU_Q38_STROKE_EXACT_TEST): tests/gpu_q38_stroke_exact_test.c src/omega_gpu_q38_graph.h $(OUT_DIR)/libomega_gpu.a |
| 3019 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_q38_stroke_exact_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3020 | test-gpu-q38-graph-host: $(GPU_Q38_GRAPH_TEST) $(GPU_Q38_GRAPH_HOST_TEST) |
| 3021 | ./$(GPU_Q38_GRAPH_TEST) --host-only |
| 3022 | ./$(GPU_Q38_GRAPH_HOST_TEST) |
| 3023 | |
| 3024 | # HUM L314 exact two-pass lm_head (XBOUND simulator proofs; the chip run comes with the export) |
| 3025 | GPU_EXACT_HEAD_TEST = $(OUT_DIR)/gpu_exact_head_test |
| 3026 | $(GPU_EXACT_HEAD_TEST): tests/gpu_exact_head_test.c tests/bw_warp_sim_k.h src/omega_blackwell_codegen_dec.h src/omega_gpu_bf16_gemv_api.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a |
| 3027 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_exact_head_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3028 | # C3 (docs/OMEGA.md): sum, max, min and prefix sum of any length 1..2^28, bit-exact against the frozen order. |
| 3029 | # test-gpu-scan: host refusals, codegen, references vs exact sums and vs the E1 reference, then the warp simulator |
| 3030 | # (both orders, mutants caught). The chip tier is "$(GPU_SCAN_TEST)" with no flag, under the GB10 lock. |
| 3031 | GPU_SCAN_TEST = $(OUT_DIR)/gpu_scan_test |
| 3032 | $(GPU_SCAN_TEST): tests/gpu_scan_test.c tests/bw_warp_sim.h src/omega_gpu_scan.h src/omega_numeric_reduce.c src/omega_numeric.c $(OUT_DIR)/libomega_gpu.a |
| 3033 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_scan_test.c src/omega_numeric_reduce.c src/omega_numeric.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3034 | .PHONY: test-gpu-scan |
| 3035 | test-gpu-scan: $(GPU_SCAN_TEST) |
| 3036 | ./$(GPU_SCAN_TEST) --sim |
| 3037 | |
| 3038 | # C3 (docs/OMEGA.md): matrix multiply of any shape, BF16 and FP8 (e4m3), both layouts, on the tensor cores; bit-exact |
| 3039 | # against the chip-measured tensor-core model. test-gpu-gemm: host refusals and codegen, then the warp simulator. |
| 3040 | # The chip tier is "$(GPU_GEMM_TEST)" with no flag (>= 200 shapes up to 8192, speed vs the measured ceiling), under the GB10 lock. |
| 3041 | GPU_GEMM_TEST = $(OUT_DIR)/gpu_gemm_test |
| 3042 | $(GPU_GEMM_TEST): tests/gpu_gemm_test.c tests/bw_warp_sim_tc.h tests/bw_hmma_model.h tests/bw_qmma_model.h src/omega_gpu_gemm.h $(OUT_DIR)/libomega_gpu.a |
| 3043 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3044 | .PHONY: test-gpu-gemm |
| 3045 | test-gpu-gemm: $(GPU_GEMM_TEST) |
| 3046 | ./$(GPU_GEMM_TEST) --sim |
| 3047 | |
| 3048 | # Expert Ribbon P1 (aienix#4 / omega#533, 2026-10-18): versioned replaceable FP8 expert slots (omega_gpu_fp8_slots.h). |
| 3049 | # test-gpu-fp8-slots is host-only (slot state machine, threaded race, mutant); the chip gate is |
| 3050 | # tools/run_gpu_fp8_slots_chip.sh under the GB10 lock (parity vs resident, churn, reader fence via a command list, negative control). |
| 3051 | .PHONY: test-gpu-fp8-slots |
| 3052 | GPU_FP8_SLOTS_TEST = $(OUT_DIR)/gpu_fp8_slots_test |
| 3053 | $(GPU_FP8_SLOTS_TEST): tests/gpu_fp8_slots_test.c src/omega_gpu_fp8_slots.h src/omega_fp8_slot_table.h src/omega_gpu_fp8_api.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a |
| 3054 | $(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_fp8_slots_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 3055 | test-gpu-fp8-slots: $(GPU_FP8_SLOTS_TEST) |
| 3056 | ./$(GPU_FP8_SLOTS_TEST) --host-only |