Bug: Experiment comparison header shows inverted improvement/regression counts
Description
The experiment comparison view shows contradictory counts for improved and regressed items between the header indicators and the detailed observation panel.
Affected Area
- Feature: Experiments comparison (results grid)
- Component: Score column headers with aggregate counts
- Introduced in: PR #16917 (merged Sept 4, 2026)
Observed Behavior
When comparing two experiment runs, the header indicators (top of comparison table) appear to show inverted/opposite colors and counts compared to the actual data:
- Observation panel (left sidebar): Shows correct counts
- Example: "Improved: 5, Regressed: 9, Unchanged: 31"
- Header indicators: Appear to show opposite values
- The counts/colors seem swapped relative to the observation panel
Expected Behavior
Header aggregate counts should match the observation panel counts and reflect the actual improvements/regressions visible when drilling down into individual traces.
Steps to Reproduce
- Navigate to Langfuse experiments comparison view
- Compare two experiment runs (baseline vs candidate)
- Look at a metric like "Answer Relevancy"
- Compare:
- Header indicator counts (at top of table)
- Observation panel counts (left sidebar detail view)
- Individual trace data (drill down into items)
- Notice the mismatch between header and observation panel
Verification
When drilling down into individual traces, the actual changes match the observation panel, confirming:
- 5 items actually improved (e.g., 80→90)
- 9 items actually regressed (e.g., 90→80)
This validates that the observation panel is correct and the header is showing inverted data.
Example Data
Metric: [Experiment] Answer Relevancy
Observation Panel (Correct):
- Improved: 5
- Regressed: 9
- Unchanged: 31
Header Display: Appears to show opposite counts/indicators
Environment
- Langfuse Version: v 4.45.1
- Browser: Chrome 153.0.8010.53
Screenshots
Additional Context
- This affects all metrics in the comparison view (Answer Relevancy, Faithfulness, Context Relevance, Check Correctness, etc.)
- The issue appears to be specifically in the header aggregation/display logic
- Individual trace data when inspected matches the observation panel, not the header
- Related to the score column header rebuild in PR #16917
Related Issues
- PR #16917: feat(experiments): rebuild the results grid around the score columns
- Feature: "every score column's header now carries its aggregate and its movement against the comparison with an improved/regressed count"
Impact
- Severity: High - misleads users about whether model upgrades improved or regressed
- Workaround: Check observation panel or drill into individual traces
- Affected Users: Anyone comparing experiment runs to evaluate model changes
Source: langfuse/langfuse