Skip to content

feat: add bounded structure-aware Behavior Tree XML diff - #31

Draft
picknik-johnny-5-bot[bot] wants to merge 7 commits into
mainfrom
fix/21717-structure-aware-diff
Draft

picknik-johnny-5-bot[bot] wants to merge 7 commits into
mainfrom
fix/21717-structure-aware-diff

Conversation

@picknik-johnny-5-bot

@picknik-johnny-5-bot picknik-johnny-5-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

[written by AI]

Related to PickNikRobotics/moveit_pro#21717

Summary

  • Add BT::RenderXMLDiff as an installed C++17 library API with deterministic Markdown and plain-text output. It distinguishes moved, modified, added, and removed BT content, including wrapper insertions.
  • Match exact and similar subtrees with indexed, parent-aware candidates instead of Cartesian candidate lists. Preserve duplicate sibling and reorder semantics, and replace quadratic reorder detection with an O(n log n) prefix-index algorithm.
  • Reject malformed UTF-8, embedded NULs, invalid XML code points, and invalid numeric character references before rendering. Emit UTF-8 move markers independent of the Windows execution code page, and avoid duplicate child edits within modified parents.

Validation

  • Release build and full CTest suite passed; 31 focused XMLDiff tests passed.
  • 31 focused XMLDiff tests passed under ASan/UBSan with leak detection disabled.
  • Strict Clang C++17 syntax check passed, as did an installed-package C++17 consumer and an adversarial stress harness.
  • Under a 128 MiB address-space limit, 2,000 modified siblings and 3,000 exact duplicate siblings passed. The 200,000-exact-sibling stress case completed in 0.24 seconds after reorder detection was bounded; it timed out at 2 seconds before that fix.
  • clang-format 17.0.6 check and git diff --check passed.

Scope and remaining work

  • This PR provides the reusable renderer API, not a standalone CLI or CI integration. A consumer can publish its Markdown/plain-text output as a companion review artifact.
  • The full sanitizer suite is not green locally: PostConditions.Issue601 intermittently asserts in the timer queue. The same test also intermittently failed in the unchanged base and prior candidate sanitizer builds. Focused sanitizer tests for the changed XML-diff path pass. Leak detection was disabled for the focused run because of a separate pre-existing leak.

CI and review status at aa671ad574505616d1e86d4164a72decce8983ec

  • Every current check passed except Pixi Windows. Its unchanged Reactive.MissingOrEmptyGenericChildIdIsRejected test fails with SEH 0xc0000005. The same test failed in the earlier fix/22500-reactive-generic-children run on September 10, before this PR: https://github.com/PickNikRobotics/BehaviorTree.CPP/actions/runs/34393607502. Current failing run: https://github.com/PickNikRobotics/BehaviorTree.CPP/actions/runs/36072102339. This does not establish that the whole Windows job is healthy; a separate baseline fix or explicit exception is needed.
  • CodeRabbit's GitHub check skipped this draft. Its local CLI found zero issues at the immediately preceding SHA; the one exact-head attempt failed with a WebSocket closure. No further automated CodeRabbit review was triggered. Request a human rerun or review before marking ready.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

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