Skip to content

Write crates/mohu-buffer/README.md #63

Description

@Bbn08

Summary

crates/mohu-buffer is the memory foundation of mohu and the most complex crate in the workspace, but it has no README.md. New contributors reading the codebase cannot understand the Buffer/Layout/RawBuffer architecture without reading thousands of lines of source.

What to do

Create crates/mohu-buffer/README.md covering:

  1. One-paragraph description of the crate's role (typed, reference-counted, strided byte storage).
  2. Architecture diagram in ASCII: Buffer = Arc<RawBuffer> + DType + Layout + BufferFlags.
  3. A table of the 5 public modules and what each owns (alloc, buffer, layout, ops, pool, strides, view).
  4. Code example showing: Buffer::zeros, Buffer::from_slice, reshape, transpose, as_slice.
  5. A section on DLPack: to_dlpack / from_dlpack with the safety contract.
  6. A section on copy-on-write semantics: share() vs make_unique().
  7. Link to workspace CONTRIBUTING.md.

Acceptance criteria

  • crates/mohu-buffer/README.md exists.
  • Code examples compile (cargo test --doc -p mohu-buffer).
  • ASCII architecture diagram is present.
  • DLPack and CoW sections present.

Signed-off-by: Bbn08 atrancendentbeing@gmail.com

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions