Refactor: Component-based architecture#192
Conversation
This refactoring restructures the Proteus JIT compilation system into distinct components: - Engine: Encapsulates backend details and creates compilation tasks - CompilationTask: Represents a function with specific specialization - Builder: Transforms CompilationTask into CompilationResult - CompilationResult: Contains function pointer and execution info - Cache: Manages storage and retrieval of compilation results - Code: Represents the extracted function code (LLVM IR) - CodeContext: Maintains registry of functions and lambdas This redesign creates a cleaner separation of concerns, with each component having a focused responsibility, making the system more modular and maintainable. Added DESIGN.md to document the new architecture.
This change adds a proper Builder interface and refactors the CompilerSync and CompilerAsync classes to use it: 1. Created a generic Builder interface 2. Implemented SyncBuilder for synchronous compilation 3. Implemented AsyncBuilder for asynchronous compilation 4. Updated CompilerSync and CompilerAsync to use these builders 5. Added a helper method in JitEngineHost to demonstrate using the new Builder This implementation provides better separation of concerns between the compilation strategy (sync vs async) and the actual compilation work. It aligns with the component-based architecture described in DESIGN.md.
This commit adds: - Engine base class with common functionality - CPU, CUDA, and HIP backend implementations - Integration with SyncBuilder and AsyncBuilder - Migration path from JitEngineHost to Engine - Test program for the Engine component - Enhanced architecture documentation and component diagram 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Cpp-Linter Report
|
Summary
This PR refactors the Proteus JIT compilation system into a component-based architecture with clear separation of concerns:
This change is intended to make the system more modular, maintainable, and easier to extend with new features.
Added DESIGN.md to document the new architecture.
Test plan
This is a refactoring PR that introduces the new architecture but doesn't change any existing behavior.
After merging this PR, additional PRs will gradually migrate the existing implementation to the new components.
🤖 Generated with Claude Code