From 2b29ba7fe6563c653c17430d9be3854cf87e7dfa Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 14:38:19 +0100 Subject: [PATCH 01/32] WIP docker idea --- .github/workflows/all.yml | 243 +++++++++++++++++++++++--------------- Dockerfile | 36 ++++++ 2 files changed, 183 insertions(+), 96 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index e89ce102..386bdede 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -5,107 +5,158 @@ on: schedule: - cron: '0 0 * * 1' jobs: - build-all-alpine: + build-base-with-docker: runs-on: ubuntu-latest - container: - image: alpine:latest steps: - name: Check out repository code uses: actions/checkout@v3 - - name: Install bash - run: apk add bash git - - name: Silence some git warnings - run: | - git config --global advice.detachedHead false - git config --global init.defaultBranch main - - name: Install and build all benchmarks and allocators - # dh: glibc-specific - # fg: Uses execinfo.h, which is a GNU extension - # gd: ? - # hd: glibc-specific - # lf: crashes redis server - # lt: return type 'struct mallinfo' is incomplete - # mesh/nomesh: infinite loop? - # pa: can't setup depot_tools and goma - # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' - # tcg: [...] specifies less restrictive attribute than its target [...] - # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # rp: rpmalloc/rpmalloc.c:980:9: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] - run: ./build-bench-env.sh all no-dh no-hd no-sm no-mesh no-nomesh no-pa no-gd no-fg no-lf no-lt no-tcg no-lp no-rp - - name: Run everything. - run: | - cd out/bench - ../../bench.sh alla allt - build-all-ubuntu: + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and run benchmarks in Docker + id: docker_build + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: false + tags: bench + target: bench-env + build-args: | + platform=ubuntu + platform_version=24.04 + cache-from: type=gha + cache-to: type=gha,mode=max + + build-and-benchmark-allocator: runs-on: ubuntu-latest + needs: build-base-with-docker + strategy: + matrix: + allocator: [mi, sn] steps: - name: Check out repository code uses: actions/checkout@v3 - - name: Silence some git warnings - run: | - git config --global advice.detachedHead false - git config --global init.defaultBranch main - - name: Install and build all benchmarks and allocators - # fg: crashes on redis - # gd: infinite loop in the redis benchmark - # lt: breaks on sh8benchN - # lf: crashes redis server - # ff: crashes on modern ubuntu: https://github.com/bwickman97/ffmalloc/issues/5 - # hoard: crashes on rocksdb - # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # sn: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression - # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - # tcg: ERROR: Error computing the main repository mapping: protobuf@29.0 depends on rules_fuzzing@0.5.2 with compatibility level 0, but depends on rules_fuzzing@0.5.1 with compatibility level 1 which is different - run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-lt no-lf no-hd no-pa no-sn no-lp no-tcg - - name: Run everything. - run: | - cd out/bench - ../../bench.sh alla allt - build-all-fedora: - runs-on: ubuntu-latest - container: - image: fedora:latest - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Install git - run: sudo dnf -y --quiet --nodocs install git - - name: Silence some git warnings - run: | - git config --global advice.detachedHead false - git config --global init.defaultBranch main - - name: Install and build all benchmarks and allocators - # gd: infinite loop in the redis benchmark - # mesh/nomesh: error: '__malloc_hook' was not declared in this scope; - # mi: error: '__malloc_hook' was not declared in this scope; - # rp: mixing declarations and code is incompatible with standards before C99 - # lf: crashes redis server - # fg: crashes redis server - # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # tcg: https://github.com/bazelbuild/bazel/issues/19295 bazel5 is required but unavailable - run: ./build-bench-env.sh all no-lean no-mi no-mesh no-nomesh no-gd no-rp no-lf no-fg no-pa no-lp no-sh8 no-tcg - - name: Run everything. - run: | - cd out/bench - ../../bench.sh alla allt - build-all-osx: - runs-on: macos-11 - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Silence some git warnings - run: | - git config --global advice.detachedHead false - git config --global init.defaultBranch main - - name: Install and build all benchmarks and allocators - # ff:ffmalloc.c:1140:14: error: implicit declaration of function 'sched_getcpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration] - # fg: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'? - # gd: so many errors - # pa: ninja: error: '../../buildtools/third_party/libc++/trunk/src/utility.cpp', needed by 'obj/buildtools/third_party/libc++/libc++/utility.o', missing and no known rule to make it - # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-pa no-lp - - name: Run everything. - run: | - cd out/bench - ../../bench.sh alla allt + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and run benchmarks in Docker + id: docker_build + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: false + target: benchmark + build-args: | + allocator=${{ matrix.allocator }} + benchs=allt + repeats=1 + cache-from: type=gha + + # build-all-alpine: + # runs-on: ubuntu-latest + # container: + # image: alpine:latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install bash + # run: apk add bash git + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # dh: glibc-specific + # # fg: Uses execinfo.h, which is a GNU extension + # # gd: ? + # # hd: glibc-specific + # # lf: crashes redis server + # # lt: return type 'struct mallinfo' is incomplete + # # mesh/nomesh: infinite loop? + # # pa: can't setup depot_tools and goma + # # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' + # # tcg: [...] specifies less restrictive attribute than its target [...] + # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + # # rp: rpmalloc/rpmalloc.c:980:9: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] + # run: ./build-bench-env.sh all no-dh no-hd no-sm no-mesh no-nomesh no-pa no-gd no-fg no-lf no-lt no-tcg no-lp no-rp + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-ubuntu: + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # fg: crashes on redis + # # gd: infinite loop in the redis benchmark + # # lt: breaks on sh8benchN + # # lf: crashes redis server + # # ff: crashes on modern ubuntu: https://github.com/bwickman97/ffmalloc/issues/5 + # # hoard: crashes on rocksdb + # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory + # # sn: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression + # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 + # # tcg: ERROR: Error computing the main repository mapping: protobuf@29.0 depends on rules_fuzzing@0.5.2 with compatibility level 0, but depends on rules_fuzzing@0.5.1 with compatibility level 1 which is different + # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-lt no-lf no-hd no-pa no-sn no-lp no-tcg + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-fedora: + # runs-on: ubuntu-latest + # container: + # image: fedora:latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install git + # run: sudo dnf -y --quiet --nodocs install git + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # gd: infinite loop in the redis benchmark + # # mesh/nomesh: error: '__malloc_hook' was not declared in this scope; + # # mi: error: '__malloc_hook' was not declared in this scope; + # # rp: mixing declarations and code is incompatible with standards before C99 + # # lf: crashes redis server + # # fg: crashes redis server + # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory + # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + # # tcg: https://github.com/bazelbuild/bazel/issues/19295 bazel5 is required but unavailable + # run: ./build-bench-env.sh all no-lean no-mi no-mesh no-nomesh no-gd no-rp no-lf no-fg no-pa no-lp no-sh8 no-tcg + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-osx: + # runs-on: macos-11 + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # ff:ffmalloc.c:1140:14: error: implicit declaration of function 'sched_getcpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration] + # # fg: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'? + # # gd: so many errors + # # pa: ninja: error: '../../buildtools/third_party/libc++/trunk/src/utility.cpp', needed by 'obj/buildtools/third_party/libc++/libc++/utility.o', missing and no known rule to make it + # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 + # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-pa no-lp + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2fa7db9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +ARG platform=ubuntu +ARG platform_version=24.04 + +FROM ${platform}:${platform_version} as bench-env + +# Pull mimalloc-bench +RUN mkdir -p /mimalloc-bench +COPY . /mimalloc-bench + +WORKDIR /mimalloc-bench +# Install dependencies +RUN ./build-bench-env.sh packages + +# Build benchmarks +RUN ./build-bench-env.sh bench + +RUN ./build-bench-env.sh redis + +RUN ./build-bench-env.sh rocksdb + +RUN ./build-bench-env.sh lean + + +FROM bench-env as benchmark + +WORKDIR /mimalloc-bench + +ARG allocator=mi +ARG benchs=allt +ARG repeats=1 + +RUN ./build-bench-env.sh $allocator + +# Run benchmarks +WORKDIR /mimalloc-bench/out/bench +RUN ../../bench.sh $allocator $benchs -r=$repeats \ No newline at end of file From eb1d428a3d75ff8005624a41328f36104d6c4415 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:01:12 +0100 Subject: [PATCH 02/32] shrinking to debug caching. --- .github/workflows/all.yml | 4 ++-- Dockerfile | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 386bdede..ff0d0498 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and run benchmarks in Docker + - name: Build benchmarks in Docker id: docker_build uses: docker/build-push-action@v4 with: @@ -42,7 +42,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and run benchmarks in Docker + - name: Build allocator and run benchmarks in Docker id: docker_build uses: docker/build-push-action@v4 with: diff --git a/Dockerfile b/Dockerfile index 2fa7db9c..fcc77a2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM ${platform}:${platform_version} as bench-env # Pull mimalloc-bench RUN mkdir -p /mimalloc-bench -COPY . /mimalloc-bench +COPY --exclude .github . /mimalloc-bench WORKDIR /mimalloc-bench # Install dependencies @@ -14,11 +14,11 @@ RUN ./build-bench-env.sh packages # Build benchmarks RUN ./build-bench-env.sh bench -RUN ./build-bench-env.sh redis +# RUN ./build-bench-env.sh redis -RUN ./build-bench-env.sh rocksdb +# RUN ./build-bench-env.sh rocksdb -RUN ./build-bench-env.sh lean +# RUN ./build-bench-env.sh lean FROM bench-env as benchmark @@ -26,7 +26,7 @@ FROM bench-env as benchmark WORKDIR /mimalloc-bench ARG allocator=mi -ARG benchs=allt +ARG benchs=cfrac ARG repeats=1 RUN ./build-bench-env.sh $allocator From 9b768f000a281decaafa41becb4a3195661acc56 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:01:40 +0100 Subject: [PATCH 03/32] shrinking to debug caching. --- .github/workflows/all.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index ff0d0498..38166d8c 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -51,6 +51,8 @@ jobs: push: false target: benchmark build-args: | + platform=ubuntu + platform_version=24.04 allocator=${{ matrix.allocator }} benchs=allt repeats=1 From 9e07ed1f0026bc2b4b33460ed2ca54e31637db52 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:03:34 +0100 Subject: [PATCH 04/32] shrinking to debug caching. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fcc77a2a..6132c38c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM ${platform}:${platform_version} as bench-env # Pull mimalloc-bench RUN mkdir -p /mimalloc-bench -COPY --exclude .github . /mimalloc-bench +COPY --exclude=.github . /mimalloc-bench WORKDIR /mimalloc-bench # Install dependencies From c14d8890e0b5145d73f4fee6cc8325effe5f4aee Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:07:29 +0100 Subject: [PATCH 05/32] drop exclude --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6132c38c..2434ffc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM ${platform}:${platform_version} as bench-env # Pull mimalloc-bench RUN mkdir -p /mimalloc-bench -COPY --exclude=.github . /mimalloc-bench +COPY . /mimalloc-bench WORKDIR /mimalloc-bench # Install dependencies From 11d9baeb0330df85fa2b1f593ddd4e926f70167c Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:17:19 +0100 Subject: [PATCH 06/32] WIP --- .dockerignore | 3 +++ .github/workflows/all.yml | 6 ++---- Dockerfile | 7 +++---- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..b72b6993 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.github +Dockerfile +README.md \ No newline at end of file diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 38166d8c..69df1fa6 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -24,8 +24,7 @@ jobs: tags: bench target: bench-env build-args: | - platform=ubuntu - platform_version=24.04 + platform=ubuntu:24.04 cache-from: type=gha cache-to: type=gha,mode=max @@ -51,8 +50,7 @@ jobs: push: false target: benchmark build-args: | - platform=ubuntu - platform_version=24.04 + platform=ubuntu:24.04 allocator=${{ matrix.allocator }} benchs=allt repeats=1 diff --git a/Dockerfile b/Dockerfile index 2434ffc1..e0795ff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -ARG platform=ubuntu -ARG platform_version=24.04 +ARG platform=ubuntu:24.04 -FROM ${platform}:${platform_version} as bench-env +FROM ${platform} AS bench-env # Pull mimalloc-bench RUN mkdir -p /mimalloc-bench @@ -21,7 +20,7 @@ RUN ./build-bench-env.sh bench # RUN ./build-bench-env.sh lean -FROM bench-env as benchmark +FROM bench-env AS benchmark WORKDIR /mimalloc-bench From 9979f701cf07c42836094357e9d8d33e5eaad9f1 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:28:33 +0100 Subject: [PATCH 07/32] WIP --- .github/workflows/all.yml | 43 +++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 69df1fa6..7910a5f5 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -28,12 +28,9 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - build-and-benchmark-allocator: + build-base-with-docker_again: runs-on: ubuntu-latest needs: build-base-with-docker - strategy: - matrix: - allocator: [mi, sn] steps: - name: Check out repository code uses: actions/checkout@v3 @@ -41,20 +38,48 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build allocator and run benchmarks in Docker + - name: Build benchmarks in Docker id: docker_build uses: docker/build-push-action@v4 with: context: . file: Dockerfile push: false - target: benchmark + tags: bench + target: bench-env build-args: | platform=ubuntu:24.04 - allocator=${{ matrix.allocator }} - benchs=allt - repeats=1 cache-from: type=gha + cache-to: type=gha,mode=max + + + # build-and-benchmark-allocator: + # runs-on: ubuntu-latest + # needs: build-base-with-docker + # strategy: + # matrix: + # allocator: [mi, sn] + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + + # - name: Build allocator and run benchmarks in Docker + # id: docker_build + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile + # push: false + # target: benchmark + # build-args: | + # platform=ubuntu:24.04 + # allocator=${{ matrix.allocator }} + # benchs=allt + # repeats=1 + # cache-from: type=gha # build-all-alpine: # runs-on: ubuntu-latest From acd7dd26bff8c7809a5d7df9fbbbb599e5bed8b9 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:42:50 +0100 Subject: [PATCH 08/32] WIP --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index b72b6993..4717ae1d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ .github +.git Dockerfile README.md \ No newline at end of file From 4e1a872863bb4dbe5f9cecd8b34537d733058ecb Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:46:40 +0100 Subject: [PATCH 09/32] WIP --- .github/workflows/all.yml | 43 ++++++++------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 7910a5f5..69df1fa6 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -28,9 +28,12 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - build-base-with-docker_again: + build-and-benchmark-allocator: runs-on: ubuntu-latest needs: build-base-with-docker + strategy: + matrix: + allocator: [mi, sn] steps: - name: Check out repository code uses: actions/checkout@v3 @@ -38,48 +41,20 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build benchmarks in Docker + - name: Build allocator and run benchmarks in Docker id: docker_build uses: docker/build-push-action@v4 with: context: . file: Dockerfile push: false - tags: bench - target: bench-env + target: benchmark build-args: | platform=ubuntu:24.04 + allocator=${{ matrix.allocator }} + benchs=allt + repeats=1 cache-from: type=gha - cache-to: type=gha,mode=max - - - # build-and-benchmark-allocator: - # runs-on: ubuntu-latest - # needs: build-base-with-docker - # strategy: - # matrix: - # allocator: [mi, sn] - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - - # - name: Build allocator and run benchmarks in Docker - # id: docker_build - # uses: docker/build-push-action@v4 - # with: - # context: . - # file: Dockerfile - # push: false - # target: benchmark - # build-args: | - # platform=ubuntu:24.04 - # allocator=${{ matrix.allocator }} - # benchs=allt - # repeats=1 - # cache-from: type=gha # build-all-alpine: # runs-on: ubuntu-latest From 0ca5828605c001bcf133b49624b4be386ab647a7 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:51:47 +0100 Subject: [PATCH 10/32] Make more realistic --- .github/workflows/all.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 69df1fa6..e191b726 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -7,6 +7,9 @@ on: jobs: build-base-with-docker: runs-on: ubuntu-latest + strategy: + matrix: + platform: [ubuntu:24.04, alpine:latest, fedora:latest] steps: - name: Check out repository code uses: actions/checkout@v3 @@ -24,16 +27,17 @@ jobs: tags: bench target: bench-env build-args: | - platform=ubuntu:24.04 - cache-from: type=gha - cache-to: type=gha,mode=max + platform=${{ matrix.platform }} + cache-from: type=gha,index=buildkit_${{ matrix.platform }} + cache-to: type=gha,mode=max, index=buildkit_${{ matrix.platform }} build-and-benchmark-allocator: runs-on: ubuntu-latest needs: build-base-with-docker strategy: matrix: - allocator: [mi, sn] + platform: [ubuntu:24.04, alpine:latest, fedora:latest] + allocator: [mi, sn, je] steps: - name: Check out repository code uses: actions/checkout@v3 @@ -50,11 +54,11 @@ jobs: push: false target: benchmark build-args: | - platform=ubuntu:24.04 + platform=${{ matrix.platform }} allocator=${{ matrix.allocator }} benchs=allt repeats=1 - cache-from: type=gha + cache-from: type=gha, index=buildkit_${{ matrix.platform }} # build-all-alpine: # runs-on: ubuntu-latest From 94513c58d3ce2a3ad633c780215b1f373d6e04d5 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 15:57:40 +0100 Subject: [PATCH 11/32] Shrink --- .github/workflows/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index e191b726..d460f742 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - platform: [ubuntu:24.04, alpine:latest, fedora:latest] + platform: [ubuntu:24.04, fedora:latest] steps: - name: Check out repository code uses: actions/checkout@v3 From cced830cc801a8fe91aad01a089ed46dacee049c Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 16:01:31 +0100 Subject: [PATCH 12/32] Shrink --- .github/workflows/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index d460f742..77723a08 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -36,7 +36,7 @@ jobs: needs: build-base-with-docker strategy: matrix: - platform: [ubuntu:24.04, alpine:latest, fedora:latest] + platform: [ubuntu:24.04, fedora:latest] allocator: [mi, sn, je] steps: - name: Check out repository code From b2d558496f5d3f3d37836935f92504166b0cbd3a Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 16:08:43 +0100 Subject: [PATCH 13/32] Shrink --- .github/workflows/all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 77723a08..c692c979 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -28,8 +28,8 @@ jobs: target: bench-env build-args: | platform=${{ matrix.platform }} - cache-from: type=gha,index=buildkit_${{ matrix.platform }} - cache-to: type=gha,mode=max, index=buildkit_${{ matrix.platform }} + cache-from: type=gha,scope=buildkit_${{ matrix.platform }} + cache-to: type=gha,mode=max,scope=buildkit_${{ matrix.platform }} build-and-benchmark-allocator: runs-on: ubuntu-latest @@ -58,7 +58,7 @@ jobs: allocator=${{ matrix.allocator }} benchs=allt repeats=1 - cache-from: type=gha, index=buildkit_${{ matrix.platform }} + cache-from: type=gha,scope=buildkit_${{ matrix.platform }} # build-all-alpine: # runs-on: ubuntu-latest From 2d13c8085dd7751bb3ffb12836664081750fcc95 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 16:20:01 +0100 Subject: [PATCH 14/32] Use reuseable workflows. --- .github/workflows/all.yml | 56 +---------- .github/workflows/platform.yml | 167 +++++++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/platform.yml diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index c692c979..93badad7 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -5,60 +5,14 @@ on: schedule: - cron: '0 0 * * 1' jobs: - build-base-with-docker: - runs-on: ubuntu-latest + build-and-run: strategy: matrix: platform: [ubuntu:24.04, fedora:latest] - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build benchmarks in Docker - id: docker_build - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile - push: false - tags: bench - target: bench-env - build-args: | - platform=${{ matrix.platform }} - cache-from: type=gha,scope=buildkit_${{ matrix.platform }} - cache-to: type=gha,mode=max,scope=buildkit_${{ matrix.platform }} - - build-and-benchmark-allocator: - runs-on: ubuntu-latest - needs: build-base-with-docker - strategy: - matrix: - platform: [ubuntu:24.04, fedora:latest] - allocator: [mi, sn, je] - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build allocator and run benchmarks in Docker - id: docker_build - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile - push: false - target: benchmark - build-args: | - platform=${{ matrix.platform }} - allocator=${{ matrix.allocator }} - benchs=allt - repeats=1 - cache-from: type=gha,scope=buildkit_${{ matrix.platform }} + fail-fast: false + uses: ./.github/workflows/platform.yml + with: + platform: ${{ matrix.platform }} # build-all-alpine: # runs-on: ubuntu-latest diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml new file mode 100644 index 00000000..4e3f5318 --- /dev/null +++ b/.github/workflows/platform.yml @@ -0,0 +1,167 @@ +name: Build and run everything +on: + workflow_call: + inputs: + platform: + description: 'Base container image to build on' + required: true + type: string + +jobs: + build-base-with-docker: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build benchmarks in Docker + id: docker_build + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: false + tags: bench + target: bench-env + build-args: | + platform=${{ inputs.platform }} + cache-from: type=gha,scope=buildkit_${{ inputs.platform }} + cache-to: type=gha,mode=max,scope=buildkit_${{ inputs.platform }} + + build-and-benchmark-allocator: + runs-on: ubuntu-latest + + needs: build-base-with-docker + strategy: + matrix: + allocator: [mi, sn, je] + fail-fast: false + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build allocator and run benchmarks in Docker + id: docker_build + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: false + target: benchmark + build-args: | + platform=${{ inputs.platform }} + allocator=${{ matrix.allocator }} + benchs=allt + repeats=1 + cache-from: type=gha,scope=buildkit_${{ inputs.platform }} + + # build-all-alpine: + # runs-on: ubuntu-latest + # container: + # image: alpine:latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install bash + # run: apk add bash git + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # dh: glibc-specific + # # fg: Uses execinfo.h, which is a GNU extension + # # gd: ? + # # hd: glibc-specific + # # lf: crashes redis server + # # lt: return type 'struct mallinfo' is incomplete + # # mesh/nomesh: infinite loop? + # # pa: can't setup depot_tools and goma + # # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' + # # tcg: [...] specifies less restrictive attribute than its target [...] + # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + # # rp: rpmalloc/rpmalloc.c:980:9: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] + # run: ./build-bench-env.sh all no-dh no-hd no-sm no-mesh no-nomesh no-pa no-gd no-fg no-lf no-lt no-tcg no-lp no-rp + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-ubuntu: + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # fg: crashes on redis + # # gd: infinite loop in the redis benchmark + # # lt: breaks on sh8benchN + # # lf: crashes redis server + # # ff: crashes on modern ubuntu: https://github.com/bwickman97/ffmalloc/issues/5 + # # hoard: crashes on rocksdb + # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory + # # sn: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression + # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 + # # tcg: ERROR: Error computing the main repository mapping: protobuf@29.0 depends on rules_fuzzing@0.5.2 with compatibility level 0, but depends on rules_fuzzing@0.5.1 with compatibility level 1 which is different + # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-lt no-lf no-hd no-pa no-sn no-lp no-tcg + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-fedora: + # runs-on: ubuntu-latest + # container: + # image: fedora:latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install git + # run: sudo dnf -y --quiet --nodocs install git + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # gd: infinite loop in the redis benchmark + # # mesh/nomesh: error: '__malloc_hook' was not declared in this scope; + # # mi: error: '__malloc_hook' was not declared in this scope; + # # rp: mixing declarations and code is incompatible with standards before C99 + # # lf: crashes redis server + # # fg: crashes redis server + # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory + # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + # # tcg: https://github.com/bazelbuild/bazel/issues/19295 bazel5 is required but unavailable + # run: ./build-bench-env.sh all no-lean no-mi no-mesh no-nomesh no-gd no-rp no-lf no-fg no-pa no-lp no-sh8 no-tcg + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt + # build-all-osx: + # runs-on: macos-11 + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Silence some git warnings + # run: | + # git config --global advice.detachedHead false + # git config --global init.defaultBranch main + # - name: Install and build all benchmarks and allocators + # # ff:ffmalloc.c:1140:14: error: implicit declaration of function 'sched_getcpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration] + # # fg: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'? + # # gd: so many errors + # # pa: ninja: error: '../../buildtools/third_party/libc++/trunk/src/utility.cpp', needed by 'obj/buildtools/third_party/libc++/libc++/utility.o', missing and no known rule to make it + # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 + # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-pa no-lp + # - name: Run everything. + # run: | + # cd out/bench + # ../../bench.sh alla allt From af46cee3951a046f1062f03d0382422796e0df96 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 16:25:29 +0100 Subject: [PATCH 15/32] Use reuseable workflows. --- .github/workflows/all.yml | 1 + .github/workflows/platform.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 93badad7..4b264895 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -11,6 +11,7 @@ jobs: platform: [ubuntu:24.04, fedora:latest] fail-fast: false uses: ./.github/workflows/platform.yml + name: ${{ matrix.platform }} with: platform: ${{ matrix.platform }} diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 4e3f5318..56a9cebb 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -10,6 +10,7 @@ on: jobs: build-base-with-docker: runs-on: ubuntu-latest + name: Base Container steps: - name: Check out repository code uses: actions/checkout@v3 @@ -39,6 +40,7 @@ jobs: matrix: allocator: [mi, sn, je] fail-fast: false + name: ${{ matrix.allocator }} - build and benchmark steps: - name: Check out repository code uses: actions/checkout@v3 From c4b3970db84f05f08ca11cfd7f12490cd51bb1fc Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 16:29:34 +0100 Subject: [PATCH 16/32] Expand build to all benchmarks --- Dockerfile | 7 +++---- build-bench-env.sh | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0795ff4..47a8ad7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,11 @@ RUN ./build-bench-env.sh packages # Build benchmarks RUN ./build-bench-env.sh bench -# RUN ./build-bench-env.sh redis +RUN ./build-bench-env.sh redis -# RUN ./build-bench-env.sh rocksdb - -# RUN ./build-bench-env.sh lean +RUN ./build-bench-env.sh rocksdb +RUN ./build-bench-env.sh lean FROM bench-env AS benchmark diff --git a/build-bench-env.sh b/build-bench-env.sh index 690975b6..8223ba57 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -441,7 +441,7 @@ if test "$setup_packages" = "1"; then # no 'apt update' equivalent needed on Fedora dnfinstall "gcc-c++ clang lld llvm-devel unzip dos2unix bc gmp-devel wget gawk \ cmake python3 ruby ninja-build libtool autoconf git patch time sed \ - ghostscript libatomic which gflags-devel xz readline-devel snappy-devel" + ghostscript libatomic libstdc++ which gflags-devel xz readline-devel snappy-devel" # bazel5 is broken on the copr: https://github.com/bazelbuild/bazel/issues/19295 #dnfinstallbazel elif grep -q -e 'ID=debian' -e 'ID=ubuntu' /etc/os-release 2>/dev/null; then From 0d149cea904b51b2037d30182f37fc99c8c28749 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 17:03:25 +0100 Subject: [PATCH 17/32] Add custom setup for each platform --- .github/workflows/all.yml | 2 +- Dockerfile | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 4b264895..4ed4d948 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -8,7 +8,7 @@ jobs: build-and-run: strategy: matrix: - platform: [ubuntu:24.04, fedora:latest] + platform: [ubuntu, fedora, alpine] fail-fast: false uses: ./.github/workflows/platform.yml name: ${{ matrix.platform }} diff --git a/Dockerfile b/Dockerfile index 47a8ad7f..fe54d991 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,14 @@ -ARG platform=ubuntu:24.04 +ARG platform=ubuntu + +FROM ubuntu:24.04 AS ubuntu + + +FROM fedora:latest AS fedora + + +FROM alpine:latest AS alpine +RUN apk add --no-cache bash + FROM ${platform} AS bench-env From 8aeea7b354b65ca66e0c6276bb2bbb431bfc004e Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 17:35:40 +0100 Subject: [PATCH 18/32] Experiment with selective allocators by platform --- .github/workflows/platform.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 56a9cebb..74661e2e 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -38,7 +38,18 @@ jobs: needs: build-base-with-docker strategy: matrix: - allocator: [mi, sn, je] + allocator: [mi, sn, je, dh, hd] + isAlpine: ${{ inputs.platform == 'alpine' }} + isFedora: ${{ inputs.platform == 'fedora' }} + isUbuntu: ${{ inputs.platform == 'ubuntu' }} + exclude: + # dh: glibc-specific + - allocator: dh + isAlpine: true + # hd: glibc-specific + - allocator: hd + isAlpine: true + fail-fast: false name: ${{ matrix.allocator }} - build and benchmark steps: From 8083a8f61df0d35d9937842519c8b39a49f3c171 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 17:45:44 +0100 Subject: [PATCH 19/32] Experiment with selective allocators by platform --- .github/workflows/platform.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 74661e2e..1dbbe9af 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -34,21 +34,18 @@ jobs: build-and-benchmark-allocator: runs-on: ubuntu-latest - needs: build-base-with-docker strategy: matrix: allocator: [mi, sn, je, dh, hd] - isAlpine: ${{ inputs.platform == 'alpine' }} - isFedora: ${{ inputs.platform == 'fedora' }} - isUbuntu: ${{ inputs.platform == 'ubuntu' }} + platform: ${{ inputs.platform }} exclude: # dh: glibc-specific - allocator: dh - isAlpine: true + platform: alpine # hd: glibc-specific - allocator: hd - isAlpine: true + platform: alpine fail-fast: false name: ${{ matrix.allocator }} - build and benchmark From b9e397b8b68afb5c92af2bf856c992d023779e77 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 7 Aug 2025 20:43:17 +0100 Subject: [PATCH 20/32] Experiment with selective allocators by platform --- .github/workflows/platform.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 1dbbe9af..6c554253 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -38,14 +38,15 @@ jobs: strategy: matrix: allocator: [mi, sn, je, dh, hd] - platform: ${{ inputs.platform }} + true: [true, false] exclude: + - true: false # dh: glibc-specific - allocator: dh - platform: alpine + platform: ${{ inputs.platform == 'alpine' }} # hd: glibc-specific - allocator: hd - platform: alpine + platform: ${{ inputs.platform == 'alpine' }} fail-fast: false name: ${{ matrix.allocator }} - build and benchmark From c0a928b53ef3709bc115c8c6a3dadf473d0397b7 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 06:42:18 +0100 Subject: [PATCH 21/32] fix name --- .github/workflows/platform.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 6c554253..e272a3c4 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -38,15 +38,15 @@ jobs: strategy: matrix: allocator: [mi, sn, je, dh, hd] - true: [true, false] + pedicate: [true, false] exclude: - - true: false + - predicate: false # dh: glibc-specific - allocator: dh - platform: ${{ inputs.platform == 'alpine' }} + predicate: ${{ inputs.platform == 'alpine' }} # hd: glibc-specific - allocator: hd - platform: ${{ inputs.platform == 'alpine' }} + predicate: ${{ inputs.platform == 'alpine' }} fail-fast: false name: ${{ matrix.allocator }} - build and benchmark From a5dc8bb872aaf62c0f3c9d2d06fad33e29a6a16c Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 06:45:53 +0100 Subject: [PATCH 22/32] Update platform.yml --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index e272a3c4..37c632c1 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -38,7 +38,7 @@ jobs: strategy: matrix: allocator: [mi, sn, je, dh, hd] - pedicate: [true, false] + predicate: [true, false] exclude: - predicate: false # dh: glibc-specific From 991cfd56e3d0cc6d454701216f4ad50e7ea0550b Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 10:50:41 +0100 Subject: [PATCH 23/32] Added more allocators. --- .github/workflows/all.yml | 2 +- .github/workflows/platform.yml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 4ed4d948..d78db0cf 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -8,7 +8,7 @@ jobs: build-and-run: strategy: matrix: - platform: [ubuntu, fedora, alpine] + platform: [ubuntu, alpine] # Dropped fedora as not currently building lean. fail-fast: false uses: ./.github/workflows/platform.yml name: ${{ matrix.platform }} diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 37c632c1..df1a1543 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -37,13 +37,16 @@ jobs: needs: build-base-with-docker strategy: matrix: - allocator: [mi, sn, je, dh, hd] + allocator: [ff, fg, gd, hd, hm, iso, je, lf, lp, lt, mesh, mng, mi, mi2, nomesh, pa, rp, scudo, sm, sn, sg, tbb, tc, yal, tcg] predicate: [true, false] exclude: - predicate: false # dh: glibc-specific - allocator: dh predicate: ${{ inputs.platform == 'alpine' }} + # fg: Uses execinfo.h, which is a GNU extension + - allocator: fg + predicate: ${{ inputs.platform == 'alpine' }} # hd: glibc-specific - allocator: hd predicate: ${{ inputs.platform == 'alpine' }} From 88d80325585eb222e57c536b35660c5dc48566a7 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 11:18:31 +0100 Subject: [PATCH 24/32] Get a clean CI run. --- .github/workflows/all.yml | 112 ++-------------------------- .github/workflows/platform.yml | 129 ++++++--------------------------- 2 files changed, 28 insertions(+), 213 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index d78db0cf..2ea6e287 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -8,114 +8,12 @@ jobs: build-and-run: strategy: matrix: - platform: [ubuntu, alpine] # Dropped fedora as not currently building lean. + platform: [ubuntu, alpine, fedora] + exclude: + # Fedora is not currently building lean. + - platform: fedora fail-fast: false uses: ./.github/workflows/platform.yml name: ${{ matrix.platform }} with: - platform: ${{ matrix.platform }} - - # build-all-alpine: - # runs-on: ubuntu-latest - # container: - # image: alpine:latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Install bash - # run: apk add bash git - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # dh: glibc-specific - # # fg: Uses execinfo.h, which is a GNU extension - # # gd: ? - # # hd: glibc-specific - # # lf: crashes redis server - # # lt: return type 'struct mallinfo' is incomplete - # # mesh/nomesh: infinite loop? - # # pa: can't setup depot_tools and goma - # # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' - # # tcg: [...] specifies less restrictive attribute than its target [...] - # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # # rp: rpmalloc/rpmalloc.c:980:9: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] - # run: ./build-bench-env.sh all no-dh no-hd no-sm no-mesh no-nomesh no-pa no-gd no-fg no-lf no-lt no-tcg no-lp no-rp - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-ubuntu: - # runs-on: ubuntu-latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # fg: crashes on redis - # # gd: infinite loop in the redis benchmark - # # lt: breaks on sh8benchN - # # lf: crashes redis server - # # ff: crashes on modern ubuntu: https://github.com/bwickman97/ffmalloc/issues/5 - # # hoard: crashes on rocksdb - # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # # sn: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression - # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - # # tcg: ERROR: Error computing the main repository mapping: protobuf@29.0 depends on rules_fuzzing@0.5.2 with compatibility level 0, but depends on rules_fuzzing@0.5.1 with compatibility level 1 which is different - # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-lt no-lf no-hd no-pa no-sn no-lp no-tcg - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-fedora: - # runs-on: ubuntu-latest - # container: - # image: fedora:latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Install git - # run: sudo dnf -y --quiet --nodocs install git - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # gd: infinite loop in the redis benchmark - # # mesh/nomesh: error: '__malloc_hook' was not declared in this scope; - # # mi: error: '__malloc_hook' was not declared in this scope; - # # rp: mixing declarations and code is incompatible with standards before C99 - # # lf: crashes redis server - # # fg: crashes redis server - # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # # tcg: https://github.com/bazelbuild/bazel/issues/19295 bazel5 is required but unavailable - # run: ./build-bench-env.sh all no-lean no-mi no-mesh no-nomesh no-gd no-rp no-lf no-fg no-pa no-lp no-sh8 no-tcg - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-osx: - # runs-on: macos-11 - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # ff:ffmalloc.c:1140:14: error: implicit declaration of function 'sched_getcpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration] - # # fg: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'? - # # gd: so many errors - # # pa: ninja: error: '../../buildtools/third_party/libc++/trunk/src/utility.cpp', needed by 'obj/buildtools/third_party/libc++/libc++/utility.o', missing and no known rule to make it - # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-pa no-lp - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt + platform: ${{ matrix.platform }} \ No newline at end of file diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index df1a1543..83a3c66a 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -41,15 +41,37 @@ jobs: predicate: [true, false] exclude: - predicate: false + # Not currently working on any platform + - allocator: pa + + # Alpine Specific disables. # dh: glibc-specific - allocator: dh predicate: ${{ inputs.platform == 'alpine' }} # fg: Uses execinfo.h, which is a GNU extension - allocator: fg predicate: ${{ inputs.platform == 'alpine' }} + # gd: ? + - allocator: gd + predicate: ${{ inputs.platform == 'alpine' }} # hd: glibc-specific - allocator: hd predicate: ${{ inputs.platform == 'alpine' }} + # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + - allocator: lp + predicate: ${{ inputs.platform == 'alpine' }} + # lt: return type 'struct mallinfo' is incomplete + - allocator: lt + predicate: ${{ inputs.platform == 'alpine' }} + # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' + - allocator: sm + predicate: ${{ inputs.platform == 'alpine' }} + # sn: __cxa_thread_at_exit_impl is not available in musl + - allocator: sn + predicate: ${{ inputs.platform == 'alpine' }} + # tcg: [...] specifies less restrictive attribute than its target [...] + - allocator: tcg + predicate: ${{ inputs.platform == 'alpine' }} fail-fast: false name: ${{ matrix.allocator }} - build and benchmark @@ -73,109 +95,4 @@ jobs: allocator=${{ matrix.allocator }} benchs=allt repeats=1 - cache-from: type=gha,scope=buildkit_${{ inputs.platform }} - - # build-all-alpine: - # runs-on: ubuntu-latest - # container: - # image: alpine:latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Install bash - # run: apk add bash git - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # dh: glibc-specific - # # fg: Uses execinfo.h, which is a GNU extension - # # gd: ? - # # hd: glibc-specific - # # lf: crashes redis server - # # lt: return type 'struct mallinfo' is incomplete - # # mesh/nomesh: infinite loop? - # # pa: can't setup depot_tools and goma - # # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' - # # tcg: [...] specifies less restrictive attribute than its target [...] - # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # # rp: rpmalloc/rpmalloc.c:980:9: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage] - # run: ./build-bench-env.sh all no-dh no-hd no-sm no-mesh no-nomesh no-pa no-gd no-fg no-lf no-lt no-tcg no-lp no-rp - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-ubuntu: - # runs-on: ubuntu-latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # fg: crashes on redis - # # gd: infinite loop in the redis benchmark - # # lt: breaks on sh8benchN - # # lf: crashes redis server - # # ff: crashes on modern ubuntu: https://github.com/bwickman97/ffmalloc/issues/5 - # # hoard: crashes on rocksdb - # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # # sn: /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression - # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - # # tcg: ERROR: Error computing the main repository mapping: protobuf@29.0 depends on rules_fuzzing@0.5.2 with compatibility level 0, but depends on rules_fuzzing@0.5.1 with compatibility level 1 which is different - # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-lt no-lf no-hd no-pa no-sn no-lp no-tcg - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-fedora: - # runs-on: ubuntu-latest - # container: - # image: fedora:latest - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Install git - # run: sudo dnf -y --quiet --nodocs install git - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # gd: infinite loop in the redis benchmark - # # mesh/nomesh: error: '__malloc_hook' was not declared in this scope; - # # mi: error: '__malloc_hook' was not declared in this scope; - # # rp: mixing declarations and code is incompatible with standards before C99 - # # lf: crashes redis server - # # fg: crashes redis server - # # pa: python3: can't open file '/__w/mimalloc-bench/mimalloc-bench/extern/pa/partition_alloc_builder/tools/rust/update_rust.py': [Errno 2] No such file or directory - # # lp: /__w/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:218:22: error: call to undeclared function 'pthread_getname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - # # tcg: https://github.com/bazelbuild/bazel/issues/19295 bazel5 is required but unavailable - # run: ./build-bench-env.sh all no-lean no-mi no-mesh no-nomesh no-gd no-rp no-lf no-fg no-pa no-lp no-sh8 no-tcg - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt - # build-all-osx: - # runs-on: macos-11 - # steps: - # - name: Check out repository code - # uses: actions/checkout@v3 - # - name: Silence some git warnings - # run: | - # git config --global advice.detachedHead false - # git config --global init.defaultBranch main - # - name: Install and build all benchmarks and allocators - # # ff:ffmalloc.c:1140:14: error: implicit declaration of function 'sched_getcpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration] - # # fg: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'? - # # gd: so many errors - # # pa: ninja: error: '../../buildtools/third_party/libc++/trunk/src/utility.cpp', needed by 'obj/buildtools/third_party/libc++/libc++/utility.o', missing and no known rule to make it - # # lp: /home/runner/work/mimalloc-bench/mimalloc-bench/extern/lp/Source/bmalloc/libpas/src/libpas/hotbit_heap_inlines.h:64:51: error: too few arguments to function call, expected 3, have 2 - # run: ./build-bench-env.sh all no-lean no-gd no-ff no-fg no-pa no-lp - # - name: Run everything. - # run: | - # cd out/bench - # ../../bench.sh alla allt + cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file From 15cc9c49c9acb3df91afa94c9bbbc6ee4ceac459 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 11:20:50 +0100 Subject: [PATCH 25/32] Add concurrency groups --- .github/workflows/all.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 2ea6e287..930eee13 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -1,9 +1,17 @@ name: Build and run everything + +# The following should ensure that the workflow only runs a single set of actions +# for each PR. But it will not apply this to pushes to the main branch. +concurrency: + group: ${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + on: push: pull_request: schedule: - cron: '0 0 * * 1' + jobs: build-and-run: strategy: From a9b963bb37fa638a1f0d40018cbac7d6d8fbd200 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 11:40:28 +0100 Subject: [PATCH 26/32] Remove redis on some platforms --- .github/workflows/platform.yml | 21 ++++++++++++++++++++- build-bench-env.sh | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 83a3c66a..d1616283 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -38,12 +38,21 @@ jobs: strategy: matrix: allocator: [ff, fg, gd, hd, hm, iso, je, lf, lp, lt, mesh, mng, mi, mi2, nomesh, pa, rp, scudo, sm, sn, sg, tbb, tc, yal, tcg] + testsuite: [allt] predicate: [true, false] exclude: - predicate: false # Not currently working on any platform - allocator: pa + # Following allocators are failing redis testsuite + - testsuite: allt + allocator: fg + - testsuite: allt + allocator: gd + - testsuite: allt + allocator: lf + # Alpine Specific disables. # dh: glibc-specific - allocator: dh @@ -72,6 +81,16 @@ jobs: # tcg: [...] specifies less restrictive attribute than its target [...] - allocator: tcg predicate: ${{ inputs.platform == 'alpine' }} + include: + # Following allocators are failing redis testsuite + - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua + allocator: lf + - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua + allocator: fg + - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua + allocator: gd + + fail-fast: false name: ${{ matrix.allocator }} - build and benchmark @@ -93,6 +112,6 @@ jobs: build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=allt + benchs=${{ matrix.testsuite }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file diff --git a/build-bench-env.sh b/build-bench-env.sh index 8223ba57..0761818d 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -656,7 +656,7 @@ if test "$setup_sn" = "1"; then else mkdir -p release cd release - env CXX=clang++ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release + env CXX=clang++ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release - cd .. fi cd release From 817e9c969399b2dd6e7bf15070feacc5efa996cd Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 11:44:59 +0100 Subject: [PATCH 27/32] Fix snmalloc on Alpine. --- .github/workflows/platform.yml | 3 --- build-bench-env.sh | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index d1616283..5be4e5da 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -75,9 +75,6 @@ jobs: # sm: ../src/supermalloc.h:10:31: error: expected initializer before '__THROW' - allocator: sm predicate: ${{ inputs.platform == 'alpine' }} - # sn: __cxa_thread_at_exit_impl is not available in musl - - allocator: sn - predicate: ${{ inputs.platform == 'alpine' }} # tcg: [...] specifies less restrictive attribute than its target [...] - allocator: tcg predicate: ${{ inputs.platform == 'alpine' }} diff --git a/build-bench-env.sh b/build-bench-env.sh index 0761818d..4cd9fed1 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -656,7 +656,8 @@ if test "$setup_sn" = "1"; then else mkdir -p release cd release - env CXX=clang++ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release - + # CXX11_DESTRUCTORS is needed as broken on Alpine without, should be fixed in the future upstrem. + env CXX=clang++ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DSNMALLOC_CLEANUP=CXX11_DESTRUCTORS cd .. fi cd release From 32a08f213b23554601d7c17a3059c4a8cd693f74 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 14:22:42 +0100 Subject: [PATCH 28/32] Fix test shrink for some allocators --- .github/workflows/platform.yml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 5be4e5da..22ea9abf 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -39,20 +39,15 @@ jobs: matrix: allocator: [ff, fg, gd, hd, hm, iso, je, lf, lp, lt, mesh, mng, mi, mi2, nomesh, pa, rp, scudo, sm, sn, sg, tbb, tc, yal, tcg] testsuite: [allt] + # Used to provide a platform-specific predicate predicate: [true, false] exclude: + # Always exclude build when predicate is false. - predicate: false + # Not currently working on any platform - allocator: pa - # Following allocators are failing redis testsuite - - testsuite: allt - allocator: fg - - testsuite: allt - allocator: gd - - testsuite: allt - allocator: lf - # Alpine Specific disables. # dh: glibc-specific - allocator: dh @@ -78,17 +73,6 @@ jobs: # tcg: [...] specifies less restrictive attribute than its target [...] - allocator: tcg predicate: ${{ inputs.platform == 'alpine' }} - include: - # Following allocators are failing redis testsuite - - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua - allocator: lf - - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua - allocator: fg - - testsuite: cfrac espresso barnes lean larson-sized mstress rptest gs lua - allocator: gd - - - fail-fast: false name: ${{ matrix.allocator }} - build and benchmark steps: @@ -106,9 +90,10 @@ jobs: file: Dockerfile push: false target: benchmark + ## If allocators in lf,fg,gd then use a smaller set of tests. build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=${{ matrix.testsuite }} + benchs=${{ contains('lf,fg,gd', matrix.allocator) && 'cfrac espresso barnes lean larson-sized mstress rptest gs lua' || 'allt' }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file From c5e6efab1a17a86038852ff8fb4d7715c867cfcc Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 17:00:29 +0100 Subject: [PATCH 29/32] Code review and final example. --- .github/workflows/platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 22ea9abf..9bef3f88 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -77,7 +77,7 @@ jobs: name: ${{ matrix.allocator }} - build and benchmark steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -94,6 +94,6 @@ jobs: build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=${{ contains('lf,fg,gd', matrix.allocator) && 'cfrac espresso barnes lean larson-sized mstress rptest gs lua' || 'allt' }} + benchs=${{ contains('lf,fg,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua' || 'allt' }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file From 8c3222a91514c0322f32af7da2ad3f3b2ce91dde Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 17:35:31 +0100 Subject: [PATCH 30/32] Remove another benchmark from fg. --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 9bef3f88..27d602f4 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -94,6 +94,6 @@ jobs: build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=${{ contains('lf,fg,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua' || 'allt' }} + benchs=${{ (contains('lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes mstress rptest gs lua') || 'allt' }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file From 355f95ab96f2040d1e287b026ee48113bde2d7aa Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 19:29:06 +0100 Subject: [PATCH 31/32] Shrink benchmarks again. --- .github/workflows/platform.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 27d602f4..bd74769f 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -90,10 +90,11 @@ jobs: file: Dockerfile push: false target: benchmark - ## If allocators in lf,fg,gd then use a smaller set of tests. + ## If allocators in lt,lf,fg,gd then use a smaller set of tests. + ## They were generally failing on lean or redis, and lf was also failing on mstress. build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=${{ (contains('lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes mstress rptest gs lua') || 'allt' }} + benchs=${{ (contains('lt,lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes rptest gs lua') || 'allt' }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file From d75065d563deddbe8c2a1b5a60c2c964a6e247fb Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 8 Aug 2025 19:54:12 +0100 Subject: [PATCH 32/32] fg again --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index bd74769f..4463bece 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -95,6 +95,6 @@ jobs: build-args: | platform=${{ inputs.platform }} allocator=${{ matrix.allocator }} - benchs=${{ (contains('lt,lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes rptest gs lua') || 'allt' }} + benchs=${{ (contains('lt,lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes gs lua') || 'allt' }} repeats=1 cache-from: type=gha,scope=buildkit_${{ inputs.platform }} \ No newline at end of file