Skip to content

docs: describe the memory model as built, and fold the loose files into Antora - #1106

Merged
michalharakal merged 2 commits into
developfrom
feature/docs-memory-architecture
Aug 25, 2026
Merged

michalharakal merged 2 commits into
developfrom
feature/docs-memory-architecture

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes the documentation half of #932: the storage model, the packed-weight contract and the planning tools existed only in design records under docs/design/ and in issue threads. Antora is the docs site, so they belong in it — and the loose Markdown files are gone.

New pages

  • explanation/memory-model.adoc — the model as built: Storage owns bytes, Format says what they mean, Layout says where they are, Scope says how long they live, and TensorView is what a kernel receives. Mermaid class diagram, the decode-step dispatch flow, the two-pool device check, what the observability stream carries, and the numbers measured on an ARMv8.2 Cortex-A55 board. Known limits are stated rather than implied — packed weights still reach the managed heap, mapping is whole-file only.
  • explanation/packed-weight-layout.adoc — the normative block-order contract, promoted from a design record. The two orders, where the order lives, how to convert, the load-boundary orientation rule, what a downstream repository consumes, and the five rules. Kdocs and error messages now point here.
  • how-to/plan-model-memory.adoc — skainet plan, the device profiles, the two-pool fit check, mapped staging on Android, and plan-vs-actual, with real output rather than descriptions of output.
  • explanation/eager-execution.adoc — the backends-and-kernels map that was a loose Markdown file, now a page with the kernel × provider and platform tables and the current gaps.

arc42 refreshed

reference/architecture.adoc describes what is there now:

  • §5.3 Memory model — new building block with a mermaid class diagram showing how Tensor / TensorData sit above TensorView / Storage / Format / Layout / Scope.
  • §6 Runtime view — the ASCII pipeline redrawn as two mermaid flows: the op-level path, and the view/dispatch path (normalize rank → build KernelKey → look up → insert a visible adapter → reference kernel).
  • §8 Cross-cutting — scoped memory, conversions as events, the block-order contract, one observability stream.
  • §9 Decisions — five rows for the storage-first model, key-based dispatch, block order in the layout, matmulWeightTransposed, and quantPolicy × staging.
  • §10 / §11 / §12 — memory quality criteria (flat memory, plan-vs-actual, the golden gate), current risks in place of stale ones, and glossary entries for the new vocabulary.

Diagrams are mermaid throughout, per the repo's offline-mermaid Antora image.

Loose files: folded in, then deleted

Deleted Where its content went
docs/design/memory/memory-architecture-proposal.md, …-milestones-prd.md the memory model page; SKEEP-003 now xrefs the as-built pages
docs/design/memory/packed-weight-layout.md explanation/packed-weight-layout.adoc
docs/design/memory/m2-acceptance.md, spike-…, baseline-… the "Measured" section of the memory model page
docs/eager-execution-backends-and-kernels.md explanation/eager-execution.adoc
docs/export/minerva.md its bundle-layout and graph-source sections moved into how-to/minerva-export.adoc

docs/.docker/README.md stays — it documents the Docker image sitting next to it, not the product.

References in kdocs, error messages, README.md, SKEEP-003 and the kernel matrix now point at the pages. CHANGELOG.md keeps its historical mention, since it records what was true at that release.

Gate

scripts/pr-gate.sh — all legs passed (the .kt files touched are kdoc and error-message text).

🤖 Generated with Claude Code

…to Antora

The storage model, the packed-weight contract and the planning tools were
documented in design records under `docs/design/` and in issue threads.
Antora is the docs site, so they belong in it.

- `explanation/memory-model.adoc` — Storage owns bytes, Format says what
  they mean, Layout says where they are, Scope says how long they live,
  and TensorView is what a kernel receives. Mermaid class diagram, the
  decode-step dispatch flow, the two-pool device check, what the
  observability stream carries, and the numbers measured on an ARMv8.2
  Cortex-A55 board. Known limits are stated, not implied.
- `explanation/packed-weight-layout.adoc` — the normative block-order
  contract: the two orders, where the order lives, how to convert, the
  load-boundary orientation rule, what a downstream repository consumes,
  and the five rules. Kdocs and error messages point here.
- `how-to/plan-model-memory.adoc` — `skainet plan`, the device profiles,
  the two-pool fit check, mapped staging on Android, plan-vs-actual.
- `explanation/eager-execution.adoc` — the backends-and-kernels map that
  was a loose Markdown file, now a page with the kernel × provider and
  platform tables and the current gaps.
- `reference/architecture.adoc` — arc42 refreshed: a memory-model
  building block (§5.3), the runtime view redrawn as two mermaid flows
  including the view/dispatch path, cross-cutting entries for scoped
  memory, visible conversions, the block-order contract and the single
  observability stream, five new decision rows, the memory quality
  criteria, current risks, and glossary entries.

Deleted after folding their content in: `docs/design/memory/` (six
records), `docs/eager-execution-backends-and-kernels.md`, and
`docs/export/minerva.md` — whose bundle layout and graph-source sections
moved into the Minerva how-to. References in kdocs, error messages,
README, SKEEP-003 and the kernel matrix now point at the pages.
`docs/.docker/README.md` stays: it documents the image next to it.

Gate: scripts/pr-gate.sh — all legs passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1106 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1106 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit 1279728 into develop Aug 25, 2026
18 checks passed
@michalharakal
michalharakal deleted the feature/docs-memory-architecture branch August 27, 2026 14:48
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.

1 participant