mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-29 19:14:13 +00:00
original uri https://github.com/zed-industries/zed
https://zed.dev
## Motivation This PR unifies the async execution infrastructure between GPUI and other components that depend on the `scheduler` crate (such as our cloud codebase). By having a scheduler that lives independently of GPUI, we can enable deterministic testing across the entire stack - testing GPUI applications alongside cloud services with a single, unified scheduler. ## Summary This PR completes the integration of the `scheduler` crate into GPUI, unifying async execution and enabling deterministic testing of GPUI combined with other components that depend on the scheduler crate. ## Key Changes ### Scheduler Integration (Phases 1-5, previously completed) - `TestDispatcher` now delegates to `TestScheduler` for timing, clock, RNG, and task scheduling - `PlatformScheduler` implements the `Scheduler` trait for production use - GPUI executors wrap scheduler executors, selecting `TestScheduler` or `PlatformScheduler` based on environment - Unified blocking logic via `Scheduler::block()` ### Dead Code Cleanup - Deleted orphaned `crates/gpui/src/platform/platform_scheduler.rs` (older incompatible version) ## Intentional Removals ### `spawn_labeled` and `deprioritize` removed The `TaskLabel` system (`spawn_labeled`, `deprioritize`) was removed during this integration. It was only used in a few places for test ordering control. cc @maxbrunsfeld @as-cii - The new priority-weighted scheduling in `TestScheduler` provides similar functionality through `Priority::High/Medium/Low`. If `deprioritize` is important for specific test scenarios, we could add it back to the scheduler crate. Let me know if this is blocking anything. ### `start_waiting` / `finish_waiting` debug methods removed Replaced by `TracingWaker` in `TestScheduler` - run tests with `PENDING_TRACES=1` to see backtraces of pending futures when parking is forbidden. ### Realtime Priority removed The realtime priority feature was unused in the codebase. I'd prefer to reintroduce it when we have an actual use case, as the implementation (bounded channel with capacity 1) could potentially block the main thread. Having a real use case will help us validate the design. ## Testing - All GPUI tests pass - All scheduler tests pass - Clippy clean ## Architecture ``` ┌─────────────────────────────────────────────────────────────┐ │ GPUI │ │ ┌──────────────────────┐ ┌────────────────────────────┐ │ │ │ gpui::Background- │ │ gpui::ForegroundExecutor │ │ │ │ Executor │ │ - wraps scheduler:: │ │ │ │ - scheduler: Arc< │ │ ForegroundExecutor │ │ │ │ dyn Scheduler> │ └────────────┬───────────────┘ │ │ └──────────┬───────────┘ │ │ │ │ │ │ │ └──────────┬──────────────────┘ │ │ ▼ │ │ ┌───────────────────────┐ │ │ │ Arc<dyn Scheduler> │ │ │ └───────────┬───────────┘ │ │ ┌──────────────┴──────────────┐ │ │ ▼ ▼ │ │ ┌──────────────────┐ ┌────────────────────┐ │ │ │ PlatformScheduler│ │ TestScheduler │ │ │ │ (production) │ │ (deterministic) │ │ │ └──────────────────┘ └────────────────────┘ │ └─────────────────────────────────────────────────────────────┘ ``` Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Yara <git@yara.blue> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com> |
||
|---|---|---|
| .cargo | ||
| .cloudflare | ||
| .config | ||
| .factory/prompts/docs-automation | ||
| .github | ||
| .zed | ||
| assets | ||
| ci | ||
| crates | ||
| docs | ||
| extensions | ||
| legal | ||
| nix | ||
| plans | ||
| script | ||
| tooling | ||
| .clinerules | ||
| .cursorrules | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .prettierrc | ||
| .rules | ||
| .windsurfrules | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| clippy.toml | ||
| CODE_OF_CONDUCT.md | ||
| compose.yml | ||
| CONTRIBUTING.md | ||
| debug.plist | ||
| default.nix | ||
| docker-compose.sql | ||
| Dockerfile-collab | ||
| Dockerfile-collab.dockerignore | ||
| Dockerfile-cross.dockerignore | ||
| Dockerfile-distros | ||
| Dockerfile-distros.dockerignore | ||
| flake.lock | ||
| flake.nix | ||
| GEMINI.md | ||
| LICENSE-AGPL | ||
| LICENSE-APACHE | ||
| LICENSE-GPL | ||
| livekit.yaml | ||
| lychee.toml | ||
| Procfile | ||
| Procfile.all | ||
| Procfile.web | ||
| README.md | ||
| renovate.json | ||
| REVIEWERS.conl | ||
| rust-toolchain.toml | ||
| shell.nix | ||
| typos.toml | ||
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.