dice-group / ida-pg

GNU Affero General Public License v3.0
6 stars 4 forks source link

Uninteractive code generator #135

Closed Cortys closed 5 years ago

Cortys commented 5 years ago

Implement an uninteractive code generator which gets a user request (task and parameters) and generates a code snippet that fulfills that request.

Cortys commented 5 years ago

Feature branch for this issue: code-generator

Weekly status update: Added support for code snippets to the library modeling submodule. This includes:

Cortys commented 5 years ago

Weekly status update: Started with the implementation of pattern injection as a new type of action during the code search. The current implementation does however not support the completion of incomplete calls with missing callables yet. This will be worked on next.

Cortys commented 5 years ago

Weekly status update: Implemented basic call completion. This uses a recursive placeholder matching algorithm to find a set of candidate completions for incomplete calls. While the matcher already performs deep matching, only shallow placeholder replacement is currently used.

Next steps: Extend the call completion implementation so that it performs proper deep replacement of placeholders. This will be an important milestone for the generation of valid control flow graphs (CFGs). After that I plan to extend the generator with support for optionals and user input to allow for the generation of useful CFGs. After that the conversion of CFGs to executable code strings can begin.

Cortys commented 5 years ago

Weekly status update:

Next steps: Some minor edge cases are still open for the call completion. After those are handled, I plan to add support for optional parameters and to tweak the search heuristics to be suitable for at least the scikit clustering use case.

If time permits, I will then start with the implementation of the inverse parser, that will convert CFGs to Python code.

These steps were already schedules for this week but were delayed due to the optimizations I worked on. Those optimizations were necessary because initial tests showed that the previous implementation was insufficient for real world use cases.

Cortys commented 5 years ago

Weekly status update:

Next steps: Complete the new search heuristic. Then start implementing the reverse parser (already a week late, due to conceptual problems in the old search heuristic approach that had to be figured out first).

Cortys commented 5 years ago

Weekly status update:

Next steps: Implement the CFG to code converter and integrate a semantic type compatibility measure in the cost model.

Cortys commented 5 years ago

Weekly status update:

Next steps:

Cortys commented 5 years ago

Weekly status update:

Next steps: Integrate the generator into the existing IDA chatbot as a POC to show that it actually works.

Cortys commented 5 years ago

Weekly status update:

Next steps: Finalize the generator and get it merged.

Cortys commented 5 years ago

Final update: Completed the integration of the code generation into IDA. Also fixed the stability issues the code executor was having when running as part of ida-ws.

The PR for this feature is #164.