Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

chore: drop the standalone mask-cache benchmark package

Richie McIlroy0c0ef19114ce
diff --git a/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.lock b/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.lock
deleted file mode 100644
index 65c420771..000000000
--- a/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.lock
+++ /dev/null
@@ -1,65 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "autocfg"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
-
-[[package]]
-name = "bytemuck"
-version = "1.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
-
-[[package]]
-name = "byteorder-lite"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
-
-[[package]]
-name = "cap-screenshot-mask-cache-benchmark"
-version = "0.1.0"
-dependencies = [
- "image",
-]
-
-[[package]]
-name = "image"
-version = "0.25.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
-dependencies = [
- "bytemuck",
- "byteorder-lite",
- "moxcms",
- "num-traits",
-]
-
-[[package]]
-name = "moxcms"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
-dependencies = [
- "num-traits",
- "pxfm",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "pxfm"
-version = "0.1.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
diff --git a/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml b/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml
deleted file mode 100644
index bda064d80..000000000
--- a/apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml
+++ /dev/null
@@ -1,22 +0,0 @@
-[workspace]
-
-[package]
-name = "cap-screenshot-mask-cache-benchmark"
-version = "0.1.0"
-edition = "2024"
-publish = false
-
-[lib]
-name = "cap_gpui_kernels"
-path = "lib.rs"
-
-[[example]]
-name = "screenshot-mask-cache-benchmark"
-path = "../../examples/screenshot-mask-cache-benchmark.rs"
-
-[dependencies]
-image = { version = "=0.25.10", default-features = false }
-
-[profile.release]
-codegen-units = 1
-lto = "thin"
diff --git a/apps/desktop-gpui/kernels/benchmarks/mask-cache/README.md b/apps/desktop-gpui/kernels/benchmarks/mask-cache/README.md
deleted file mode 100644
index 30fca7dab..000000000
--- a/apps/desktop-gpui/kernels/benchmarks/mask-cache/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# Screenshot mask cache benchmark
-
-Run from the repository root:
-
-```sh
-cargo +stable run --locked --release \
- --manifest-path apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml \
- --example screenshot-mask-cache-benchmark
-```
-
-This standalone package compiles the production `mask_cache.rs` and `screenshot.rs` directly. It requires Rust and the `image` crate, with a committed lockfile matching the desktop workspace's image/filter dependencies. It does not build GPUI, audio, FFmpeg, or platform libraries, and can run on Linux x86_64 as well as macOS arm64. The same example is also available through `cargo run -p cap-gpui-kernels --release --example screenshot-mask-cache-benchmark` in the desktop workspace, when its full dependency prerequisites are installed.
-
-The fixture is a deterministic, nonuniform 3840 × 2160 RGBA image with varying alpha. Each workload has 1, 4, 8, or 16 masks of 640 × 360 pixels at level 16, using either blur or pixelate. One mask moves one pixel per event; the others stay fixed. Each workload primes the cache, runs 12 warmup pairs, then measures 120 drag events. The old path filters every mask on every update. The new path calls the production cache diff and filters only changed masks. Both paths call the unchanged production `mask_filter`.
-
-Execution order alternates between old-first and new-first to reduce order bias. Every overlay's request and all of its output bytes are compared after every warmup and measured event, outside the timed intervals. A mismatch or unexpected filter-call count fails the run. Filter-call counts in the table cover the 120 measured events only; cache priming and warmup are excluded. The speedup is the ratio of means. The median is the average of the two middle samples.
-
-Timings include cache diffing, region extraction/filtering, image allocation, `Arc` ownership, and release of retired CPU images. Request/geometry construction and correctness comparisons are outside timing. The benchmark excludes GPUI image conversion, task scheduling/cancellation, GPU atlas uploads, painting, and screenshot export. It measures completed CPU preparation work, not pointer-event latency or application FPS. One mask is a control case: it has no reusable image during a drag. A replaced frame invalidates every mask and is not expected to benefit. Overlapping masks, deletion, reordering, style changes, frame/layout invalidation, and fractional/clipped rectangles are covered by the production module's unit tests.
-
-Run the portable tests and lint checks:
-
-```sh
-cargo +stable test --locked \
- --manifest-path apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml \
- --all-targets
-cargo +stable clippy --locked \
- --manifest-path apps/desktop-gpui/kernels/benchmarks/mask-cache/Cargo.toml \
- --all-targets -- -D warnings
-```
-
-Run the release command at least twice on an otherwise idle machine. Keep the full output, CPU model, operating system, Rust version, and power mode with results. Compare both means and medians, including the one-mask control. Cross-architecture results should use the same lockfile and workload.
-
-## Recorded results
-
-Two consecutive release runs on Apple M4 Pro, macOS 27.2, Rust 1.97.0, battery power with automatic power mode, October 13, 2026. All overlay bytes matched after every event in both runs. These are CPU overlay-preparation measurements with the exclusions described above.
-
-Run 1:
-
-| Mode | Masks | Old mean ms | New mean ms | Old median ms | New median ms | Mean speedup | Old calls | New calls |
-| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
-| blur | 1 | 1.637 | 1.631 | 1.630 | 1.621 | 1.00x | 120 | 120 |
-| blur | 4 | 6.701 | 1.687 | 6.697 | 1.688 | 3.97x | 480 | 120 |
-| blur | 8 | 13.266 | 1.664 | 13.291 | 1.660 | 7.97x | 960 | 120 |
-| blur | 16 | 26.504 | 1.688 | 26.494 | 1.685 | 15.70x | 1920 | 120 |
-| pixelate | 1 | 0.805 | 0.812 | 0.804 | 0.804 | 0.99x | 120 | 120 |
-| pixelate | 4 | 3.310 | 0.828 | 3.306 | 0.826 | 4.00x | 480 | 120 |
-| pixelate | 8 | 6.938 | 0.900 | 6.956 | 0.902 | 7.71x | 960 | 120 |
-| pixelate | 16 | 13.723 | 0.911 | 13.605 | 0.878 | 15.07x | 1920 | 120 |
-
-Run 2:
-
-| Mode | Masks | Old mean ms | New mean ms | Old median ms | New median ms | Mean speedup | Old calls | New calls |
-| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
-| blur | 1 | 1.600 | 1.600 | 1.585 | 1.589 | 1.00x | 120 | 120 |
-| blur | 4 | 6.569 | 1.657 | 6.548 | 1.651 | 3.96x | 480 | 120 |
-| blur | 8 | 13.384 | 1.713 | 13.293 | 1.672 | 7.82x | 960 | 120 |
-| blur | 16 | 26.587 | 1.708 | 26.138 | 1.661 | 15.57x | 1920 | 120 |
-| pixelate | 1 | 0.790 | 0.789 | 0.791 | 0.791 | 1.00x | 120 | 120 |
-| pixelate | 4 | 3.252 | 0.812 | 3.234 | 0.809 | 4.00x | 480 | 120 |
-| pixelate | 8 | 6.749 | 0.862 | 6.664 | 0.857 | 7.83x | 960 | 120 |
-| pixelate | 16 | 13.750 | 0.888 | 13.766 | 0.883 | 15.48x | 1920 | 120 |
diff --git a/apps/desktop-gpui/kernels/benchmarks/mask-cache/lib.rs b/apps/desktop-gpui/kernels/benchmarks/mask-cache/lib.rs
deleted file mode 100644
index 334cafd74..000000000
--- a/apps/desktop-gpui/kernels/benchmarks/mask-cache/lib.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-#[path = "../../src/mask_cache.rs"]
-pub mod mask_cache;
-#[path = "../../src/screenshot.rs"]
-pub mod screenshot;