Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions 2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ applies the submitted patch to a clean skeleton, runs a hidden arena against
multiple baseline bot families, and scores by mean baseline win rate with a
small faster-win tiebreak. The online generals.io service is not used.

## RocksDB Native Compaction Policy

This systems problem asks agents to patch the leveled compaction picker in a
pinned RocksDB checkout. Its problem ID is `rocksdb_native_compaction_policy`.
The judge runs native RocksDB workloads, checks snapshots and full database
contents, and scores paired improvements in write/read/space amplification and
compaction debt against unmodified RocksDB.

## vLLM LLM-Serving Optimization

This systems problem asks agents to patch a clean upstream vLLM checkout to
Expand Down
49 changes: 49 additions & 0 deletions 2.0/problems/rocksdb_native_compaction_policy/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
tag: systems
runtime:
language: cpp
timeout_seconds: 10800
environment: "Patch a pinned RocksDB v10.10.1 checkout; native correctness and compaction-cost judge"
apt_packages:
- bash
- build-essential
- ca-certificates
- git
- libbz2-dev
- libgflags-dev
- liblz4-dev
- libsnappy-dev
- libzstd-dev
- zlib1g-dev
docker:
image: python:3.12-slim-bookworm
judge_image: frontiercs/rocksdb-native-compaction-judge:experimental-v10.10.1-task2
visible_inputs:
- source: /opt/rocksdb-clean
destination: /app/rocksdb
environment:
cpus: 8
memory_mb: 16384
storage_mb: 32768
build_timeout_seconds: 7200
evaluation:
schema_version: rocksdb-native-compaction-v2
public_suite_id: rocksdb-native-public-v2
final_suite_id: rocksdb-native-final-v2
rocksdb_commit: "4595a5e95ae8525c42e172a054435782b3479c57"
feedback_cases:
- {seed: 1101, profile: smoke}
- {seed: 1202, profile: l0_pressure}
- {seed: 1303, profile: range_snapshot}
- {seed: 1404, profile: scanmix}
- {seed: 1505, profile: multi_cf}
- {seed: 1606, profile: time_series}
- {seed: 1707, profile: difficulty}
- {seed: 1808, profile: overlap_rewrite}
build_timeout_seconds: 7200
run_timeout_seconds: 1800
build_jobs: 3
submission:
kind: file
path: /app/solution.patch
allow_empty: true
max_queue_size: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail

ROCKSDB_COMMIT="${ROCKSDB_COMMIT:-4595a5e95ae8525c42e172a054435782b3479c57}"
ROCKSDB_ARCHIVE_SHA256="${ROCKSDB_ARCHIVE_SHA256:-9469e7d24644e298134d0464ec2d398a9b91cc401102009ec1ecde0383485d6c}"
ROCKSDB_BUILD_JOBS="${ROCKSDB_BUILD_JOBS:-3}"
JUDGE_TAG="${JUDGE_TAG:-frontiercs/rocksdb-native-compaction-judge:experimental-v10.10.1-task2}"
PUSH_IMAGE="${PUSH_IMAGE:-0}"
PLATFORMS="${PLATFORMS:-linux/amd64,linux/arm64}"
PROBLEM_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)

BUILD_ARGS=(
--build-arg "ROCKSDB_COMMIT=${ROCKSDB_COMMIT}" \
--build-arg "ROCKSDB_ARCHIVE_SHA256=${ROCKSDB_ARCHIVE_SHA256}" \
--build-arg "ROCKSDB_BUILD_JOBS=${ROCKSDB_BUILD_JOBS}" \
-f "${PROBLEM_DIR}/docker/judge/Dockerfile" \
-t "${JUDGE_TAG}" \
"${PROBLEM_DIR}"
)

if [[ "${PUSH_IMAGE}" == 1 ]]; then
docker buildx build --platform "${PLATFORMS}" --push "${BUILD_ARGS[@]}"
echo "Published ${JUDGE_TAG} for ${PLATFORMS}"
else
DOCKER_BUILDKIT=1 docker build "${BUILD_ARGS[@]}"
echo "Built ${JUDGE_TAG} for the local platform"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# syntax=docker/dockerfile:1.7
FROM python:3.12-slim-bookworm

