Update dataset
Browse files- README.md +2 -2
- data/test-00000-of-00001.json +1 -0
README.md
CHANGED
|
@@ -25,10 +25,10 @@ A benchmark dataset for evaluating AI systems on challenging computer science pr
|
|
| 25 |
|
| 26 |
## Dataset Description
|
| 27 |
|
| 28 |
-
This dataset contains
|
| 29 |
- **Algorithmic**: 188 competitive programming problems with automated judging
|
| 30 |
- **Research**: 66 open-ended research problems
|
| 31 |
-
- **2.0**:
|
| 32 |
|
| 33 |
## Dataset Structure
|
| 34 |
|
|
|
|
| 25 |
|
| 26 |
## Dataset Description
|
| 27 |
|
| 28 |
+
This dataset contains 275 problems across three categories:
|
| 29 |
- **Algorithmic**: 188 competitive programming problems with automated judging
|
| 30 |
- **Research**: 66 open-ended research problems
|
| 31 |
+
- **2.0**: 21 next-generation open-ended optimization problems
|
| 32 |
|
| 33 |
## Dataset Structure
|
| 34 |
|
data/test-00000-of-00001.json
CHANGED
|
@@ -265,6 +265,7 @@
|
|
| 265 |
{"problem_id": "kmeans_gpu_kernel_optimization", "category": "2.0", "statement": "# GPU K-Means Kernel Optimization\n\n## Problem\n\nYou are given a small GPU K-Means library, `kmeanslib`, in the Harbor workspace\nat `/app/kmeanslib`. Its public entry point is a **single Lloyd iteration**:\n\n```python\nkmeanslib.step(x, centroids) -> (labels, new_centroids)\n```\n\n`x` is an `(N, D)` **bfloat16** CUDA tensor of points and `centroids` is the\ncurrent `(K, D)` bfloat16 tensor. One call performs exactly one Euclidean\n(squared-L2) Lloyd step: assign every point to its nearest centroid\n(`labels`, an `(N,)` int64 full assignment), then recompute each centroid as the\nmean of its assigned points (`new_centroids`, `(K, D)`; empty clusters keep their\nprevious centroid). All data is bfloat16 — treat it as the fixed working\nprecision. The shipped implementation is a straightforward, correct PyTorch\nversion (a bf16 matmul + argmin, then a scatter update).\n\n**The judge owns the iteration loop.** It fixes the data and the initial\ncentroids, then calls your `step` a fixed number of times per workload, feeding\neach call's `new_centroids` into the next. You do not control the data, the\ninitial centroids, or how many iterations run — you control only how fast a\nsingle `step` executes.\n\nYour goal is to make `kmeanslib.step` **as fast as possible** on the GPU while\nproducing the same clustering. You may rewrite the internals of the package\nhowever you like and add new modules (including Triton kernels) under\n`kmeanslib/` — in particular you may **fuse the assign and update into a single\nkernel**. The public function signature and return contract above must not\nchange, and each result must remain a deterministic function of its inputs.\n\n## Workload\n\nThe graded workloads are a family of held-out dense clustering problems that\nvary `(N, D, K)`, spanning small/medium/large point counts and both wide-feature\n(large `D`) and many-cluster (large `K`) regimes, in **bfloat16**, with a fixed\nnumber of judge-owned `step` calls per workload and caller-supplied initial\ncentroids. How the point sets are generated is not disclosed — implement a\n**general** exact Lloyd step (correct assignment to the given centroids + exact\ncluster-mean update) and do not special-case the data.\n\n## Iterate on a GPU\n\nThe agent workspace has no GPU, and the data generator is judge-only (it is not in\nyour image). To check your current code, **submit it to the judge** — it runs the\nexact graded workloads on a GPU and returns your per-workload result + score. This\none command packages, submits, and waits for the result:\n\n```bash\nbash /app/public_test.sh\n```\n\nIt reports, per graded workload, whether your result passes the quality gate and\nyour speedup, plus the geometric-mean speedup and your score (0-100) — the\nidentical evaluation used for your final grade. (Equivalently:\n`bash /app/make_submission.sh && bash /app/submit.sh`, then poll with\n`bash /app/submissions.sh`.) Submissions are asynchronous; submit early and iterate.\n\n## Submission\n\nThe submitted artifact is a patch over the `kmeanslib` package:\n\n```text\n/app/solution.patch\n```\n\nAfter editing `/app/kmeanslib`, generate and submit:\n\n```bash\nbash /app/make_submission.sh\nbash /app/submit.sh\n```\n\nSubmissions are asynchronous; submit early and keep iterating. The judge applies\nyour patch to a clean copy of `kmeanslib` and times it against the original\nbaseline on a GPU, on the same seeded data and initial centroids.\n\n## Correctness\n\nCorrectness is a gate. After running the fixed loop of `step` calls, the judge\ncomputes the **inertia of your returned clustering** — the sum of squared\ndistances of every point to `new_centroids[labels]`, i.e. using **the `labels`\nand `new_centroids` your final `step` returned** — and compares it to the\nbaseline's, requiring your inertia to stay within a small relative tolerance.\nBecause the gate reads your returned `labels`, they must be the real full `(N,)`\nnearest-centroid assignment to the `centroids` each `step` was given: returning\nfake/empty labels, a partial or sub-sampled assignment, or centroids computed\nfrom a subset of points all inflate this inertia and fail the gate. Each `step`\nreturns `labels` `(N,)` and `new_centroids` `(K, D)`. Crashes, non-finite output,\nwrong shapes/dtypes, timeouts, and clustering that regresses beyond the tolerance\nare penalized before speed is considered. The working precision is fixed at bfloat16 for every solution (the\ninputs are bfloat16), so it is not a tuning knob — speed comes from the kernel,\nnot from the arithmetic precision.\n\n## Scoring\n\nValid submissions are scored by speedup relative to the baseline on the same\nhardware and workloads. For each workload:\n\n```text\nspeedup = baseline_time / your_time\n```\n\nThe objective is the geometric mean of per-workload speedups, so broad speedups\nare preferred over a single large outlier. A result no faster than the baseline\nearns 0; regressions earn 0. The raw geometric-mean speedup is reported in the\nevaluator metrics.\n\n## Patch Policy\n\nThe evaluator validates the patch before running it. Only Python files under the\npackage may change:\n\n```text\nkmeanslib/**\n```\n\nNew Python modules inside `kmeanslib/` are allowed. Patches may not: modify\nanything outside `kmeanslib/`; import or call an external optimized ML/kernel\nlibrary (write the kernels yourself); read or write environment variables, spawn\nprocesses, or access the network; or otherwise tamper with the measurement\nframework. The judge owns the loop, the data, and the initial centroids and\nre-verifies quality from your final centroids, so faking labels, skipping the\nreal assign/update work, or caching results across calls does not help.\n\n## Resource Budget\n\n```text\nGPU: single Modal GPU (H100 reference; the Triton paths also run on L40S / A100)\nAgent container: CPU-only (GPU work is offloaded to Modal)\n```\n", "config": "tag: systems\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"GPU K-Means kernel optimization. The agent patches the kmeanslib package; the judge offloads timing to a Modal GPU, comparing the patched kmeans against a frozen naive baseline on hidden (N, D, K) workloads with an inertia (clustering-quality) gate.\"\n apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images. Build with docker/build_images.sh before a local\n # Harbor trial. Both are light (ubuntu + modal + git); torch/triton/flashlib\n # run on the Modal GPU image defined in flash_gpu.py. The agent image bakes\n # /app/kmeanslib (git) + /opt/kmeans_ref + /opt/flash_gpu.py; the judge image\n # additionally bakes /opt/kmeanslib-clean.\n image: frontiercs/kmeans-gpu-kernel-optimization-agent:experimental-v0.4.0\n judge_image: frontiercs/kmeans-gpu-kernel-optimization-judge:experimental-v0.4.0\nenvironment:\n cpus: 4\n memory_mb: 8192\n storage_mb: 16384\n build_timeout_seconds: 3600\nevaluation:\n # --- primitive wiring (consumed by the generic evaluator + flash_gpu) ---\n primitive: kmeans\n pkg: kmeanslib\n ref_module: refkmeans\n clean_source: /opt/kmeanslib-clean\n baseline_source: /opt/kmeans_ref\n # --- Modal GPU ---\n gpu: \"H100\" # Modal GPU spec (H100 / A100 / L40S)\n cuda_image: \"nvidia/cuda:12.4.1-devel-ubuntu22.04\"\n pip: [\"torch\", \"numpy\"]\n app_name: \"kmeans-kernel-opt-eval\"\n modal_timeout_seconds: 1800\n # --- timing + quality gate ---\n warmup_iters: 2\n timed_iters: 1 # one timed run per workload; the timed unit is the judge-owned loop of max_iters `step` calls\n inertia_tolerance: 0.05 # clustering gate: inertia of the agent's RETURNED (labels, centroids) <= (1+tol) x the baseline's. Catches fake/garbage labels and badly-placed centroids. Inertia is dominated by within-cluster noise, so it is deliberately backed up by label_mismatch_tolerance below.\n label_mismatch_tolerance: 0.002 # assignment gate: fraction of points whose returned label is not the exact (fp32) nearest centroid of the centroids that step was handed. Inertia barely moves when ~1% of points are misassigned (~+0.1%), so this is what actually rejects approximate distances -- e.g. assigning on only the leading feature dims. Set above the bf16-vs-fp32 tie rate the honest reference shows.\n speedup_target: 20.0 # score cap = 2x the FUSED best-known geomean (9.97x on H100, all 6 pass). The vendored flashlib reference.patch runs assign and update as two separate kernels (two passes over x) and only reaches 7.92x (scores ~69/100); a kernel that fuses assign+scatter-update into one pass over x -- which is exactly what this task asks for -- reaches 9.97x (~77/100), and you must be 2x faster than THAT to max out. Calibrating on the unfused reference alone made the cap too easy (a merely-fused solution scored 94).\n # High-K (K=512-2048, arithmetic intensity >= H100 bf16 roofline knee ~295 FLOP/byte) keeps the assign GEMM compute-bound: ~138 TFLOPS geomean (14% of bf16 peak) vs ~40 TFLOPS on the old low-K workloads.\n base_seed: 20260701\n agent_workload_count: 6 # agent's submission feedback covers ALL graded workloads (no blind pass-3/fail-6 cliff); params are agent-visible anyway\n expose_per_workload_metrics: true # show per-workload pass/fail so the agent can fix the specific workload it regresses on\n # The agent provides one Lloyd `step(x, centroids)`; the JUDGE owns the loop and\n # calls it exactly max_iters times (=2). The agent cannot skip iterations, change\n # the data/init, or fake the count -- it can only make a single step faster\n # (e.g. fuse assign+update). Data is bf16 (locked in gen) so precision is not a\n # lever; planted well-separated blobs. max_iters=2 (not 1) is enough to be a real\n # loop while too few for a converged step to become a redundant no-op.\n workloads:\n - {id: w0, N: 200000, D: 64, K: 512, max_iters: 2}\n - {id: w1, N: 300000, D: 128, K: 1024, max_iters: 2}\n - {id: w2, N: 500000, D: 128, K: 1024, max_iters: 2}\n - {id: w3, N: 150000, D: 512, K: 512, max_iters: 2}\n - {id: w4, N: 1000000, D: 64, K: 1024, max_iters: 2}\n - {id: w5, N: 300000, D: 256, K: 2048, max_iters: 2}\nsubmission:\n kind: file\n path: /app/solution.patch\n"}
|
| 266 |
{"problem_id": "knn_gpu_kernel_optimization", "category": "2.0", "statement": "# GPU Brute-Force k-NN Kernel Optimization\n\n## Problem\n\nYou are given a small GPU brute-force k-nearest-neighbor library, `knnlib`, in\nthe Harbor workspace at `/app/knnlib`. Its public entry point is:\n\n```python\nknnlib.knn(queries, database, k) -> (distances, indices)\n```\n\n`queries` is a `(Q, D)` **bfloat16** CUDA tensor of query points, `database` is an\n`(M, D)` **bfloat16** CUDA tensor of database points to search, and `k` is the\nnumber of nearest neighbors to return per query. The inputs are bfloat16 by\ndesign — treat it as the fixed working precision; upcasting to fp32/TF32 buys no\naccuracy over bf16 tensor cores here (only latency), so precision is not a tuning\nknob. The function returns `distances`, a `(Q, k)` float32 tensor of the\n**squared-L2** distances to the `k` nearest database points (ascending, nearest\nfirst), and `indices`, a `(Q, k)` int64 tensor of the corresponding database row\nindices. The shipped implementation is a straightforward, correct PyTorch version.\n\nYour goal is to make `knnlib.knn` **as fast as possible** on the GPU while\nreturning the same nearest neighbors. You may rewrite the internals of the\npackage however you like and add new modules (including Triton kernels) under\n`knnlib/`. The public function signature and return contract above must not\nchange, and every result must remain a deterministic function of its inputs.\n\n## Workload\n\nThe graded workloads are a family of held-out dense search problems that vary\n`(Q, M, D, k)`, spanning both wide-feature (large `D`) and many-neighbor (large\n`k`) regimes. All use squared-L2 distance and float32 data. The points are real\nimage-descriptor vectors, not synthetic noise: expect clustered, non-uniform\ndata rather than i.i.d. gaussians.\n\nEvery timed iteration draws a **fresh random `Q` queries and a fresh random `M`\ndatabase rows**, so neither the query set nor the `database` tensor repeats\nacross calls. Building an index or precomputing norms once and caching them for\nreuse on a later call therefore buys nothing — each call sees a database it has\nnever seen. Optimize the per-call search itself.\n\nThe public self-test now runs the **exact graded workloads** — the same shapes,\nthresholds, seeds, and timing the judge uses to score you — so there are no\nseparate hidden shapes to guess at. Treat this as a general dense brute-force\nk-NN kernel; the workloads are just where it is measured.\n\n## Iterate on a GPU\n\nThe agent workspace has no GPU. Use the public test to check your current code's correctness and speed on\na GPU through Modal (needs `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` in your\nenvironment):\n\n```bash\nbash /app/public_test.sh\n```\n\nIt runs the **identical evaluation the judge uses to grade you** and reports, per\ngraded workload, whether your result passes the quality gate, your speedup over\nthe baseline, the geometric-mean speedup, and your **predicted final score**\n(0-100). Any workload that fails its gate makes the submission score 0.\n\n## Submission\n\nThe submitted artifact is a patch over the `knnlib` package:\n\n```text\n/app/solution.patch\n```\n\nAfter editing `/app/knnlib`, generate and submit:\n\n```bash\nbash /app/make_submission.sh\nbash /app/submit.sh\n```\n\nSubmissions are asynchronous; submit early and keep iterating. The judge applies\nyour patch to a clean copy of `knnlib` and times it against the original\nbaseline on a GPU, on the same seeded queries and database.\n\n## Correctness\n\nCorrectness is a gate. On every timed iteration the judge scores your neighbours\nby **ball-recall**: each returned index counts if the exact (fp32) squared-L2\ndistance from its query to that database row lies within the true k-nearest-\nneighbour ball (the distance to the k-th true neighbour). This is tie-robust —\nbf16 distances tie heavily near rank k, so which of several equidistant points\nyou return does not matter, but returning a genuinely farther point does. Your\nball-recall must stay at or above a high threshold. Because the inputs are bf16,\nan honest bf16 kernel clears it comfortably; a search that drops below bf16\nprecision (e.g. fp8) returns farther points and fails. Crashes, non-finite\noutput, wrong shapes/dtypes, and timeouts are penalized before speed is\nconsidered.\n\n## Scoring\n\nValid submissions are scored by speedup relative to the baseline on the same\nhardware and workloads. For each workload:\n\n```text\nspeedup = baseline_time / your_time\n```\n\nThe objective is the geometric mean of per-workload speedups, so broad speedups\nare preferred over a single large outlier. A result no faster than the baseline\nearns 0; regressions earn 0. The raw geometric-mean speedup is reported in the\nevaluator metrics.\n\n## Patch Policy\n\nThe evaluator validates the patch before running it. Only Python files under the\npackage may change:\n\n```text\nknnlib/**\n```\n\nNew Python modules inside `knnlib/` are allowed. Patches may not: modify\nanything outside `knnlib/`; import or call an external optimized ML/kernel\nlibrary (write the kernels yourself); read or write environment variables, spawn\nprocesses, or access the network; or otherwise tamper with the measurement\nframework. The timing harness measures your code on freshly generated data every\niteration and re-verifies quality each time, so caching results across calls does\nnot help.\n\n## Resource Budget\n\n```text\nGPU: single Modal GPU (H100 reference; the Triton paths also run on L40S / A100)\nAgent container: CPU-only (GPU work is offloaded to Modal)\n```\n", "config": "tag: systems\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"GPU brute-force k-NN kernel optimization. The agent patches the knnlib package; the judge offloads timing to a Modal GPU, comparing the patched nearest-neighbor search against a frozen naive baseline on hidden (Q, M, D, k) workloads with a recall@k (retrieval-quality) gate.\"\n apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images. Build with docker/build_images.sh before a local\n # Harbor trial. Both are light (ubuntu + modal + git); torch/triton/flashlib\n # run on the Modal GPU image defined in flash_gpu.py. The agent image bakes\n # /app/knnlib (git) + /opt/knn_ref + /opt/flash_gpu.py; the judge image\n # additionally bakes /opt/knnlib-clean.\n image: frontiercs/knn-gpu-kernel-optimization-agent:experimental-v0.6.0\n judge_image: frontiercs/knn-gpu-kernel-optimization-judge:experimental-v0.6.0\nenvironment:\n cpus: 4\n memory_mb: 8192\n storage_mb: 16384\n build_timeout_seconds: 3600\nevaluation:\n # --- primitive wiring (consumed by the generic evaluator + flash_gpu) ---\n primitive: knn\n pkg: knnlib\n ref_module: refknn\n clean_source: /opt/knnlib-clean\n baseline_source: /opt/knn_ref\n # --- Modal GPU ---\n gpu: \"H100\"\n cuda_image: \"nvidia/cuda:12.4.1-devel-ubuntu22.04\"\n pip: [\"torch\", \"numpy\", \"h5py\"] # match the original (validated) knn image; torch brings its matched triton. h5py loads SIFT/GIST HDF5\n app_name: \"knn-kernel-opt-eval\"\n dataset_volume: \"flashlib-ann-datasets\" # Modal Volume holding sift.hdf5 / gist.hdf5 (ann-benchmarks); mounted read-only at /data\n modal_timeout_seconds: 3600 # exact brute-force over a 1M-row real database is heavier than the synthetic shapes; give margin\n warmup_iters: 2\n timed_iters: 7\n recall_threshold: 0.88 # ball-recall gate on bf16 data (see knn_ball_recall): a returned neighbour counts if its exact fp32 distance is within the true k-NN ball. bf16 distances tie heavily near rank k, so even a correct bf16 kernel only reaches ~0.94-1.0 (the flashlib reference measured 0.935-1.0). 0.88 clears that with margin while still rejecting a sub-bf16 (e.g. fp8) search, whose coarser distances drop far lower. Precision is pinned by the bf16 DATA, not this threshold.\n distance_ball_tolerance: 0.0 # relative slack on the k-NN ball radius (the check already carries a 1e-6 absolute epsilon for fp32 reduction jitter)\n speedup_target: 4.0 # score cap = 2x the flashlib reference geomean on the bf16 real workloads (1.94x on H100: SIFT k10/50/100 = 4.43/2.60/1.48x, GIST = 1.71/1.67/1.10x, ball-recall >=0.94 all 6). bf16 data + modest cuBLAS-cdist headroom keep the factor small.\n base_seed: 20260701\n agent_workload_count: 6 # agent's submission feedback covers ALL graded workloads (no blind pass-3/fail-6 cliff); params are agent-visible anyway\n expose_per_workload_metrics: true # show per-workload pass/fail so the agent can fix the specific workload it regresses on\n # REAL-DATA WORKLOADS: exact brute-force k-NN over real descriptor vectors\n # (SIFT 128d / GIST 960d, 1M-row bases). ANTI-CACHING: every iteration draws a\n # fresh random Q-subset of the held-out real query set AND a fresh random\n # M-subset of the real base as the database, so neither the queries nor the\n # database tensor repeats across calls -- a solution cannot cache a prebuilt\n # index/norms keyed on a fixed database and skip the timed search (a fixed\n # database let a trial hit 80x by caching an index instead of writing a fast\n # kernel). M = database rows drawn per iteration; k varies the neighbour count.\n # Q <= #queries (SIFT 10000, GIST 1000); M <= base rows (1M).\n workloads:\n - {id: sift_k10, dataset: sift, M: 500000, Q: 1024, k: 10}\n - {id: sift_k50, dataset: sift, M: 500000, Q: 1024, k: 50}\n - {id: sift_k100, dataset: sift, M: 500000, Q: 1024, k: 100}\n - {id: gist_k10, dataset: gist, M: 500000, Q: 512, k: 10}\n - {id: gist_k50, dataset: gist, M: 500000, Q: 512, k: 50}\n - {id: gist_k100, dataset: gist, M: 500000, Q: 512, k: 100}\nsubmission:\n kind: file\n path: /app/solution.patch\n"}
|
| 267 |
{"problem_id": "lwe_structured_recovery", "category": "2.0", "statement": "# Structured-LWE Public Witness Recovery\n\n## Goal\n\nRecover valid secret vectors for as many public structured-LWE instances as\nyou can. For each instance, the public data define dimensions `n` and `m`, a\nmodulus `q`, a reproducible matrix `A`, a target vector `b`, public secret and\nerror distributions, and the exact predicates used for acceptance. A valid\nsubmission satisfies the public relation\n\n```text\nb = A s + e (mod q)\n```\n\nwith a secret `s` and centered residual `e` that pass those predicates. Any\nvalid `s` is accepted; you do not have to recover the particular witness used\nwhen the instance was generated.\n\n## Corpus\n\nThe production corpus has 200 public instances, split evenly across ten\nstructural families (20 per family):\n\n| Family | Public structure |\n| --- | --- |\n| `DS_BIN`, `DS_TER` | dense uniform matrix; exact-weight binary or signed-ternary secret |\n| `DS_SMALL` | dense uniform matrix; dense small-alphabet secret |\n| `SA_Q` | sparse matrix over general nonzero residues; unrestricted mod-`q` secret |\n| `SA_SMALL` | sparse small-alphabet matrix; unrestricted mod-`q` secret |\n| `DA_BIN`, `DA_TER` | dense binary or ternary matrix; unrestricted mod-`q` secret |\n| `MIX_Q_SPARSE` | sparse general-residue matrix and sparse small secret |\n| `MIX_SMALL_SPARSE` | sparse small-alphabet matrix and sparse small secret |\n| `MIX_DENSE_SMALL` | dense small-alphabet matrix and small or sparse small secret |\n\nThe public catalog deliberately omits difficulty labels, runtime bins,\ncalibration estimates, cryptanalysis paths, and reference solutions. You\nshould treat the instance IDs as opaque names. The intended workflow is\nincremental: inspect the public algebraic structure, try any attack strategy\nyou like, validate every candidate with the public facade, and submit each new\nsolution immediately while retaining all earlier ones.\n\n## Reproducibility\n\nEvery public record contains the complete matrix description, a SHAKE-256 seed\nand domain separator, inline `b`, all predicates, and an instance digest. Thus\nany implementation can reconstruct `A` deterministically, and the catalog\nsidecar binds the exact JSONL bytes used by the evaluator. The checked-in\nPython facade is the reference implementation; independent implementations\ncan be compared row-for-row against it.\n\nThe current production catalog SHA-256 is\n`318f32b68e8a30c6bcd5867c89eb10d87a5472614401f4e6df0f55356cdc98a6`.\nProduction witnesses and errors are sampled during corpus construction and must\nnot be retained as evaluator inputs or release assets. Reproducibility means\nreproducing the public instance from its released record, not recovering any\nprivate generation seed.\n\n## Public catalog and stable Python interface\n\nThe packaged task contract uses these agent-visible paths:\n\n```text\n/app/public/catalog.jsonl public instance catalog\n/app/public/lwe_instance.py stable read-only Python facade\n/app/add_solution.py cumulative-ledger helper\n/app/solution.json submitted solution ledger\n/app/submit.sh submission command\n/app/wait_submission.sh wait for one submitted UUID\n/app/submissions.sh list submissions\n```\n\nThe production catalog contains exactly 200 instances. Its entries and\nverified digest are authoritative.\n\nUse `public/lwe_instance.py`; callers do not need to import\n`lwe_challenge.*` or parse catalog JSON directly. This complete example loads\nthe catalog, streams matrix rows, and checks a candidate:\n\n```python\nfrom pathlib import Path\nimport sys\n\npublic_dir = Path(\"/app/public\")\nsys.path.insert(0, str(public_dir))\n\nfrom lwe_instance import Catalog\n\ncatalog = Catalog.load(public_dir / \"catalog.jsonl\")\nprint(catalog.catalog_id, len(catalog.instances))\n\ninstance = catalog.instances[0]\nprint(instance.instance_id, instance.n, instance.m, instance.q)\nfirst_row = next(instance.iter_rows())\n\ncandidate = (0,) * instance.n # replace with a candidate from your analysis\nverdict = instance.validate_secret(candidate)\nprint(first_row, verdict.ok, verdict.code)\n```\n\n`Catalog.instances` preserves public catalog order and `Catalog.get(id)` does\nlookup by ID. Each immutable `Instance` exposes `n`, `m`, `q`, `b`, the matrix\nkind/seed/domain/alphabet/row weight, all public secret and error distribution\nparameters, all verifier bounds, and the instance digest. It also provides:\n\n- `iter_rows()` to stream rows without materializing `A`;\n- `materialize_row_block(start, stop)` for a bounded row block;\n- `materialize_rows()` when the full public matrix fits your memory budget;\n- `matvec(secret)` for `A * secret mod q`; and\n- `validate_secret(secret)` for the exact public acceptance check.\n\nPrefer row streaming or blocks for large instances.\n\nThe declared matrix kinds are `uniform`, `small_alphabet`, `sparse_uniform`,\nand `sparse_small_alphabet`. Secret-generation kinds are `uniform_mod_q`,\n`iid_alphabet`, `exact_weight_alphabet`, `balanced_exact_weight_signed`, and\n`centered_binomial`; error kinds are `truncated_discrete_gaussian`,\n`centered_binomial`, `bounded_uniform`, and `sparse_bounded`. These labels and\nevery associated parameter are public. The balanced signed plant uses an even\nexact weight and places equally many `-1` and `1` entries; its public acceptance\npredicate remains the separately declared alphabet and nonzero-weight range.\n\nThe facade property secret_alphabet is the acceptance alphabet. For\nexact-weight secrets, the `exact_weight_alphabet` generation alphabet is\n`secret_alphabet` with zero removed because zero fills positions outside the\nexact support. The `balanced_exact_weight_signed` plant specifically uses\n`{-1,1}` on its support even though the verifier also accepts any other vector\nmeeting the published signed alphabet and exact-weight predicate. For the\nother alphabet-based kinds, `iid_alphabet` and `centered_binomial` generation\nand acceptance alphabets coincide. The `uniform_mod_q` kind instead has no\nalphabet and uses all residues `0 <= s_j < q`.\n\n## Exact validity predicates\n\nFor one public instance, a submitted vector `s` is valid exactly when all of\nthe following hold:\n\n1. `len(s) == n`, and every component is a JSON/Python integer (booleans are\n not integers for this contract).\n2. If `secret_predicate_kind == \"alphabet\"`, every component belongs to\n `secret_alphabet`. If it is `\"mod_q\"`, every component is in\n `0 <= s_j < q`.\n3. The number of nonzero components is between `secret_min_nonzero` and\n `secret_max_nonzero`, inclusive.\n4. Compute `p = A * s mod q`, then compute each canonical residual as\n `r_i = center_q(b_i - p_i)`. Equivalently, the evaluator computes\n `center_q(b_i - (A s)_i)`. The centered representative lies in\n `[-floor(q/2), ceil(q/2) - 1]`.\n5. `max_i(abs(r_i)) <= error_max_abs`.\n6. When `error_max_l1` is not `None`,\n `sum_i(abs(r_i)) <= error_max_l1`.\n7. When `error_max_l2_squared` is not `None`,\n `sum_i(r_i * r_i) <= error_max_l2_squared`.\n8. When `error_max_nonzero` is not `None`, the number of nonzero residual\n components is at most `error_max_nonzero`.\n\nThe public sampling-distribution fields are analysis inputs; acceptance is\ndetermined by the predicates above. The evaluator holds no secret, planted\nanswer, private seed, or private error. It reconstructs `A` from public data\nand checks only the submitted vector against public `(A, b)` and the public\npredicates.\n\nThe method validate_secret checks mathematical witness validity for one\nalready-selected instance. At the submission boundary, ledger admissibility\nis a separate check covering the JSON/file limits, exact record shape, ID\nhandling, and duplicate rules below. Thus an `ok` mathematical verdict does\nnot by itself make arbitrary ledger JSON admissible.\n\n## Cumulative JSON ledger\n\nThe only scored artifact is `/app/solution.json`. Its strict schema is:\n\n```json\n{\n \"schema_version\": 1,\n \"solutions\": [\n {\"instance_id\": \"example-id\", \"secret\": [1, 0, -1]}\n ]\n}\n```\n\nThe whole-file rules require an unambiguous UTF-8 JSON object whose top-level\nfields are exactly `schema_version` and `solutions`, with integer\n`schema_version == 1` and a `solutions` array of at most 200 elements. No JSON\nobject may repeat a key, and the encoded file may contain at most 2,000,000\nbytes. The decoder also permits at most 4 levels of JSON nesting and 820,205\ndecoded nodes. Exceeding either decoder budget is a whole-file\n`invalid_json` error; for example, a nested secret such as `[[0]]` is rejected\nbefore per-record validation. Therefore, violating a whole-file rule scores\nzero even when another record is valid.\n\nRecords are checked separately. A canonical record has exactly `instance_id`\nand `secret`; the ID matches `[A-Za-z0-9][A-Za-z0-9._-]{0,63}` and names a\npublic instance, while `secret` is an integer array whose components have\nabsolute value at most `2^63 - 1` and whose length is at most 4,096. A\nper-record rejection does not invalidate the whole ledger; unrelated valid\nrecords can still score; the canonical empty ledger is pre-provisioned at\n/app/solution.json as:\n\n```json\n{\"schema_version\":1,\"solutions\":[]}\n```\n\nUse the locked, atomic cumulative helper instead of rebuilding the file:\n\n```bash\npython3 /app/add_solution.py INSTANCE_ID '1,0,-1'\n```\n\nThe helper reads `/app/solution.json`, retains its prior records, adds the new\nrecord, writes canonical sorted JSON atomically, and prints the resulting\nrecord count. An identical existing witness is an idempotent no-op. A\ndifferent existing witness is rejected unless you pass --replace explicitly:\n\n```bash\npython3 /app/add_solution.py --replace INSTANCE_ID '0,1,-1'\n```\n\nA successful add_solution exit and write enforces canonical structural ledger\nrules: exact object fields and version, unique regex-valid IDs, integer arrays\nof at most 4,096 bounded components, and the 200-record and 2,000,000-byte\ncaps. The helper refuses an update that would exceed the 200-record or\n2,000,000-byte cap, as well as either component bound.\nSuccess does not prove catalog membership or mathematical witness validity\nbecause the helper does not load the catalog. Validate with\n`instance.validate_secret(candidate)` before adding a record. After every\nsuccessful helper call, the ledger remains cumulative.\n\nDuplicate handling by the evaluator is deliberately strict: every repeated\nsafe instance_id invalidates every occurrence for that ID, even when the\nvectors are identical or one occurrence is malformed. That ID earns no point.\nHere safe means syntactically valid under the instance-ID regex; it does not\nmean that the ID occurs in the public catalog. duplicate_count counts distinct\nsyntactically valid IDs that occur more than once, not duplicate occurrences.\nconflict_count counts distinct IDs with more than one distinct syntactically\nvalid integer vector, not conflicting pairs or occurrences. Here a\nsyntactically valid integer vector is a JSON array of non-boolean integers\nwithin the ledger integer bound and at most 4,096 components; it need not have\nthe right dimension or pass the mathematical witness predicates. Every\nrejected occurrence contributes to `invalid_count`.\n\nunknown_count counts distinct regex-valid IDs absent from the catalog, even\nwhen an ID is repeated or another field in its record is malformed. This set\ncount is independent of the per-occurrence rejection code. unknown_instance_id\napplies only to a unique otherwise syntactically admissible record. For a\nunique admissible record, a syntactically valid but unknown instance_id is a\nper-record `unknown_instance_id` rejection. invalid_record_fields takes\nprecedence for a unique malformed unknown when its record fields are wrong.\nWith exact fields but a malformed secret, invalid_secret takes precedence for\na unique malformed unknown over the unknown-ID code. For repeated IDs,\nduplicate_instance_id takes precedence for every occurrence of a repeated ID.\nThe helper normally prevents duplicate records; use `--replace` instead of\ncreating a second JSON record.\n\n## Scoring and public feedback\n\nEvery catalog instance has equal weight. Let `solved_count` be the number of\nunique instance IDs whose submitted secret passes all predicates, and let\n`instance_count` be the catalog size:\n\n```text\nscore = 100 * solved_count / instance_count\nscore_unbounded = solved_count\n```\n\nAn invalid record does not erase unrelated valid records. Whole-ledger format\nerrors score zero, so keep the helper-produced ledger intact.\n\nThe public feedback contains the bounded `score`, count-valued\n`score_unbounded`, a sanitized summary message, and aggregate metrics. Metrics\ninclude `instance_count`, `solved_count`, `submitted_count`, `invalid_count`,\n`duplicate_count`, `conflict_count`, `unknown_count`,\n`rejection_code_counts`, `invalid_examples`, and `solved_ids`. Feedback never\ncontains difficulty labels, runtime bins, family buckets, submitted vectors,\nresiduals, private values, filesystem paths, tracebacks, or exception text.\n\n## Iterate and submit cumulatively\n\nAlways submit after every newly validated secret for a previously unsolved\ninstance, or after a score-changing replacement; do not wait to finish a\nbatch. Always retain all prior entries in `/app/solution.json`.\n\nSubmission is asynchronous. Running `bash /app/submit.sh` snapshots and queues\nthe current `/app/solution.json` and prints a submission UUID:\n\n```bash\nbash /app/submit.sh\n```\n\nSave that UUID, then wait for its result with:\n\n```bash\nbash /app/wait_submission.sh SUBMISSION_UUID\n```\n\nList submissions when you need to recover an ID or inspect status:\n\n```bash\nbash /app/submissions.sh\n```\n\nThe submit command does not return evaluator feedback. Plain\n`submissions.sh` gives a status and score summary, while `wait_submission.sh`\nprints the completed score, message, and metrics. Add `--json` to either wait\nor list when you need the complete structured submission record. The adapter\nallows at most 3 pending submissions. Use each completed public response to\nguide the next analysis, and submit again whenever the cumulative ledger\nimproves.\n\n## Resource budget\n\nThe configured environment is CPU-only and provides:\n\n- Ubuntu 24.04 with its distro Python 3.12 runtime;\n- 8 CPU cores;\n- 32 GiB memory;\n- 32 GiB storage;\n- 10,800 seconds (3 hours) of task runtime;\n- 1,800 seconds (30 minutes) of build time;\n- Ubuntu's generic `fplll-tools` package and standard build dependencies.\n\nDo not rely on a GPU.\n", "config": "tag: security\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"Public structured-LWE instances; Python 3.12 helper library; CPU only\"\n apt_packages:\n - build-essential\n - ca-certificates\n - fplll-tools\n - git\n - libgmp-dev\n - libmpfr-dev\n - pkg-config\n - python3\n - python3-dev\n docker:\n image: ubuntu:24.04\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 1800\nsubmission:\n kind: file\n path: /app/solution.json\n max_queue_size: 3\n"}
|
|
|
|
| 268 |
{"problem_id": "nanowm_rollout_speedup", "category": "2.0", "statement": "# NanoWM Rollout Speedup — fast diffusion sampling for a frozen video world model\n\n## Problem\n\nYou are given a clean checkout of **Nano World Models** (arXiv:2605.23993) and\nits frozen **NanoWM-L/2 CSGO** checkpoint — a diffusion-forcing video world model.\nThe judge runs a **fixed** autoregressive long-rollout: from 4 context frames,\ngenerate **50 future frames** of held-out CSGO gameplay, sequential scheduling,\nnominal **50 DDIM steps**.\n\nYour job: **make that rollout faster** by submitting a **Python-only patch** to\nthe diffusion **sampling** code, **without degrading rollout quality**. Score is\nwall-clock speedup over the unpatched baseline, gated by a quality guardrail.\n\nThis is a real fast-sampling problem: the paper's Fig. 6 shows DDIM step count\ngenuinely trades off against rollout quality on CSGO (unlike saturated toy\ndomains). Naively cutting steps degrades quality and fails the guardrail; to win\nyou must reproduce ~50-step quality with less compute — DPM-Solver++ / higher-order\nor exponential integrators, KV/feature caching across denoising steps and frames,\nmixed precision, `torch.compile`, fused attention, redundancy elimination, etc.\n\n## What you submit\n\nA unified-diff patch at **`/app/solution.patch`** against the checkout in\n`/app/nano-world-model`. **Python source only**, and only within the diffusion\nsampling layer:\n\n**Allowed:** `src/diffusion/**.py`, `src/sample/sampling_utils.py`\n**Denied:** the model architecture (`src/models/**`), VAE (`src/latent_codecs/**`),\nthe metric (`src/sample/evaluate_metrics.py`), the rollout harness\n(`src/sample/rollout.py`), data loading (`src/wm_datasets/**`), training/eval\nharness, and any native/build/dependency files. New `.py` files inside the\nallowed areas are fine. Patches are validated **before** running.\n\nThe rollout invocation (length, context, nominal step count, scheduling) is\n**fixed by the judge** — you change the sampler internals, not the call. Patches\nthat read judge/Modal/HF env vars, hard-code episode ids or ground truth,\nshort-circuit/sleep, or special-case the benchmark are rejected.\n\n## Evaluation & scoring\n\n- The judge applies your patch to a clean checkout and runs the fixed CSGO\n rollout on hidden held-out episodes on a **GPU (served via Modal)**. Iterative\n (`bash /app/submit.sh`) uses a small quick set; the final verifier uses a\n larger disjoint set.\n- **Quality guardrail:** rollout **LPIPS vs ground truth** must not rise more\n than `quality_tolerance` (default **3%**) above the unpatched seq@50 baseline.\n (Calibration: seq@20 is already +5% over seq@50, so naive step-cutting fails\n this — real fast-sampling is required.)\n- **Score:**\n\n```\ngeomean_speedup = baseline_seconds / patched_seconds (rollout generation)\nscore = clip(100 * log2(geomean_speedup), 0, 100) * quality_multiplier\n```\n\n `quality_multiplier` is 1.0 within tolerance and decays inverse-proportionally\n beyond it. `score_unbounded` keeps rewarding speedup past 2× (the bounded score\n caps at 100). A patch that degrades quality past tolerance is penalized toward\n 0; one that crashes, exceeds limits, or violates the patch policy scores 0.\n\n## Resource budget\n\nCPU agent + judge containers (8 CPU / 32 GB); one Modal GPU per evaluation.\nEvaluation timeout 21600 s. Submission queue depth 2.\n\n## Getting started\n\n`/app/nano-world-model` is the checkout you patch. `bash /app/public_test.sh`\nruns a tiny local policy check on your `solution.patch`. See `AGENT.md` and\n`harbor/app/README.md` for the submission workflow, and the paper / `docs/` for\nthe sampling code you'll be optimizing (`src/diffusion/df_sample.py`,\n`gaussian_diffusion.py`).\n", "config": "tag: systems\nruntime:\n # Submission is a Python-only source patch (the real reference is\n # reference.patch). `language: python` keeps the file extension/CLI conventions\n # standard (mirrors vllm_llm_serving_optimization, #145); there is no separate\n # \"patch\" language in the framework.\n language: python\n timeout_seconds: 21600\n environment: >-\n Python-only patch against a clean NanoWM checkout (Nano World Models,\n arXiv:2605.23993); Modal GPU runs the NanoWM-L/2 CSGO 50-frame long-rollout;\n speedup-vs-baseline judge with an LPIPS rollout-quality guardrail\n apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images; build with docker/build_images.sh before a local\n # Harbor trial. Both bake a clean NanoWM checkout + the L/2 CSGO ckpt; the\n # judge image additionally vendors the held-out CSGO episode subset, the\n # LPIPS scorer, and the cached vanilla baseline metrics.\n image: frontiercs/nanowm-rollout-speedup-agent:experimental-v0\n judge_image: frontiercs/nanowm-rollout-speedup-judge:experimental-v0\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 5400\nevaluation:\n # GPU served on Modal (one per environment); judge container is CPU-only.\n # H100 matches the hardware the reference + noise floor were calibrated on, so\n # the production scoring path and the validated numbers share one GPU SKU.\n model: nanowm_l2_csgo\n dataset: game/csgo\n gpu: H100\n # FIXED rollout invocation (the agent's patch changes sampler internals, not these).\n rollout_length: 50\n history_length: 4\n num_steps: 50 # nominal reference DDIM budget\n scheduling: sequential\n history_stab: 0.02\n # Quality guardrail: patched rollout LPIPS-vs-GT may rise at most this\n # (relative) above the unpatched seq@50 baseline before the score is penalized.\n # Calibrated: seq@20 is already +5% over seq@50, so a 3% tolerance forces real\n # fast-sampling work (DPM-Solver++, caching, distillation), not naive step cuts.\n quality_tolerance: 0.03\n # (E) Speedup at which the latency score saturates to 100: score is\n # 100*log2(speedup)/log2(target). The old bare 100*log2 capped everything >=2x\n # at 100; 4x keeps a gradient across the achievable range (causal-prefix ~3x).\n speedup_target: 4.0\n # (A) Faithfulness BACKSTOP: mean LPIPS between PATCHED and BASELINE rollout\n # frames (paired final run), always reported; penalty only past this generous\n # threshold so it catches an egregious rollout SUBSTITUTION, not legitimate\n # iso-quality speedups. Calibrated on H100: bf16 reference drifts 0.206 from the\n # fp32 baseline (iso-quality vs GT, different trajectory), so 0.30 clears it with\n # margin while still flagging ~half-divergent substitutions; causal-prefix ~0.\n faithfulness_tol: 0.30\n quick_clips: 4 # iterative (agent-role) public feedback\n final_clips: 16 # final (verifier-role) evaluation\n batch_size: 4\n # Key MUST be `baseline_cache` (settings.py strips the FRONTIER_NWM_ prefix and\n # looks up `baseline_cache`); `baseline_cache_path` was silently ignored.\n baseline_cache: /opt/nanowm/baseline/baseline_metrics.json\nsubmission:\n kind: file\n path: /app/solution.patch\n max_queue_size: 2\n"}
|
| 269 |
{"problem_id": "nanowm_rollout_stability", "category": "2.0", "statement": "# NanoWM Rollout Stability — minimize long-horizon drift at fixed compute\n\n## Problem\n\nYou are given a clean checkout of Nano World Models (arXiv:2605.23993) and its\nfrozen NanoWM-L/2 CSGO checkpoint. The judge runs a **fixed long-horizon**\nautoregressive rollout (sequential, **50 DDIM steps**). Long autoregressive\nrollouts accumulate perceptual error — by the tail of the rollout the prediction\nhas drifted into a \"plausible but wrong\" state (paper Finding #5).\n\nYour job: **minimize that drift** — the mean LPIPS-vs-ground-truth over the\n**drifted tail frames** (the late portion of the rollout) — by submitting a\n**Python-only patch** to the diffusion **sampling** code, **without using more\ncompute** (a wall-clock budget = the unpatched baseline's generation time is\nenforced).\n\nThe exact rollout length and which frames are scored as the \"tail\" are fixed by\nthe judge and **not disclosed** — the scored horizon is drawn per run — so a\nsolution must reduce drift **generally**; keying behaviour off an assumed rollout\nlength or a hardcoded frame index will not transfer to the scored run.\n\nThis is a hard, open problem: simply adding denoising steps reduces drift but is\ndisallowed (it costs compute — that's the *speedup* task). At fixed compute you\nmust use the budget *smarter*: history stabilization, scheduling-matrix design,\ndrift-aware KV/feature caching that frees time for re-grounding, periodic\ncontext re-anchoring, error-feedback correction, better solvers, etc.\n\n## What you submit\n\nA unified-diff patch at `/app/solution.patch` against `/app/nano-world-model`.\n**Python source only**, within the diffusion sampling layer:\n**Allowed:** `src/diffusion/**.py`, `src/sample/sampling_utils.py`.\n**Denied:** model (`src/models/**`), VAE, the metric, the rollout harness\n(`src/sample/rollout.py`), data loading, training/eval harness, native/build\nfiles. No env-var/benchmark/timing tricks. Validated before running.\n\n## Evaluation & scoring\n\n- Judge applies your patch, runs the fixed long-horizon CSGO rollout on hidden\n episodes (Modal GPU), measures **tail-drift** (mean LPIPS-vs-GT over the late /\n tail frames) and **generation wall-clock**. Quick set for iterative `submit.sh`;\n a larger disjoint set for the final verifier (enough clips to resolve small drift\n reductions above per-clip noise). The exact rollout length and tail window are\n not disclosed and vary per scored run.\n- **Score:**\n\n```\nscore = clip(100 * (baseline_tail_drift - patched_tail_drift) / baseline_tail_drift, 0, 100)\n * wallclock_multiplier\n```\n\n `wallclock_multiplier` is 1.0 while patched generation time stays within 10%\n of the baseline, and decays beyond (so you cannot buy drift reduction with\n more compute). A patch that does not reduce drift, exceeds the wall-clock\n budget, crashes, or violates the patch policy scores 0.\n\n## Reference & difficulty\n\n`reference.patch` raises history stabilization (a one-line sampling change) — it\nreliably reduces tail-drift ~6.8% (± 1.2%) over the baseline at iso-wall-clock\n(validated under common-random-numbers pairing: 74% per-clip win, pooled paired\nt=5.15, p<1e-4 across 3 seeds × 22 clips), proving the task is solvable.\nSubstantially beating it is the open challenge.\n\n## Resource budget\n\nCPU agent + judge; one Modal GPU per evaluation. Evaluation timeout 21600 s.\nSee `AGENT.md` and `harbor/app/README.md`.\n", "config": "tag: systems\nruntime:\n # Submission is a Python-only source patch (the real reference is\n # reference.patch). `language: python` keeps the file extension/CLI conventions\n # standard (mirrors vllm_llm_serving_optimization, #145); there is no separate\n # \"patch\" language in the framework.\n language: python\n # 12h. The scored final is a 22->12-clip baseline+patched PAIR of 80-frame\n # rollouts under strict determinism (TF32 off ~3x slower): ~5-7h on H100. The\n # old 6h verifier timeout was SHORTER than the final run, so the verifier raised\n # VerifierTimeoutError -> reward 0 even though the agent submissions scored fine.\n # Matches the Modal _rollout_pair function timeout (43200s).\n timeout_seconds: 43200\n environment: >-\n Python-only patch against a clean NanoWM checkout (Nano World Models,\n arXiv:2605.23993); Modal GPU runs a NanoWM-L/2 CSGO long-horizon rollout (the\n exact length and scored tail are fixed by the judge and not disclosed);\n minimize long-horizon drift (tail-frame LPIPS) at iso-wall-clock\n apt_packages: [bash, ca-certificates, curl, git, python3, python3-pip]\n judge_apt_packages: [bash, ca-certificates, curl, git, python3, python3-pip]\n judge_pip_packages: [modal]\n docker:\n image: frontiercs/nanowm-rollout-stability-agent:experimental-v0\n judge_image: frontiercs/nanowm-rollout-stability-judge:experimental-v0\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 5400\nevaluation:\n # H100 matches the hardware the reference + noise floor were calibrated on, so\n # the production scoring path and the validated numbers share one GPU SKU.\n model: nanowm_l2_csgo\n dataset: game/csgo\n gpu: H100\n # LONG rollout so error accumulates into a drifted tail; FIXED steps + a\n # wall-clock budget => the agent improves the rollout PROCEDURE at iso-compute\n # (stabilization / scheduling / drift-aware caching), not by adding steps.\n rollout_length: 80 # NOMINAL: agent-role QUICK loop + cache fingerprint\n history_length: 4\n num_steps: 50 # fixed compute budget\n scheduling: sequential\n history_stab: 0.02 # baseline default (repo long_rollout setting)\n drift_tail_start: 60 # NOMINAL tail (cached agent path); scored tail derives from the randomized horizon\n # Anti-overfit (audit #7): the SCORED (role=final) horizon is drawn at random per\n # run from [rollout_length_min, rollout_length_max] (MAX < nominal so the agent's\n # dev-measured horizon never scores, and GT headroom/clip-count are unchanged), and\n # the scored tail = horizon - tail_frames. This neutralizes the codex module-counter\n # tail-targeting hack (its period 76 / frame-64 ramp misfire off the tail at <=72;\n # see stability_eval/test_antihack_horizon.py). Tune to trade anti-hack margin vs\n # SNR (lower max = stronger anti-hack; raise toward 80 = closer to calibrated tail>=60).\n rollout_length_min: 64\n rollout_length_max: 72\n tail_frames: 20\n # Wall-clock guardrail: patched gen time may rise at most this over baseline,\n # else drift is being bought with compute (the speedup task's axis).\n wallclock_tolerance: 0.10\n # Drift reductions are small; enough clips to resolve above per-clip noise\n # (validated under common-random-numbers pairing: stab=0.20 reference beats\n # baseline; 74% per-clip win, pooled paired t=5.15, p<1e-4 across 3 seeds x 22 clips).\n quick_clips: 8\n # Full held-out set = the 22 test_split episodes number<=200 staged from the\n # 1-200 chunk (>22 indexes past the sliced dataset and crashes). The scored final\n # uses all 22 for SNR (validated headline). The 80-frame paired rollout is ~10h\n # sequentially under strict determinism, so the judge FANS the clips out across\n # Modal containers (chunk_size each) -- bit-identical to the sequential run since\n # the per-batch seed keys on the global clip index -- finishing in ~one chunk's\n # wall-time. batch_size=2 => QUICK(8) is a noise-identical prefix of FINAL(22).\n final_clips: 22\n batch_size: 2\n # Clips per Modal container in the fanned-out scored pair (rounded up to a\n # multiple of batch_size for global batch alignment). 22/4 => 6 parallel chunks.\n chunk_size: 4\n # Key MUST be `baseline_cache` (settings.py strips the FRONTIER_NWM_ prefix and\n # looks up `baseline_cache`); `baseline_cache_path` was silently ignored.\n baseline_cache: /opt/nanowm/baseline/stability_baseline.json\nsubmission:\n kind: file\n path: /app/solution.patch\n max_queue_size: 2\n"}
|
| 270 |
{"problem_id": "rocksdb_native_compaction_policy", "category": "2.0", "statement": "RocksDB Native Compaction Policy\n\nGoal\n\nImprove leveled compaction selection in RocksDB v10.10.1 while preserving database correctness. The workspace contains the pinned source tree at /app/rocksdb. The judge applies your patch to a clean checkout at commit 4595a5e95ae8525c42e172a054435782b3479c57, rebuilds RocksDB, and compares it with the unmodified build.\n\nWorkload\n\nThe judge runs native RocksDB workloads with changing write, point-read, scan, range-delete, snapshot, time-series, and multi-column-family phases. Options such as write-buffer size, L0 thresholds, level sizes, value sizes, and cache size vary by case. Leveled compaction is always used; universal and FIFO compaction are outside this task.\n\nFeedback uses one fixed development case per workload family plus a smoke case. Final verification uses two fixed judge-derived seeds per family. Final seeds are not included in the agent workspace or task configuration.\n\nSubmission\n\nSubmit /app/solution.patch. After editing the checkout, run:\n\n bash /app/make_submission.sh\n bash /app/submit.sh\n\nmake_submission.sh rejects changes outside the editable surface instead of silently omitting them. An empty patch is a valid zero-score baseline.\n\nEditable surface\n\n db/compaction/compaction_picker.cc\n db/compaction/compaction_picker.h\n db/compaction/compaction_picker_level.cc\n db/compaction/compaction_picker_level.h\n db/version_set.cc\n\nThe task covers leveled compaction selection: choosing levels and files, computing file priority, handling L0 pressure, intra-L0 decisions, marked files, tombstone-driven picks, and picker expansion. Output-file cutting is not part of the editable surface.\n\nCorrectness\n\nCorrectness is a hard gate. The candidate must build and complete every case without crash, timeout, deadlock, or background error. The harness checks point reads, range deletes, held snapshots, column families, database reopen, and a complete iterator comparison against its logical oracle.\n\nPatches may not inspect judge identity, paths, environment variables, process state, clocks, profile names, or infrastructure details. New preprocessor directives and changes outside the five listed files are rejected. Submitted binaries and local benchmark output are ignored.\n\nScoring\n\nEach case runs one isolated vanilla/candidate pair concurrently on the same deterministic operation stream. Final verification uses two seeds per workload family. The case objective is a weighted geometric mean of lower-is-better ratios:\n\n 40% write amplification\n 25% read amplification\n 20% pre-drain space amplification\n 15% trusted compaction output required after the policy run\n\nThe initial database load is compacted through a fixed manual path, fingerprinted, and excluded from scored counters. A candidate that changes this base state is invalid. Later writes and compactions run in fixed phase-boundary cycles so each picker decision starts from a reproducible state. Pre-drain memtables are flushed, actual table-file bytes are measured, and metadata is captured while background work is paused. After each policy run closes, an unmodified judge binary reopens the database and runs the normal vanilla policy until an additional pass produces no compaction output. It verifies the logical data before and after this residual drain. Trusted residual output is added to write amplification, and the policy plus residual drain is scored separately as 1 + output bytes divided by the larger of user-write bytes and 64 MiB, so deferred work cannot lower the measured cost. Final score uses the mean paired log improvement with a small cross-case dispersion penalty. Robust gains at or below 1.005x are treated as measurement noise and earn zero; a robust 1.017x aggregate reaches 100. Invalid or failed submissions score zero and report a strongly negative unbounded score, so they always rank below valid submissions. A positive score requires at least 40% and at least two workload families to improve by 0.5% or more, and at most one family may regress by more than 2%. Severe per-case or per-metric regressions reduce or cap the score. Extreme runtime or stall regressions are validity guards; otherwise wall-clock throughput, latency, and stall time are diagnostics, not score terms.\n\nFeedback exposes validity, build status, aggregate gain, worst-case gain, component floor, workload breadth counts, average intra-L0 decision delta per case, case count, and a coarse score band. It does not expose per-case metrics, seeds, or final profile order.\n\nResources\n\n vCPUs: 8\n memory: 16 GiB\n storage: 32 GiB\n build timeout: 7200 seconds\n per-run timeout: 1800 seconds\n", "config": "tag: systems\nruntime:\n language: cpp\n timeout_seconds: 10800\n environment: \"Patch a pinned RocksDB v10.10.1 checkout; native correctness and compaction-cost judge\"\n apt_packages:\n - bash\n - build-essential\n - ca-certificates\n - git\n - libbz2-dev\n - libgflags-dev\n - liblz4-dev\n - libsnappy-dev\n - libzstd-dev\n - zlib1g-dev\n docker:\n image: python:3.12-slim-bookworm\n judge_image: frontiercs/rocksdb-native-compaction-judge:experimental-v10.10.1-task2\n visible_inputs:\n - source: /opt/rocksdb-clean\n destination: /app/rocksdb\nenvironment:\n cpus: 8\n memory_mb: 16384\n storage_mb: 32768\n build_timeout_seconds: 7200\nevaluation:\n schema_version: rocksdb-native-compaction-v2\n public_suite_id: rocksdb-native-public-v2\n final_suite_id: rocksdb-native-final-v2\n rocksdb_commit: \"4595a5e95ae8525c42e172a054435782b3479c57\"\n feedback_cases:\n - {seed: 1101, profile: smoke}\n - {seed: 1202, profile: l0_pressure}\n - {seed: 1303, profile: range_snapshot}\n - {seed: 1404, profile: scanmix}\n - {seed: 1505, profile: multi_cf}\n - {seed: 1606, profile: time_series}\n - {seed: 1707, profile: difficulty}\n - {seed: 1808, profile: overlap_rewrite}\n build_timeout_seconds: 7200\n run_timeout_seconds: 1800\n build_jobs: 3\nsubmission:\n kind: file\n path: /app/solution.patch\n allow_empty: true\n max_queue_size: 2\n"}
|
|
|
|
| 265 |
{"problem_id": "kmeans_gpu_kernel_optimization", "category": "2.0", "statement": "# GPU K-Means Kernel Optimization\n\n## Problem\n\nYou are given a small GPU K-Means library, `kmeanslib`, in the Harbor workspace\nat `/app/kmeanslib`. Its public entry point is a **single Lloyd iteration**:\n\n```python\nkmeanslib.step(x, centroids) -> (labels, new_centroids)\n```\n\n`x` is an `(N, D)` **bfloat16** CUDA tensor of points and `centroids` is the\ncurrent `(K, D)` bfloat16 tensor. One call performs exactly one Euclidean\n(squared-L2) Lloyd step: assign every point to its nearest centroid\n(`labels`, an `(N,)` int64 full assignment), then recompute each centroid as the\nmean of its assigned points (`new_centroids`, `(K, D)`; empty clusters keep their\nprevious centroid). All data is bfloat16 — treat it as the fixed working\nprecision. The shipped implementation is a straightforward, correct PyTorch\nversion (a bf16 matmul + argmin, then a scatter update).\n\n**The judge owns the iteration loop.** It fixes the data and the initial\ncentroids, then calls your `step` a fixed number of times per workload, feeding\neach call's `new_centroids` into the next. You do not control the data, the\ninitial centroids, or how many iterations run — you control only how fast a\nsingle `step` executes.\n\nYour goal is to make `kmeanslib.step` **as fast as possible** on the GPU while\nproducing the same clustering. You may rewrite the internals of the package\nhowever you like and add new modules (including Triton kernels) under\n`kmeanslib/` — in particular you may **fuse the assign and update into a single\nkernel**. The public function signature and return contract above must not\nchange, and each result must remain a deterministic function of its inputs.\n\n## Workload\n\nThe graded workloads are a family of held-out dense clustering problems that\nvary `(N, D, K)`, spanning small/medium/large point counts and both wide-feature\n(large `D`) and many-cluster (large `K`) regimes, in **bfloat16**, with a fixed\nnumber of judge-owned `step` calls per workload and caller-supplied initial\ncentroids. How the point sets are generated is not disclosed — implement a\n**general** exact Lloyd step (correct assignment to the given centroids + exact\ncluster-mean update) and do not special-case the data.\n\n## Iterate on a GPU\n\nThe agent workspace has no GPU, and the data generator is judge-only (it is not in\nyour image). To check your current code, **submit it to the judge** — it runs the\nexact graded workloads on a GPU and returns your per-workload result + score. This\none command packages, submits, and waits for the result:\n\n```bash\nbash /app/public_test.sh\n```\n\nIt reports, per graded workload, whether your result passes the quality gate and\nyour speedup, plus the geometric-mean speedup and your score (0-100) — the\nidentical evaluation used for your final grade. (Equivalently:\n`bash /app/make_submission.sh && bash /app/submit.sh`, then poll with\n`bash /app/submissions.sh`.) Submissions are asynchronous; submit early and iterate.\n\n## Submission\n\nThe submitted artifact is a patch over the `kmeanslib` package:\n\n```text\n/app/solution.patch\n```\n\nAfter editing `/app/kmeanslib`, generate and submit:\n\n```bash\nbash /app/make_submission.sh\nbash /app/submit.sh\n```\n\nSubmissions are asynchronous; submit early and keep iterating. The judge applies\nyour patch to a clean copy of `kmeanslib` and times it against the original\nbaseline on a GPU, on the same seeded data and initial centroids.\n\n## Correctness\n\nCorrectness is a gate. After running the fixed loop of `step` calls, the judge\ncomputes the **inertia of your returned clustering** — the sum of squared\ndistances of every point to `new_centroids[labels]`, i.e. using **the `labels`\nand `new_centroids` your final `step` returned** — and compares it to the\nbaseline's, requiring your inertia to stay within a small relative tolerance.\nBecause the gate reads your returned `labels`, they must be the real full `(N,)`\nnearest-centroid assignment to the `centroids` each `step` was given: returning\nfake/empty labels, a partial or sub-sampled assignment, or centroids computed\nfrom a subset of points all inflate this inertia and fail the gate. Each `step`\nreturns `labels` `(N,)` and `new_centroids` `(K, D)`. Crashes, non-finite output,\nwrong shapes/dtypes, timeouts, and clustering that regresses beyond the tolerance\nare penalized before speed is considered. The working precision is fixed at bfloat16 for every solution (the\ninputs are bfloat16), so it is not a tuning knob — speed comes from the kernel,\nnot from the arithmetic precision.\n\n## Scoring\n\nValid submissions are scored by speedup relative to the baseline on the same\nhardware and workloads. For each workload:\n\n```text\nspeedup = baseline_time / your_time\n```\n\nThe objective is the geometric mean of per-workload speedups, so broad speedups\nare preferred over a single large outlier. A result no faster than the baseline\nearns 0; regressions earn 0. The raw geometric-mean speedup is reported in the\nevaluator metrics.\n\n## Patch Policy\n\nThe evaluator validates the patch before running it. Only Python files under the\npackage may change:\n\n```text\nkmeanslib/**\n```\n\nNew Python modules inside `kmeanslib/` are allowed. Patches may not: modify\nanything outside `kmeanslib/`; import or call an external optimized ML/kernel\nlibrary (write the kernels yourself); read or write environment variables, spawn\nprocesses, or access the network; or otherwise tamper with the measurement\nframework. The judge owns the loop, the data, and the initial centroids and\nre-verifies quality from your final centroids, so faking labels, skipping the\nreal assign/update work, or caching results across calls does not help.\n\n## Resource Budget\n\n```text\nGPU: single Modal GPU (H100 reference; the Triton paths also run on L40S / A100)\nAgent container: CPU-only (GPU work is offloaded to Modal)\n```\n", "config": "tag: systems\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"GPU K-Means kernel optimization. The agent patches the kmeanslib package; the judge offloads timing to a Modal GPU, comparing the patched kmeans against a frozen naive baseline on hidden (N, D, K) workloads with an inertia (clustering-quality) gate.\"\n apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images. Build with docker/build_images.sh before a local\n # Harbor trial. Both are light (ubuntu + modal + git); torch/triton/flashlib\n # run on the Modal GPU image defined in flash_gpu.py. The agent image bakes\n # /app/kmeanslib (git) + /opt/kmeans_ref + /opt/flash_gpu.py; the judge image\n # additionally bakes /opt/kmeanslib-clean.\n image: frontiercs/kmeans-gpu-kernel-optimization-agent:experimental-v0.4.0\n judge_image: frontiercs/kmeans-gpu-kernel-optimization-judge:experimental-v0.4.0\nenvironment:\n cpus: 4\n memory_mb: 8192\n storage_mb: 16384\n build_timeout_seconds: 3600\nevaluation:\n # --- primitive wiring (consumed by the generic evaluator + flash_gpu) ---\n primitive: kmeans\n pkg: kmeanslib\n ref_module: refkmeans\n clean_source: /opt/kmeanslib-clean\n baseline_source: /opt/kmeans_ref\n # --- Modal GPU ---\n gpu: \"H100\" # Modal GPU spec (H100 / A100 / L40S)\n cuda_image: \"nvidia/cuda:12.4.1-devel-ubuntu22.04\"\n pip: [\"torch\", \"numpy\"]\n app_name: \"kmeans-kernel-opt-eval\"\n modal_timeout_seconds: 1800\n # --- timing + quality gate ---\n warmup_iters: 2\n timed_iters: 1 # one timed run per workload; the timed unit is the judge-owned loop of max_iters `step` calls\n inertia_tolerance: 0.05 # clustering gate: inertia of the agent's RETURNED (labels, centroids) <= (1+tol) x the baseline's. Catches fake/garbage labels and badly-placed centroids. Inertia is dominated by within-cluster noise, so it is deliberately backed up by label_mismatch_tolerance below.\n label_mismatch_tolerance: 0.002 # assignment gate: fraction of points whose returned label is not the exact (fp32) nearest centroid of the centroids that step was handed. Inertia barely moves when ~1% of points are misassigned (~+0.1%), so this is what actually rejects approximate distances -- e.g. assigning on only the leading feature dims. Set above the bf16-vs-fp32 tie rate the honest reference shows.\n speedup_target: 20.0 # score cap = 2x the FUSED best-known geomean (9.97x on H100, all 6 pass). The vendored flashlib reference.patch runs assign and update as two separate kernels (two passes over x) and only reaches 7.92x (scores ~69/100); a kernel that fuses assign+scatter-update into one pass over x -- which is exactly what this task asks for -- reaches 9.97x (~77/100), and you must be 2x faster than THAT to max out. Calibrating on the unfused reference alone made the cap too easy (a merely-fused solution scored 94).\n # High-K (K=512-2048, arithmetic intensity >= H100 bf16 roofline knee ~295 FLOP/byte) keeps the assign GEMM compute-bound: ~138 TFLOPS geomean (14% of bf16 peak) vs ~40 TFLOPS on the old low-K workloads.\n base_seed: 20260701\n agent_workload_count: 6 # agent's submission feedback covers ALL graded workloads (no blind pass-3/fail-6 cliff); params are agent-visible anyway\n expose_per_workload_metrics: true # show per-workload pass/fail so the agent can fix the specific workload it regresses on\n # The agent provides one Lloyd `step(x, centroids)`; the JUDGE owns the loop and\n # calls it exactly max_iters times (=2). The agent cannot skip iterations, change\n # the data/init, or fake the count -- it can only make a single step faster\n # (e.g. fuse assign+update). Data is bf16 (locked in gen) so precision is not a\n # lever; planted well-separated blobs. max_iters=2 (not 1) is enough to be a real\n # loop while too few for a converged step to become a redundant no-op.\n workloads:\n - {id: w0, N: 200000, D: 64, K: 512, max_iters: 2}\n - {id: w1, N: 300000, D: 128, K: 1024, max_iters: 2}\n - {id: w2, N: 500000, D: 128, K: 1024, max_iters: 2}\n - {id: w3, N: 150000, D: 512, K: 512, max_iters: 2}\n - {id: w4, N: 1000000, D: 64, K: 1024, max_iters: 2}\n - {id: w5, N: 300000, D: 256, K: 2048, max_iters: 2}\nsubmission:\n kind: file\n path: /app/solution.patch\n"}
|
| 266 |
{"problem_id": "knn_gpu_kernel_optimization", "category": "2.0", "statement": "# GPU Brute-Force k-NN Kernel Optimization\n\n## Problem\n\nYou are given a small GPU brute-force k-nearest-neighbor library, `knnlib`, in\nthe Harbor workspace at `/app/knnlib`. Its public entry point is:\n\n```python\nknnlib.knn(queries, database, k) -> (distances, indices)\n```\n\n`queries` is a `(Q, D)` **bfloat16** CUDA tensor of query points, `database` is an\n`(M, D)` **bfloat16** CUDA tensor of database points to search, and `k` is the\nnumber of nearest neighbors to return per query. The inputs are bfloat16 by\ndesign — treat it as the fixed working precision; upcasting to fp32/TF32 buys no\naccuracy over bf16 tensor cores here (only latency), so precision is not a tuning\nknob. The function returns `distances`, a `(Q, k)` float32 tensor of the\n**squared-L2** distances to the `k` nearest database points (ascending, nearest\nfirst), and `indices`, a `(Q, k)` int64 tensor of the corresponding database row\nindices. The shipped implementation is a straightforward, correct PyTorch version.\n\nYour goal is to make `knnlib.knn` **as fast as possible** on the GPU while\nreturning the same nearest neighbors. You may rewrite the internals of the\npackage however you like and add new modules (including Triton kernels) under\n`knnlib/`. The public function signature and return contract above must not\nchange, and every result must remain a deterministic function of its inputs.\n\n## Workload\n\nThe graded workloads are a family of held-out dense search problems that vary\n`(Q, M, D, k)`, spanning both wide-feature (large `D`) and many-neighbor (large\n`k`) regimes. All use squared-L2 distance and float32 data. The points are real\nimage-descriptor vectors, not synthetic noise: expect clustered, non-uniform\ndata rather than i.i.d. gaussians.\n\nEvery timed iteration draws a **fresh random `Q` queries and a fresh random `M`\ndatabase rows**, so neither the query set nor the `database` tensor repeats\nacross calls. Building an index or precomputing norms once and caching them for\nreuse on a later call therefore buys nothing — each call sees a database it has\nnever seen. Optimize the per-call search itself.\n\nThe public self-test now runs the **exact graded workloads** — the same shapes,\nthresholds, seeds, and timing the judge uses to score you — so there are no\nseparate hidden shapes to guess at. Treat this as a general dense brute-force\nk-NN kernel; the workloads are just where it is measured.\n\n## Iterate on a GPU\n\nThe agent workspace has no GPU. Use the public test to check your current code's correctness and speed on\na GPU through Modal (needs `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` in your\nenvironment):\n\n```bash\nbash /app/public_test.sh\n```\n\nIt runs the **identical evaluation the judge uses to grade you** and reports, per\ngraded workload, whether your result passes the quality gate, your speedup over\nthe baseline, the geometric-mean speedup, and your **predicted final score**\n(0-100). Any workload that fails its gate makes the submission score 0.\n\n## Submission\n\nThe submitted artifact is a patch over the `knnlib` package:\n\n```text\n/app/solution.patch\n```\n\nAfter editing `/app/knnlib`, generate and submit:\n\n```bash\nbash /app/make_submission.sh\nbash /app/submit.sh\n```\n\nSubmissions are asynchronous; submit early and keep iterating. The judge applies\nyour patch to a clean copy of `knnlib` and times it against the original\nbaseline on a GPU, on the same seeded queries and database.\n\n## Correctness\n\nCorrectness is a gate. On every timed iteration the judge scores your neighbours\nby **ball-recall**: each returned index counts if the exact (fp32) squared-L2\ndistance from its query to that database row lies within the true k-nearest-\nneighbour ball (the distance to the k-th true neighbour). This is tie-robust —\nbf16 distances tie heavily near rank k, so which of several equidistant points\nyou return does not matter, but returning a genuinely farther point does. Your\nball-recall must stay at or above a high threshold. Because the inputs are bf16,\nan honest bf16 kernel clears it comfortably; a search that drops below bf16\nprecision (e.g. fp8) returns farther points and fails. Crashes, non-finite\noutput, wrong shapes/dtypes, and timeouts are penalized before speed is\nconsidered.\n\n## Scoring\n\nValid submissions are scored by speedup relative to the baseline on the same\nhardware and workloads. For each workload:\n\n```text\nspeedup = baseline_time / your_time\n```\n\nThe objective is the geometric mean of per-workload speedups, so broad speedups\nare preferred over a single large outlier. A result no faster than the baseline\nearns 0; regressions earn 0. The raw geometric-mean speedup is reported in the\nevaluator metrics.\n\n## Patch Policy\n\nThe evaluator validates the patch before running it. Only Python files under the\npackage may change:\n\n```text\nknnlib/**\n```\n\nNew Python modules inside `knnlib/` are allowed. Patches may not: modify\nanything outside `knnlib/`; import or call an external optimized ML/kernel\nlibrary (write the kernels yourself); read or write environment variables, spawn\nprocesses, or access the network; or otherwise tamper with the measurement\nframework. The timing harness measures your code on freshly generated data every\niteration and re-verifies quality each time, so caching results across calls does\nnot help.\n\n## Resource Budget\n\n```text\nGPU: single Modal GPU (H100 reference; the Triton paths also run on L40S / A100)\nAgent container: CPU-only (GPU work is offloaded to Modal)\n```\n", "config": "tag: systems\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"GPU brute-force k-NN kernel optimization. The agent patches the knnlib package; the judge offloads timing to a Modal GPU, comparing the patched nearest-neighbor search against a frozen naive baseline on hidden (Q, M, D, k) workloads with a recall@k (retrieval-quality) gate.\"\n apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images. Build with docker/build_images.sh before a local\n # Harbor trial. Both are light (ubuntu + modal + git); torch/triton/flashlib\n # run on the Modal GPU image defined in flash_gpu.py. The agent image bakes\n # /app/knnlib (git) + /opt/knn_ref + /opt/flash_gpu.py; the judge image\n # additionally bakes /opt/knnlib-clean.\n image: frontiercs/knn-gpu-kernel-optimization-agent:experimental-v0.6.0\n judge_image: frontiercs/knn-gpu-kernel-optimization-judge:experimental-v0.6.0\nenvironment:\n cpus: 4\n memory_mb: 8192\n storage_mb: 16384\n build_timeout_seconds: 3600\nevaluation:\n # --- primitive wiring (consumed by the generic evaluator + flash_gpu) ---\n primitive: knn\n pkg: knnlib\n ref_module: refknn\n clean_source: /opt/knnlib-clean\n baseline_source: /opt/knn_ref\n # --- Modal GPU ---\n gpu: \"H100\"\n cuda_image: \"nvidia/cuda:12.4.1-devel-ubuntu22.04\"\n pip: [\"torch\", \"numpy\", \"h5py\"] # match the original (validated) knn image; torch brings its matched triton. h5py loads SIFT/GIST HDF5\n app_name: \"knn-kernel-opt-eval\"\n dataset_volume: \"flashlib-ann-datasets\" # Modal Volume holding sift.hdf5 / gist.hdf5 (ann-benchmarks); mounted read-only at /data\n modal_timeout_seconds: 3600 # exact brute-force over a 1M-row real database is heavier than the synthetic shapes; give margin\n warmup_iters: 2\n timed_iters: 7\n recall_threshold: 0.88 # ball-recall gate on bf16 data (see knn_ball_recall): a returned neighbour counts if its exact fp32 distance is within the true k-NN ball. bf16 distances tie heavily near rank k, so even a correct bf16 kernel only reaches ~0.94-1.0 (the flashlib reference measured 0.935-1.0). 0.88 clears that with margin while still rejecting a sub-bf16 (e.g. fp8) search, whose coarser distances drop far lower. Precision is pinned by the bf16 DATA, not this threshold.\n distance_ball_tolerance: 0.0 # relative slack on the k-NN ball radius (the check already carries a 1e-6 absolute epsilon for fp32 reduction jitter)\n speedup_target: 4.0 # score cap = 2x the flashlib reference geomean on the bf16 real workloads (1.94x on H100: SIFT k10/50/100 = 4.43/2.60/1.48x, GIST = 1.71/1.67/1.10x, ball-recall >=0.94 all 6). bf16 data + modest cuBLAS-cdist headroom keep the factor small.\n base_seed: 20260701\n agent_workload_count: 6 # agent's submission feedback covers ALL graded workloads (no blind pass-3/fail-6 cliff); params are agent-visible anyway\n expose_per_workload_metrics: true # show per-workload pass/fail so the agent can fix the specific workload it regresses on\n # REAL-DATA WORKLOADS: exact brute-force k-NN over real descriptor vectors\n # (SIFT 128d / GIST 960d, 1M-row bases). ANTI-CACHING: every iteration draws a\n # fresh random Q-subset of the held-out real query set AND a fresh random\n # M-subset of the real base as the database, so neither the queries nor the\n # database tensor repeats across calls -- a solution cannot cache a prebuilt\n # index/norms keyed on a fixed database and skip the timed search (a fixed\n # database let a trial hit 80x by caching an index instead of writing a fast\n # kernel). M = database rows drawn per iteration; k varies the neighbour count.\n # Q <= #queries (SIFT 10000, GIST 1000); M <= base rows (1M).\n workloads:\n - {id: sift_k10, dataset: sift, M: 500000, Q: 1024, k: 10}\n - {id: sift_k50, dataset: sift, M: 500000, Q: 1024, k: 50}\n - {id: sift_k100, dataset: sift, M: 500000, Q: 1024, k: 100}\n - {id: gist_k10, dataset: gist, M: 500000, Q: 512, k: 10}\n - {id: gist_k50, dataset: gist, M: 500000, Q: 512, k: 50}\n - {id: gist_k100, dataset: gist, M: 500000, Q: 512, k: 100}\nsubmission:\n kind: file\n path: /app/solution.patch\n"}
|
| 267 |
{"problem_id": "lwe_structured_recovery", "category": "2.0", "statement": "# Structured-LWE Public Witness Recovery\n\n## Goal\n\nRecover valid secret vectors for as many public structured-LWE instances as\nyou can. For each instance, the public data define dimensions `n` and `m`, a\nmodulus `q`, a reproducible matrix `A`, a target vector `b`, public secret and\nerror distributions, and the exact predicates used for acceptance. A valid\nsubmission satisfies the public relation\n\n```text\nb = A s + e (mod q)\n```\n\nwith a secret `s` and centered residual `e` that pass those predicates. Any\nvalid `s` is accepted; you do not have to recover the particular witness used\nwhen the instance was generated.\n\n## Corpus\n\nThe production corpus has 200 public instances, split evenly across ten\nstructural families (20 per family):\n\n| Family | Public structure |\n| --- | --- |\n| `DS_BIN`, `DS_TER` | dense uniform matrix; exact-weight binary or signed-ternary secret |\n| `DS_SMALL` | dense uniform matrix; dense small-alphabet secret |\n| `SA_Q` | sparse matrix over general nonzero residues; unrestricted mod-`q` secret |\n| `SA_SMALL` | sparse small-alphabet matrix; unrestricted mod-`q` secret |\n| `DA_BIN`, `DA_TER` | dense binary or ternary matrix; unrestricted mod-`q` secret |\n| `MIX_Q_SPARSE` | sparse general-residue matrix and sparse small secret |\n| `MIX_SMALL_SPARSE` | sparse small-alphabet matrix and sparse small secret |\n| `MIX_DENSE_SMALL` | dense small-alphabet matrix and small or sparse small secret |\n\nThe public catalog deliberately omits difficulty labels, runtime bins,\ncalibration estimates, cryptanalysis paths, and reference solutions. You\nshould treat the instance IDs as opaque names. The intended workflow is\nincremental: inspect the public algebraic structure, try any attack strategy\nyou like, validate every candidate with the public facade, and submit each new\nsolution immediately while retaining all earlier ones.\n\n## Reproducibility\n\nEvery public record contains the complete matrix description, a SHAKE-256 seed\nand domain separator, inline `b`, all predicates, and an instance digest. Thus\nany implementation can reconstruct `A` deterministically, and the catalog\nsidecar binds the exact JSONL bytes used by the evaluator. The checked-in\nPython facade is the reference implementation; independent implementations\ncan be compared row-for-row against it.\n\nThe current production catalog SHA-256 is\n`318f32b68e8a30c6bcd5867c89eb10d87a5472614401f4e6df0f55356cdc98a6`.\nProduction witnesses and errors are sampled during corpus construction and must\nnot be retained as evaluator inputs or release assets. Reproducibility means\nreproducing the public instance from its released record, not recovering any\nprivate generation seed.\n\n## Public catalog and stable Python interface\n\nThe packaged task contract uses these agent-visible paths:\n\n```text\n/app/public/catalog.jsonl public instance catalog\n/app/public/lwe_instance.py stable read-only Python facade\n/app/add_solution.py cumulative-ledger helper\n/app/solution.json submitted solution ledger\n/app/submit.sh submission command\n/app/wait_submission.sh wait for one submitted UUID\n/app/submissions.sh list submissions\n```\n\nThe production catalog contains exactly 200 instances. Its entries and\nverified digest are authoritative.\n\nUse `public/lwe_instance.py`; callers do not need to import\n`lwe_challenge.*` or parse catalog JSON directly. This complete example loads\nthe catalog, streams matrix rows, and checks a candidate:\n\n```python\nfrom pathlib import Path\nimport sys\n\npublic_dir = Path(\"/app/public\")\nsys.path.insert(0, str(public_dir))\n\nfrom lwe_instance import Catalog\n\ncatalog = Catalog.load(public_dir / \"catalog.jsonl\")\nprint(catalog.catalog_id, len(catalog.instances))\n\ninstance = catalog.instances[0]\nprint(instance.instance_id, instance.n, instance.m, instance.q)\nfirst_row = next(instance.iter_rows())\n\ncandidate = (0,) * instance.n # replace with a candidate from your analysis\nverdict = instance.validate_secret(candidate)\nprint(first_row, verdict.ok, verdict.code)\n```\n\n`Catalog.instances` preserves public catalog order and `Catalog.get(id)` does\nlookup by ID. Each immutable `Instance` exposes `n`, `m`, `q`, `b`, the matrix\nkind/seed/domain/alphabet/row weight, all public secret and error distribution\nparameters, all verifier bounds, and the instance digest. It also provides:\n\n- `iter_rows()` to stream rows without materializing `A`;\n- `materialize_row_block(start, stop)` for a bounded row block;\n- `materialize_rows()` when the full public matrix fits your memory budget;\n- `matvec(secret)` for `A * secret mod q`; and\n- `validate_secret(secret)` for the exact public acceptance check.\n\nPrefer row streaming or blocks for large instances.\n\nThe declared matrix kinds are `uniform`, `small_alphabet`, `sparse_uniform`,\nand `sparse_small_alphabet`. Secret-generation kinds are `uniform_mod_q`,\n`iid_alphabet`, `exact_weight_alphabet`, `balanced_exact_weight_signed`, and\n`centered_binomial`; error kinds are `truncated_discrete_gaussian`,\n`centered_binomial`, `bounded_uniform`, and `sparse_bounded`. These labels and\nevery associated parameter are public. The balanced signed plant uses an even\nexact weight and places equally many `-1` and `1` entries; its public acceptance\npredicate remains the separately declared alphabet and nonzero-weight range.\n\nThe facade property secret_alphabet is the acceptance alphabet. For\nexact-weight secrets, the `exact_weight_alphabet` generation alphabet is\n`secret_alphabet` with zero removed because zero fills positions outside the\nexact support. The `balanced_exact_weight_signed` plant specifically uses\n`{-1,1}` on its support even though the verifier also accepts any other vector\nmeeting the published signed alphabet and exact-weight predicate. For the\nother alphabet-based kinds, `iid_alphabet` and `centered_binomial` generation\nand acceptance alphabets coincide. The `uniform_mod_q` kind instead has no\nalphabet and uses all residues `0 <= s_j < q`.\n\n## Exact validity predicates\n\nFor one public instance, a submitted vector `s` is valid exactly when all of\nthe following hold:\n\n1. `len(s) == n`, and every component is a JSON/Python integer (booleans are\n not integers for this contract).\n2. If `secret_predicate_kind == \"alphabet\"`, every component belongs to\n `secret_alphabet`. If it is `\"mod_q\"`, every component is in\n `0 <= s_j < q`.\n3. The number of nonzero components is between `secret_min_nonzero` and\n `secret_max_nonzero`, inclusive.\n4. Compute `p = A * s mod q`, then compute each canonical residual as\n `r_i = center_q(b_i - p_i)`. Equivalently, the evaluator computes\n `center_q(b_i - (A s)_i)`. The centered representative lies in\n `[-floor(q/2), ceil(q/2) - 1]`.\n5. `max_i(abs(r_i)) <= error_max_abs`.\n6. When `error_max_l1` is not `None`,\n `sum_i(abs(r_i)) <= error_max_l1`.\n7. When `error_max_l2_squared` is not `None`,\n `sum_i(r_i * r_i) <= error_max_l2_squared`.\n8. When `error_max_nonzero` is not `None`, the number of nonzero residual\n components is at most `error_max_nonzero`.\n\nThe public sampling-distribution fields are analysis inputs; acceptance is\ndetermined by the predicates above. The evaluator holds no secret, planted\nanswer, private seed, or private error. It reconstructs `A` from public data\nand checks only the submitted vector against public `(A, b)` and the public\npredicates.\n\nThe method validate_secret checks mathematical witness validity for one\nalready-selected instance. At the submission boundary, ledger admissibility\nis a separate check covering the JSON/file limits, exact record shape, ID\nhandling, and duplicate rules below. Thus an `ok` mathematical verdict does\nnot by itself make arbitrary ledger JSON admissible.\n\n## Cumulative JSON ledger\n\nThe only scored artifact is `/app/solution.json`. Its strict schema is:\n\n```json\n{\n \"schema_version\": 1,\n \"solutions\": [\n {\"instance_id\": \"example-id\", \"secret\": [1, 0, -1]}\n ]\n}\n```\n\nThe whole-file rules require an unambiguous UTF-8 JSON object whose top-level\nfields are exactly `schema_version` and `solutions`, with integer\n`schema_version == 1` and a `solutions` array of at most 200 elements. No JSON\nobject may repeat a key, and the encoded file may contain at most 2,000,000\nbytes. The decoder also permits at most 4 levels of JSON nesting and 820,205\ndecoded nodes. Exceeding either decoder budget is a whole-file\n`invalid_json` error; for example, a nested secret such as `[[0]]` is rejected\nbefore per-record validation. Therefore, violating a whole-file rule scores\nzero even when another record is valid.\n\nRecords are checked separately. A canonical record has exactly `instance_id`\nand `secret`; the ID matches `[A-Za-z0-9][A-Za-z0-9._-]{0,63}` and names a\npublic instance, while `secret` is an integer array whose components have\nabsolute value at most `2^63 - 1` and whose length is at most 4,096. A\nper-record rejection does not invalidate the whole ledger; unrelated valid\nrecords can still score; the canonical empty ledger is pre-provisioned at\n/app/solution.json as:\n\n```json\n{\"schema_version\":1,\"solutions\":[]}\n```\n\nUse the locked, atomic cumulative helper instead of rebuilding the file:\n\n```bash\npython3 /app/add_solution.py INSTANCE_ID '1,0,-1'\n```\n\nThe helper reads `/app/solution.json`, retains its prior records, adds the new\nrecord, writes canonical sorted JSON atomically, and prints the resulting\nrecord count. An identical existing witness is an idempotent no-op. A\ndifferent existing witness is rejected unless you pass --replace explicitly:\n\n```bash\npython3 /app/add_solution.py --replace INSTANCE_ID '0,1,-1'\n```\n\nA successful add_solution exit and write enforces canonical structural ledger\nrules: exact object fields and version, unique regex-valid IDs, integer arrays\nof at most 4,096 bounded components, and the 200-record and 2,000,000-byte\ncaps. The helper refuses an update that would exceed the 200-record or\n2,000,000-byte cap, as well as either component bound.\nSuccess does not prove catalog membership or mathematical witness validity\nbecause the helper does not load the catalog. Validate with\n`instance.validate_secret(candidate)` before adding a record. After every\nsuccessful helper call, the ledger remains cumulative.\n\nDuplicate handling by the evaluator is deliberately strict: every repeated\nsafe instance_id invalidates every occurrence for that ID, even when the\nvectors are identical or one occurrence is malformed. That ID earns no point.\nHere safe means syntactically valid under the instance-ID regex; it does not\nmean that the ID occurs in the public catalog. duplicate_count counts distinct\nsyntactically valid IDs that occur more than once, not duplicate occurrences.\nconflict_count counts distinct IDs with more than one distinct syntactically\nvalid integer vector, not conflicting pairs or occurrences. Here a\nsyntactically valid integer vector is a JSON array of non-boolean integers\nwithin the ledger integer bound and at most 4,096 components; it need not have\nthe right dimension or pass the mathematical witness predicates. Every\nrejected occurrence contributes to `invalid_count`.\n\nunknown_count counts distinct regex-valid IDs absent from the catalog, even\nwhen an ID is repeated or another field in its record is malformed. This set\ncount is independent of the per-occurrence rejection code. unknown_instance_id\napplies only to a unique otherwise syntactically admissible record. For a\nunique admissible record, a syntactically valid but unknown instance_id is a\nper-record `unknown_instance_id` rejection. invalid_record_fields takes\nprecedence for a unique malformed unknown when its record fields are wrong.\nWith exact fields but a malformed secret, invalid_secret takes precedence for\na unique malformed unknown over the unknown-ID code. For repeated IDs,\nduplicate_instance_id takes precedence for every occurrence of a repeated ID.\nThe helper normally prevents duplicate records; use `--replace` instead of\ncreating a second JSON record.\n\n## Scoring and public feedback\n\nEvery catalog instance has equal weight. Let `solved_count` be the number of\nunique instance IDs whose submitted secret passes all predicates, and let\n`instance_count` be the catalog size:\n\n```text\nscore = 100 * solved_count / instance_count\nscore_unbounded = solved_count\n```\n\nAn invalid record does not erase unrelated valid records. Whole-ledger format\nerrors score zero, so keep the helper-produced ledger intact.\n\nThe public feedback contains the bounded `score`, count-valued\n`score_unbounded`, a sanitized summary message, and aggregate metrics. Metrics\ninclude `instance_count`, `solved_count`, `submitted_count`, `invalid_count`,\n`duplicate_count`, `conflict_count`, `unknown_count`,\n`rejection_code_counts`, `invalid_examples`, and `solved_ids`. Feedback never\ncontains difficulty labels, runtime bins, family buckets, submitted vectors,\nresiduals, private values, filesystem paths, tracebacks, or exception text.\n\n## Iterate and submit cumulatively\n\nAlways submit after every newly validated secret for a previously unsolved\ninstance, or after a score-changing replacement; do not wait to finish a\nbatch. Always retain all prior entries in `/app/solution.json`.\n\nSubmission is asynchronous. Running `bash /app/submit.sh` snapshots and queues\nthe current `/app/solution.json` and prints a submission UUID:\n\n```bash\nbash /app/submit.sh\n```\n\nSave that UUID, then wait for its result with:\n\n```bash\nbash /app/wait_submission.sh SUBMISSION_UUID\n```\n\nList submissions when you need to recover an ID or inspect status:\n\n```bash\nbash /app/submissions.sh\n```\n\nThe submit command does not return evaluator feedback. Plain\n`submissions.sh` gives a status and score summary, while `wait_submission.sh`\nprints the completed score, message, and metrics. Add `--json` to either wait\nor list when you need the complete structured submission record. The adapter\nallows at most 3 pending submissions. Use each completed public response to\nguide the next analysis, and submit again whenever the cumulative ledger\nimproves.\n\n## Resource budget\n\nThe configured environment is CPU-only and provides:\n\n- Ubuntu 24.04 with its distro Python 3.12 runtime;\n- 8 CPU cores;\n- 32 GiB memory;\n- 32 GiB storage;\n- 10,800 seconds (3 hours) of task runtime;\n- 1,800 seconds (30 minutes) of build time;\n- Ubuntu's generic `fplll-tools` package and standard build dependencies.\n\nDo not rely on a GPU.\n", "config": "tag: security\nruntime:\n language: python\n timeout_seconds: 10800\n environment: \"Public structured-LWE instances; Python 3.12 helper library; CPU only\"\n apt_packages:\n - build-essential\n - ca-certificates\n - fplll-tools\n - git\n - libgmp-dev\n - libmpfr-dev\n - pkg-config\n - python3\n - python3-dev\n docker:\n image: ubuntu:24.04\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 1800\nsubmission:\n kind: file\n path: /app/solution.json\n max_queue_size: 3\n"}
|
| 268 |
+
{"problem_id": "nanoslm_hybrid_arch_design", "category": "2.0", "statement": "# NanoSLM Hybrid Architecture Design (fixed-wall-clock, held-out bits-per-byte)\n\n## Problem\n\nDesign a language-model **architecture** that reaches the lowest possible\nheld-out **bits-per-byte** (`val_bpb`) when trained **from scratch** under a\n**fixed wall-clock budget on a single H100**. You submit one file — `model.py`,\nthe model definition — and nothing else. The hidden judge plugs it into a locked\ntraining + evaluation harness, trains it for a fixed wall-clock budget of\n**`T` = 15 minutes (900 s)**, and scores its held-out `val_bpb`; a **locked\nbaseline architecture** trained under the identical budget is reported for\ncomparison.\n\nWhat 15 minutes buys, concretely: the LR cosine spans a **6-hour horizon**, so\nyour run is the *prefix* of a long schedule (LR still near peak at cutoff), and\n**kernel** warmup (Triton autotune / compilation) happens **outside** the\nbudget — the optimizer's 100-step LR warmup, by contrast, runs inside it. At ctx 8192 the\nbaseline completes ~330 optimizer steps and the reference hybrid ~260 — the\nregime is severely step-starved by design, and run-to-run variance across GPU\nnodes is a few hundredths of a bpb, so chase real architectural effects, not\nthird-decimal noise.\n\nThe starting point is a 3:1 Gated DeltaNet hybrid (`reference.py`, following\n*Olmo Hybrid*, arXiv:2604.03444); the question is how much further it can be\npushed. The optimizer, learning-rate schedule,\nweight-decay grouping, data, tokenizer, and the wall-clock budget are all\n**fixed by the judge**. You control the architecture — and, as of this revision,\nthe **training context length** (see below). A more compute-efficient\narchitecture legitimately completes more useful training steps within `T` — that\nis the intended lever.\n\nWhy a hybrid, specifically: the baseline is already a tuned modern transformer,\nso the easy block-level wins (RMSNorm, rotary embeddings, QK-norm, SwiGLU) are\nalready in it — what is left on the table is the sequence-mixing direction. A\nlinear-recurrent mixer is cheaper per token at long context than attention, so\nunder a fixed wall-clock budget it can complete more optimizer steps, while a\nfew attention layers preserve the global context a pure linear RNN lacks. That\nis the bet the reference hybrid makes; the design space it opens is the mixer\nchoice, the recurrence's internals, layer placement, the attention ratio, and\nthe training context length.\n\n## Metric\n\nThe tokenizer is fixed by the judge: **dolma2 BPE**\n(`allenai/dolma2-tokenizer`, 100278 real ids padded to a model vocabulary of\n100352, the Olmo 3 convention) over a FineWeb-Edu corpus. The\nscored quantity is held-out **bits per byte**:\n\n```\nval_bpb = total_cross_entropy_nats / (val_bytes * ln 2)\n```\n\nwhere `val_bytes` is the byte length of the hidden held-out **text** — not the\nnumber of tokens it was split into. Normalizing by bytes is what makes the\nnumber independent of the tokenizer, so it is comparable across architectures\nand cannot be gamed by changing tokenization. **Lower is better.**\n\nA per-token validation perplexity is also reported, for readability only. It is\nnot the scored quantity, and because the tokenizer is not byte-level it is *not*\nequal to `2**val_bpb`.\n\n## Program interface\n\nSubmit a single Python file `model.py` that defines a factory the harness calls:\n\n```python\ndef build_model(config) -> torch.nn.Module: ...\n# or, equivalently, a class usable as NanoSLM(config):\nclass NanoSLM(torch.nn.Module): ...\n```\n\n`config` is provided by the harness and has:\n\n- `config.vocab_size` — always `100352` (dolma2 BPE padded, Olmo 3\n convention; do not change). Actual token ids are always `< 100278` — the\n padding rows are never indexed, but your logits must span the full width.\n- `config.block_size` — the context length you will be **trained** at (8192 by\n default; see \"Training context length\" below).\n- `config.eval_block_size` — the context length you will be **scored** at.\n Always `8192`, whatever you train at.\n- `config.train_seconds_hint`, `config.param_cap_hint`, `config.device_hint` —\n read-only informational hints (no guarantees).\n\nThe returned module must implement:\n\n```python\ndef forward(self, idx):\n # idx: LongTensor [B, T] of BPE token ids in [0, 100278); logits span\n # the padded vocab_size (100352)\n return logits # FloatTensor [B, T, vocab_size]\n```\n\nReturning `(logits, loss)` is accepted, but the judge **ignores any returned\nloss** and computes cross-entropy itself, from your `logits`, for both training\nand validation. You choose everything inside the model: width, depth, attention\nmechanism, normalization, positional scheme, embedding sharing, initialization,\nand so on. You do **not** control the optimizer or training loop.\n\nThe vocabulary is large enough that the embedding table is a first-class design\nconcern — at `d=768` it is ~77M parameters on its own, so tying, factorizing or\notherwise reshaping it is a real lever rather than a detail.\n\nA 3:1 Gated DeltaNet hybrid `model.py` — GDN in most layers, full attention in\nthe rest, at the `olmo3_190M` baseline's shape — is provided as a starting point.\n\n## Training context length — yours to choose, with a catch\n\nYou may declare the context length you are **trained** at by defining a\nmodule-level integer in `model.py`:\n\n```python\nBLOCK_SIZE = 2048 # power of two in [256, 8192]; omit it to train at 8192\n```\n\nOmit it and you train at the default **8192**. A value outside `[256, 8192]`, or\none that is not a power of two, is rejected before training (score 0).\n\n**You are always evaluated at 8192.** That is fixed for every submission — it is\nwhat makes `val_bpb` comparable across submissions — and it is the whole trade:\n\n- A shorter training context makes each optimizer step cheaper, so you complete\n **more steps** inside the same fixed wall-clock budget `T`. At 8192,\n attention dominates the sequence-mixer sublayer (~73–84% of its FLOPs; about\n half of a full block once the MLP is counted), so this is a large effect.\n- Mind the arithmetic, though: at the recipe's fixed micro-batching (2 seqs ×\n 16 accum), halving the context also **halves the tokens seen per step**, and\n per-step costs that don't scale with context (the optimizer update over all\n parameters, kernel launches) mean the step count does NOT rise\n proportionally — a deeper model at half context has been measured to see\n *half the training tokens* in the same wall-clock. Measure the trade, don't\n assume it.\n- But your model is still scored on 8192-token windows. Train at 1024 and you\n are asked for logits at positions **8x beyond anything you saw in training**.\n\nHow well a model survives that depends heavily on its **position encoding**,\nwhich is not the same thing as architectural quality under a compute budget.\nPlain RoPE degrades sharply past its training length; NTK-aware / YaRN-style\nscaling, position interpolation and ALiBi extrapolate considerably better. So if\nyou shorten the training context, treat the position encoding as part of the\ndecision rather than an afterthought — and be aware that some of what you would\nthen be measuring is extrapolation behaviour, not mixer efficiency.\n\nPractical warning: anything you size or cache off `config.block_size` — RoPE\ntables, learned positional embeddings, causal or sliding-window mask buffers —\nmust still work at `config.eval_block_size`. Build such buffers against\n`config.eval_block_size`, or lazily against the actual `T` you are handed. A\nmodel that crashes or silently truncates at 8192 is rejected (score 0).\n\nThe baseline always trains at 8192, so this trade is measured against a fixed\npoint.\n\n## Validity constraints\n\n- Submission is `model.py` only, `.py`, at most 256 KB.\n- The file must define `build_model(config)` or `class NanoSLM`.\n- Train from scratch: no loading pretrained weights, no reading files, no\n network, no environment access, no reading the clock, no timing\n short-circuits. Submissions containing such calls are rejected before running.\n- Imports are restricted to an allowlist: `torch`, `numpy`, `fla`, `einops`,\n `triton` (custom kernels are a legitimate lever), `math`, and a few\n pure-computation stdlib modules (`typing`, `dataclasses`, `functools`,\n `itertools`, `collections`, ...). Wildcard and relative imports, bare\n `eval`/`exec`/`getattr`/`__import__`/`open`, dunder attributes other than\n `__init__`/`__version__`/`__name__`, and raw-file-reader attributes (`fromfile`,\n `memmap`, ...) are rejected statically. `model.eval()` and\n `torch.compile(...)` remain allowed.\n- A measured bits-per-byte below the plausibility floor (0.4 — far beyond any\n honest result at this scale and budget) is rejected as presumed held-out\n leakage (score 0).\n- Trainable parameters must be within the judge's param cap, and the model must\n fit and train within GPU memory. Over-cap or out-of-memory is rejected\n (score 0).\n- The model must actually train (its parameters must change) and must produce a\n non-degenerate output distribution. Untrained or constant-output models are\n rejected (score 0).\n\n## Scoring\n\nLet `base_bpb` be the locked baseline architecture's held-out bits-per-byte and\n`sub_bpb` be your submission's, both trained for the same wall-clock `T` on the\nsame H100 with the same data order (common random numbers), and both scored on\nthe same hidden held-out text at the same fixed 8192-token windows. (Iterative\nfeedback runs reuse a cached baseline measurement — flagged\n`iterative(cached-baseline)` in the message; the final verification always\ntrains a fresh pair.) Your score is\na **smooth, tempered function of the per-byte likelihood your model assigns to\nthe held-out text**: the curve reaches 100 exactly at 0 bits per byte (a\nperfect fit; measurements at or below the 0.4 leakage floor are rejected\ninstead), and the shipped reference solution scores exactly 70. HIGHER IS\nBETTER.\n\n```\nscore = 100 * 2**(-GAMMA * sub_bpb) # GAMMA = log2(100/70) / ref_bpb\n # = 100 * (2**-sub_bpb)**GAMMA: a fixed power of likelihood p = 2**-bpb\n```\n\n- Minimize your `val_bpb`. The curve is strictly decreasing with no interior\n clipping (a [0, 100] numerical clamp exists but never binds for a real\n measurement): every bpb improvement raises your score; it halves every\n 1/GAMMA (~3.0) bits per byte.\n- The baseline's `base_bpb` and your gain over it (absolute and relative) are\n still reported in the feedback for context — they do not affect the score.\n- Failed or rejected runs (policy, guards, crashes) score **0**.\n\n`val_bpb` itself is always reported alongside, so results stay directly\ncomparable to published figures.\n\nSubmissions are asynchronous: `submit.sh` returns immediately and a scored\nresult takes ~20 minutes of wall-clock, so submit an early plausible design and\nkeep improving your next candidate while the judge works (the queue holds 2;\ncancel superseded submissions rather than flooding it).\n\nPublic feedback reports `base_val_bpb`, `sub_val_bpb`, the absolute gain and the\nrelative improvement, the training context you used, the number of optimizer\nsteps completed, and the training wall-clock. Hidden data, evaluator internals,\nand the baseline definition are not exposed.\n\n## Iterating\n\nDuring a trial you can package and score the current `model.py`:\n\n```bash\nbash /app/submit.sh\n```\n\nThe best successful iterative submission is kept if a later artifact is worse or\nyou time out.\n\n## Problem structure\n\n```\nnanoslm_hybrid_arch_design/\n├── readme This file: problem statement, metric, scoring.\n├── config.yaml Harbor problem config: runtime, images, GPU/eval\n│ knobs (budget, param cap).\n├── evaluator.py Judge entrypoint. evaluate(model.py) -> (score,\n│ score_unbounded, message, metrics): static policy\n│ gate -> Modal (or local-GPU) dispatch -> scoring.\n│ `--selftest` runs the torch-free test suite.\n├── evaluate.sh Local CLI wrapper around evaluator.py.\n├── reference.py Reference solution: the 3:1 GDN:attention hybrid\n│ at the baseline's shape (~254M params). Also the\n│ shipped starter (harbor/app/model.py is a copy).\n├── harness/ The locked training+evaluation harness.\n│ ├── settings.py TaskConfig: every locked knob (optimizer, budget,\n│ │ data paths, caps), config fingerprint (baseline-\n│ │ cache key), byte-accounting resolution.\n│ ├── model_config.py ModelConfig: the read-only object handed to the\n│ │ submission's build_model(config).\n│ ├── policy.py Static gate: substring denylists + AST scan with\n│ │ a strict import allowlist. Shipped verbatim to\n│ │ the agent image so the rules cannot drift.\n│ ├── data.py TokenData: loads the uint32 token streams, serves\n│ │ CRN training batches (identical across arms) and\n│ │ the fixed 8192-wide validation windows; converts\n│ │ scored tokens to bytes for the bpb denominator.\n│ ├── train.py Locked training loop: AdamW, step-warmup +\n│ │ wall-clock cosine LR decay, grad accumulation,\n│ │ harness-owned cross-entropy, wall-clock cutoff.\n│ ├── eval_ppl.py Held-out evaluation: val_bpb (scored) + val_ppl\n│ │ (readability) + degeneracy probe.\n│ ├── runner.py Orchestration: BLOCK_SIZE resolution, kernel\n│ │ warmup (incl. eval-shape fast-fail), dynamic\n│ │ guards (param cap, OOM, trained-from-scratch,\n│ │ plausibility floor), run_arm / run_pair (CRN).\n│ ├── baseline_model.py The locked baseline: faithful plain-PyTorch\n│ │ olmo3_190M (SWA via FlexAttention on CUDA).\n│ └── modal_app.py Modal GPU app: run_pair_remote (role-aware --\n│ │ final = fresh CRN pair, agent = cached baseline\n│ │ from the corpus Volume + submission-only train),\n│ │ image pins (torch/triton/fla), corpus Volume.\n├── docker/\n│ ├── build_images.sh Builds agent+judge images; stages the corpus on a\n│ │ cold cache; leak-greps everything agent-visible.\n│ ├── prep_assets.py Tokenizes FineWeb-Edu with dolma2 into\n│ │ train.bin / val.bin / manifest.json (val_bytes,\n│ │ the bpb denominator, measured here).\n│ ├── agent/Dockerfile Agent workspace image: CPU-only, no corpus, no\n│ │ torch; starter model.py + the policy gate.\n│ └── judge/Dockerfile Judge image: CPU-only, holds the token streams +\n│ manifest, dispatches GPU work to Modal.\n└── harbor/app/ The agent's workspace (copied into /app).\n ├── model.py Starter submission (copy of reference.py).\n ├── README.md Agent-facing brief: interface, BLOCK_SIZE trade,\n │ static-gate rules.\n └── public_test.py/.sh Runs the judge's exact static gate locally.\n```\n\nThe held-out `val.bin` and its manifest exist only in the judge image and the\nModal corpus volume — never in the agent workspace.\n", "config": "tag: systems\nruntime:\n # Submission is a single Python file, the model definition (/app/model.py).\n # `language: python` keeps the extension/CLI conventions standard.\n language: python\n timeout_seconds: 86400\n environment: >-\n Full-freedom PyTorch model.py submitted against a locked\n training harness over a dolma2-BPE-tokenized FineWeb-Edu corpus; a single\n Modal H100 trains the model from scratch for a fixed wall-clock budget; the\n judge scores held-out validation bits-per-byte vs a locked baseline\n architecture trained under the same budget.\n apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n image: ghcr.io/frontiercs/nanoslm-hybrid-arch-design-agent:experimental-v0\n judge_image: ghcr.io/frontiercs/nanoslm-hybrid-arch-design-judge:experimental-v0\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 7200\nevaluation:\n gpu: H100\n tokenizer: allenai/dolma2-tokenizer\n # 100352 = dolma2's 100278 real ids padded up (Olmo 3 convention; ids on\n # disk stay < 100278). > 65535, so token streams are uint32.\n vocab_size: 100352\n dataset: HuggingFaceFW/fineweb-edu:sample-10BT\n block_size: 8192\n eval_block_size: 8192\n train_seconds: 900 # fixed wall-clock budget T per training run (15 min)\n # LR cosine horizon: the FULL 6h schedule. A 15-min run traverses only its\n # first 1/24 (prefix-of-a-long-run behavior), not a compressed anneal.\n lr_schedule_seconds: 21600\n max_train_seconds: 1800\n val_tokens: 1048576\n # The scored metric is bits per byte: nll_nats / (val_bytes * ln2). val_bytes\n # is measured by docker/prep_assets.py and shipped in the judge image's\n # manifest.json -- normalizing by the token count would make the metric\n # tokenizer-dependent.\n metric: val_bpb\n # score = 100 * 2**(-GAMMA * val_bpb): smooth tempered per-byte likelihood.\n # Perfect fit (0 bpb) = 100 exactly; reference solution = 70; no interior\n # clipping; HIGHER is better; failures score 0. Anchors in\n # harness/scoring.py (not fingerprinted).\n param_cap: 400000000\n seed: 1337\nsubmission:\n kind: file\n path: /app/model.py\n max_queue_size: 2\n"}
|
| 269 |
{"problem_id": "nanowm_rollout_speedup", "category": "2.0", "statement": "# NanoWM Rollout Speedup — fast diffusion sampling for a frozen video world model\n\n## Problem\n\nYou are given a clean checkout of **Nano World Models** (arXiv:2605.23993) and\nits frozen **NanoWM-L/2 CSGO** checkpoint — a diffusion-forcing video world model.\nThe judge runs a **fixed** autoregressive long-rollout: from 4 context frames,\ngenerate **50 future frames** of held-out CSGO gameplay, sequential scheduling,\nnominal **50 DDIM steps**.\n\nYour job: **make that rollout faster** by submitting a **Python-only patch** to\nthe diffusion **sampling** code, **without degrading rollout quality**. Score is\nwall-clock speedup over the unpatched baseline, gated by a quality guardrail.\n\nThis is a real fast-sampling problem: the paper's Fig. 6 shows DDIM step count\ngenuinely trades off against rollout quality on CSGO (unlike saturated toy\ndomains). Naively cutting steps degrades quality and fails the guardrail; to win\nyou must reproduce ~50-step quality with less compute — DPM-Solver++ / higher-order\nor exponential integrators, KV/feature caching across denoising steps and frames,\nmixed precision, `torch.compile`, fused attention, redundancy elimination, etc.\n\n## What you submit\n\nA unified-diff patch at **`/app/solution.patch`** against the checkout in\n`/app/nano-world-model`. **Python source only**, and only within the diffusion\nsampling layer:\n\n**Allowed:** `src/diffusion/**.py`, `src/sample/sampling_utils.py`\n**Denied:** the model architecture (`src/models/**`), VAE (`src/latent_codecs/**`),\nthe metric (`src/sample/evaluate_metrics.py`), the rollout harness\n(`src/sample/rollout.py`), data loading (`src/wm_datasets/**`), training/eval\nharness, and any native/build/dependency files. New `.py` files inside the\nallowed areas are fine. Patches are validated **before** running.\n\nThe rollout invocation (length, context, nominal step count, scheduling) is\n**fixed by the judge** — you change the sampler internals, not the call. Patches\nthat read judge/Modal/HF env vars, hard-code episode ids or ground truth,\nshort-circuit/sleep, or special-case the benchmark are rejected.\n\n## Evaluation & scoring\n\n- The judge applies your patch to a clean checkout and runs the fixed CSGO\n rollout on hidden held-out episodes on a **GPU (served via Modal)**. Iterative\n (`bash /app/submit.sh`) uses a small quick set; the final verifier uses a\n larger disjoint set.\n- **Quality guardrail:** rollout **LPIPS vs ground truth** must not rise more\n than `quality_tolerance` (default **3%**) above the unpatched seq@50 baseline.\n (Calibration: seq@20 is already +5% over seq@50, so naive step-cutting fails\n this — real fast-sampling is required.)\n- **Score:**\n\n```\ngeomean_speedup = baseline_seconds / patched_seconds (rollout generation)\nscore = clip(100 * log2(geomean_speedup), 0, 100) * quality_multiplier\n```\n\n `quality_multiplier` is 1.0 within tolerance and decays inverse-proportionally\n beyond it. `score_unbounded` keeps rewarding speedup past 2× (the bounded score\n caps at 100). A patch that degrades quality past tolerance is penalized toward\n 0; one that crashes, exceeds limits, or violates the patch policy scores 0.\n\n## Resource budget\n\nCPU agent + judge containers (8 CPU / 32 GB); one Modal GPU per evaluation.\nEvaluation timeout 21600 s. Submission queue depth 2.\n\n## Getting started\n\n`/app/nano-world-model` is the checkout you patch. `bash /app/public_test.sh`\nruns a tiny local policy check on your `solution.patch`. See `AGENT.md` and\n`harbor/app/README.md` for the submission workflow, and the paper / `docs/` for\nthe sampling code you'll be optimizing (`src/diffusion/df_sample.py`,\n`gaussian_diffusion.py`).\n", "config": "tag: systems\nruntime:\n # Submission is a Python-only source patch (the real reference is\n # reference.patch). `language: python` keeps the file extension/CLI conventions\n # standard (mirrors vllm_llm_serving_optimization, #145); there is no separate\n # \"patch\" language in the framework.\n language: python\n timeout_seconds: 21600\n environment: >-\n Python-only patch against a clean NanoWM checkout (Nano World Models,\n arXiv:2605.23993); Modal GPU runs the NanoWM-L/2 CSGO 50-frame long-rollout;\n speedup-vs-baseline judge with an LPIPS rollout-quality guardrail\n apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_apt_packages:\n - bash\n - ca-certificates\n - curl\n - git\n - python3\n - python3-pip\n judge_pip_packages:\n - modal\n docker:\n # Experimental local images; build with docker/build_images.sh before a local\n # Harbor trial. Both bake a clean NanoWM checkout + the L/2 CSGO ckpt; the\n # judge image additionally vendors the held-out CSGO episode subset, the\n # LPIPS scorer, and the cached vanilla baseline metrics.\n image: frontiercs/nanowm-rollout-speedup-agent:experimental-v0\n judge_image: frontiercs/nanowm-rollout-speedup-judge:experimental-v0\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 5400\nevaluation:\n # GPU served on Modal (one per environment); judge container is CPU-only.\n # H100 matches the hardware the reference + noise floor were calibrated on, so\n # the production scoring path and the validated numbers share one GPU SKU.\n model: nanowm_l2_csgo\n dataset: game/csgo\n gpu: H100\n # FIXED rollout invocation (the agent's patch changes sampler internals, not these).\n rollout_length: 50\n history_length: 4\n num_steps: 50 # nominal reference DDIM budget\n scheduling: sequential\n history_stab: 0.02\n # Quality guardrail: patched rollout LPIPS-vs-GT may rise at most this\n # (relative) above the unpatched seq@50 baseline before the score is penalized.\n # Calibrated: seq@20 is already +5% over seq@50, so a 3% tolerance forces real\n # fast-sampling work (DPM-Solver++, caching, distillation), not naive step cuts.\n quality_tolerance: 0.03\n # (E) Speedup at which the latency score saturates to 100: score is\n # 100*log2(speedup)/log2(target). The old bare 100*log2 capped everything >=2x\n # at 100; 4x keeps a gradient across the achievable range (causal-prefix ~3x).\n speedup_target: 4.0\n # (A) Faithfulness BACKSTOP: mean LPIPS between PATCHED and BASELINE rollout\n # frames (paired final run), always reported; penalty only past this generous\n # threshold so it catches an egregious rollout SUBSTITUTION, not legitimate\n # iso-quality speedups. Calibrated on H100: bf16 reference drifts 0.206 from the\n # fp32 baseline (iso-quality vs GT, different trajectory), so 0.30 clears it with\n # margin while still flagging ~half-divergent substitutions; causal-prefix ~0.\n faithfulness_tol: 0.30\n quick_clips: 4 # iterative (agent-role) public feedback\n final_clips: 16 # final (verifier-role) evaluation\n batch_size: 4\n # Key MUST be `baseline_cache` (settings.py strips the FRONTIER_NWM_ prefix and\n # looks up `baseline_cache`); `baseline_cache_path` was silently ignored.\n baseline_cache: /opt/nanowm/baseline/baseline_metrics.json\nsubmission:\n kind: file\n path: /app/solution.patch\n max_queue_size: 2\n"}
|
| 270 |
{"problem_id": "nanowm_rollout_stability", "category": "2.0", "statement": "# NanoWM Rollout Stability — minimize long-horizon drift at fixed compute\n\n## Problem\n\nYou are given a clean checkout of Nano World Models (arXiv:2605.23993) and its\nfrozen NanoWM-L/2 CSGO checkpoint. The judge runs a **fixed long-horizon**\nautoregressive rollout (sequential, **50 DDIM steps**). Long autoregressive\nrollouts accumulate perceptual error — by the tail of the rollout the prediction\nhas drifted into a \"plausible but wrong\" state (paper Finding #5).\n\nYour job: **minimize that drift** — the mean LPIPS-vs-ground-truth over the\n**drifted tail frames** (the late portion of the rollout) — by submitting a\n**Python-only patch** to the diffusion **sampling** code, **without using more\ncompute** (a wall-clock budget = the unpatched baseline's generation time is\nenforced).\n\nThe exact rollout length and which frames are scored as the \"tail\" are fixed by\nthe judge and **not disclosed** — the scored horizon is drawn per run — so a\nsolution must reduce drift **generally**; keying behaviour off an assumed rollout\nlength or a hardcoded frame index will not transfer to the scored run.\n\nThis is a hard, open problem: simply adding denoising steps reduces drift but is\ndisallowed (it costs compute — that's the *speedup* task). At fixed compute you\nmust use the budget *smarter*: history stabilization, scheduling-matrix design,\ndrift-aware KV/feature caching that frees time for re-grounding, periodic\ncontext re-anchoring, error-feedback correction, better solvers, etc.\n\n## What you submit\n\nA unified-diff patch at `/app/solution.patch` against `/app/nano-world-model`.\n**Python source only**, within the diffusion sampling layer:\n**Allowed:** `src/diffusion/**.py`, `src/sample/sampling_utils.py`.\n**Denied:** model (`src/models/**`), VAE, the metric, the rollout harness\n(`src/sample/rollout.py`), data loading, training/eval harness, native/build\nfiles. No env-var/benchmark/timing tricks. Validated before running.\n\n## Evaluation & scoring\n\n- Judge applies your patch, runs the fixed long-horizon CSGO rollout on hidden\n episodes (Modal GPU), measures **tail-drift** (mean LPIPS-vs-GT over the late /\n tail frames) and **generation wall-clock**. Quick set for iterative `submit.sh`;\n a larger disjoint set for the final verifier (enough clips to resolve small drift\n reductions above per-clip noise). The exact rollout length and tail window are\n not disclosed and vary per scored run.\n- **Score:**\n\n```\nscore = clip(100 * (baseline_tail_drift - patched_tail_drift) / baseline_tail_drift, 0, 100)\n * wallclock_multiplier\n```\n\n `wallclock_multiplier` is 1.0 while patched generation time stays within 10%\n of the baseline, and decays beyond (so you cannot buy drift reduction with\n more compute). A patch that does not reduce drift, exceeds the wall-clock\n budget, crashes, or violates the patch policy scores 0.\n\n## Reference & difficulty\n\n`reference.patch` raises history stabilization (a one-line sampling change) — it\nreliably reduces tail-drift ~6.8% (± 1.2%) over the baseline at iso-wall-clock\n(validated under common-random-numbers pairing: 74% per-clip win, pooled paired\nt=5.15, p<1e-4 across 3 seeds × 22 clips), proving the task is solvable.\nSubstantially beating it is the open challenge.\n\n## Resource budget\n\nCPU agent + judge; one Modal GPU per evaluation. Evaluation timeout 21600 s.\nSee `AGENT.md` and `harbor/app/README.md`.\n", "config": "tag: systems\nruntime:\n # Submission is a Python-only source patch (the real reference is\n # reference.patch). `language: python` keeps the file extension/CLI conventions\n # standard (mirrors vllm_llm_serving_optimization, #145); there is no separate\n # \"patch\" language in the framework.\n language: python\n # 12h. The scored final is a 22->12-clip baseline+patched PAIR of 80-frame\n # rollouts under strict determinism (TF32 off ~3x slower): ~5-7h on H100. The\n # old 6h verifier timeout was SHORTER than the final run, so the verifier raised\n # VerifierTimeoutError -> reward 0 even though the agent submissions scored fine.\n # Matches the Modal _rollout_pair function timeout (43200s).\n timeout_seconds: 43200\n environment: >-\n Python-only patch against a clean NanoWM checkout (Nano World Models,\n arXiv:2605.23993); Modal GPU runs a NanoWM-L/2 CSGO long-horizon rollout (the\n exact length and scored tail are fixed by the judge and not disclosed);\n minimize long-horizon drift (tail-frame LPIPS) at iso-wall-clock\n apt_packages: [bash, ca-certificates, curl, git, python3, python3-pip]\n judge_apt_packages: [bash, ca-certificates, curl, git, python3, python3-pip]\n judge_pip_packages: [modal]\n docker:\n image: frontiercs/nanowm-rollout-stability-agent:experimental-v0\n judge_image: frontiercs/nanowm-rollout-stability-judge:experimental-v0\nenvironment:\n cpus: 8\n memory_mb: 32768\n storage_mb: 32768\n build_timeout_seconds: 5400\nevaluation:\n # H100 matches the hardware the reference + noise floor were calibrated on, so\n # the production scoring path and the validated numbers share one GPU SKU.\n model: nanowm_l2_csgo\n dataset: game/csgo\n gpu: H100\n # LONG rollout so error accumulates into a drifted tail; FIXED steps + a\n # wall-clock budget => the agent improves the rollout PROCEDURE at iso-compute\n # (stabilization / scheduling / drift-aware caching), not by adding steps.\n rollout_length: 80 # NOMINAL: agent-role QUICK loop + cache fingerprint\n history_length: 4\n num_steps: 50 # fixed compute budget\n scheduling: sequential\n history_stab: 0.02 # baseline default (repo long_rollout setting)\n drift_tail_start: 60 # NOMINAL tail (cached agent path); scored tail derives from the randomized horizon\n # Anti-overfit (audit #7): the SCORED (role=final) horizon is drawn at random per\n # run from [rollout_length_min, rollout_length_max] (MAX < nominal so the agent's\n # dev-measured horizon never scores, and GT headroom/clip-count are unchanged), and\n # the scored tail = horizon - tail_frames. This neutralizes the codex module-counter\n # tail-targeting hack (its period 76 / frame-64 ramp misfire off the tail at <=72;\n # see stability_eval/test_antihack_horizon.py). Tune to trade anti-hack margin vs\n # SNR (lower max = stronger anti-hack; raise toward 80 = closer to calibrated tail>=60).\n rollout_length_min: 64\n rollout_length_max: 72\n tail_frames: 20\n # Wall-clock guardrail: patched gen time may rise at most this over baseline,\n # else drift is being bought with compute (the speedup task's axis).\n wallclock_tolerance: 0.10\n # Drift reductions are small; enough clips to resolve above per-clip noise\n # (validated under common-random-numbers pairing: stab=0.20 reference beats\n # baseline; 74% per-clip win, pooled paired t=5.15, p<1e-4 across 3 seeds x 22 clips).\n quick_clips: 8\n # Full held-out set = the 22 test_split episodes number<=200 staged from the\n # 1-200 chunk (>22 indexes past the sliced dataset and crashes). The scored final\n # uses all 22 for SNR (validated headline). The 80-frame paired rollout is ~10h\n # sequentially under strict determinism, so the judge FANS the clips out across\n # Modal containers (chunk_size each) -- bit-identical to the sequential run since\n # the per-batch seed keys on the global clip index -- finishing in ~one chunk's\n # wall-time. batch_size=2 => QUICK(8) is a noise-identical prefix of FINAL(22).\n final_clips: 22\n batch_size: 2\n # Clips per Modal container in the fanned-out scored pair (rounded up to a\n # multiple of batch_size for global batch alignment). 22/4 => 6 parallel chunks.\n chunk_size: 4\n # Key MUST be `baseline_cache` (settings.py strips the FRONTIER_NWM_ prefix and\n # looks up `baseline_cache`); `baseline_cache_path` was silently ignored.\n baseline_cache: /opt/nanowm/baseline/stability_baseline.json\nsubmission:\n kind: file\n path: /app/solution.patch\n max_queue_size: 2\n"}
|
| 271 |
{"problem_id": "rocksdb_native_compaction_policy", "category": "2.0", "statement": "RocksDB Native Compaction Policy\n\nGoal\n\nImprove leveled compaction selection in RocksDB v10.10.1 while preserving database correctness. The workspace contains the pinned source tree at /app/rocksdb. The judge applies your patch to a clean checkout at commit 4595a5e95ae8525c42e172a054435782b3479c57, rebuilds RocksDB, and compares it with the unmodified build.\n\nWorkload\n\nThe judge runs native RocksDB workloads with changing write, point-read, scan, range-delete, snapshot, time-series, and multi-column-family phases. Options such as write-buffer size, L0 thresholds, level sizes, value sizes, and cache size vary by case. Leveled compaction is always used; universal and FIFO compaction are outside this task.\n\nFeedback uses one fixed development case per workload family plus a smoke case. Final verification uses two fixed judge-derived seeds per family. Final seeds are not included in the agent workspace or task configuration.\n\nSubmission\n\nSubmit /app/solution.patch. After editing the checkout, run:\n\n bash /app/make_submission.sh\n bash /app/submit.sh\n\nmake_submission.sh rejects changes outside the editable surface instead of silently omitting them. An empty patch is a valid zero-score baseline.\n\nEditable surface\n\n db/compaction/compaction_picker.cc\n db/compaction/compaction_picker.h\n db/compaction/compaction_picker_level.cc\n db/compaction/compaction_picker_level.h\n db/version_set.cc\n\nThe task covers leveled compaction selection: choosing levels and files, computing file priority, handling L0 pressure, intra-L0 decisions, marked files, tombstone-driven picks, and picker expansion. Output-file cutting is not part of the editable surface.\n\nCorrectness\n\nCorrectness is a hard gate. The candidate must build and complete every case without crash, timeout, deadlock, or background error. The harness checks point reads, range deletes, held snapshots, column families, database reopen, and a complete iterator comparison against its logical oracle.\n\nPatches may not inspect judge identity, paths, environment variables, process state, clocks, profile names, or infrastructure details. New preprocessor directives and changes outside the five listed files are rejected. Submitted binaries and local benchmark output are ignored.\n\nScoring\n\nEach case runs one isolated vanilla/candidate pair concurrently on the same deterministic operation stream. Final verification uses two seeds per workload family. The case objective is a weighted geometric mean of lower-is-better ratios:\n\n 40% write amplification\n 25% read amplification\n 20% pre-drain space amplification\n 15% trusted compaction output required after the policy run\n\nThe initial database load is compacted through a fixed manual path, fingerprinted, and excluded from scored counters. A candidate that changes this base state is invalid. Later writes and compactions run in fixed phase-boundary cycles so each picker decision starts from a reproducible state. Pre-drain memtables are flushed, actual table-file bytes are measured, and metadata is captured while background work is paused. After each policy run closes, an unmodified judge binary reopens the database and runs the normal vanilla policy until an additional pass produces no compaction output. It verifies the logical data before and after this residual drain. Trusted residual output is added to write amplification, and the policy plus residual drain is scored separately as 1 + output bytes divided by the larger of user-write bytes and 64 MiB, so deferred work cannot lower the measured cost. Final score uses the mean paired log improvement with a small cross-case dispersion penalty. Robust gains at or below 1.005x are treated as measurement noise and earn zero; a robust 1.017x aggregate reaches 100. Invalid or failed submissions score zero and report a strongly negative unbounded score, so they always rank below valid submissions. A positive score requires at least 40% and at least two workload families to improve by 0.5% or more, and at most one family may regress by more than 2%. Severe per-case or per-metric regressions reduce or cap the score. Extreme runtime or stall regressions are validity guards; otherwise wall-clock throughput, latency, and stall time are diagnostics, not score terms.\n\nFeedback exposes validity, build status, aggregate gain, worst-case gain, component floor, workload breadth counts, average intra-L0 decision delta per case, case count, and a coarse score band. It does not expose per-case metrics, seeds, or final profile order.\n\nResources\n\n vCPUs: 8\n memory: 16 GiB\n storage: 32 GiB\n build timeout: 7200 seconds\n per-run timeout: 1800 seconds\n", "config": "tag: systems\nruntime:\n language: cpp\n timeout_seconds: 10800\n environment: \"Patch a pinned RocksDB v10.10.1 checkout; native correctness and compaction-cost judge\"\n apt_packages:\n - bash\n - build-essential\n - ca-certificates\n - git\n - libbz2-dev\n - libgflags-dev\n - liblz4-dev\n - libsnappy-dev\n - libzstd-dev\n - zlib1g-dev\n docker:\n image: python:3.12-slim-bookworm\n judge_image: frontiercs/rocksdb-native-compaction-judge:experimental-v10.10.1-task2\n visible_inputs:\n - source: /opt/rocksdb-clean\n destination: /app/rocksdb\nenvironment:\n cpus: 8\n memory_mb: 16384\n storage_mb: 32768\n build_timeout_seconds: 7200\nevaluation:\n schema_version: rocksdb-native-compaction-v2\n public_suite_id: rocksdb-native-public-v2\n final_suite_id: rocksdb-native-final-v2\n rocksdb_commit: \"4595a5e95ae8525c42e172a054435782b3479c57\"\n feedback_cases:\n - {seed: 1101, profile: smoke}\n - {seed: 1202, profile: l0_pressure}\n - {seed: 1303, profile: range_snapshot}\n - {seed: 1404, profile: scanmix}\n - {seed: 1505, profile: multi_cf}\n - {seed: 1606, profile: time_series}\n - {seed: 1707, profile: difficulty}\n - {seed: 1808, profile: overlap_rewrite}\n build_timeout_seconds: 7200\n run_timeout_seconds: 1800\n build_jobs: 3\nsubmission:\n kind: file\n path: /app/solution.patch\n allow_empty: true\n max_queue_size: 2\n"}
|