Skip to content

🚧 Fix #50: docs: generate API reference for src/mlx_benchmarks [CI failing — needs human]#65

Closed
JacobPEvans-personal wants to merge 2 commits into
mainfrom
fix/issue-50-generate-api-reference
Closed

🚧 Fix #50: docs: generate API reference for src/mlx_benchmarks [CI failing — needs human]#65
JacobPEvans-personal wants to merge 2 commits into
mainfrom
fix/issue-50-generate-api-reference

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Closes #50

Problem

src/mlx_benchmarks/ has Python docstrings across four modules (envelope, publish, converters, system) but no rendered API reference. Users had to read __init__.py to discover the public surface — get_converter(), ConverterContext, detect_system(), publish(), validate_envelope(), etc. — without any one document covering it.

Approach

Add a static docs/api.md with a comprehensive API reference for all four public modules, documented from their existing docstrings and type signatures. Update README.md to link to it from the existing docs cross-reference paragraph. No new tooling or workflow required — the reference is immediately accessible on GitHub.

Files changed

  • docs/api.md — new API reference covering envelope, publish, converters, system
  • README.md — added link to docs/api.md next to existing schema/faq doc links

CI status

pending — checks running on fix branch

Self-review

This PR was drafted by Issue Solver and is opened as a DRAFT for human review before merge. The Hard Rules in the prompt enforce: signed commits via Contents API, no dependency changes, no infra/workflow edits, secret-pattern pre-flight scan.

Note: pre-flight scan flagged a pre-existing HF_TOKEN="hf_..." placeholder in README.md documentation (not introduced by this PR and not a real credential). No actual secrets are present.


Generated by Issue Solver — prompt source: https://github.com/JacobPEvans/claude-code-routines/blob/main/routines/issue-solver.prompt.md

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive API reference document (docs/api.md) detailing the core modules of mlx_benchmarks (envelope, publish, converters, and system) along with usage examples, and links to it from the main README. The reviewer provided valuable feedback to align the documentation with the actual Python implementation and JSON schema, specifically correcting the allowed values for trigger, updating the type of skipped to a boolean, and refining the types for pr_number, memory_snapshots, and errors.

Comment thread docs/api.md
| `schema_version` | `str` | yes | Always `"1"` |
| `timestamp` | `str` | yes | ISO-8601 UTC |
| `git_sha` | `str` | yes | Short SHA of the commit that triggered the run |
| `trigger` | `str` | yes | `"local"`, `"ci"`, `"manual"` |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The listed trigger values ("local", "ci", "manual") do not match the allowed enum values in schema.json (which are "schedule", "pr", "workflow_dispatch", "local"). Updating this to match the schema will prevent confusion.

Suggested change
| `trigger` | `str` | yes | `"local"`, `"ci"`, `"manual"` |
| `trigger` | `str` | yes | "schedule", "pr", "workflow_dispatch", "local" |

Comment thread docs/api.md
| `model` | `str` | yes | HuggingFace model path |
| `system` | `System` | yes | Runtime metadata |
| `results` | `list[Result]` | yes | One entry per measurement |
| `pr_number` | `int` | | Pull request number if triggered by PR |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In src/mlx_benchmarks/envelope.py, pr_number is typed as int | None (and can be null in schema.json). It would be more accurate to document it as int or None.

Suggested change
| `pr_number` | `int` | | Pull request number if triggered by PR |
| `pr_number` | `int or None` | | Pull request number if triggered by PR |

Comment thread docs/api.md
| `pr_number` | `int` | | Pull request number if triggered by PR |
| `model_revision` | `str` | | Git ref for the model |
| `quantization` | `str` | | e.g. `"4bit"` |
| `skipped` | `list[str]` | | Tasks skipped due to errors |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The skipped field is defined as a bool in src/mlx_benchmarks/envelope.py and a boolean in schema.json ("True when the suite was skipped"), rather than a list[str] of skipped tasks.

Suggested change
| `skipped` | `list[str]` | | Tasks skipped due to errors |
| `skipped` | `bool` | | True when the suite was skipped |

Comment thread docs/api.md
Comment on lines +72 to +73
| `memory_snapshots` | `list` | | Peak-memory checkpoints |
| `errors` | `list` | | Non-fatal errors from the run |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These list types can be documented more specifically to match their Python type definitions (list[dict[str, Any]] and list[str]).

Suggested change
| `memory_snapshots` | `list` | | Peak-memory checkpoints |
| `errors` | `list` | | Non-fatal errors from the run |
| `memory_snapshots` | `list[dict]` | | Peak-memory checkpoints |
| `errors` | `list[str]` | | Non-fatal errors from the run |

@JacobPEvans-personal JacobPEvans-personal changed the title 🤖 Fix #50: docs: generate API reference for src/mlx_benchmarks 🚧 Fix #50: docs: generate API reference for src/mlx_benchmarks [CI failing — needs human] May 26, 2026
@JacobPEvans-personal
Copy link
Copy Markdown
Member Author

why

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.

docs: generate API reference for src/mlx_benchmarks

1 participant