Skip to content

s2 parity 2: every s1 test covered by s2c; --eval, --hash, --store-check; type facts, generic escapes - #29

Merged
vic merged 3 commits into
mainfrom
s2c-parity2
Nov 9, 2026
Merged

vic merged 3 commits into
mainfrom
s2c-parity2

Conversation

@vic

@vic vic commented Nov 9, 2026

Copy link
Copy Markdown
Owner

After this PR, tests/s2/todo is empty. s2c detects all 125 negative tests and compiles and runs all 33 programs. It also passes the eval, hash and store suites.

  • Tl: value args and value binders are type-checked (NoVals, ArgType, BinderType, PatType). Tl.typeGoals gives the {} goals of the types a def names. Ty.checkWith resolves them with the def's own binders; a protocol goal needs one capability in scope.
  • Fx also checks the fact groups of type decls.
  • s2/eval.srs (Ev) is the comptime evaluator, with fuel and division by zero as rejects. It backs s2c --eval.
  • s2/hash.srs (Hs) gives Unison content hashes: locals by position, refs by hash, and SCC members by position, ordered by their first-pass hash (Tarjan). It backs s2c --hash.
  • s2/store.srs: an entry is the decl as the printer writes it, keyed by its hash. The read-back check is parse, then print, then compare. rt gains rt_capture_begin and rt_capture_end, so printer output can become a string. It backs s2c --store-check.
  • Flow: the result of a call whose result type is a [] binder of the callee keeps every arg's region (vic-m5r.15), and so does an evidence method result.
  • Type facts: a type with <> facts stays nominal. Ty widens it to its body, so OpenFile can be used where Ptr is wanted, but not the reverse. Emit gives it its body's C type. Flow rejects a read of such a value when its capability is no longer in the state the type names.

Gate: 372 ok, 0 FAIL, 0 todo. Store oracle: a cut entry is detected for all 16 entries (checked one by one).

vic added 3 commits November 9, 2026 03:23
…eric results, type facts (nominal fact types, stale reads); every s1 test covered in tests/s2
@vic
vic merged commit fba2b44 into main Nov 9, 2026
3 checks passed
@vic
vic deleted the s2c-parity2 branch November 17, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant