Skip to content

Add TON language support: Tact, FunC, and Tolk#52

Open
mysteryon88 wants to merge 53 commits intoagroce:masterfrom
mysteryon88-forks:master
Open

Add TON language support: Tact, FunC, and Tolk#52
mysteryon88 wants to merge 53 commits intoagroce:masterfrom
mysteryon88-forks:master

Conversation

@mysteryon88
Copy link
Copy Markdown

Summary

I have known this tool for a long time and wanted to make a small but useful contribution to its development.

This PR adds mutation testing support for three TON languages: Tact, FunC, and Tolk. I tried to keep changes to the existing codebase as limited as possible and stay close to the current architecture, but along the way I also made a few targeted improvements in the core and surrounding infrastructure to make the integration more stable and practical.

What Changed

  • added support for .tact, .fc / .func, and .tolk files so the new languages can be detected by extension and flow through the existing mutation pipeline
  • added both regex rules and Comby rules for all three languages, plus shared TON rules, so both mutation modes are supported without drifting apart in their core rule families
  • added handlers and a compile-check flow so that only valid mutants are kept, automatically filtering out mutants that do not pass compiler validation
  • made small, focused updates to genmutants.py, mutator.py, and a few related parts: this includes proper TON rule set / matcher selection, less noise in some swap and regex cases, and more robust execution and temp-file handling
  • fixed mutant path handling so basename extraction now works correctly for both Windows-style (\) and Unix-style (/) paths, which makes downstream commands such as show_mutants and related flows behave consistently on both platforms
  • added and updated tests, examples, and packaging so the new rules and handlers are reproducible locally and are correctly included in the package
  • made a small CI/CD update so the new scenarios are better covered by automated checks

Why

  • I wanted to bring TON smart contract support to a tool I have known and appreciated for a long time
  • I intentionally avoided large refactors and tried to fit the new languages into the existing design
  • the accompanying core changes were only added where they directly helped the new languages and also improved the overall behavior of the tool

Next Steps

  • I plan to continue supporting and developing the TON side of this tool
  • at this point, I believe the main integration work has been completed
  • next, I want to revisit and refine the mutation rules
  • Tolk is currently evolving quite actively, so it is likely that new mutation rules for it will appear over time

Validation

  • implemented and verified both regex rules and Comby rules
  • checked the flow on both Windows and Linux
  • added a regression test for cross-platform mutant path handling to make sure Windows-style paths also work correctly in the analysis/show pipeline
  • ran test mutation flows for all three languages: Tact, FunC, and Tolk
  • based on the current runs, everything works well; if helpful, I can also attach additional statistics and run summaries

xzescha and others added 30 commits December 25, 2025 21:22
…le validity checks.

[new] Added Makefile and updated README (sorry for Russian in it but I'll work on it later)
[fix] Fixed genmutants.py and mutator.py for work with up-to-date libraries.
- skip universal numeric literal mutations for dense sums in store_uint/store_int (func-only, regex mode)
- add inline/inline_ref removal to static and comby rules
- update FunC rule tests and mutation table; document core changes in FORK
- skip swaps for identical lines (including same content after strip)
@mysteryon88
Copy link
Copy Markdown
Author

@agroce

Hi! I’d appreciate your review and feedback.

@agroce
Copy link
Copy Markdown
Owner

agroce commented May 4, 2026

@mysteryon88 will take a look! it'll take a bit, since I'm finishing up grading for semester and other things, but I'll put this a bit ahead of student submits. one thing to note that you might want to look at yourself, and I'll try to handle this week so you can take advantage, is that I'm finally dumping the terrible hand parsing of command line arguments and using a sane argparse approach, assuming a student PR for this works (I have a few candidates).

@agroce
Copy link
Copy Markdown
Owner

agroce commented May 4, 2026

And thanks very much! At a look, lots of little cleanups, including I think I saw in analyze.py some fixes I'd applied elsewhere and never done there! The problem with having a professor as the "code guy" is that my actual employer has zero interest in my doing this stuff well!

@mysteryon88
Copy link
Copy Markdown
Author

@agroce
Thanks! I’ll keep an eye on the changes and update my pull request once your updates are in. Glad the small cleanups look useful — I tried to keep them focused and low-risk, especially in places like analyze.py.

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.

4 participants