Skip to content

feat(M83): divergence heatmap by token position - #180

Merged
hlin99 merged 1 commit into
mainfrom
feat/m83-divergence-heatmap
Apr 6, 2026
Merged

hlin99 merged 1 commit into
mainfrom
feat/m83-divergence-heatmap

Conversation

@hlin99

@hlin99 hlin99 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

Add xpyd-acc heatmap subcommand that bins divergence points by token position across all samples in a batch report.

Features

  • heatmap.py module: compute_heatmap(), HeatmapBucket, HeatmapReport, format_heatmap()
  • CLI: xpyd-acc heatmap --report <path> --buckets <n> --json <path>
  • Configurable bucket count (default 10)
  • Per-bucket: divergence count, avg logprob gap
  • Rich terminal bar chart visualization
  • JSON export

Tests

14 tests covering bucket computation, edge cases (no divergent, single sample, none gaps), formatting, JSON export.

Closes #179

@hlin99-Review-Bot hlin99-Review-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. Clean implementation — dataclasses, bucketing logic, formatting, and CLI integration all look solid. 14 tests cover the important cases (empty, single, multiple, None gaps, boundary). CI green. Approved.

@hlin99-Review-BotX hlin99-Review-BotX left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

M83 looks solid. Clean heatmap module with proper bucketing, dataclass serialization, and bar-chart formatting. Tests cover edge cases well (empty, single, none logprob, zero buckets). CLI integration and docs updated correctly. LGTM ✅

@hlin99
hlin99 force-pushed the feat/m83-divergence-heatmap branch from e7f4fae to 02cd85c Compare April 6, 2026 05:35
- heatmap.py: compute_heatmap(), HeatmapBucket, HeatmapReport, format_heatmap()
- CLI subcommand: xpyd-acc heatmap --report <path> --buckets <n> --json <path>
- Bin divergence points by token position with avg logprob gap per bucket
- Rich terminal bar chart visualization
- JSON export support
- 14 tests covering computation, edge cases, formatting, JSON export
- Updated ROADMAP.md: M82 ✅, added M83-M85
- Updated docs/iterations/current.md

Closes #179
@hlin99
hlin99 force-pushed the feat/m83-divergence-heatmap branch from 02cd85c to 35a7c24 Compare April 6, 2026 06:45
@hlin99
hlin99 merged commit 1a5dfca into main Apr 6, 2026
4 checks passed
@hlin99
hlin99 deleted the feat/m83-divergence-heatmap branch April 6, 2026 06:46
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.

feat: Divergence Heatmap by Token Position (M83)

3 participants