Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Replace incremental build scenario with binary size (#64453)

Piotr Osiewiczac729007ba81
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
index 7d58e86215e..bcfe8b6be53 100644
--- a/.github/workflows/run_tests.yml
+++ b/.github/workflows/run_tests.yml
@@ -115,7 +115,7 @@ jobs:
check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP
check_pattern "run_docs" '^(docs/|crates/.*\.rs)' -qP
check_pattern "run_licenses" '^(Cargo\.lock$|script/.*licenses|(?:.*/)?LICENSE[^/]*$)' -qP
- check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|extensions/)' -qvP
+ check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|[.]wezel/|extensions/)' -qvP
# Detect changed extension directories (excluding extensions/workflows)
CHANGED_EXTENSIONS=$(echo "$CHANGED_FILES" | grep -oP '^extensions/[^/]+(?=/)' | sort -u | grep -v '^extensions/workflows$' || true)
# Filter out deleted extensions
diff --git a/.wezel/config.toml b/.wezel/config.toml
index ffe52f025c5..e62e1e3a5df 100644
--- a/.wezel/config.toml
+++ b/.wezel/config.toml
@@ -11,3 +11,9 @@ targets = [
[tools.foragers.cargo]
github = "wezel-build/forager_cargo"
+
+[tools.foragers.exec]
+github = "wezel-build/wezel_exec"
+
+[tools.foragers.filesize]
+github = "wezel-build/wezel_filesize"
diff --git a/.wezel/experiments/binary-size/experiment.toml b/.wezel/experiments/binary-size/experiment.toml
new file mode 100644
index 00000000000..971fc50845c
--- /dev/null
+++ b/.wezel/experiments/binary-size/experiment.toml
@@ -0,0 +1,19 @@
+#:schema ../../schema.json
+
+description = "Measures stripped and unstripped release binary size"
+
+[step.cargo.build-release]
+command = "build"
+build_target = ["zed"]
+profile = "release"
+
+[step.filesize.measure-unstripped]
+glob = "target/release/zed"
+summary.unstripped-binary-size = { outcome = "target/release/zed" }
+
+[step.exec.strip-copy]
+cmd = "cp target/release/zed target/release/zed-stripped && strip target/release/zed-stripped"
+
+[step.filesize.measure-stripped]
+glob = "target/release/zed-stripped"
+summary.stripped-binary-size = { outcome = "target/release/zed-stripped" }
diff --git a/.wezel/experiments/incremental-editor/editor-doc-comment.patch b/.wezel/experiments/incremental-editor/editor-doc-comment.patch
deleted file mode 100644
index 42839fdf71a..00000000000
--- a/.wezel/experiments/incremental-editor/editor-doc-comment.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
-index 31ddc4b5c4..cd8e8e77e2 100644
---- a/crates/editor/src/editor.rs
-+++ b/crates/editor/src/editor.rs
-@@ -11,6 +11,7 @@
- //! All other submodules and structs are mostly concerned with holding editor data about the way it displays current buffer region(s).
- //!
- //! If you're looking to improve Vim mode, you should check out Vim crate that wraps Editor and overrides its behavior.
-+//!
- pub mod actions;
- pub mod blink_manager;
- mod bracket_colorization;
diff --git a/.wezel/experiments/incremental-editor/experiment.toml b/.wezel/experiments/incremental-editor/experiment.toml
deleted file mode 100644
index 1d664fa18f7..00000000000
--- a/.wezel/experiments/incremental-editor/experiment.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-#:schema ../../schema.json
-
-description = "Measures rebuild time after a trivial edit to the editor crate"
-
-# `zed` rather than `workspace`: it pulls in the whole editor -> ... -> binary
-# chain that a developer actually waits on, without also building collab, the
-# benchmarks and the other workspace members that no editor edit can affect.
-
-# Prime the build cache off a clean build, so the measured step below pays only
-# for editor and its dependents.
-[step.cargo.prime-cache]
-command = "build"
-build_target = ["zed"]
-
-# The patch only appends an empty `//!` line to the crate-root doc comment, so
-# nothing about editor's public surface changes. What's left is the floor cost
-# of touching the crate at all: rustc's incremental reuse for editor itself,
-# plus the relink of every crate downstream of it.
-[step.cargo.editor-doc-comment]
-apply-diff = true
-command = "build"
-build_target = ["zed"]
-summary.incremental-editor-build = { outcome = "time_ms", aggregation = "min", samples = 5 }
diff --git a/.wezel/schema.json b/.wezel/schema.json
index e95c3d9e9df..58e4d5081f4 100644
--- a/.wezel/schema.json
+++ b/.wezel/schema.json
@@ -165,7 +165,7 @@
{
"properties": {
"outcome": {
- "description": "**`time_ms`** — cargo's own reported build duration (the `Finished … in <t>` line), in milliseconds. Excludes process startup and dependency resolution.",
+ "description": "**`time_ms`** — how long `cargo <command>` took, in milliseconds.",
"type": "string"
}
}
@@ -192,6 +192,121 @@
"command"
],
"type": "object"
+ },
+ "Step_exec": {
+ "additionalProperties": false,
+ "description": "Body of a `[step.<tool>.<step_name>]` table. The tool name is recovered from the outer key, not a field; flatten-collected `rest` is forwarded to the forager plugin via `FORAGER_INPUTS` as JSON.",
+ "properties": {
+ "apply-diff": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DiffField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Apply a patch before running this step. `true` uses `<step name>.patch`; a string overrides the filename."
+ },
+ "cmd": {
+ "description": "Shell command to run.",
+ "type": "string"
+ },
+ "cwd": {
+ "description": "Working directory override.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "description": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "env": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "default": {},
+ "description": "Extra environment variables.",
+ "type": "object"
+ },
+ "summary": {
+ "additionalProperties": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/EmbeddedSummaryToml"
+ },
+ {
+ "properties": {
+ "outcome": {
+ "description": "Every successful command emits these outcomes on Linux and macOS. No root access\nor external profiling tool is required.\n\n| Outcome | Unit | Meaning |\n| --- | --- | --- |\n| `wall_time_ms` | milliseconds | Elapsed time from immediately before command launch until its exit is collected, including waiting. |\n| `user_time_ms` | milliseconds | CPU time spent executing in user mode. |\n| `system_time_ms` | milliseconds | CPU time spent executing in kernel mode. |\n| `max_rss_bytes` | bytes | Largest individual process peak resident memory reported by the OS. |\n| `minor_page_faults` | count | Page faults serviced without I/O. |\n| `major_page_faults` | count | Page faults requiring I/O. |\n| `voluntary_context_switches` | count | Context switches caused by yielding or blocking. |\n| `involuntary_context_switches` | count | Context switches caused by preemption. |\n\nTime values retain fractional milliseconds. Memory and count values are integers.\nAll outcomes have unit metadata, use the default lower-is-better direction, and\nhave no tags. Fault and context-switch counts are diagnostic signals; a reduction\nalone does not establish that a build improved.\n\nCPU time and resource counters include the shell and descendants whose usage is\npropagated by their parents waiting for them. Commands must wait for their work to\nfinish; detached processes and work performed by an existing build daemon are not\nfully accounted for. CPU time can exceed wall time when work runs in parallel.\n\n`max_rss_bytes` is **not the combined peak memory of a parallel build**. It is the\nlargest individual peak reported through the process hierarchy. OS accounting\nsemantics differ, so compare measurements on the same platform and testbed.\n\nA command that cannot start, exits unsuccessfully, or is terminated by a signal\nfails the step and produces no outcome report.\n",
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "description": "Summaries emitted by this step, keyed by summary name.",
+ "type": "object"
+ }
+ },
+ "required": [
+ "cmd"
+ ],
+ "type": "object"
+ },
+ "Step_filesize": {
+ "additionalProperties": false,
+ "description": "Body of a `[step.<tool>.<step_name>]` table. The tool name is recovered from the outer key, not a field; flatten-collected `rest` is forwarded to the forager plugin via `FORAGER_INPUTS` as JSON.",
+ "properties": {
+ "apply-diff": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DiffField"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Apply a patch before running this step. `true` uses `<step name>.patch`; a string overrides the filename."
+ },
+ "description": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "glob": {
+ "description": "Glob pattern, evaluated against the experiment workspace cwd.",
+ "type": "string"
+ },
+ "summary": {
+ "additionalProperties": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/EmbeddedSummaryToml"
+ },
+ {
+ "properties": {
+ "outcome": {
+ "description": "One outcome per matched file. The outcome name is the file's path (relative to cwd); the value is its size in bytes.",
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ "description": "Summaries emitted by this step, keyed by summary name.",
+ "type": "object"
+ }
+ },
+ "required": [
+ "glob"
+ ],
+ "type": "object"
}
},
"description": "Top-level shape of `.wezel/experiments/<name>/experiment.toml`.\n\nSteps live under `[step.<tool>.<step_name>]`. The outer map is keyed by tool name and the inner by step name; bodies are wrapped in `toml::Spanned` so the parser can recover file-line order across reopened tables.",
@@ -211,7 +326,21 @@
"additionalProperties": {
"$ref": "#/definitions/Step_cargo"
},
- "description": "Runs `cargo <command>` and records the build time cargo reports",
+ "description": "Runs `cargo <command>` and records wall-clock time",
+ "type": "object"
+ },
+ "exec": {
+ "additionalProperties": {
+ "$ref": "#/definitions/Step_exec"
+ },
+ "description": "Executes a shell command and measures time and resource usage",
+ "type": "object"
+ },
+ "filesize": {
+ "additionalProperties": {
+ "$ref": "#/definitions/Step_filesize"
+ },
+ "description": "Reports byte size of every file matching a glob",
"type": "object"
}
},
diff --git a/.wezel/wezel.lock b/.wezel/wezel.lock
index c4c1d9ed270..1a6c044c69d 100644
--- a/.wezel/wezel.lock
+++ b/.wezel/wezel.lock
@@ -5,6 +5,27 @@ github = "wezel-build/forager_cargo"
tag = "nightly-2026-07-17-dd1c13f"
[tools.foragers.cargo.assets]
+aarch64-apple-darwin = "sha256:6ab37a321c528404f5fc998c55ac7b499e8d8dd8d24c807fe11ab9ec6885f071"
aarch64-unknown-linux-gnu = "sha256:4162756b5268d29046242a1f29d41649e07ef024c72a690914bff61af82dcee1"
x86_64-apple-darwin = "sha256:263224ed47256fabd71a02e638fccd768cda4ff7023f34cc35bd520edcee0162"
x86_64-unknown-linux-gnu = "sha256:18092f74eabef4e0774d14ac3ca967505b6d5ccf6fd2a1f1ddef79d8317b0722"
+
+[tools.foragers.exec]
+github = "wezel-build/wezel_exec"
+tag = "nightly-2026-09-13-f96d366"
+
+[tools.foragers.exec.assets]
+aarch64-apple-darwin = "sha256:7114aeece8eabecf36090169913bbb939be0034e8ead187fbdedadca9cdc31a7"
+aarch64-unknown-linux-gnu = "sha256:c4e10f11b36ad70817aa1897e072185f624cce248cd560b8f6f7884d85c0edb5"
+x86_64-apple-darwin = "sha256:7b284018b759d8a07c3143bbbf015de39baa2ac54aecfe0a16e18eb47eb11c20"
+x86_64-unknown-linux-gnu = "sha256:292709a40dad042d2c9f7054a01c48e8d06514e1713d20e372980f980936ebee"
+
+[tools.foragers.filesize]
+github = "wezel-build/wezel_filesize"
+tag = "nightly-2026-09-13-b72395f"
+
+[tools.foragers.filesize.assets]
+aarch64-apple-darwin = "sha256:7dcf99b47444b06217aa9b21b570068181e8d5983b071ef82d4ff7c50568d789"
+aarch64-unknown-linux-gnu = "sha256:cacc578d36333b1f64b057b5393663b9e096fbcb09ec3e3a985fcbd0b206fb5a"
+x86_64-apple-darwin = "sha256:2f1c0a4b3346d59032fc1e589c00e5c8fb5f4230a732eaf7936fecd40b57e5e4"
+x86_64-unknown-linux-gnu = "sha256:a42a28956781548936993d7518db5881c19dfdf20177d359f21f5dc9cad6f91e"
diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs
index 1bff686127d..162daa3eddd 100644
--- a/tooling/xtask/src/tasks/workflows/run_tests.rs
+++ b/tooling/xtask/src/tasks/workflows/run_tests.rs
@@ -26,10 +26,11 @@ pub(crate) fn run_tests() -> Workflow {
// - script/update_top_ranking_issues/
// - .github/ISSUE_TEMPLATE/
// - .github/workflows/ (except .github/workflows/ci.yml)
+ // - .wezel/
// - extensions/ (these have their own test workflow)
let should_run_tests = PathCondition::inverted(
"run_tests",
- r"^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|extensions/)",
+ r"^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|[.]wezel/|extensions/)",
);
let should_check_docs = PathCondition::new("run_docs", r"^(docs/|crates/.*\.rs)");
let should_check_scripts = PathCondition::new(