Measuring on the judge itself#
rbx time usually measures your solutions on the machine rbx runs on. It
can also measure them on the judge: your solutions run on the judge's own machines, and
rbx estimates the time limits from the running times the judge reports back.
Why measure there#
A time limit is a claim about hardware. Estimate on your laptop and you get a limit that's correct for your laptop. The judge has another CPU and other compiler flags, and it shares its machines with a contest's worth of submissions, so the margin you thought you left may not be there.
Measuring on the judge removes the guess: the timings are the judge's own, so you derive the limit from the machines that enforce it.
Only the timings change. The estimate itself is still computed by rbx, on your side, by the
same rules a local rbx time follows, and it ends in the same limits profile.
If what you want is a verdict rather than a limit, reach for rbx run
--runner instead.
Timing on MOJ#
With the moj limits profile, rbx time measures on MOJ by default, so this is all it takes:
rbx has MOJ run the solutions the estimate needs. MOJ reports how long each one took on its machines, and rbx estimates the limit from those times, exactly as it would from a local run.
To also check every other solution's verdict, add
--run-all: MOJ runs those solutions
alongside the ones the estimate needs, and the report shows each of them at the limit rbx
estimated.
rbx remembers what it already asked MOJ to run, so running rbx time again on an unchanged
problem costs no judge time at all.
MOJ runs the solutions side by side, and a solution that uses a lot of memory gets slower
next to others. To measure each solution alone instead, one test at a time, set
extensions.moj.calibration.serial in your env.rbx.yml. With or without it, runs
measures every solution that many times and pick chooses which time each test keeps:
extensions:
moj:
calibration:
runs: 3 # measure each solution 3 times
pick: max # keep each test's slowest time; `min` keeps its fastest
serial: true
runs and serial both make rbx time slower: each extra run measures every solution again,
and serial makes each solution wait for the one before it.
To estimate the moj profile on your own machine instead, pass --runner local.
What it needs, and what it cannot tell you#
You must be logged in to the moj CLI — rbx reuses
its session and never handles your credentials. On macOS the CLI also needs a bash newer than
the one the system ships; if it refuses to start, see
The MOJ CLI needs bash 4 or newer.
rbx uploads throwaway problems of its own, all named <your login>#rbxt-<slug>… after
the slug in .rbx-id at the package root. That slug is the one identity your package has on any
remote judge, shared with the DOMjudge backend. rbx creates it once and then keeps it, so
every later run reuses the same problems instead of orphaning them. Commit .rbx-id if you want
a co-setter's runs to use them too. The id is also written to
.moj-id, which is what the moj CLI itself reads.
It never touches a problem it did not create: a package already bound to a real MOJ problem is refused by name rather than overwritten.
A judge reports less than the local sandbox does. It hands back a verdict, not the bytes your solution wrote, so some of what a local run shows you has no counterpart at all:
- No memory usage, no
.out/.errartifacts, and a verdict code rather than the checker's own message. --runsgreater than one and a sanitizer are refused by name before anything is uploaded — each would produce a report answering a different question than the one you asked.
rbx refuses whatever it cannot answer honestly on a given backend, rather than quietly reporting less than you asked for.
Interactive (communication) problems run as they would in a real submission: the throwaway
problem ships your interactor exactly as rbx package moj
does, and refuses the same interactors it does. For an interactive problem, MOJ reports the wall
time of the whole interaction, your interactor and the language runtime's startup included, so
it's usually higher than the same run's local time. That's the time MOJ judges against, so a
limit measured this way already has the interaction's overhead built in.
Timing on DOMjudge#
It works the same way: rbx runs your solutions on DOMjudge and estimates the limits from the times DOMjudge reports. Running it again on an unchanged problem only re-submits the solutions you changed.
What it needs, and what it cannot tell you#
rbx talks to DOMjudge's REST API directly, so there is no CLI to install. Point it at the instance with three environment variables:
export RBX_DOMJUDGE_SERVER=https://judge.example.edu/
export RBX_DOMJUDGE_USERNAME=your-admin-user
export RBX_DOMJUDGE_PASSWORD=...
They are environment variables rather than package settings on purpose: which DOMjudge you can reach is a property of your machine, and committing one setter's server would break the package for everyone else.
The account needs admin rights. rbx creates a private rbx-timing contest the first
time it runs, uploads a throwaway rbxt-… problem into it, and submits as the built-in
domjudge team — none of which a plain jury account may do. The problem is named from the slug
in .rbx-id at the package root — the one identity your package has on any remote judge, shared
with the MOJ backend — so it stays the same problem as
your testset grows, rather than leaving a trail of abandoned ones behind. The contest has no scoreboard
anyone reads, and nothing rbx does there touches a real contest.
Before uploading anything, rbx checks the instance and refuses by name what cannot work, rather than leaving you watching a run that will never finish:
verification_requiredturned on. It hides every judgement and run until a human verifies it, so a timing run would poll an empty list until it gave up.- No enabled judgehost, or one that is enabled but has not asked for work recently. Either way submissions would be stored and never judged — but the fix differs, so the two are reported differently.
A judge reports less than the local sandbox does. It hands back a verdict, not the bytes your solution wrote:
- No memory usage, no
.out/.errartifacts, and a verdict rather than the checker's own message. DOMjudge has no memory-limit verdict at all, so a solution that runs out of memory comes back as a runtime error. - Times are CPU time, not wall clock. A solution killed for exceeding the limit reports the CPU it actually burned, which for a sleeping or I/O-bound solution is close to zero. The verdict is what says it was too slow.
--runsgreater than one and sanitizers are refused by name before anything is uploaded — each would produce a report answering a different question than the one you asked.
Interactive (communication) problems do work. DOMjudge runs the interactor rbx ships as
the problem's run script, so the verdict comes from the same program that judges locally — and
a legacy interactor paired with a checker is chained so that both still run.
Solutions are submitted one at a time. A judgehost judges one submission at a time anyway, and two in flight on a multi-judgehost instance would land on different machines — whose timings are not comparable, which is the whole point of measuring remotely.