---
name: playwright-bisect-chromium
description: Bisect a Chromium regression down to the upstream commit with the prebuilt per-commit Chrome for Testing builds - no Chromium checkout and no build. Use when a test or a repro passes on an older Chromium and fails on a newer one, for example on a Chromium roll PR or a tip-of-tree roll PR.
user_invocable: true
title: playwright-bisect-chromium
canonical_url: https://skilld.dev/gh/microsoft/playwright/playwright-bisect-chromium
last_updated: 2026-11-21T07:31:15.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install microsoft/playwright/playwright-bisect-chromium`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/playwright-bisect-chromium`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/microsoft/playwright/playwright-bisect-chromium) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/playwright-bisect-chromium`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/playwright-bisect-chromium --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/playwright-bisect-chromium --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Bisecting Chromium

Playwright's Chromium is Chrome for Testing (CfT), downloaded from Google. There is no patch and no
source tree to bisect here. Google publishes a CfT build for almost every trunk commit position in
the `chrome-for-testing-per-commit-public` bucket, and
[`utils/bisect-chromium.mjs`](../../../utils/bisect-chromium.mjs) does a binary search over those
builds between a known-good and a known-bad revision. It runs a check command against each build,
with `CRPATH` set to the executable of the build. Each step downloads one build of about 130 MB. A
whole roll is about 8000 positions, that is about 13 steps, so a bisect takes minutes.

## Find the two revisions

The script takes a revision as a Chrome version (`159.0.8154.6`) or as a trunk commit position
(`1739869`, the number in `https://crrev.com/1739869`). It resolves a version to the position that
the release branch of the version was cut from.

- **Roll PR** (`feat(chromium): roll to <version>`, branch `roll-chromium/<version>`): the
  description has the line `Version: <old> → <new>`. `<old>` is `--good`, `<new>` is `--bad`. A
  tip-of-tree roll PR (`feat(chromium-tip-of-tree): roll to <version> - DO NOT MERGE`) has the same
  line.
- **A roll that merged**: `git log -p -- packages/playwright-core/browsers.json` shows each change of
  the `browserVersion` of `chromium`.
- **Anything else with a version**: a `Chrome/154.0.8037.0` user agent, `browser.version()`, a bug
  report. Pass the version as it is.

Not every position has a build. In bisect mode the script moves `--good` and `--bad` to the nearest
position that has a build, and prints a warning. Single-revision mode needs an exact position; to
see which positions near `1689400` have a build, open
`https://storage.googleapis.com/chrome-for-testing-per-commit-public/?delimiter=/&prefix=linux64/r&marker=linux64/r1689400`.

## Run it

Run from the root of the Playwright checkout, after `npm run build`. Always pass a check that runs
only the failing test. The default check, a full `npm run ctest`, is too slow for a bisect.

```bash
node utils/bisect-chromium.mjs --good 158.0.8127.18 --bad 159.0.8154.6 \
  --check 'npm run ctest -- tests/page/page-goto.spec.ts:42 --workers=1 --repeat-each=3'
```

- `--check` decides if a build is good: exit code 0 means good. The script runs it in the current
  directory with `CRPATH` set to the executable of the build and with `PLAYWRIGHT_HTML_OPEN=never`.
  Anything that reads `CRPATH` works: a Playwright test of this repo, or a script that launches
  `process.env.CRPATH`. When the failure is flaky, add `--repeat-each`, so that one pass by chance
  does not send the bisect the wrong way.
- The default build is `chrome-headless-shell`, which is what Playwright runs in headless mode. Pass
  `--headed` to the script to get the full Chrome build: for tests that you run with `--headed`, and
  for `channel: 'chromium'` (the full Chrome in the new headless mode).
- The script checks both ends before it starts. "Supposedly good revision is BAD" means that the
  regression is older than your range: pass an older `--good`. "Supposedly bad revision is GOOD"
  means that the check does not reproduce the failure: wrong headed or headless build, wrong test
  filter, a flaky test, or a regression on the release branch (see the limits below).
- Builds are cached in `<tmpdir>/chromium-r<position>-<headless|headed>/` and used again, so a second
  run with a different check is fast. Do not delete them during a bisect.
- Single-revision mode, `node utils/bisect-chromium.mjs 1739117 --check '...'`, checks one build and
  prints the full output of the check. Use it to confirm an end of the range by hand.
- There are builds for `linux64`, `mac-arm64` and `win64` only, and the script takes the builds of the
  machine that it runs on. A failure that occurs on one platform only needs a bisect on that
  platform.

## Read the result

```
=== RESULT ===
Last good build:  r1739116
First bad build:  r1739117
Commits: https://crrev.com/1739116 .. https://crrev.com/1739117
```

Two adjacent builds usually differ by one commit. When the positions between them have no build, the
range has a few commits. `https://crrev.com/<position>` opens the commit. For a range, take the two
hashes and read `https://chromium.googlesource.com/chromium/src/+log/<good-hash>..<bad-hash>`.

Report the commit that caused the regression: what it changed and why that breaks the test, with
the exact revisions and the check that you used. Then decide where the fix belongs:

- Playwright relied on behavior that Chromium changed on purpose: fix Playwright, in the roll PR or
  before it.
- Chromium has a bug: it goes to https://crbug.com/new with the commit and a repro that needs no
  Playwright. Only a person can file there, see "Browser bugs" in [AGENTS.md](../../../AGENTS.md).

## Limits

- Per-commit builds are trunk builds. A beta build is the trunk at the position of the version, plus
  the commits that were cherry-picked to its release branch after that. When a failure reproduces on
  the build of the roll, but not on the trunk build at the same position, the cause is on the release
  branch: read `https://chromium.googlesource.com/chromium/src/+log/refs/branch-heads/<branch>`,
  where `<branch>` is the third number of the version (`8154` for `159.0.8154.6`).
- Two versions of the same release branch (`159.0.8154.6` and `159.0.8154.13`) have the same position.
  The script stops with an error, because there are no per-commit builds between them. Read
  `https://chromium.googlesource.com/chromium/src/+log/<old-version>..<new-version>` instead.
