-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (54 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
70 lines (54 loc) · 1.91 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
# beal_bigint Makefile — Frente B Phase 1 (M3)
# Build: make ARCH=sm_120
ARCH ?= sm_120
NVCC ?= nvcc
NVCC_FLAGS = -O3 -std=c++17 -arch=$(ARCH) -Xcompiler -Wall
LIBS = -lgmp
SRC = src/beal_bigint.cu
BIN = beal_bigint
.PHONY: all clean test sanity oracle help calibrate status
all: $(BIN)
$(BIN): $(SRC)
$(NVCC) $(NVCC_FLAGS) $(SRC) -o $@ $(LIBS)
# Sanity vs V1 oracle (V1-compat, must produce 17 confirmed)
sanity: $(BIN)
./$(BIN) 50 3 6
# Larger oracle (V1-compat, 50 hits)
oracle: $(BIN)
./$(BIN) 100 3 10
# Push to 128-bit ceiling for C<=10
explore_c10: $(BIN)
./$(BIN) 10 3 38 --raw
# Raw mode sanity
sanity_raw: $(BIN)
./$(BIN) 50 3 6 --raw
# Cross-validate vs Python oracle (must match line-by-line)
crossval: $(BIN)
@echo "=== Python oracle (V1-compat) ==="
@python3 oracle/oracle_by_cz.py 50 3 6 --v1-compat 2>&1 | grep '^ [0-9]' | \
awk '{print $$1, $$2, $$3, $$4, $$5}' | sort > /tmp/py_hits.txt
@wc -l /tmp/py_hits.txt
@echo "=== CUDA kernel (V1-compat) ==="
@./$(BIN) 50 3 6 2>&1 | grep '^ [0-9]' | \
awk '{print $$1, $$2, $$3, $$4, $$5}' | sort > /tmp/cu_hits.txt
@wc -l /tmp/cu_hits.txt
@echo "=== Diff (must be empty) ==="
@diff /tmp/py_hits.txt /tmp/cu_hits.txt && echo " ✓ MATCH"
# M3.5 calibration: small matrix to validate skip-gmp safety + measure throughput
calibrate: $(BIN)
./scripts/calibrate.sh
# Show ledger status
status:
@python3 scripts/coverage_ledger.py status
clean:
rm -f $(BIN)
help:
@echo "Targets:"
@echo " all - build $(BIN)"
@echo " sanity - V1-compat: bound=50 exp=3-6 (expect 17 hits)"
@echo " oracle - V1-compat: bound=100 exp=3-10 (expect 50 hits)"
@echo " explore_c10 - RAW: bound=10 exp=3-38 (push 128-bit ceiling)"
@echo " crossval - diff Python oracle vs CUDA kernel"
@echo " calibrate - run M3.5 calibration matrix (~5-15 min)"
@echo " status - print ledger summary"
@echo " clean - remove binary"