Skip to content

Cleanup a5 host_build_graph header guards and stale docs - #1670

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:a5-hbg-cleanup
Aug 4, 2026
Merged

Cleanup a5 host_build_graph header guards and stale docs#1670
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:a5-hbg-cleanup

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two mechanical post-#1661 cleanups in one commit.

Header guard rename

The a5 tree was a verbatim copy of a2a3, so 33 header guards still spelled SRC_A2A3_* and 9 still named TENSORMAP_AND_RINGBUFFER rather than HOST_BUILD_GRAPH. Rename to SRC_A5_RUNTIME_HOST_BUILD_GRAPH to match the actual path. 13 files, each with 3 consistent guard occurrences (ifndef / define / endif).

docs/dfx/args-dump.md — stale host_build_graph references

Two references described the old add_task / set_tensor_info_to_task ABI that #1661 deleted:

  • Line 70 pointed at examples/a5/host_build_graph/vector_example, which does not exist (a5 hbg has no examples). Replaced with the actual scene test path.
  • Section 5.3 and the associated troubleshooting entry described TensorInfo wiring and tensor_info.h, both gone. Rewritten to describe the post-convergence world where tensor metadata comes from PTO2TaskPayload.

No behaviour change — guard rename is a no-op, and the doc edit only touches prose.

Testing

  • All four platforms compile clean (a5sim, a5, a2a3sim, a2a3)
  • a5sim scene tests — 35 passed, host_build_graph 8
  • a2a3sim host_build_graph + task_timing — 17 passed / 4 skipped
  • pre-commit clean
  • CI — a5 onboard scene tests (this box is a2a3 silicon)

@coderabbitai

coderabbitai Bot commented Aug 4, 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: 86379ec8-e07a-42f6-8b1a-061338e80658

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 updates Args Dump documentation for payload-based tensor metadata and renames include guards in A5 host-build-graph headers. Runtime structures, constants, and APIs remain unchanged.

Changes

Args Dump and A5 runtime alignment

Layer / File(s) Summary
Args Dump metadata workflow
docs/dfx/args-dump.md
The documentation uses the host_build_graph/dump_args scene test and describes tensor metadata propagation through PTO2TaskPayload, TensorCreateInfo, and tensor argument APIs.
A5 host-build-graph header guards
src/a5/runtime/host_build_graph/common/pto_runtime_status.h, src/a5/runtime/host_build_graph/runtime/*.h
Header guards and closing comments now use A5 host-build-graph path identifiers. Runtime definitions remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit checks the tensor trail,
Payload metadata fills the pail.
A5 guards now match each door,
Old A2A3 names are no more.
The dump args path is clear and bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the header guard cleanup and documentation updates.
Description check ✅ Passed The description accurately explains both cleanup areas, confirms no behavior changes, and reports testing results.
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 `@docs/dfx/args-dump.md`:
- Line 70: In the bash example in the a5 host_build_graph section, keep the
explanatory text as a comment and move the pytest invocation to its own
following line so it executes when copied.
- Around line 308-314: Update the documentation paragraphs around
host_build_graph, the corresponding section near lines 452-459, and the section
near lines 875-877 to state that tensor arguments provide metadata when existing
Tensors are passed. Describe TensorCreateInfo as the metadata source
specifically for allocated tensor outputs, rather than implying it is required
for every add_input, add_output, or add_inout call.
- Around line 872-874: Update the diagnosis text around
try_log_dump_args_layout_mismatch to apply only when tensors are expected,
explicitly treating tensor_count == 0 as valid for scalar-only add_scalar tasks.
Replace the stale tensor_info reference with the current
PTO2TaskPayload::tensors[] terminology and describe the issue as tensor-missing
rather than a generic payload inconsistency.
🪄 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: 81a8bff1-58d1-4b24-bf4f-492ad57a6dcc

📥 Commits

Reviewing files that changed from the base of the PR and between 26b67fd and 5bf8536.

📒 Files selected for processing (12)
  • docs/dfx/args-dump.md
  • src/a5/runtime/host_build_graph/common/pto_runtime_status.h
  • src/a5/runtime/host_build_graph/runtime/aicore_completion_mailbox.h
  • src/a5/runtime/host_build_graph/runtime/aicore_completion_mailbox_types.h
  • src/a5/runtime/host_build_graph/runtime/dep_gen_host_graph.h
  • src/a5/runtime/host_build_graph/runtime/host_tensor_access.h
  • src/a5/runtime/host_build_graph/runtime/pto_completion_token.h
  • src/a5/runtime/host_build_graph/runtime/pto_constants.h
  • src/a5/runtime/host_build_graph/runtime/pto_dep_compute.h
  • src/a5/runtime/host_build_graph/runtime/pto_runtime2_types.h
  • src/a5/runtime/host_build_graph/runtime/pto_types.h
  • src/a5/runtime/host_build_graph/runtime/runtime.h

Comment thread docs/dfx/args-dump.md Outdated
Comment thread docs/dfx/args-dump.md Outdated
Comment thread docs/dfx/args-dump.md Outdated
@ChaoWao
ChaoWao force-pushed the a5-hbg-cleanup branch 3 times, most recently from ed0acc3 to c1a736d Compare August 4, 2026 01:47
The 13 files under src/a5/runtime/host_build_graph/ that still used
#ifndef SRC_A2A3_* / #define / #endif guards are replaced with #pragma
once, matching the other half of the tree that already uses it. Also
removes the two remaining docs/dfx/args-dump.md references to the old
host_build_graph ABI — the deleted tensor_info.h / set_tensor_info_to_task
API and the non-existent examples/a5/host_build_graph/ path.

Four platforms compile clean; a5sim 35 passed; a2a3sim 17 passed / 4 skipped.
@ChaoWao
ChaoWao merged commit 880e942 into hw-native-sys:main Aug 4, 2026
17 checks passed
@ChaoWao
ChaoWao deleted the a5-hbg-cleanup branch August 4, 2026 02:51
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