Agent docs - #1527
Open
vloncar wants to merge 4 commits into
Open
Conversation
Builds on the AI tool usage section with the points raised in review: - CONTRIBUTING.md: fix typos and the LICENSE link; state that PRs are squash-merged and that the PR description is the permanent record; require that quoted numbers come from real runs; forbid crediting AI tools as commit authors, since authorship carries copyright a tool cannot hold and the trailers distort contributor statistics. - PULL_REQUEST_TEMPLATE.md: replaced. Instructions are HTML comments so they do not survive into the submitted description. Adds affected-area, configuration and generated-HLS sections, and an AI assistance disclosure with attestations the contributor makes about their own review. - ISSUE_TEMPLATE: converted to YAML issue forms, giving a chooser with bug report, performance issue, feature request, plan/RFC and documentation categories, plus discussion links for questions and ideas. Forms ask for the version, frontend, backend and io_type that reports usually omit. - AGENTS.md: the same expectations in a form AI agents read, kept short so harnesses that inject it into every request can afford it.
37 tasks
JanFSchulte
approved these changes
Aug 28, 2026
JanFSchulte
left a comment
Contributor
There was a problem hiding this comment.
Looks good and very complete to me. The agent docs should probably be required reading for all humans wanting to contribute as well, very nice :-D.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ oooh a shiny new template ✨
Description
AGENTS.md(added in #1514) tells an AI agent how to behave in this repository. It does not tell it how hls4ml works. An agent therefore learns the codebase by exploring it, and gets it wrong in the same few ways every time: assuming one backend's conventions hold for all of them, generalizing fromDenseto layer families that share none of its structure, and quoting C synthesis estimates as if they were measured results.This PR adds that knowledge as plain Markdown under
.agents/, withAGENTS.mdrouting to it. Twelve documents: how a model is converted and run, a map of the pipeline, the frontends, the optimizer passes, the C++ kernels, precision and debugging, evaluating an implementation, standing up a backend, toolchain access, contributing a change, reporting an issue, and a template for site-specific setup.Three things shaped how they are written:
strategyfield, thekerneltypedef and thennet_utilslayout exist in the Vivado family; Quartus and oneAPI have neither, oneAPI uses pipes and its own template classes, and the symbolic backend has no kernels at all. Documentation that presents the Vivado shape as "how hls4ml works" is what sends a contributor down the wrong path.local-setup.template.mdis a skeleton each group fills in for itself. If people are interested, I can provide my cvmfs-based setup that would work well for CERN people (onsite or users through lxplus/lxtunnel).agents/agent_adapters.pyrenders them into each layout on demand. Generated output is git-ignored, so.agents/stays the only copy anyone edits. Pointing an assistant straight at.agents/also works.Documentation about mechanisms rots faster than the code it describes, so
test/pytest/test_agent_docs.pychecks that every repository path these documents mention still exists, that the front matter parses, and that the links between them resolve. A renamed module fails the suite.Relates to #1514
Type of change
Affected areas
Backends:
hls4ml.model)Frontends:
Components:
Configurations affected and exercised
Not applicable — this PR adds documentation, a helper script and a test. No conversion path is touched.
Impact on generated HLS
Tests
test/pytest/test_agent_docs.py— 38 checks over the twelve documents:Runs in under a second and needs no toolchain. I also verified it is not vacuous: it accepts current paths and rejects renamed ones.
Test configuration: Linux, Python 3.11, pytest 9.1.1. No HLS tool involved.
AI assistance disclosure
Tool(s) and model(s): Claude Code (Claude Opus 5)
Where it was used: Everywhere. The documents are largely from my extensive prompts with bullet points i felt are important to be included. The adapter script and the test were fully generated by the agent. All of it was reviewed and revised by me over several rounds.
If anything other than None is ticked, confirm all of the following:
Checklist
Required:
pre-commiton the files I edited.test/pytestcovering this change (a bug fix should add a test that fails onmainand passes here).If applicable:
docs/updated.Release note