Skip to content

performance: keep results measured before a history reset out of the series - #587

Open
Jay (jay23606) wants to merge 4 commits into
microsoft:devfrom
jay23606:fix/persist-results-after-history-reset
Open

Jay (jay23606) wants to merge 4 commits into
microsoft:devfrom
jay23606:fix/persist-results-after-history-reset

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Fixes #511 (performance history reset race).

Summary

  • persist_results appended any result whose commit and metric were missing from the destination CSV. A reset removes those identities, so a result measured before a reset commit was inserted after it and counted toward the ten-point warmup. A delayed dev run could then gate a metric with only nine post-reset measurements.
  • Before appending, persist asks git which dimensions lost rows between each result's commit and HEAD, and skips those rows. A result whose commit is not an ancestor of HEAD fails the persist rather than being guessed at. Unaffected metrics still persist.
  • The CLI checks whenever its history directory is inside a git checkout. The persist job checks out with fetch-depth: 0, so the history is available. Callers outside a checkout keep the previous behavior.
  • The reset contract in doc/benchmarks.md now states the rule.

Test

  • test_persist_drops_rows_measured_before_a_later_history_reset uses a real temporary git repository. It persists a measurement from commit A, commits a reset of the latency metric only, adds nine post-reset rows, and then persists the stale A rows. The latency series keeps nine rows, and the unaffected throughput row from A is still persisted. The test failed before the change with a TypeError on the new argument.
  • python -B -m unittest test_nvx_tools: 538 tests, OK (54 skipped, as before). test_performance: 84 tests, OK. ruff check and format are clean.
  • Not run: a live dev persist with the workflow's retry loop.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:00

Copilot AI 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.

🟡 Changes recommended

Legacy CSV parsing and merged-history comparisons can retain stale measurements or discard unaffected results.

2 open findings
What changed in this PR

Addresses #511 by filtering delayed benchmark results that predate a history reset, protecting the performance gate’s ten-point warmup.

Changes:

  • Adds Git-history reset detection to persistence.
  • Adds a selective-reset regression test.
  • Documents the stale-result exclusion rule.
File Description
scripts/​test_performance.py Tests delayed results after a selective reset.
scripts/​nvx_tools/​performance.py Filters pre-reset results using committed history.
doc/​benchmarks.md Clarifies persistence behavior after resets.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/nvx_tools/performance.py Outdated
Comment thread scripts/nvx_tools/performance.py Outdated
Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:23

Copilot AI 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.

🟡 Changes recommended

Merge-parent comparisons can misclassify earlier resets and discard valid post-reset measurements.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced

Comment thread scripts/nvx_tools/performance.py
Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:46

Copilot AI 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.

🔵 Needs a closer look

Merge-ancestry handling warrants human validation before approval.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 00:07
@jay23606
Jay (jay23606) force-pushed the fix/persist-results-after-history-reset branch from cb054a3 to a640846 Compare October 19, 2026 00:07

Copilot AI 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.

🟡 Changes recommended

Merge-history handling and validation ordering still allow stale results or incorrectly reject valid measurements.

3 open issues

Review effort: Balanced

Comment thread scripts/nvx_tools/performance.py
Comment thread scripts/nvx_tools/performance.py
Comment thread scripts/nvx_tools/performance.py Outdated
Copilot AI balanced review requested due to automatic review settings October 20, 2026 05:20
@jay23606
Jay (jay23606) force-pushed the fix/persist-results-after-history-reset branch from a640846 to f15f9f8 Compare October 20, 2026 05:20

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 05:40

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:27
@jay23606
Jay (jay23606) force-pushed the fix/persist-results-after-history-reset branch from 980cdf1 to 32c1e89 Compare October 20, 2026 11:27

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jay23606
Jay (jay23606) force-pushed the fix/persist-results-after-history-reset branch from 32c1e89 to ce79af6 Compare October 20, 2026 11:50
Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:50

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Jay (jay23606) and others added 2 commits October 20, 2026 07:59
…series

persist_results appended any row whose commit and metric were absent from the
destination CSV. A reset removes those identities, so a result measured before a
reset commit was inserted after it and counted toward the ten-point warmup. A
delayed dev run could therefore gate a metric that had only nine post-reset
measurements.

Before appending, persist now asks git which dimensions lost rows between each
result's commit and HEAD, and skips those rows. A result whose commit is not an
ancestor of HEAD fails the persist instead of being guessed. Unaffected metrics
still persist. The CLI checks whenever its history directory is inside a git
checkout, which the persist job always is.

Adds a regression test in which a result from before a reset arrives after nine
post-reset rows; the series stays at nine rows and the unaffected throughput row
still persists. Documents the rule next to the reset contract.

Fixes microsoft#511 (performance history reset race)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
…atform

The reset check compared consecutive commits in log order. A side branch forked
before the measurement can hold fewer rows without resetting them, so it was
misread as a reset. Compare each commit with its own parents instead, and include
merged history with --full-history.

A legacy CSV takes its platform from its file name, so the committed blob keeps
its basename when it is read back.

Adds a regression test in which a side branch changes latency without throughput
and is merged with A's throughput row intact. Before this change the check
flagged throughput.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Jay (jay23606) and others added 2 commits October 20, 2026 07:59
…t's line

A branch forked before an earlier reset can keep rows that the target already
reset before the measurement. Merging it drops those rows relative to that branch,
which was misread as a reset after the measurement, and its valid result was
discarded. Compare a commit with a parent only when the parent came before the
measurement or was built on it.

Adds a regression test for that merge.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:59
@jay23606
Jay (jay23606) force-pushed the fix/persist-results-after-history-reset branch from ce79af6 to 9e8b746 Compare October 20, 2026 11:59

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Track performance history reset bugs: older runs refill reset series

2 participants