# Adaptive bounded search ## Goal The evaluator needs one general search policy for a family of hidden continuous scalar functions. Submit a program that chooses bounded vectors from previous value queries and seeks the smallest objective value. The host records every query and the best value it observes; the submitted program cannot report a substitute objective or final vector. A lower loss is better. ## What You Have | path | what is in it | |---|---| | `/app/methods/main/` | your submission; it starts as the starter, and `run.sh` is its entry point | | `/app/core/` | the shared interface and metric; `CORE_DIR=/app/core` is set | | `/app/data/` | the practice instances' inputs | | `/app/data-answers/` | the matching practice answers | | `/app/selfcheck.py` | the rehearsal described below | Each input directory contains `instance.json`, a JSON object with the keys `dimension`, `lower`, `upper`, `queries`, `cases`, and `token`. These fields give the coordinate dimension, coordinate bounds, query limit, number of objective cases, and an opaque identifier. The token has no useful numeric order. The answer files are for the evaluator and are not inputs to your search program. Practice files are available for inspection. Each practice instance has a subdirectory under both practice roots, with matching directory names. The starter's source spends each case's whole query limit on uniformly random vectors within the bounds; you may replace its source and wrapper. The query program receives the dimension, query limit, and a deterministic nonzero random state. The current coordinate bounds are the `lower` and `upper` values in the instance. Each case uses hidden offsets, an orthogonal transformation, and one member of a heterogeneous function family. ## What You Submit Place a general method in `/app/methods/main/`. Only this directory is carried into the clean grading container, which also provides the installed runtime and `/app/core/` at the same path. Submit a general algorithm, rather than precomputed answers. Its entry point is `run.sh `. It must write a regular text file named `policy.json` in the output directory. That JSON object has one required key, `wasm_base64`, whose value is a base64-encoded WebAssembly module. Compile freestanding C with `python3 /app/core/interface/compile.py search.c ` when useful; all dependencies must be inside the method directory or the installed runtime. The grader calls the entry point once per sealed instance, with a read-only input directory and a writable output directory. It uses the same unprivileged account as rehearsal. The module exports `memory` and `run(i32, i32, i32) -> ()`. Its only host import is `oracle.value(i32) -> f64`. The pointer identifies dimension consecutive little-endian float64 coordinates. Every coordinate must be finite and inside the declared bounds. A successful query returns a value and consumes one query. The host starts a fresh module for every case and records the best value itself. No final vector is trusted. The query program has no filesystem, clock, network, or other host imports. The header `interface/api.h` declares the query call for C, and `interface/example-policy.json` provides a complete encoded example output under the core. Invalid modules, imports, queries, or output files are rejected by the evaluator. A module may use at most 262144 bytes of module data and 1048576 bytes of linear memory. Each case receives 50000000 units of VM fuel. These limits apply when the evaluator executes the emitted policy, after the method has written its output. Attempting one query beyond the budget ends normally with the best value already obtained; a no-query program or another trap fails the instance. ## Budget `TASK_BUDGET_SEC` supplies the method time limit, which is 120 seconds per invocation. An optional `build.sh` runs once, offline, within 900 seconds; a failed build floors every graded instance. Output files must be regular text files at most 64 MB each. The grading container uses 4 CPUs, 8 GB memory, and no network access. Set thread counts to fit these grading resources. The runner kills a method that reaches its deadline and kills any processes left behind when the entry point returns; either condition gives that instance the failure score. The session is 12 hours with 4 CPUs and 16 GB memory, without network access. The session and grading each have 10 GB of storage. ## How It Is Judged For each case the evaluator defines `e = best_value - optimum_value` and sets `e = 0` whenever `e < 1e-8`; otherwise it keeps `e`. A case contributes `log10(1 + e)`. The instance score is the arithmetic mean of its case contributions, and the final score is the arithmetic mean over the sealed instances. Lower is better. A failed, timed-out, unreadable, or invalid instance receives the failure score 1000000. The sealed instances and their answers are in the grading container only. ## Self-check Run `python3 /app/selfcheck.py rehearse` to evaluate your current method on every practice instance using the grading sandbox, unprivileged account, time limit, and metric. Its last line is `{"score": …}`, the arithmetic mean of the practice scores. This is a smoke test and a way to compare methods during development; it is not the graded score.