Skip to content

Scale ops docs: KSP TensorOps surface scan + human-prose partials #511

@michalharakal

Description

@michalharakal

Context

The Ops reference in the Antora site is near-empty: only 4 hand-annotated symbols produce generated scaffolds. The pipeline (OperatorDocProcessor KSP → operators.jsonGenerateDocumentationTask → AsciiDoc) works end-to-end, but coverage is bottlenecked on @DslOp / @InProgress annotations, the backend matrix drifts from reality, and there's nowhere for human-authored math/intuition/examples to live alongside the generated reference.

Goal

One URL per op that fuses auto-discovered signature + backend matrix with hand-authored prose + LaTeX math, scaling across the full TensorOps surface and any number of compute backends.

Approach

Three cooperating layers, reusing the existing pipeline.

Layer 1 — KSP discovery: scan the interface, not just annotations

  • New @Backend(id, displayName) class annotation in skainet-lang-ksp-annotations.
  • OperatorDocProcessor walks TensorOps and every @Backend-tagged implementor, deriving statusByBackend from override presence.
  • Annotations remain authoritative overrides for owner/issue notes.

Layer 2 — Generator fusion: human partials per function

  • GenerateDocumentationTask emits include::partial\$ops/<op>/<fn>.adoc[tag=...,optional] for math / intuition / examples / references between auto sections.
  • Missing partials render cleanly as empty — graceful scale-up.

Layer 3 — Backend matrix stays auto

  • Existing ops-status-matrix.adoc already aggregates statusByBackend; once Layer 1 populates it from real impls the matrix becomes ground truth.

Status

Layers 1–3 landed for skainet-lang-core (commit referenced this issue). Coverage went from 4 → ~50 methods; void column is real. matmul migrated as the partials reference example.

Follow-up (Layer 4)

Wire KSP into skainet-backend-cpu and merge multiple operators.json files in generateOperatorDocs so the cpu and apple columns appear alongside void.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions