File size: 6,308 Bytes
3ffd868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638d759
 
 
 
 
3ffd868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5c4f405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
task_categories:
- text-classification
tags:
- formal-methods
- model-checking
- verification
- reasoning
- synthetic
size_categories:
- n<1K
configs:
- config_name: medium
  data_files: specforge_medium.jsonl
  default: true
- config_name: easy
  data_files: specforge_easy.jsonl
- config_name: hard
  data_files: specforge_hard.jsonl
---

# specforge — a verification benchmark that cannot be memorised

600 protocol-shaped state machines whose ground truth was **computed by an exhaustive model checker**,
not written down by hand.

Every fixed benchmark has a shelf life: once its answers are in a training corpus, a high score stops
telling you whether a model reasons or remembers. This snapshot is generated, and the generator is
public — so when this set ages, you make a new one with a different seed rather than trusting a stale
number.

```python
from datasets import load_dataset

ds = load_dataset("nickh007/specforge", split="train")     # medium by default
ds[0]["spec"]        # the state machine
ds[0]["violated"]    # ground truth, computed not assumed
```

## Configs

| config | rows | violated | safe |
|---|---|---|---|
| `easy` | 150 | 75 | 75 |
| `medium` *(default)* | 300 | 150 | 150 |
| `hard` | 150 | 75 | 75 |

Difficulty controls the **size of the search**, not how tricky the answer is: more components, more
auxiliary fields, wider bounds.

## Fields

| field | meaning |
|---|---|
| `id` | `{shape}_{difficulty}_{seed}` |
| `shape` | one of `mutual_exclusion`, `bounded_retry`, `handshake`, `sequence_window`, `resource_pool` |
| `difficulty` | `easy`, `medium`, `hard` |
| `seed` | the generation seed for this task |
| `spec` | the declarative state machine (JSON) |
| `property` | the name of the safety property being checked |
| `violated` | **ground truth** — computed by exhaustive check |
| `reachable_states` | size of the reachable state space |
| `counterexample_length` | steps to the violation, when there is one |

Plus per-shape metadata, present only on the shapes that define them and `null` elsewhere (the
configs are a union of all five shapes): `guarded`, `components`, `limit`, `capped`, `ordered`,
`width`, `checked`, `size`. These record **which variant was generated** — e.g. `guarded: false` on
a `mutual_exclusion` task is why that task is violated. 17 columns in total.

## Why the answer key is trustworthy

Three rules, enforced at generation time and covered by tests in the
[generator](https://github.com/nickharris808/specforge):

1. **A task is emitted only on a definite verdict.** A candidate the checker could not settle is
   discarded, never labelled. An answer key containing guesses is worse than no benchmark.
2. **Every violated task's counterexample was replayed** against its own model before the task was
   emitted.
3. **Generation is deterministic from the seed**, so this exact set is reproducible:
   `specforge export --n 300 --seed 2026 --difficulty medium`.

One subtlety worth stating: a **safe** label requires an exhaustive search, because it is a claim
about every reachable state. A **violated** label does not, because it rests on a single witness that
stands whether or not the search finished. Different evidential bars, applied separately.

## Scoring credits only what replays

Predicting "violated" is cheap; producing a counterexample that replays is not. Scoring a submission
needs the [`specforge`](https://github.com/nickharris808/specforge) package, because a trace only
means something when replayed against the real model.

```bash
pip install "specforge @ git+https://github.com/nickharris808/specforge.git"
specforge score submission.json --tasks tasks.json
```

Measured on 20 tasks at seed 42: a submission that knows every answer and **fabricates every trace**
scores **balanced accuracy 0.500** — exactly what guessing scores — while `accuracy_ignoring_replay`
reads **1.000**. The gap between those two numbers is the measurement.

## Honest scope

**What a score measures.** How well a solver finds and *demonstrates* safety violations in synthetic
finite state machines, at a given size.

**What it does not.** Nothing about real-world protocol implementations — the shapes are drawn from
how protocols are built, but the machines are synthetic and deliberately so. Nothing about reading a
specification, since the model is given. And nothing comparable across seeds or difficulties unless
you say which you used.

**It makes no claim about any named third-party protocol, product or implementation.** Judgements
about named systems belong in a human-reviewed corpus; that is
[`protocol-bench`](https://huggingface.co/datasets/nickh007/protocol-bench), which is fixed, small
and reviewed.

Always report the **seed and count** with any score. A number nobody can reproduce is not a result.

## Licence

MIT.

---

## The portfolio

This is one artifact in a set built around a single rule: **a verdict you cannot check is not a
verdict** — and its corollary, *undetermined is not a pass.*

| | |
|---|---|
| [**Documentation**](https://nickharris808.github.io/verification-docs/) | the front door: what an explicit-state check proves, and what it does not |
| [`minicheck`](https://github.com/nickharris808/minicheck) | the model checker underneath all of it |
| [`protocol-bench`](https://github.com/nickharris808/protocol-bench) | fixed ground truth from published standards; a detection must replay |
| [`specforge`](https://github.com/nickharris808/specforge) | a benchmark that cannot be memorised — ground truth is computed |
| [`minicheck-mcp`](https://github.com/nickharris808/minicheck-mcp) | the checker as an MCP server, for agents |
| [`failclosed`](https://github.com/nickharris808/failclosed) | default-deny middleware for verification-gated endpoints |
| [`polyfrac`](https://github.com/nickharris808/polyfrac) | exact rational arithmetic with Sturm root counting |

**Try it in the browser** · [model-check a state machine](https://huggingface.co/spaces/nickh007/protocol-bench-demo) · [the specforge leaderboard](https://huggingface.co/spaces/nickh007/specforge-leaderboard)

**Ground-truth data** · [protocol-bench](https://huggingface.co/datasets/nickh007/protocol-bench) · [specforge](https://huggingface.co/datasets/nickh007/specforge)