Skip to content

Conversation

@rtfeldman
Copy link
Contributor

Summary

  • Adds a new fuzzer (fuzz-typecheck) that generates syntactically and semantically valid Roc code
  • Verifies the parse-canonicalize-type-check pipeline accepts generated code without crashes or type errors
  • Complements the existing canonicalization fuzzer which tests robustness against arbitrary input

The TypedCodeGenerator maintains scopes with variable-to-type mappings and generates type-correct expressions including:

  • Literals for Bool, Str, List, and all numeric types (U8-U128, I8-I128, F32, F64, Dec)
  • Let bindings with proper type annotations
  • If-then-else expressions
  • Block expressions with nested scopes

Test plan

  • Build with zig build repro-typecheck
  • Test with seed files: ./zig-out/bin/repro-typecheck --verbose <seed_file>
  • Verify generated code parses and type-checks correctly
  • Run with AFL++ for extended fuzzing (requires LLVM)

🤖 Generated with Claude Code

This adds a new fuzzer that generates syntactically and semantically
valid Roc code, then verifies the parse-canonicalize-type-check pipeline
accepts it without crashes or type errors.

The TypedCodeGenerator maintains scopes with variable-to-type mappings
and generates type-correct expressions including:
- Literals for Bool, Str, List, and all numeric types
- Let bindings with proper type annotations
- If-then-else expressions
- Block expressions with nested scopes

This complements the existing canonicalization fuzzer which tests
robustness against arbitrary input - this fuzzer tests correctness
by generating code that should always type-check successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants