Fuzzing: generate Prodigy's AST and print it with the existing printers

Open
#246 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
compilers, testing

Research direction

Start with tests/fuzzing/programs.py and compare its expression and statement generators with prodigy.pgcl.ast and the existing printers, including ppy_printer. Keep prodigy/simulator.py independent as the simulation oracle. Add a separate text-to-AST-to-text round-trip check, then run the fuzz and simulation tests; they should remain green without getting slower and still find the same bug classes.

Written by the indexing model from the issue text.

Description

area: maintenance priority: low

Priority: low. Part of the code quality pass #221.

tests/fuzzing/programs.py (from #245, about 400 lines) has its own small AST for expressions and statements and its own text output for .ppy and .pgcl (render_expr, render_stmt). This duplicates prodigy.pgcl.ast and the existing printers (ppy_printer etc.).

The simulator (prodigy/simulator.py) is not part of this: it deliberately evaluates programs independently of the generating-function code, so it can serve as an oracle.

Done when

  • The Hypothesis strategies generate prodigy.pgcl.ast programs, and the existing printers produce their .ppy and .pgcl text.
  • The round trip text → AST → text is tested separately, so parser and printer bugs are still found.
  • The fuzzing finds the same bug classes as before. Features keeps switching off known open bug classes.
  • Behaviour-preserving: the fuzz and simulation tests stay green and do not get slower.

🤖 Generated with Claude Code

Dominant language
Python
Stars
6
Forks
2
Avg merge
1h 52m
Merged PRs (30d)
187

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LKlinke/Prodigy

All issues in LKlinke/Prodigy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.