This gist contains the harness, raw data, and plot for a matched A/B measurement of
the Niri compositor memory leak fixed by niri-wm/niri#4485
(issue #1457): when an output is
removed before a layer-shell client destroys its per-output layer surface, Niri
retains the stale MappedLayer and its imported DMA-BUF indefinitely. On real
hardware this accumulates ~84 MiB of GPU-backed shared memory per output off/on
cycle for a full shell (~39 MiB for a minimal Quickshell layer) — a 16-day session
with 138 HDMI reconnect cycles had accumulated ~12 GiB; see the
| [nixbuild.net] Build 7086740 queued at 26-03-04 14:34:44Z. Allocated 36 CPUs, 133.4 GB memory. | |
| Running phase: unpackPhase | |
| unpacking source archive /nix/store/s3nx31pxs73fplsicjh1zsznkw4asmfg-source | |
| source root is source | |
| Running phase: patchPhase | |
| patching script interpreter paths in . | |
| ./.kokoro/generate_index_html.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/kysqfpylfpl8yrmgahj1sk6yrih918gl-bash-5.3p9/bin/bash" | |
| ./build_tools/ci/build.py: interpreter directive changed from "#!/usr/bin/python3" to "/nix/store/sgwyk49anisz13i8j8gn7nxk0d9daf7j-python3-3.13.12-env/bin/python3" | |
| ./build_tools/ci/parallel_gpu_execute.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/kysqfpylfpl8yrmgahj1sk6yrih918gl-bash-5.3p9/bin/bash" | |
| ./build_tools/configure/configure.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/sgwyk49anisz13i8j8gn7nxk0d9daf7j-python3-3.13.12-env/bin/python3" |
Note
This document has been migrated to my blog at samlikes.pizza/blog/elements-of-skainswo-style. Future updates will be made there.
In the course of my open source and day-to-day work I am occasionally asked to weigh in on software design. In the interest of my time and energy and the time and energy of others, this document is an attempt to codify as much as possible of my personal design philosophy and programming aesthetics. It is my goal that after reading this document and all of the linked material you will have a faithful mental model of how I think about the world and programming in particular -- hopefully to the extent that you could imitate me in a PR review or design discussion, whether or not you agree.
| ![i know kung fu](https://media4.giphy.com/media/v1.Y2lkPTZjMDliOTUyZXZzeWdyamY5aDJmMmEzd3ViNGZ6dXpia2IyYXY3MzQzMXZ5N3JoZyZlcD12MV9naWZzX3NlYXJjaC
| ❯ nix-build -A python3Packages.anndata | |
| this derivation will be built: | |
| /nix/store/swwnk1mhz2wfxy75asx67zjg2qkhi8di-python3.12-anndata-0.11.4.drv | |
| building '/nix/store/swwnk1mhz2wfxy75asx67zjg2qkhi8di-python3.12-anndata-0.11.4.drv'... | |
| Sourcing python-remove-tests-dir-hook | |
| Sourcing python-catch-conflicts-hook.sh | |
| Sourcing python-remove-bin-bytecode-hook.sh | |
| Sourcing pypa-build-hook | |
| Using pypaBuildPhase | |
| Sourcing python-runtime-deps-check-hook |
| nixpkgs on samuela/scanpy | |
| ❯ nix-build -A python3Packages.anndata | |
| this derivation will be built: | |
| /nix/store/kgligwzymlzjy7wvlb9jc9wv0wl3i198-python3.12-anndata-0.11.4.drv | |
| building '/nix/store/kgligwzymlzjy7wvlb9jc9wv0wl3i198-python3.12-anndata-0.11.4.drv'... | |
| Sourcing python-remove-tests-dir-hook | |
| Sourcing python-catch-conflicts-hook.sh | |
| Sourcing python-remove-bin-bytecode-hook.sh | |
| Sourcing pypa-build-hook |
| // This config is in the KDL format: https://kdl.dev | |
| // "/-" comments out the following node. | |
| // Check the wiki for a full description of the configuration: | |
| // https://github.com/YaLTeR/niri/wiki/Configuration:-Overview | |
| // See https://github.com/YaLTeR/niri/wiki/Application-Issues#electron-applications | |
| environment { | |
| ELECTRON_OZONE_PLATFORM_HINT "auto" | |
| } |
| // This config is in the KDL format: https://kdl.dev | |
| // "/-" comments out the following node. | |
| // Check the wiki for a full description of the configuration: | |
| // https://github.com/YaLTeR/niri/wiki/Configuration:-Overview | |
| // See https://github.com/YaLTeR/niri/wiki/Application-Issues#electron-applications | |
| environment { | |
| ELECTRON_OZONE_PLATFORM_HINT "auto" | |
| } |
| nixpkgs on master on ☁️ | |
| 10% ❯ nix-build -E 'with import <nixpkgs> {}; bazel_7.override { enableNixHacks = true; }' | |
| this derivation will be built: | |
| /nix/store/abzdw0gb1lz10w5rc97y88l3glpfxy0y-bazel-7.4.1.drv | |
| building '/nix/store/abzdw0gb1lz10w5rc97y88l3glpfxy0y-bazel-7.4.1.drv'... | |
| Running phase: unpackPhase | |
| unpacking source archive /nix/store/9dh7hw9x3jw35s0xjb2zinlkh3ckr0yw-bazel-7.4.1-dist.zip | |
| source root is . | |
| Running phase: patchPhase | |
| applying patch /nix/store/bak52cz0p06vsjd6wn0v3k7d8r822nca-java_toolchain.patch |
| { | |
| "nodes": { | |
| "naersk": { | |
| "inputs": { | |
| "nixpkgs": "nixpkgs" | |
| }, | |
| "locked": { | |
| "lastModified": 1698420672, | |
| "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=", | |
| "owner": "nix-community", |
| { | |
| "nodes": { | |
| "nixpkgs": { | |
| "locked": { | |
| "lastModified": 1711624657, | |
| "narHash": "sha256-IViG6BKCJY/I6oRNfAANf/QitYylepQSCzgam0TF+bs=", | |
| "owner": "NixOS", | |
| "repo": "nixpkgs", | |
| "rev": "72c6ed328aa4e5d9151b1a512f6ad83aca7529fa", | |
| "type": "github" |