graph TD
%% Core Modules
Core["skainet-lang-core<br/>📦 Multiplatform Core<br/>• Tensor operations<br/>• Common interfaces"]
Models["skainet-lang-models<br/>📦 Model Definitions<br/>• Neural network models<br/>• MNIST, CNN implementations"]
%% KSP Infrastructure
Annotations["skainet-lang-ksp-annotations<br/>📝 Annotation Definitions<br/>• @NotImplemented<br/>• @InProgress<br/>• Backend status markers"]
Processor["skainet-lang-ksp-processor<br/>🔧 KSP Processor<br/>• SymbolProcessor implementation<br/>• Code generation logic<br/>• kotlinpoet integration"]
ExportOps["skainet-lang-export-ops<br/>🚀 Ops Renderer/Exporter<br/>• Uses KSP for doc generation<br/>• Operator metadata extraction<br/>• JSON output generation"]
%% Generated Artifacts
JSON["operators.json<br/>📄 Generated Metadata<br/>• Function signatures<br/>• Backend status<br/>• Version info"]
Generated["Generated Code<br/>⚡ KSP Output<br/>• Documentation fragments<br/>• AsciiDoc files<br/>• Status matrices"]
%% Dependencies and Flow
Core --> Annotations
Models --> Core
Processor --> Annotations
ExportOps --> Core
ExportOps --> Annotations
ExportOps --> |"ksp dependency"| Processor
%% KSP Processing Flow
Processor --> |"processes"| JSON
Processor --> |"generates"| Generated
%% Build Configuration
subgraph "Build Process"
KSP["KSP Plugin<br/>🔨 Kotlin Symbol Processing"]
Gradle["Gradle Tasks<br/>📋 Build Orchestration"]
KSP --> Processor
Gradle --> KSP
Gradle --> ExportOps
end
%% Notes
classDef coreModule fill:#e1f5fe
classDef kspModule fill:#f3e5f5
classDef generatedModule fill:#e8f5e8
classDef errorModule fill:#ffebee
class Core,Models coreModule
class Annotations,Processor,ExportOps kspModule
class JSON,Generated generatedModule
class miKrograd errorModule
KSP Gradle Module Structure for SKaiNET
Based on the analysis of the project structure, here's a mermaid diagram visualizing the KSP-related Gradle modules and their relationships:
graph TD %% Core Modules Core["skainet-lang-core<br/>📦 Multiplatform Core<br/>• Tensor operations<br/>• Common interfaces"] Models["skainet-lang-models<br/>📦 Model Definitions<br/>• Neural network models<br/>• MNIST, CNN implementations"] %% KSP Infrastructure Annotations["skainet-lang-ksp-annotations<br/>📝 Annotation Definitions<br/>• @NotImplemented<br/>• @InProgress<br/>• Backend status markers"] Processor["skainet-lang-ksp-processor<br/>🔧 KSP Processor<br/>• SymbolProcessor implementation<br/>• Code generation logic<br/>• kotlinpoet integration"] ExportOps["skainet-lang-export-ops<br/>🚀 Ops Renderer/Exporter<br/>• Uses KSP for doc generation<br/>• Operator metadata extraction<br/>• JSON output generation"] %% Generated Artifacts JSON["operators.json<br/>📄 Generated Metadata<br/>• Function signatures<br/>• Backend status<br/>• Version info"] Generated["Generated Code<br/>⚡ KSP Output<br/>• Documentation fragments<br/>• AsciiDoc files<br/>• Status matrices"] %% Dependencies and Flow Core --> Annotations Models --> Core Processor --> Annotations ExportOps --> Core ExportOps --> Annotations ExportOps --> |"ksp dependency"| Processor %% KSP Processing Flow Processor --> |"processes"| JSON Processor --> |"generates"| Generated %% Build Configuration subgraph "Build Process" KSP["KSP Plugin<br/>🔨 Kotlin Symbol Processing"] Gradle["Gradle Tasks<br/>📋 Build Orchestration"] KSP --> Processor Gradle --> KSP Gradle --> ExportOps end %% Notes classDef coreModule fill:#e1f5fe classDef kspModule fill:#f3e5f5 classDef generatedModule fill:#e8f5e8 classDef errorModule fill:#ffebee class Core,Models coreModule class Annotations,Processor,ExportOps kspModule class JSON,Generated generatedModule class miKrograd errorModuleModule Breakdown
Core Modules
skainet-lang-core: Multiplatform core module with tensor operations and common interfacesskainet-lang-models: Contains neural network model implementations (MNIST, CNN, etc.)KSP Infrastructure
skainet-lang-ksp-annotations: Defines annotations for backend status tracking@NotImplemented(backends: Array<String>)@InProgress(backends: Array<String>, owner: String, issue: String)skainet-lang-ksp-processor: KSP processor implementation:miKrograd-annotationsinstead of:skainet-lang-ksp-annotationsskainet-lang-export-ops: Ops renderer/documentation generatoroperators.jsonwith function signatures and backend status:miKrogradprojectsGenerated Artifacts
operators.json: Machine-readable metadata about operatorsKey Issues Identified
Naming Inconsistency: Build files reference
:miKrograd-*modules but actual directories are namedskainet-lang-*Incomplete Module Registration:
settings.gradle.ktsonly includes 2 modules but 5 modules exist in the filesystemBroken Dependencies: KSP processor cannot find its annotation dependencies due to incorrect module references
KSP Workflow
sequenceDiagram participant Gradle participant KSP participant Processor participant Annotations participant ExportOps participant Output Gradle->>KSP: Execute kspJvm task KSP->>Processor: Load OperatorDocProcessor Processor->>Annotations: Read @NotImplemented/@InProgress Processor->>Processor: Scan operator interfaces Processor->>Output: Generate operators.json ExportOps->>Output: Read operators.json ExportOps->>Output: Generate AsciiDoc fragmentsRequired Fixes
settings.gradle.ktsto include all modules:Fix module references in build files:
:miKrograd-annotations→:skainet-lang:skainet-lang-ksp-annotations:miKrograd-processor→:skainet-lang:skainet-lang-ksp-processorEstablish proper dependency chain for the KSP documentation pipeline