stratabox commited on
Commit
f804d12
·
verified ·
1 Parent(s): b4a01a4

docs: refresh dataset card

Browse files

Dataset suite cross-links, quickstart, SDK snippet, and measured hf:// cold-boot telemetry.

Files changed (1) hide show
  1. README.md +156 -48
README.md CHANGED
@@ -1,79 +1,187 @@
1
  ---
2
- license: mit
 
 
3
  task_categories:
4
- - text-generation
5
  - reinforcement-learning
 
6
  language:
7
  - en
 
 
 
 
 
8
  tags:
9
  - stratabox
 
 
 
 
 
10
  - livecodebench
11
  - competitive-programming
12
- - erofs
13
  - code-execution
14
- - reinforcement-learning
15
- pretty_name: StrataBox LiveCodeBench 3-Layer EROFS Sandboxes (v1..v6)
16
  ---
17
 
18
- # StrataBox LiveCodeBench 3-Layer EROFS Dataset (`v1..v6`)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- Pre-built, 256 KiB-chunked 3-layer **EROFS** sandbox environments for [`livecodebench/code_generation_lite`](https://huggingface.co/datasets/livecodebench/code_generation_lite) (`release_v1` through `release_v6`), designed for zero-conversion `hf://` HTTP Range on-demand paging in **StrataBox**.
21
 
22
- ## Architecture & Deduplication Summary
23
 
24
- Instead of embedding ~4.5 GB of base64/zlib-compressed test cases into a monolithic metadata index or pulling multi-GB container images per rollout, every problem composes three read-only EROFS layers over `OverlayFS`:
 
 
 
 
 
 
25
 
26
- 1. **Base Layer (`lcb/base:ubuntu22`)**: Minimal Ubuntu 22.04 rootfs with static `stratabox-agent` (`1` shared layer).
27
- 2. **Toolkit Layer (`lcb/tk:judge-py312-cpp20`)**: Self-contained Python 3.12 (`numpy`, `scipy`) + C++20 (`g++`) judge toolchain and `/opt/lcb/runner.py` (`1` shared layer).
28
- 3. **Workspace Layers (`lcb/ws:<question_id>`)**: Per-problem decoded `tests_public.json`, `tests_private.json`, `meta.json`, `prompt.md`, `starter.py`, and `solution.py` under `/testbed` (`1055` layers).
29
 
30
  | Metric | Value |
31
  | :--- | ---: |
32
- | **Total Problems (`v1..v6`)** | `1055` |
33
- | **Total Public / Private Test Cases** | `2762` / `25492` |
34
- | **Unique Layers (`base` + `toolkit` + `workspace`)** | `1 + 1 + 1055 = 1057` |
35
- | **Aggregate Logical Rootfs Footprint** | `1409.45 GiB` |
36
- | **Deduplicated Contiguous EROFS Size** | `9.72 GiB` |
37
- | **Deduplication Ratio / Space Saved** | `144.95x` (`99.31%` saved) |
 
 
38
 
39
- ## Breakdown by Release, Platform, and Difficulty
40
 
41
- ### By Release
42
- | Release | Problems |
43
- | :--- | ---: |
44
- | `v1` | `400` |
45
- | `v2` | `111` |
46
- | `v3` | `101` |
47
- | `v4` | `101` |
48
- | `v5` | `167` |
49
- | `v6` | `175` |
50
-
51
- ### By Platform
52
- | Platform | Problems |
53
- | :--- | ---: |
54
- | `atcoder` | `602` |
55
- | `codeforces` | `9` |
56
- | `leetcode` | `444` |
57
 
58
- ### By Difficulty
59
- | Difficulty | Problems |
60
- | :--- | ---: |
61
- | `easy` | `322` |
62
- | `hard` | `350` |
63
- | `medium` | `383` |
 
 
64
 
65
- ## Quickstart (`hf://` On-Demand Streaming)
 
 
 
 
66
 
67
  ```bash
68
- STRATABOX_REMOTE_URI="hf://datasets/stratabox/livecodebench-erofs" \
69
- ./target/release/stratabox cluster --listen 127.0.0.1:18080 --edges 1
 
 
 
70
 
71
- STRATABOX_REMOTE_URI="hf://datasets/stratabox/livecodebench-erofs" \
72
- python3 examples/livecodebench_boot_demo.py
 
 
 
 
73
  ```
74
 
