Skip to content

Require regenerating docs/ir/attributes.rst with its script, bring it up to date, and test it - #1587

Merged
jmitrevs merged 3 commits into
fastmachinelearning:mainfrom
vloncar:attr-docs-guide
Oct 19, 2026
Merged

jmitrevs merged 3 commits into
fastmachinelearning:mainfrom
vloncar:attr-docs-guide

Conversation

@vloncar

@vloncar vloncar commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Description

docs/ir/attributes.rst is generated by docs/attr_doc_gen.py, but nothing told contributors to run the
script. The file is out of date on main and is sometimes edited by hand.

  • CONTRIBUTING.md: a new item in the pull request list. If you add layers or backends, or change layer
    attributes or their descriptions, regenerate the file with the script and commit the result. Do not edit it
    by hand. The items of that list are now numbered 1 to 6 in the source instead of all 1..
  • AGENTS.md, .agents/contributing-changes.md, .agents/optimizer-passes.md: a short pointer to that item,
    so the rule is stated in one place only.
  • docs/ir/attributes.rst: regenerated with the script, in its own commit. This adds VitisUnified to the
    "Available in" lists, removes the recurrent and Bidirectional reuse factor settings that Fix recurrent layers on Vivado and Vitis, and add SimpleRNN #1577 removed from
    the Vivado, Vitis and related backends, and updates the description of static changed in Fix recurrent layers on Vivado and Vitis, and add SimpleRNN #1577.
  • test/pytest/test_attribute_docs.py: regenerates the file into a temporary directory and fails if it
    differs from the committed one. It is skipped when backend plugins are installed, because they would appear
    in the output, and when docs/ is absent, because the source distribution includes test/ but not docs/.

The open pull requests #1537, #1545 and #1581 also change docs/ir/attributes.rst. After this one is merged,
they should regenerate the file instead of merging it by hand; the new test fails until they do.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (existing configs, APIs or generated code behave differently)
  • New frontend / backend
  • New layer / operator support
  • New configuration option — a new io_type, Strategy, or config attribute
  • Research paper implementation
  • Documentation
  • Build, CI or tooling
  • Refactor / cleanup (no functional change)

Affected areas

Backends: none (documentation and a test only)

Frontends:

  • Not related to a frontend

Components:

  • IR (layers + model graph) / optimizer passes
  • C++ templates / HLS sources under hls4ml/templates/
  • Profiling, reporting or the CLI
  • Packaging, build or CI

Configurations affected and exercised

Backend io_type Strategy Verified
n/a n/a n/a pytest

Tests

  • test/pytest/test_attribute_docs.py (new) passes on this branch and fails with the version of
    docs/ir/attributes.rst on main (checked by putting that version back for one run).
  • It is skipped when HLS4ML_BACKEND_PLUGINS is set.
  • test/pytest/test_agent_docs.py passes with the edited agent documents.
  • pre-commit run --files on all edited files is clean.

Test configuration: Linux (EL9); Python 3.11 with Keras 3 (TensorFlow backend), and Python 3.10 with
TensorFlow 2.14 (Keras 2). Both environments generate an identical file. No HLS tools are needed.

AI assistance disclosure

  • None — no AI tool was used.
  • Assisted — completion, refactoring, docstrings, tests; design and code are mine.
  • Substantial — significant AI-generated portions, reviewed and edited by me.
  • Agentic — produced largely end-to-end by an AI agent from my prompts.

Tool(s) and model(s): Claude Code (Claude Opus 5.5)

Where it was used: the documentation text, the new test, and running the script to regenerate
docs/ir/attributes.rst.

If anything other than None is ticked, confirm all of the following:

  • I am the author of this contribution and take full responsibility for
    it.
    I have read and understood every line and can explain and defend it
    in review.
  • I verified the generated code against real hls4ml and HLS semantics —
    no invented APIs, config keys, pragmas or citations.
  • All numbers, logs and test results quoted in this PR come from runs I
    actually performed, not from agent output.
  • I have the right to submit this work under the project's licence, and to
    my knowledge it does not reproduce third-party code that would conflict
    with it.
  • No AI tool is credited as an author in any commit in this branch.

Checklist

Required:

  • I have read the contributing guidelines.
  • I installed and ran pre-commit on the files I edited.
  • I added tests under test/pytest covering this change (a bug fix should
    add a test that fails on main and passes here).
  • I self-reviewed the full diff and it contains no leftover debug code,
    commented-out blocks or unrelated changes.
  • The AI assistance disclosure above is complete and accurate.

If applicable:

  • Documentation under docs/ updated.
  • No new build or synthesis warnings.
  • Public API / config schema changes are documented.

Release note

none

@bo3z bo3z left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM but I'll let others review as well before merging

@jmitrevs
jmitrevs merged commit d7212e0 into fastmachinelearning:main Oct 19, 2026
4 checks passed
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.

3 participants