Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ee2c532
Initial commit with task details
konard Nov 25, 2026
b295fa5
Bump Rust doublets to 0.21.0, add SQLite_File_Tuned and the transacti…
konard Nov 25, 2026
2b78ecb
Bump Platform.Data.Doublets to 1.0.0 and Microsoft.Data.Sqlite to 11.…
konard Nov 25, 2026
805a5a2
Add the minimal C# Delete reproduction and record the Platform.Data.D…
konard Nov 25, 2026
f7f4313
Add the configured benchmark reports, workflow and tables: the durabl…
konard Nov 25, 2026
eb6e4d1
Bump rusqlite to 0.43.0 (SQLite 3.54.1)
konard Nov 25, 2026
2f2e2d2
Fix CI: rustix 1.1.6 (RUSTSEC-2026-0486), the tuned C# objects rows i…
konard Nov 25, 2026
4242e98
Map the non-volatile stores without writing their reservation
konard Nov 25, 2026
7152d1c
Fix CI: check the unwritten reservation on Linux only, bump the sqlit…
konard Nov 25, 2026
2af2ed3
Describe the durability of the stores, the tuned SQLite file, the con…
konard Nov 25, 2026
4caf6c2
Measure the published configured tables on this pull request (tempora…
konard Nov 25, 2026
17a6478
Set the dirty page thresholds of the memory-limit runs to the default…
konard Nov 25, 2026
2ad8b0a
Publish the durable 10M tables: the transactional Doublets store next…
konard Nov 25, 2026
ba77efa
Run each storage under a memory limit in its own job and merge their …
konard Nov 25, 2026
2ce59cd
Restore the smoke plan of the configured benchmarks on pull requests
konard Nov 25, 2026
802b0f5
Remove the placeholder .gitkeep of the pull request
konard Nov 25, 2026
4a5b264
Describe the dirty page thresholds of the memory-limit runs as the ke…
konard Nov 25, 2026
1c071cc
Render the local configured tables with the published default results…
konard Nov 25, 2026
38103bf
Say that only the mapped stores' misses are major page faults in the …
konard Nov 25, 2026
f67a810
Stop a memory-limited store at the end of its job's time and report t…
konard Nov 25, 2026
20e1475
Let a manual configured run choose the minutes a memory-limited job g…
konard Nov 25, 2026
47eaa22
Sample a memory-limited scope after its first minute too
konard Nov 25, 2026
94adc0b
Lower the dirty page ratios of a memory-limited job instead of settin…
konard Nov 25, 2026
28266df
Set strict_limit on the storage disk of a memory-limited job so its t…
konard Nov 25, 2026
cd60f42
Set memory.high at 7/8 of a memory-limited job's limit instead of str…
konard Nov 25, 2026
326f6e1
Record the memory.high of a memory-limited job in its report and show…
konard Nov 25, 2026
b4a3469
List the memory-limit options of record in the usage of benchmark_con…
konard Nov 25, 2026
a517546
Publish the memory-limit tables: SQLite File and the file-mapped Doub…
konard Nov 26, 2026
48299e4
Address the Codacy and CodeFactor findings: one-line docstrings, a si…
konard Nov 26, 2026
3eca702
Split validate_configuration, plan, unfinished and provenance into he…
konard Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions .github/workflows/configurations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
name: Configured benchmarks

# Rust links tables in a non-default configuration: the durable transactional store next to SQLite File,
# and the file-backed stores under a cgroup memory limit. Pull requests run a small plan that checks the
# pipeline; the published tables are measured with a manual run and committed to
# docs/benchmarks/configurations (see README.md, "Configured benchmarks"). Under a memory limit a store
# can take hours, so the plan gives each storage its own job, and the report merges their reports.
on:
pull_request:
paths: ['rust/**', 'scripts/benchmark_configuration.py', 'scripts/benchmark_report.py', 'scripts/benchmark_provenance.py', 'scripts/memory_limit_run.sh', '.github/actions/**', '.github/workflows/configurations.yml']
workflow_dispatch:
inputs:
plan:
description: 'JSON runs: {"kind": "durable", "bits", "size"} or {"kind": "memory_limit", "bits", "size", "limit_mib"}'
default: '[{"kind": "memory_limit", "bits": 32, "size": 1000000, "limit_mib": 24}]'
disk:
description: Disk of the stores, the runner's work disk (temp) or its temporary disk (mnt)
type: choice
options: [temp, mnt]
default: temp
minutes:
description: Minutes a memory-limited job gives its storage before it stops it, at most 340
default: '340'

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
SOURCE_SHA: ${{ github.sha }}

jobs:
plan:
name: Plan
runs-on: ubuntu-24.04
timeout-minutes: 10
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.13'
- name: Validate the plan and emit the matrix
id: plan
env:
PLAN: ${{ inputs.plan || '[{"kind":"durable","bits":32,"size":1000},{"kind":"memory_limit","bits":32,"size":20000,"limit_mib":24}]' }}
run: |
matrix="$(python scripts/benchmark_configuration.py plan "$PLAN")"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"

benchmark:
name: ${{ matrix.name }}
needs: plan
runs-on: ubuntu-24.04
timeout-minutes: 355
concurrency:
group: check-${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
env:
KIND: ${{ matrix.kind }}
BITS: ${{ matrix.bits }}
SIZE: ${{ matrix.size }}
LIMIT_MIB: ${{ matrix.limit_mib }}
VARIANTS: ${{ matrix.variants }}
NAME: ${{ matrix.name }}
DISK: ${{ inputs.disk || 'temp' }}
MINUTES: ${{ inputs.minutes || '340' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/prepare-ci # zizmor: ignore[self-repository] actionlint 1.7.12 lacks $/ syntax
- uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d # stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
workspaces: rust
save-if: false
- run: cargo build --locked --release --manifest-path rust/Cargo.toml
- name: Probe the disks
run: |
sudo mkdir -p /mnt/benchmark
sudo chown "$(id -u):$(id -g)" /mnt/benchmark
# Both disks are logged; the published latencies are those of the disk the stores use.
for directory in "$RUNNER_TEMP/probe" /mnt/benchmark/probe; do
mkdir -p "$directory"
echo "$directory: $(df --output=source,fstype "$directory" | tail -1)"
python3 scripts/benchmark_configuration.py probe "$directory"
done
if [ "$DISK" = mnt ]; then root=/mnt/benchmark; else root="$RUNNER_TEMP"; fi
echo "STORAGE=$root/storage" >> "$GITHUB_ENV"
echo "DISK_LATENCY=$(python3 scripts/benchmark_configuration.py probe "$root/probe")" >> "$GITHUB_ENV"
- name: Benchmark
run: |
benchmark=("$PWD/rust/target/release/sqlite-vs-doublets" links "$BITS" "$SIZE" --repetitions 1
--variants "$VARIANTS" --directory "$STORAGE" --output "$RUNNER_TEMP/measured.json")
record=(--kind "$KIND" --disk "$DISK_LATENCY")
if [ "$KIND" = memory_limit ]; then
# The scope's memory.max charges the page cache too; without swap the stores' pages are evicted
# to their files. memory_limit_run.sh samples the scope while the benchmark runs and writes its
# stats at the end.
# With the default dirty page thresholds (20% and 10%), the united store's dirty pages and pages
# under writeback filled the limit, which reclaim cannot free, and it was killed under 24 MiB
# (run 45604850024: 21 MiB dirty, 15 MiB of it under writeback). Byte thresholds of 20% and 10%
# of the limit throttled every store instead: the kernel applies byte thresholds to a cgroup as
# a fraction of the runner's memory, rounded up to 1/4096 (domain_dirty_limits), so they came to
# a few pages, and each store waited in balance_dirty_pages after a minute (run 45681559798).
# The ratios apply to the memory the cgroup can use.
# A store that has not finished when the job's time runs out is stopped, and its report keeps
# the phases it finished, from the benchmark's phase log. 340 minutes leave the job's setup and
# report their time within its 355.
if ! [[ "$MINUTES" =~ ^[1-9][0-9]*$ ]] || [ "$MINUTES" -gt 340 ]; then
echo "::error::minutes must be a whole number from 1 to 340, not $MINUTES"
exit 1
fi
budget=$((MINUTES * 60))
sudo sysctl -q vm.dirty_ratio=5 vm.dirty_background_ratio=2
# The cgroup's dirty and writeback counts that balance_dirty_pages compares with its thresholds are
# flushed every few seconds (mem_cgroup_wb_stats), long enough for the united store to dirty the
# whole limit (run 45683252380: killed 4 seconds into create with 23 MiB under writeback).
# strict_limit on the storage disk throttled the mapped stores to a few MiB in six minutes
# (run 45685437372). memory.high at 7/8 of the limit makes a store over it reclaim and wait on
# its way back to user space, which gives the writeback time to finish before memory.max.
high_kib=$((LIMIT_MIB * 1024 * 7 / 8))
status=0
sudo systemd-run --scope --quiet -p "MemoryMax=${LIMIT_MIB}M" -p "MemoryHigh=${high_kib}K" \
-p MemorySwapMax=0 -p OOMPolicy=continue \
--same-dir -- \
sh scripts/memory_limit_run.sh "$RUNNER_TEMP/cgroup-stats" "$budget" \
"${benchmark[@]}" --phases "$RUNNER_TEMP/phases.jsonl" || status=$?
cat "$RUNNER_TEMP/cgroup-stats"
for file in measured.json cgroup-stats phases.jsonl; do
if [ -e "$RUNNER_TEMP/$file" ]; then sudo chown "$(id -u):$(id -g)" "$RUNNER_TEMP/$file"; fi
done
if [ "$status" = 124 ]; then
python3 scripts/benchmark_configuration.py unfinished "$RUNNER_TEMP/phases.jsonl" \
--variants "$VARIANTS" --after-seconds "$budget" > "$RUNNER_TEMP/measured.json"
elif [ "$status" != 0 ]; then
exit "$status"
fi
record+=(--memory-limit-bytes "$((LIMIT_MIB * 1048576))" --cgroup-stats "$RUNNER_TEMP/cgroup-stats"
--memory-high-bytes "$((high_kib * 1024))"
--dirty-ratio "$(cat /proc/sys/vm/dirty_ratio)"
--dirty-background-ratio "$(cat /proc/sys/vm/dirty_background_ratio)")
else
"${benchmark[@]}"
fi
machine="$(sed -n 's/^PRETTY_NAME=//p' /etc/os-release | tr -d '"'), $(lscpu | sed -n 's/^Model name: *//p' | head -1)"
machine="$machine, $(nproc) cores, $(awk '/^MemTotal/ { printf "%.0f", $2 / 1048576 }' /proc/meminfo) GiB"
mkdir results
jq --arg run_url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
--arg source_sha "$SOURCE_SHA" --arg tree_sha "$(git rev-parse 'HEAD^{tree}')" \
--arg date "$(date -u +%Y-%m-%d)" --arg machine "$machine" \
'. + {run_url: $run_url, source_sha: $source_sha, tree_sha: $tree_sha, date: $date, machine: $machine}' \
"$RUNNER_TEMP/measured.json" > "results/$NAME.json"
python3 scripts/benchmark_provenance.py "results/$NAME.json" --toolchain "$(rustc --version)"
python3 scripts/benchmark_configuration.py record "results/$NAME.json" "${record[@]}"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: configured-${{ env.NAME }}
path: results/${{ env.NAME }}.json
if-no-files-found: error
retention-days: 90

report:
name: Report
needs: benchmark
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.13'
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: configured-*
merge-multiple: true
path: ${{ runner.temp }}/results
- name: Check the configured tables
run: python scripts/benchmark_configuration.py report "$RUNNER_TEMP/results" --sha "$SOURCE_SHA" >> "$GITHUB_STEP_SUMMARY"

pipeline-status:
name: Pipeline Status
needs: [plan, benchmark, report]
if: ${{ !cancelled() }}
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.13'
- run: python -m pip install PyYAML==6.0.3
- name: Check terminal status
env:
NEEDS_JSON: ${{ toJSON(needs) }}
WORKFLOW_FILE: .github/workflows/configurations.yml
RUN_REF: ${{ github.ref }}
RUN_SHA: ${{ github.sha }}
run: python scripts/check_pipeline_status.py
Loading
Loading