ARG ROCKSDB_COMMIT=4595a5e95ae8525c42e172a054435782b3479c57
ARG ROCKSDB_ARCHIVE_SHA256=9469e7d24644e298134d0464ec2d398a9b91cc401102009ec1ecde0383485d6c
ARG ROCKSDB_BUILD_JOBS=3
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
build-essential \
ca-certificates \
cmake \
git \
ninja-build \
pkg-config \
libgflags-dev \
libsnappy-dev \
zlib1g-dev \
libbz2-dev \
liblz4-dev \
libzstd-dev \
python3 && \
rm -rf /var/lib/apt/lists/*

# Prebuild one tree for incremental candidate builds, then copy it for vanilla.
RUN python3 - "${ROCKSDB_COMMIT}" "${ROCKSDB_ARCHIVE_SHA256}" <<'PY'
import hashlib
import io
import shutil
import sys
import tarfile
import time
import urllib.request
from pathlib import Path

commit, expected_sha256 = sys.argv[1:]
url = f"https://codeload.github.com/facebook/rocksdb/tar.gz/{commit}"
for attempt in range(5):
try:
request = urllib.request.Request(url, headers={"User-Agent": "Frontier-CS"})
with urllib.request.urlopen(request, timeout=30) as response:
archive = response.read()
actual_sha256 = hashlib.sha256(archive).hexdigest()
if actual_sha256 != expected_sha256:
raise ValueError(f"archive sha256 mismatch: {actual_sha256}")
break
except Exception:
if attempt == 4:
raise
time.sleep(3 * (attempt + 1))

extract_dir = Path("/tmp/rocksdb-extract")
shutil.rmtree(extract_dir, ignore_errors=True)
extract_dir.mkdir(parents=True)
with tarfile.open(fileobj=io.BytesIO(archive), mode="r:gz") as source:
source.extractall(extract_dir, filter="data")
roots = list(extract_dir.iterdir())
if len(roots) != 1 or not roots[0].is_dir():
raise RuntimeError("unexpected RocksDB archive layout")
shutil.move(str(roots[0]), "/opt/rocksdb-clean")
shutil.rmtree(extract_dir)
PY

RUN printf '%s\n' "${ROCKSDB_COMMIT}" \
> /opt/rocksdb-clean/.frontier-upstream-commit && \
git -C /opt/rocksdb-clean init -q && \
git -C /opt/rocksdb-clean config user.name "Frontier-CS" && \
git -C /opt/rocksdb-clean config user.email frontier-cs@example.invalid && \
git -C /opt/rocksdb-clean add -A && \
GIT_AUTHOR_DATE=2026-01-01T00:00:00Z \
GIT_COMMITTER_DATE=2026-01-01T00:00:00Z \
git -C /opt/rocksdb-clean commit -q -m "Pinned RocksDB ${ROCKSDB_COMMIT}" && \
cd /opt/rocksdb-clean && \
PORTABLE=1 DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 \
make -j"${ROCKSDB_BUILD_JOBS}" static_lib && \
cp -a /opt/rocksdb-clean /opt/rocksdb-vanilla

COPY judge/harness/lsm_policy_harness.cc /judge/harness/lsm_policy_harness.cc

WORKDIR /judge
19 changes: 19 additions & 0 deletions 2.0/problems/rocksdb_native_compaction_policy/evaluate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

if [[ $# -gt 0 ]]; then
exec python3 "$SCRIPT_DIR/evaluator.py" "$1"
fi

for candidate in \
/work/execution_env/solution_env/solution.patch \
/work/execution_env/solution_env/solution.cpp; do
if [[ -f "$candidate" ]]; then
exec python3 "$SCRIPT_DIR/evaluator.py" "$candidate"
fi
done

echo "Error: solution artifact is missing" >&2
exit 1
Loading