Skip to content

Support Instruction Dependency column and Discovery.adoc scraping/XML output#80

Open
raul-marquez-csa wants to merge 2 commits into
project-chip:mainfrom
raul-marquez-csa:icd-tables
Open

Support Instruction Dependency column and Discovery.adoc scraping/XML output#80
raul-marquez-csa wants to merge 2 commits into
project-chip:mainfrom
raul-marquez-csa:icd-tables

Conversation

@raul-marquez-csa

@raul-marquez-csa raul-marquez-csa commented Jun 18, 2026

Copy link
Copy Markdown

Addresses
Alchemy for hint tables #71750

Add Instruction Dependency column support

Alchemy ignores any bitmap-table column it doesn't have an explicit TableColumn for, so the new column has to be threaded through the whole pipeline. The following was performed:

  • matter/tables.go

    • added a TableColumnInstructionDependency column and registered it in the bitmap table's column set
  • matter/spec/table.go

    • mapped the "Instruction Dependency" header to that column
  • matter/bitmap.go

    • added an InstructionDependency field (plus getter/setter) to BitmapBit, exposed it on the Bit interface,
      and propagated it through Clone/JSON
  • matter/spec/bitmap.go

    • toBitmap() reads the column per bit
  • dm/bitmap.go

    • renderBit() emits an instructionDependency XML attribute when a value is present

Fix SpecialCharacter table-cell parsing

SpecialCharacter cells are stored as values, not pointers, so the pointer-form type switch never matched and any cell containing one errored out, a path the PairingHintBitmap table's bit-21 row is the first to hit. The fix:

  • matter/spec/table_info.go

    • changed readRowCellValueElements() from case *asciidoc.SpecialCharacter: to the value form case asciidoc.SpecialCharacter:

Impact

  • Bitmap tables that define an Instruction Dependency column now emit an instructionDependency attribute on each ; bitmaps without the column are unaffected, since the attribute is omitted when empty.
  • PairingHintBitmap is now generated to discovery/PairingHint.xml

ICDManagement.xml Excerpt

Before

  <bitfield name="PowerCycle" bit="0" summary="Power Cycle...">
  <bitfield name="SettingsMenu" bit="1" summary="Settings menu...">
  <bitfield name="CustomInstruction" bit="2" summary="Custom Instruction...">

After

  <bitfield name="PowerCycle" bit="0" summary="Power Cycle..." instructionDependency="no">
  <bitfield name="SettingsMenu" bit="1" summary="Settings menu..." instructionDependency="no">
  <bitfield name="CustomInstruction" bit="2" summary="Custom Instruction..." instructionDependency="M">

Discovery.xml Excerpt

  <discovery>
    <bitmap name="PairingHintBitmap">
      <bitfield name="PowerCycle" bit="0" summary="..." instructionDependency="no">
      <bitfield name="CustomInstruction" bit="4" summary="..." instructionDependency="M">
      <bitfield name="PressResetButtonUntilLightBlinks" bit="9" summary="..." instructionDependency="O">

@raul-marquez-csa raul-marquez-csa requested a review from a team as a code owner June 18, 2026 04:05

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for parsing and rendering "Instruction Dependency" attributes in bitmaps, and adds specialized rendering logic for discovery bitmaps in the dm package. The review feedback highlights two critical issues: a type switch modification in matter/spec/table_info.go that changes a pointer type to a value type, which will cause runtime failures when matching AST elements, and a missing nil check in isDiscoveryDoc that could lead to a nil pointer dereference panic.

Comment thread matter/spec/table_info.go
Comment thread dm/discovery.go
@raul-marquez-csa raul-marquez-csa changed the title adds instructionDependency scraping for UAT and PairingHint bitmap ta… Support Instruction Dependency column and Discovery.adoc scraping/XML output Jun 18, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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