Skip to content

Add: directory indexes for examples/, examples/a2a3/, examples/a5/ - #1564

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:docs/examples-directory-indexes
Jul 29, 2026
Merged

Add: directory indexes for examples/, examples/a2a3/, examples/a5/#1564
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:docs/examples-directory-indexes

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Of the three branches under examples/, only workers/ had an index. The 22 @scene_test examples under a2a3/tensormap_and_ringbuffer/ and a5/tensormap_and_ringbuffer/ were reachable only by listing the directory, with nothing to say what distinguished one from the next.

  • examples/README.md — states the organizing principle, which the tree does not show: workers/ teaches how the runtime works through the raw Worker API and is split by level; a2a3/ and a5/ teach how to write and validate a kernel through @scene_test and are split by architecture.
  • examples/a2a3/tensormap_and_ringbuffer/README.md and examples/a5/tensormap_and_ringbuffer/README.md — group each tree's examples by what they add (first kernel → compute → asynchronous completion and cross-card transfer) and record the platforms each is marked for. Most are onboard-only, which is invisible until a run silently deselects them.

Two things that were previously undiscoverable:

  • docs/INCORE_ORCHESTRATION_GUIDE.md had no inbound link from anywhere in the repo. It is the one document explaining the AICPU-side orchestration model that every example in both trees depends on — orchestration runs on the AICPU, TensorMap discovers dependencies from tensor overlap, task memory comes from ring buffers. Both indexes now open by pointing at it.
  • Seven examples exist under both architectures with the same name and are ports of each other: vector_example, paged_attention, paged_attention_manual_scope, paged_attention_unroll_manual_scope, async_notify_demo, deferred_notify_demo, sdma_async_completion_demo. They differ mainly in tile shapes and platform strings — vector_example differs by two lines of 72. Each index names the shared seven and the ones unique to it, so a change to one side is not made without seeing the other. This documents the duplication; it does not attempt to remove it.

The root README's examples/a2a3/ reference is retargeted at the new index.

Testing

  • markdownlint-cli2 --config tests/lint/.markdownlint.yaml — 0 errors on all four files
  • Every relative link resolves to an existing path
  • Platform claims cross-checked against each test's @scene_test CASES[*]["platforms"] or @pytest.mark.platforms, and device counts against device_count markers
  • Examples not executed — this worktree has no built project venv, and the change is documentation only

Docs only; no code, test, or build files touched.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ebca1c74-1fd7-45df-815e-610cbb3232a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR expands documentation for the examples directory, adds detailed a2a3 and a5 tensormap/ringbuffer guides, and updates the root references section to point to the general examples index.

Changes

Examples documentation

Layer / File(s) Summary
Examples index and usage guide
README.md, examples/README.md
The repository reference now points to the examples index, which documents entry points, pytest execution, directory layout, prerequisites, and related guides.
Tensormap and ringbuffer guides
examples/a2a3/tensormap_and_ringbuffer/README.md, examples/a5/tensormap_and_ringbuffer/README.md
Architecture-specific guides describe orchestration behavior, categorized examples, simulator and hardware commands, and differences between the a2a3 and a5 sets.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit with docs in my den,
Mapping examples from start to end.
Ring buffers hop, kernels shine,
A2A3 and A5 align.
Read, run, and learn again!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the addition of directory indexes for the examples trees.
Description check ✅ Passed The description matches the change and explains the new example indexes and documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/a2a3/tensormap_and_ringbuffer/README.md`:
- Around line 37-39: Update the scope statement in the README to exempt
deferred_notify_demo from the onboard-only classification, while keeping the
statement that the other examples require onboard hardware and transfer demos
need two dies.

In `@examples/README.md`:
- Around line 10-11: Complete the sentence in the example introduction by
changing the kernel-examples clause to say “if kernels are new to you,” while
preserving the existing runtime guidance and sentence structure.
- Around line 15-20: Revise the examples/README.md description so it claims
pytest collects the relevant test files and cases, not everything under
examples/. Keep standalone worker examples and their script-based invocations
documented separately from the pytest commands, while preserving the simulator
and hardware command details.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6588ce55-9f9d-4919-9ef2-01fe58ff55a4

📥 Commits

Reviewing files that changed from the base of the PR and between 321954b and 3f64b0c.

📒 Files selected for processing (4)
  • README.md
  • examples/README.md
  • examples/a2a3/tensormap_and_ringbuffer/README.md
  • examples/a5/tensormap_and_ringbuffer/README.md

Comment thread examples/a2a3/tensormap_and_ringbuffer/README.md Outdated
Comment thread examples/README.md Outdated
Comment thread examples/README.md
@ChaoWao
ChaoWao force-pushed the docs/examples-directory-indexes branch from 3f64b0c to 4d9e3f8 Compare July 29, 2026 04:26
Of the three branches under `examples/`, only `workers/` had an index. The 22
`@scene_test` examples under `a2a3/tensormap_and_ringbuffer/` and
`a5/tensormap_and_ringbuffer/` were reachable only by listing the directory,
and nothing said what distinguished one from the next.

`examples/README.md` states the organizing principle, which is not visible
from the tree: `workers/` teaches how the runtime works through the raw
`Worker` API and is split by level, while `a2a3/` and `a5/` teach how to write
and validate a kernel through `@scene_test` and are split by architecture.

The two per-architecture indexes group their examples by what each one adds —
first kernel, compute, asynchronous completion and cross-card transfer — and
record which platforms each is marked for and how many dies it needs, since
most are onboard-only and that is invisible until a run silently deselects.
The exceptions are named rather than generalized over: `deferred_notify_demo`
runs the simulator path on both architectures, and `prefetch_async_demo` is
the one async demo that needs a single die.

Two facts that were previously undiscoverable:

- `docs/INCORE_ORCHESTRATION_GUIDE.md` explains the AICPU-side orchestration
  model every example in both trees depends on, and had no inbound link from
  anywhere in the repo. Both indexes now open by pointing at it.
- Seven examples exist under both architectures with the same name and are
  ports of each other, differing mainly in tile shapes and platform strings
  (`vector_example` differs by two lines). Each index names the seven and the
  ones unique to it, so a change to one side is not made without seeing the
  other.

The root README's `examples/a2a3/` reference is retargeted at the new index.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChaoWao
ChaoWao merged commit 5cbbeb4 into hw-native-sys:main Jul 29, 2026
14 checks passed
@ChaoWao
ChaoWao deleted the docs/examples-directory-indexes branch July 29, 2026 06:24
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