# gpui: Separate benchmark support from test support \(\#63039\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1f7eae7fb753be69ac8cd80575daf43103c85883)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1f7eae7fb753be69ac8cd80575daf43103c85883

Requested commit: 1f7eae7fb753be69ac8cd80575daf43103c85883

Commit: 1f7eae7fb753be69ac8cd80575daf43103c85883

Tree: d70b11b5a007679a793afd564c059cb50f7a7030

Author: Anthony Eid

Committer: GitHub

## Message

```
gpui: Separate benchmark support from test support (#63039)

`gpui::bench` previously required GPUI's full `test-support` feature.
Any benchmark using the supported GPUI harness therefore compiled
test-only APIs and fakes, even when the benchmark otherwise followed
production dependency paths.

This change introduces `bench-support` as GPUI's canonical benchmark
feature and keeps `bench` as a compatibility alias for existing
consumers. The benchmark feature now exposes only the existing GPUI
internals that `BenchAppContext` needs: the real threaded dispatcher,
profiler integration, and a headless platform surface. Benchmark HTTP
requests use the production `BlockedHttpClient`, so accidental network
access fails instead of silently entering a fake response path.

The current headless implementation reuses the cfg-stripped core of
`TestPlatform`. Test-only prompt state, simulation APIs, and test
executors remain unavailable under `bench-support`. Cargo feature-tree
checks confirm that both `bench-support` and the compatibility alias
remain independent of `test-support`.

This also adds a `gpui-bench` agent skill covering production-shaped
fixtures, frame and foreground responsiveness, macOS headless Metal
rendering, deterministic correctness guards, Criterion measurement,
Instruments symbolication, and the requirement that a benchmark's
complete dependency graph contain no `test-support` feature.

Two follow-ups are intentionally deferred to keep this feature-isolation
change reviewable:

- Extract the shared headless implementation into
`HeadlessPlatformCore`, with separate `BenchPlatform` and `TestPlatform`
wrappers. This will remove benchmark-related cfg branches from the
test-facing type and make their supported surfaces explicit.
- Add a shared scripted HTTP client that compiles independently under
either `http_client/test-support` or `http_client/bench-support`. Tests
and benchmarks could then serve predefined responses through the same
deterministic transport boundary without either support feature enabling
the other; the default benchmark context should remain network-blocked.

This PR only isolates GPUI itself. Migrating downstream benchmark
fixtures that explicitly request other crates' `test-support` features
remains separate work.

Testing performed:

- `cargo tree --offline --package gpui --no-default-features --features
bench-support --edges features --invert gpui`
- `cargo tree --offline --package gpui --no-default-features --features
bench --edges features --invert gpui`
- `cargo check -p gpui --no-default-features --features bench-support`
- `cargo check -p gpui --no-default-features --features bench`
- `git diff --check`

Release Notes:

- N/A
```

## Parents

- [5f1f7e634be61a21fa25411a27d210440ad6e1a8](https://git.cafe/gitcafe/zed/commit/5f1f7e634be61a21fa25411a27d210440ad6e1a8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1f7eae7fb753be69ac8cd80575daf43103c85883?format=markdown)