75
- Inside each sandbox, write candidate Python or C++20 code to `/testbed/solution.py` (or `/testbed/solution.cpp`) and invoke:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
  ```bash
78
- /opt/lcb/bin/python3 -I /opt/lcb/runner.py --suite all --solution /testbed/solution.py
 
79
  ```
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ license_name: upstream-terms
4
+ license_link: https://huggingface.co/datasets/livecodebench/code_generation_lite
5
  task_categories:
 
6
  - reinforcement-learning
7
+ - text-generation
8
  language:
9
  - en
10
+ pretty_name: LiveCodeBench 3-Layer EROFS Sandboxes (v1..v6)
11
+ size_categories:
12
+ - 1K<n<10K
13
+ source_datasets:
14
+ - livecodebench/code_generation_lite
15
  tags:
16
  - stratabox
17
+ - erofs
18
+ - code-agents
19
+ - reinforcement-learning
20
+ - sandbox
21
+ - http-range
22
  - livecodebench
23
  - competitive-programming
 
24
  - code-execution
25
+ viewer: false
 
26
  ---
27
 
28
+ # LiveCodeBench on StrataBox (`stratabox/livecodebench-erofs`)
29
+
30
+ 1,055 `LiveCodeBench` problems (`v1`..`v6`) with decoded public and private tests and a shared multi-language judge toolkit. Mount it directly from the Hub with [StrataBox](https://github.com/stratabox/stratabox) over `hf://` HTTP Range.
31
+
32
+ [![GitHub](https://img.shields.io/badge/GitHub-stratabox%2Fstratabox-181717?logo=github)](https://github.com/stratabox/stratabox)
33
+ [![Website](https://img.shields.io/badge/Website-stratabox.github.io-0EA5E9)](https://stratabox.github.io/)
34
+ [![Python SDK](https://img.shields.io/badge/pip%20install-stratabox-3776AB?logo=python&logoColor=white)](https://github.com/stratabox/stratabox#official-sdks)
35
+ [![SDKs](https://img.shields.io/badge/SDKs-Rust%20%7C%20Python%20%7C%20Go%20%7C%20TypeScript-3776AB)](https://github.com/stratabox/stratabox#official-sdks)
36
+ [![Integrations](https://img.shields.io/badge/Integrations-verl%20%7C%20Harbor-8A2BE2)](https://github.com/stratabox/stratabox/tree/main/integrations)
37
+ [![License](https://img.shields.io/badge/StrataBox-MIT%20OR%20Apache--2.0-blue)](https://github.com/stratabox/stratabox)
38
+
39
+ See the [50-sandbox cold-boot demo](https://raw.githubusercontent.com/stratabox/stratabox/main/docs/assets/swebench-50-boot.gif) recorded on `stratabox/swebench-verified-erofs`.
40
+
41
+ Official SDKs: Rust (`cargo add stratabox-sdk`), Python (`pip install stratabox`), Go (`go get github.com/stratabox/stratabox-sdk-go`), TypeScript (`npm install @stratabox/sdk`).
42
+
43
+ ## Overview
44
 
45
+ 1,055 problems, 3 platforms, 6 releases. Each task is stored as read-only EROFS layers served from this repository, so an Edge mounts a task by fetching only the 256 KiB chunks it touches. Metadata (`meta.erofs`) is prefetched, so directory walks and `stat` calls cost no data reads. Writes go to a per-sandbox OverlayFS upper directory and never modify the shared blobs.
46
 
47
+ ## StrataBox EROFS Dataset Suite
48
 
49
+ | Repository | Upstream benchmark | Tasks | Logical size | EROFS size | Size ratio | Range network saved (cold boot) | Status |
50
+ | :--- | :--- | ---: | ---: | ---: | ---: | ---: | :--- |
51
+ | [`stratabox/swebench-verified-erofs`](https://huggingface.co/datasets/stratabox/swebench-verified-erofs) | `princeton-nlp/SWE-bench_Verified` | 500 | 1,278.60 GiB | 105.54 GiB | 12.12x | 99.64% | Live |
52
+ | [`stratabox/swebench-multilingual-erofs`](https://huggingface.co/datasets/stratabox/swebench-multilingual-erofs) | `SWE-bench/SWE-bench_Multilingual` | 300 | 481.73 GiB | 457.18 GiB | 1.05x | 98.10% | Live |
53
+ | **[`stratabox/livecodebench-erofs`](https://huggingface.co/datasets/stratabox/livecodebench-erofs)** (this repo) | `livecodebench/code_generation_lite` | 1,055 | 1,409.45 GiB | 9.72 GiB | 144.95x | 99.90% | Live |
54
+ | [`stratabox/terminal-bench-erofs`](https://huggingface.co/datasets/stratabox/terminal-bench-erofs) | `harborframework/terminal-bench-2.0` | 89 | 81.57 GiB | 80.00 GiB | 1.02x | 99.08% | Live |
55
+ | [`stratabox/swebench-pro-erofs`](https://huggingface.co/datasets/stratabox/swebench-pro-erofs) | `ScaleAI/SWE-bench_Pro` | 731 (planned) | - | - | - | - | Publishing |
56
 
57
+ Sizes are computed from each repository's root `index.json`. Network savings are the share of logical image bytes not transferred during a measured cold boot (see the telemetry table on each card).
58
+
59
+ ## Storage and Deduplication
60
 
61
  | Metric | Value |
62
  | :--- | ---: |
63
+ | Tasks | 1,055 |
64
+ | Unique base layers | 1 |
65
+ | Unique toolkit layers | 1 |
66
+ | Unique workspace layers | 1,055 |
67
+ | Total unique layers | 1,057 |
68
+ | Aggregate logical image size | 1,409.45 GiB (1,513,383,177,639 bytes) |
69
+ | Contiguous EROFS size | 9.72 GiB (10,440,413,184 bytes) |
70
+ | Size ratio | 144.95x (99.31% saved) |
71
 
72
+ EROFS layers are uncompressed and chunk-aligned to 256 KiB so that HTTP Range reads map directly to touched file extents.
73
 
74
+ One shared base and one shared judge toolkit serve every problem, so the 1,055 per-problem workspaces (decoded public and private tests) are the only per-task bytes.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ ## Measured `hf://` Cold-Boot Telemetry
77
+
78
+ Recorded against this live repository with a single StrataBox Edge (`stratabox cluster --edges 1`, kernel `7.0.0-1018-gcp`, GCP `n2-standard-64`, empty L2 chunk cache, no Docker daemon). 50 sandboxes (24 AtCoder, 4 Codeforces, 22 LeetCode) plus an oracle judge self-test.
79
+
80
+ | Strategy | Sandboxes | Logical image size | Network I/O | Wall time | Host RAM delta |
81
+ | :--- | ---: | ---: | ---: | ---: | ---: |
82
+ | Eager OCI pull | 50 | 66.64 GiB | 66.64 GiB | - | - |
83
+ | StrataBox `hf://` 256 KiB HTTP Range | 50 | 66.64 GiB | **70.9 MiB** (99.90% saved) | 77.0 s | ~495 MiB |
84
 
85
+ Wall time includes first-touch lazy paging over the public internet and depends on the Edge-to-Hub path. A warm L2 cache serves repeat boots with no remote reads.
86
+
87
+ ## Quickstart
88
+
89
+ Terminal 1 starts a local cluster whose storage reads straight from this repository over HTTP Range. No Docker daemon, S3 credentials, or image pulls are needed.
90
 
91
  ```bash
92
+ export STRATABOX_REMOTE_URI="hf://datasets/stratabox/livecodebench-erofs"
93
+ # Optional mirror (for example mainland China or offline CI):
94
+ # export HF_ENDPOINT="https://hf-mirror.com"
95
+ ./target/release/stratabox cluster --edges 1
96
+ ```
97
 
98
+ Terminal 2 boots sandboxes from `index.json` with the runnable demo [`examples/livecodebench_boot_demo.py`](https://github.com/stratabox/stratabox/tree/main/examples/livecodebench_boot_demo.py):
99
+
100
+ ```bash
101
+ export STRATABOX_REMOTE_URI="hf://datasets/stratabox/livecodebench-erofs"
102
+ pip install stratabox httpx
103
+ python3 examples/livecodebench_boot_demo.py
104
  ```
105
 
106
+ ## Python SDK Snippet
107
+
108
+ Self-contained example (requires the cluster from Terminal 1):
109
+
110
+ ```python
111
+ import asyncio, httpx
112
+ from stratabox import StrataBoxClient, StrataBoxContainerRunArgs
113
+
114
+ INDEX = "https://huggingface.co/datasets/stratabox/livecodebench-erofs/resolve/main/index.json"
115
+
116
+ async def main():
117
+ tasks = httpx.get(INDEX, follow_redirects=True).json()["instances"]
118
+ t = next(x for x in tasks if x["platform"] == "atcoder")
119
+ async with StrataBoxClient("http://127.0.0.1:18080") as client:
120
+ sbx = await client.run_container(StrataBoxContainerRunArgs(
121
+ base_layer=t["base_layer"], toolkit_layers=[t["toolkit_layer"]],
122
+ workspace_layers=[t["workspace_layer"]], memory_limit_mb=512))
123
+ try:
124
+ r = await sbx.run_shell("/opt/lcb/bin/python3 -I /opt/lcb/runner.py --verify-workspace", timeout=180)
125
+ print(t["question_id"], r.exit_code, r.stdout.strip())
126
+ finally:
127
+ await sbx.stop()
128
+
129
+ asyncio.run(main())
130
+ ```
131
+
132
+ ## Integrations
133
+
134
+ - **verl.** `StrataBoxVerlTool` and `StrataBoxRolloutEnv` accept `base_layer`, `toolkit_layers`, and `workspace_layers` straight from `index.json`, with `idle_auto_pause_ms` freezing idle rollouts between LLM turns. See [`integrations/verl`](https://github.com/stratabox/stratabox/tree/main/integrations/verl).
135
+ - **Harbor.** `stratabox_harbor:StrataBoxEnvironment` runs Harbor task directories on the `container`, `microvm`, `fullvm`, and `fncall` backends. See [`integrations/harbor`](https://github.com/stratabox/stratabox/tree/main/integrations/harbor).
136
+
137
+ ## Layout and `index.json`
138
+
139
+ ```text
140
+ index.json root manifest (schema_version 1)
141
+ .gitattributes Git LFS rules for *.blob and *.erofs
142
+ layers/<layer_slug>/ meta.erofs, layer_id.txt, layer_manifest.json
143
+ blobs/<blob_slug>/ data.blob, blob_manifest.json (served via HTTP Range)
144
+ ```
145
+
146
+ Each layer uses a contiguous five-file layout with no per-chunk files, which stays far below the Hub's 10,000-files-per-directory limit.
147
+
148
+ Example `instances[0]` entry:
149
+
150
+ ```json
151
+ {
152
+ "instance_id": "1873_A",
153
+ "question_id": "1873_A",
154
+ "title": "A. Short Sort",
155
+ "platform": "codeforces",
156
+ "difficulty": "easy",
157
+ "contest_id": "1873",
158
+ "contest_date": "2023-08-21T00:00:00",
159
+ "release": "v1",
160
+ "fn_name": null,
161
+ "base_layer": "lcb/base:ubuntu22",
162
+ "toolkit_layer": "lcb/tk:judge-py312-cpp20",
163
+ "workspace_layer": "lcb/ws:1873_A",
164
+ "target_file": "solution.py",
165
+ "test_cmd": "/opt/lcb/bin/python3 -I /opt/lcb/runner.py --suite all --solution /testbed/solution.py",
166
+ "public_test_count": 1,
167
+ "private_test_count": 4,
168
+ "logical_image_bytes": 1425590251
169
+ }
170
+ ```
171
+
172
+ ## Reproduce This Dataset
173
 
174
  ```bash
175
+ python3 examples/livecodebench_pack.py --out-remote-dir ./hf_export
176
+ hf upload-large-folder stratabox/livecodebench-erofs ./hf_export --repo-type=dataset
177
  ```
178
+
179
+ The packer pulls each upstream image, converts layers with `stratabox layer publish-dir`, and writes the manifest. Source: [`examples/livecodebench_pack.py`](https://github.com/stratabox/stratabox/tree/main/examples/livecodebench_pack.py).
180
+
181
+ ## Licensing
182
+
183
+ The card metadata declares `license: other` because the upstream `livecodebench/code_generation_lite` card lists a Creative Commons license and the problem statements originate from LeetCode, AtCoder, and Codeforces, which retain their own terms. The packaging tooling is MIT. Review upstream terms before redistribution or commercial use.
184
+
185
+ ## Citation and Credits
186
+
187
+ Upstream benchmark: [`livecodebench/code_generation_lite`](https://huggingface.co/datasets/livecodebench/code_generation_lite). Jain et al., *LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code* (2024). Packaging and sandbox runtime: [StrataBox](https://github.com/stratabox/stratabox), an independent open-source implementation inspired by DSec (arXiv:2609.22978).