Skip to content

Add drift test for optimization pass documentation #34

@bachase

Description

@bachase

Problem or motivation

The instruction reference has a drift test that checks C++ opcodes and HIR operation types against docs/opcodes.json. Optimization pass documentation does not have an equivalent guard.

Pass metadata is registered in src/clifft/optimizer/pass_registry.h, while the docs metadata is manually mirrored in docs/macros.py. If a pass is added, removed, renamed, or has its default-enabled status changed, the docs can silently drift.

Proposed solution

Add a focused Python test, similar in spirit to tests/python/test_opcode_docs.py, that verifies pass documentation is complete relative to the C++ pass registry.

Suggested acceptance criteria:

  • Parse src/clifft/optimizer/pass_registry.h for registered pass names.
  • Check that every registered pass appears in the pass metadata exposed from docs/macros.py or an equivalent docs data source.
  • Optionally also check kind/default-enabled metadata if that can be done without making the test brittle.
  • The test should fail with an actionable message when docs metadata is missing or stale.

Alternatives considered

A future refactor could move pass docs metadata into a shared structured file, but a small drift test is likely the best first step. It keeps the issue approachable and matches the existing pattern used for opcode documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions