Skip to content

s2/mono: instances from the roots (B1) - #23

Merged
vic merged 1 commit into
mainfrom
s2-mono-b1
Nov 9, 2026
Merged

vic merged 1 commit into
mainfrom
s2-mono-b1

Conversation

@vic

@vic vic commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Self-host rung B1: monomorphization (s2/mono.srs), as s1/mono.srs.

  • Roots are the non-generic defs.
  • Each generic call reached from an instance becomes a key: callee plus type args, reified with the final substitution and with the instance's binders replaced.
  • A new key makes an instance, which is then scanned in turn.
  • The made set is a 2-3-4 tree from key hash to a bucket of keys.

Oracle: over s2's own sources, more than 100 generic instances, none with an unsolved type left. A small program reaches exactly Coll.length[I64], Coll.lengthFrom[I64], Coll.rev[I64], Coll.revOnto[I64]. Two mutants (binders not replaced, reached instances not scanned) each change the output. Local tests/run.sh: 186 ok, 0 FAIL.

…ung B1)

As s1/mono.srs: the roots are the non-generic defs; each generic call reached from an instance's body,
with its type args reified by the final substitution and the instance's binders replaced, is a key
(callee + ground args); a new key makes an instance (the El.Fn and its binders' args) to scan. The
made set is a 2-3-4 tree from a key hash to a bucket of keys.

tests/s2/types: over s2's own sources more than 100 generic instances, none with a var left; a small
program reaches exactly Coll.length[I64], Coll.lengthFrom[I64], Coll.rev[I64], Coll.revOnto[I64].
Mutants: binders not replaced, reached instances not scanned: each changes the output.
@vic
vic merged commit 50a8886 into main Nov 9, 2026
3 checks passed
@vic
vic deleted the s2-mono-b1 branch November 9, 2026 06:27
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