Skip to content

Commit dce43b4

Browse files
lukaszsamsonclaude
andcommitted
Add CI check comparing @specs against inferred type signatures
make check_specs runs lib/elixir/scripts/compare_specs_and_signatures.exs, which translates stdlib @SPEC declarations into Module.Types.Descr types and compares them against the compiler-inferred signatures (ExCk chunk) with semantic subtyping, slice-wise per spec clause. Residue that cannot be auto-triaged is executed against concrete witnesses (rejection-sampled in-domain values plus doctest-mined calls) in sandboxed tasks. The gate fails on witness-proven findings, lattice contradictions, and any divergence not acknowledged in compare_specs_exclusions.txt; stale exclusions only warn. Witness sampling is PRNG-seeded so runs are deterministic on a given build. Wired into the deterministic CI matrix entry, ~11s per run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 251d3fe commit dce43b4

4 files changed

Lines changed: 1516 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ jobs:
9797
name: TestCoverage
9898
path: cover/*
9999

100+
- name: Check specs vs inferred type signatures
101+
if: ${{ matrix.deterministic }}
102+
run: make check_specs
103+
100104
- name: Check reproducible builds
101105
if: ${{ matrix.deterministic }}
102106
run: taskset 1 make check_reproducible

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$hea
2626
SOURCE_DATE_EPOCH_PATH = lib/elixir/tmp/ebin_reproducible
2727
SOURCE_DATE_EPOCH_FILE = $(SOURCE_DATE_EPOCH_PATH)/SOURCE_DATE_EPOCH
2828

29-
.PHONY: cover install install_man build_plt clean_plt dialyze test check_reproducible clean clean_elixir clean_man format docs Docs.zip Precompiled.zip zips
29+
.PHONY: cover install install_man build_plt clean_plt dialyze test check_reproducible check_specs clean clean_elixir clean_man format docs Docs.zip Precompiled.zip zips
3030
.NOTPARALLEL:
3131

3232
#==> Functions
@@ -141,6 +141,11 @@ install: compile
141141
done
142142
"$(MAKE)" install_man
143143

144+
check_specs: compile
145+
$(Q) echo "==> Checking @specs against inferred type signatures..."
146+
$(Q) bin/elixir lib/elixir/scripts/compare_specs_and_signatures.exs \
147+
--exclusions lib/elixir/scripts/compare_specs_exclusions.txt
148+
144149
check_reproducible: compile
145150
$(Q) echo "==> Checking for reproducible builds..."
146151
$(Q) rm -rf lib/*/tmp/ebin_reproducible/

0 commit comments

Comments
 (0)