Skip to content

Long-chat A/B: measure against the base tip the PR merge was built on - #19349

Merged
danielhanchen merged 1 commit into
mainfrom
ci/long-chat-ab-merge-parent-base
Nov 24, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/long-chat-ab-merge-parent-base

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Long-chat cost against the base build is red on chat PRs that did not cause the slowdown it reports. On #19169 (load a second quant of a GGUF repo):

stream_scroll base median head median head/base
blocked_ms 31 496 4.96x
long_tasks 1 7

This is the same stream_scroll slowdown #19172 introduced (26 to 337 ms, 1 to 7 long tasks; see the comment there).

Cause

The step measured against github.event.pull_request.base.sha, which does not move when main advances. The checkout, though, is the PR merge ref built on the current base tip. For #19169:

So the head arm carried #19172's slowdown and the base arm did not, and any chat PR opened before #19172 merged now fails the gate for a change it does not contain. The tool is right; the step handed it the wrong base.

Fix

studio-frontend-ci.yml, long-chat-ab: read the base from the checkout. When HEAD is a merge commit (the PR merge ref), BASE_SHA is its first parent, the base tip the merge was built on; otherwise it falls back to the event base as before. git cat-file -p HEAD keeps the parent lines in the depth-1 checkout, so no deeper fetch is needed. The step now prints both SHAs.

tests/studio/test_long_chat_ab_measures_against_the_merge_base_tip.py runs the step's own resolution lines in bash:

  • in a depth-1 clone of a merge whose PR branch forked from an older base, it resolves the tip the merge was built on, not the event base;
  • in a checkout that is not a merge, it keeps the event base;
  • BASE_SHA is no longer taken from the event directly.

The new guard is listed in workflow-trigger-lint.yml, so a workflow-only edit still runs it.

Verification

  • New tests: 3 passed; against the workflow on main all 3 fail.
  • Every test that reads studio-frontend-ci.yml or workflow-trigger-lint.yml: 743 passed.

Not changed

  • The regression itself: that is Studio: add a Files menu to chat #19172's, now on main and noted on that PR. With this change, later chat PRs measure against a base that already contains it, so the gate goes back to judging each PR's own change.
  • Other workflows also read pull_request.base.sha (lint-ci.yml, security-audit.yml, studiobench-ui-parity.yml, the Windows installer and AMSI differentials). The ones that only diff the PR's own changes are fine with it; any that build or measure a base arm against the merge ref can drift the same way and are worth a look, but are left alone here.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T21:08:14.153613Z 421e028 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 421e028ce8

ℹ️ 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".

@danielhanchen
danielhanchen merged commit ebab9a3 into main Nov 24, 2026
2 of 31 checks passed
@danielhanchen
danielhanchen deleted the ci/long-chat-ab-merge-parent-base branch November 24, 2026 21:10
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