Skip to content

docs(m2): record comparison value semantics - #19

Merged
RLungWu merged 1 commit into
mainfrom
feat/structured-comparison-result
Aug 26, 2026
Merged

docs(m2): record comparison value semantics#19
RLungWu merged 1 commit into
mainfrom
feat/structured-comparison-result

Conversation

@RLungWu

@RLungWu RLungWu commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Problem

What situation existed before this change? Why did it need to change?

Change

What did you actually do? Summarize the change, not the diff line-by-line.

Design Decisions

Any non-obvious choices made while implementing this — trade-offs, rejected
alternatives, or anything a future reader would ask "why did you do it this
way?" about.

Validation

  • pytest passes
  • ruff check . passes
  • mypy src passes
  • New behavior is covered by tests (unit / integration / golden)

Risks

What could this break? What wasn't tested? What assumptions might not hold
for other inputs or backends?

Related

  • Closes #
  • Milestone:
  • ADR (if applicable):

@RLungWu
RLungWu merged commit 629869f into main Aug 26, 2026
1 check passed
@RLungWu
RLungWu deleted the feat/structured-comparison-result branch August 26, 2026 10:44

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 129335fded

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +91 to +93
* mean difference;
* median difference;
* positive-pair count and rate;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Disambiguate which differences are aggregated

For lower-is-better metrics, raw_difference and improvement_difference have opposite signs, but this result shape exposes only an unnamed mean and median while the positive-pair rate explicitly uses improvement differences. Implementations can therefore produce incompatible aggregate signs, such as a negative mean beside a 100% positive-pair rate. Specify which per-pair value is aggregated, or retain separately named raw and direction-aware aggregates.

Useful? React with 👍 / 👎.

Comment on lines +58 to +63
Runs are paired by seed. A comparison fails explicitly when:

* a selected run has no seed;
* the baseline and candidate seed sets do not match;
* a selected run lacks the requested summary metric or has a missing value;
* more than one run has the same variant and seed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject identical baseline and candidate variants

When callers select the same variant for baseline and candidate, every listed validation condition passes and each run can be paired with itself, silently yielding zero differences instead of a meaningful comparison. The comparison contract should explicitly require distinct baseline and candidate variants and report a selection error when they match.

Useful? React with 👍 / 👎.

Comment on lines +30 to +32
M2 will compare the requested metric from `summary_metrics` only. If the
metric is absent or its value is missing, the comparison fails explicitly.
There is no automatic fallback from summary metrics to metric history.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject non-finite summary values

When a canonical Run contains NaN or infinity, the value is neither absent nor missing, so this policy permits it even though means, medians, differences, and positive-pair rates then become non-finite or misleading. Because Run.summary_metrics currently uses unconstrained floats, require selected values to be finite and cover those inputs in validation tests.

Useful? React with 👍 / 👎.

@RLungWu
RLungWu restored the feat/structured-comparison-result branch August 27, 2026 04:56
@RLungWu
RLungWu deleted the feat/structured-comparison-result branch August 27, 2026 04:59
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