Skip to content

About

A task to copy and bring to Rosadelmar: a rosadelmar/ folder of four files

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A task for Rosadelmar: the template

This repository holds a tiny task, "Guess the number", that you can copy and change into your own. A task is a folder of four files and the code they grade, in a repository. You offer it to Rosadelmar by its address, a commit or a branch, and the folder; Rosadelmar checks it with no model, then agents search for programs that score well on it.

rosadelmar/           the task's folder (any folder name works; this is the default)
  task.toml           its settings
  grading.py          run_scenario(seed, target, ask_program) and score(rows)
  program_call.py     optional: load_program(path) and answer_request(program, request)
  card.md             what the agents read about the task
challenge/            the target: the organiser's code that grading.py imports
docs/RULES.md         the organiser's rules; the agents read them after card.md
examples/             the starter program, and one more that a check grades beside it

One repository can hold many tasks, each in a folder of its own. The folder holds only those four file names, each at most 1 MiB.

What a task is

  • A scenario is one seed. grading.py builds a scenario from it, asks the agent's program what to do through ask_program, and returns the numbers the scenario produced, by name.
  • The grading runs on Rosadelmar's side, with the seeds. The program runs apart from it, in a process of its own for each scenario that can write no file and start no process or thread, so it sees only what the requests show it.
  • The seeds are hidden. Rosadelmar draws them, more than gap apart. Every grade plays the feedback scenarios. A submitted program also plays the holdout ones, privately. A scenario that fails voids the grade.
  • The score is score(rows), over the rows of all of a part's scenarios in seed order. higher_is_better says which way is good.
  • The target is your code, taken from a repository at a commit into a zip that grading.py imports from. It holds what the agents' programs must not hold: the rules of the game, a simulator, the truth.

The files

task.toml:

  • name (lowercase words with hyphens) and title (one line).
  • [target]: files (paths; a folder is taken whole), rules (a text file the agents read), starter (the program a search is graded first on), and optionally try (one to four more programs that the check grades). Leave out repository and commit and the target is this repository at the commit you offer. To use another repository's, name both: its https address and a commit of 40 hex digits.
  • [scenarios]: feedback and holdout (each 2 to 100,000), gap (how far apart any two seeds are, at least), and per_room, how many scenarios one grading room plays. A part makes at most 100 rooms, so per_room is at least the larger of the two counts divided by 100.
  • [score]: title, compare (the key run_scenario returns that pairs two programs on the same scenarios), unit and higher_is_better.
  • [program]: libraries, the packages a program may import beside the standard library. Add call = "name" when there is no program_call.py: the program file is then run as a module and its function name(request) is called.
  • [resources]: wall_time and inference_deadline in seconds, and optionally cpu_time and memory_bytes.
  • [labs]: network is "off", "open" or a list of hosts, the most an agent may reach; and optionally never, hosts it may not.

grading.py has two functions.

  • run_scenario(seed, target, ask_program) returns a dict of numbers by name. target is the path of the zip, already on the import path. ask_program(request) sends a request to the program and returns its answer; requests and answers are plain values (None, booleans, numbers, strings, bytes, lists, dicts). Raise CandidateInvalid (from research.harness.candidate import CandidateInvalid) for an answer you cannot use: it voids the grade as the program's fault, and your message is kept with the failure.
  • score(rows) returns the part's grade, a number.

program_call.py is optional. load_program(path) returns the program from its file, program.py, and answer_request(program, request) returns its plain answer. It is for a program that is handed your own objects, or that runs under restrictions of yours; it is imported once in each scenario's process.

card.md is what the agents read first: what the program is, what each request shows, what it must answer and how it is scored. Say what is true of the task, and nothing of the hidden seeds.

Offering it

Give Rosadelmar the repository's address, a commit in full or a branch (a branch is resolved to its commit when you offer it, and the answer says which), and the folder if it is not rosadelmar. Rosadelmar:

  1. fetches that commit, reads the folder and checks its settings;
  2. takes the target's files at their commit, at most 10,000 files and 64 MiB in all;
  3. draws the hidden seeds;
  4. grades the starter, and the try programs, on machines, with no model.

A refusal says what to change. A few things to know:

  • Only https addresses work, and a file tracked with Git LFS is refused (its pointer is not the file): commit the file itself.
  • A private repository can be offered once Rosadelmar's GitHub App is installed on it. "Private" means private from the public: your files reach Rosadelmar's team, its agents and their model provider.
  • Offering the same folder again makes a new task with new hidden seeds. To keep grades comparable with an earlier task you offered, offer the folder as a new version of it, which keeps its seeds.

Make it yours

Change the numbers in task.toml, write your own challenge/, grading.py and card.md, replace the starter and the example, and offer it.

About

A task to copy and bring to Rosadelmar: a rosadelmar/ folder of four files

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages