MuType Graph interpreter
RPython compiler has a very well developed testing framework. One key part of it is the graph interpreter. It interprets the LLTyped graph with simulated semantics using Python objects. This interpreter is widely used in unit tests to test the semantic correctness of the LLTyped graphs. Similar framework is also used in test running the RPython JIT.
Currently there is no such thing available for the Mu back-end. This causes the unit tests to be vague, only testing the 'appearance' of translation rather than the 'meaning'. Having a graph interpreter that interprets MuTyped graphs can greatly improve the quality of unit tests, and will be a great help in finding semantic bugs early with the powerful PyTest testing framework. It could also be a great help in testing the Mu back-end for JIT as well.
The main objective is thus to build one such graph interpreter based on the existing
LLInterpreter to assist in writing tests.
A breaking down of objectives would include:
- Review the semantic simulation defined in
mutype.pyto correctly reflect the Mu specification;
- Construct a
MuInterpreterand other related things based on
rpython/rtyper/opimpl; use as much existing frameworks as possible. All the files should be placed under
- Review and improve the quality of existing unit tests for the AoT Mu back-end, and write new tests for things not covered.
- As an extension, investigate
LLGraphCPUand other components used in JIT testing, provide support for Mu back-end if necessary.