Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
165 lines (134 loc) · 7.49 KB
/
Copy pathMakefile
File metadata and controls
165 lines (134 loc) · 7.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Go-Hybrid — one-command routine actions (SPEC.md §14.1)
# NOTE: `just` was deferred (PLAN.md Decision Log); make is ubiquitous on this box.
# RECIPES ARE TAB-INDENTED (8639e0b fixed this once; Batch I's regeneration
# silently reintroduced spaces — make check now guards the syntax, see below).
SHELL := /bin/sh
PY := python3
KAGGLE_CLI ?= /home/z/.venv/bin/kaggle
JOB ?= 001-spike0-kaggle-smoke
SHARDS ?= 4
MAXPAR ?= 4
CARGO := $(HOME)/.cargo/bin/cargo
CARGO_TARGET_DIR ?= $(HOME)/go-hybrid-target
HYB_BIN := $(CARGO_TARGET_DIR)/debug/hyb
.PHONY: help env check test-quick ci corpus workspace examples differential bench spike0-kaggle spike0-kaggle-status spike0-kaggle-fetch \
spike0-actions-4 spike0-actions-20 spike-1 spike-2 spike-3 kaggle-job kaggle-status kaggle-fetch kaggle-wait \
actions-dispatch actions-watch census guarantees clean
help:
@echo "make env — verify pinned toolchains (source tools/env.sh)"
@echo "make check — quick sanity: tool syntax + runner selftest + hygiene"
@echo "make test-quick — sandbox unit tests (grows with the compiler)"
@echo "make ci — what CI runs on push"
@echo "make examples — the ten target programs, byte-exact acceptance"
@echo "make corpus — Tier-0 corpus verdicts (135/135)"
@echo "make census — every stated corpus count matches the corpus"
@echo "make guarantees — GUARANTEES.md claims table matches the rules and corpus"
@echo "make differential — the differential corpus loop (accept + reject)"
@echo "make bench — G2 call-overhead bench on the live bridge (hyb bench-overhead)"
@echo "make spike0-kaggle — submit Spike 0 part A to the Kaggle worker"
@echo "make spike0-actions-4 / -20 — dispatch the Actions fleet smoke test"
@echo "make spike-1 / spike-2 / spike-3 — re-run that spike's bench suite (sandbox)"
@echo "make kaggle-job J=NNN-name — submit jobs/\$(J) to the worker"
@echo "make clean — prune caches (disk hygiene)"
env:
@tools/env.sh
check:
@$(MAKE) -n examples >/dev/null 2>&1 || { echo "MAKE SYNTAX BROKEN (recipes must be TAB-indented)"; exit 1; }
@echo "make-syntax OK"
@$(PY) -m py_compile tools/runner/runner.py tools/job.py worker/script.py tools/corpus_harness.py tools/differential_loop.py tools/check_guarantees.py tools/test_check_guarantees.py && echo "py-syntax OK"
@$(PY) -m unittest discover -s tools -p test_differential_loop.py -v
@$(PY) -m unittest discover -s tools -p test_check_guarantees.py -v
@$(PY) -m unittest discover -s tools -p test_check_versions.py -v
@$(PY) -m unittest discover -s tools -p test_workload_run.py -v
@$(PY) -m unittest discover -s tools -p test_runner_env_report.py -v
@$(PY) -m unittest discover -s tools -p test_corpus_harness.py -v
@$(PY) -m unittest discover -s tools -p test_package_version.py -v
@$(PY) -m unittest discover -s tools/runner -p test_runner.py -v
@$(PY) -m unittest discover -s tools -p test_check_test_registration.py -v
@$(PY) -m unittest discover -s tools -p test_check_corpus_census.py -v
@$(PY) -m unittest discover -s tools -p test_check_claims_links.py -v
@$(PY) tools/check_corpus_census.py && echo "corpus census OK"
@$(PY) tools/check_claims_links.py && echo "claims links OK"
@$(PY) tools/check_guarantees.py && echo "guarantees OK"
@$(PY) tools/check_test_registration.py && echo "test registration OK"
@bash tools/check-versions.sh --no-toolchain && echo "versions OK"
@$(PY) tools/check_conflict_markers.py && echo "conflict markers OK"
@cd /tmp && rm -rf gh-selftest && mkdir gh-selftest && cd gh-selftest && \
printf '%s\n' '{"job":"selftest","tier":"sandbox","sha":"HEAD","repo":"none","gpu":false,"setup":[],"commands":[{"name":"echo","run":"echo selftest-ok","timeout":30}],"expected_results":[]}' > job.json && \
$(PY) $(CURDIR)/tools/runner/runner.py job.json --results-dir results >/dev/null && \
test -f results/summary.json && grep -q '"ok": true' results/summary.json && echo "runner selftest OK"
@$(PY) -c "import glob,json;[json.load(open(p)) for p in glob.glob('jobs/*/job.json')];print('job specs OK')"
@! git grep -qE 'ghp_[A-Za-z0-9]{20,}|KGAT_[A-Za-z0-9]{20,}|eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{10,}' HEAD 2>/dev/null || (echo "SECRET LEAK"; exit 1)
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) check --workspace --quiet && echo "cargo check OK"
@echo "check OK"
test-quick: check
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) test --workspace --quiet
@$(PY) tools/corpus_harness.py --bin $(HYB_BIN)
@$(PY) tools/differential_loop.py --bin $(HYB_BIN)
# MVP-0 walking-skeleton acceptance: parse → Tier-0 check → emit → go build
# → run → diff against each example's expected.txt.
examples:
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) build -p hyb --quiet
@bash tools/run_examples.sh
workspace:
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) check --workspace
corpus:
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) build -p hyb --quiet
@$(PY) tools/corpus_harness.py --bin $(HYB_BIN)
census:
@$(PY) tools/check_corpus_census.py
# GUARANTEES.md claims table is rendered from guarantees.json; this fails when a
# row names a rule the registry no longer has, when a fixture EXPECTED-VERDICT
# contradicts the row that pins it, when a scoped rule appears in no row, when an
# evidence link does not resolve, or when the doc drifts from the table (#710).
guarantees:
@$(PY) tools/check_guarantees.py
# The differential corpus loop (Batch I): accepted corpus programs must
# survive the full pipeline (hyb build + run, exit 0); rejected programs
# must be rejected by the checker. SPEC §"Differential tests on the corpus".
differential:
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) build -p hyb --quiet
@$(PY) tools/differential_loop.py --bin $(HYB_BIN)
# The G2 gate's call-overhead bench (Batch J): assembles the bench through
# the exact hyb workspace recipe and measures the no-op crossing on the live
# bridge. Two scenarios (shallow / grown stack); median of 3 process runs.
bench:
@cd compiler && CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) CARGO_BUILD_JOBS=2 $(CARGO) build -p hyb --quiet
@$(HYB_BIN) bench-overhead
ci: check
@echo "CI parity with .github/workflows/ci.yml"
# ---- Spike 0 orchestration ----
spike0-kaggle:
$(PY) tools/job.py kaggle submit jobs/$(JOB)
spike0-kaggle-status:
$(PY) tools/job.py kaggle status
spike0-kaggle-fetch:
$(PY) tools/job.py kaggle fetch jobs/$(JOB)
spike0-actions-4:
$(PY) tools/job.py actions dispatch heavy "$(shell git rev-parse --short=40 HEAD)" $(JOB) 4 4
spike0-actions-20:
$(PY) tools/job.py actions dispatch heavy "$(shell git rev-parse --short=40 HEAD)" $(JOB) 20 20
kaggle-job:
$(PY) tools/job.py kaggle submit jobs/$(J)
kaggle-status:
$(PY) tools/job.py kaggle status
kaggle-wait:
$(PY) tools/job.py kaggle wait $(or $(MINUTES),20)
kaggle-fetch:
$(PY) tools/job.py kaggle fetch jobs/$(J)
spike-1:
bash spikes/spike1-call-overhead/work/run.sh
spike-2:
bash spikes/spike2-go-linking/work/run.sh
spike-3:
bash spikes/spike3-memory/work/run.sh
spike-5:
bash spikes/spike5-errors/work/run.sh
spike-4:
bash spikes/spike4-scheduling/work/run.sh
actions-watch:
$(PY) tools/job.py actions watch
clean:
@command -v cargo >/dev/null && cargo clean 2>/dev/null || true
@if command -v go >/dev/null; then GOFLAGS= go clean -cache 2>/dev/null || true; fi
@df -h / | tail -1