Problem schema#
problem.rbx.yml#
Checker
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fallback_to
|
Checker | None
|
Checker to fall back to if the mainly specified checker does not exist. |
None
|
mode
|
Literal['testlib', 'boca']
|
In which compatibility mode the checker should be run. |
'testlib'
|
Source code in rbx/box/schema.py
CheckerTest
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
glob
|
str | None
|
A glob pattern for the files to be used as unit test input for the checker. |
None
|
testplan
|
Path | None
|
A testplan to be used as unit test input for the checker. |
None
|
outcome
|
ExpectedOutcome | None
|
The expected outcome of the checker. |
None
|
Source code in rbx/box/schema.py
CodeItem
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path to the code file, relative to the package directory. |
required |
language
|
str | None
|
The language of the code file. |
None
|
compilationFiles
|
List[str] | None
|
Extra files that should be available during the compilation of the code file, such as testlib.h, jngen.h, tgen.h, etc. The paths should be given relative to the package directory, and are placed at the
same package-relative path inside the sandbox (the package directory structure is
mirrored). This means a code file in a subdirectory can include a file from
elsewhere in the package via a relative path (e.g. Third-party libraries such as testlib.h, jngen.h and tgen.h are provided by the
preset's |
[]
|
executionFiles
|
List[str] | None
|
Extra files that should be available at execution time, the runtime equivalent of
The paths should be given relative to the package directory, and are placed at the same package-relative path inside the sandbox (the package directory structure is mirrored). Use this for runtime companion files a compiled binary or interpreted script needs at run time (data files, sibling modules, etc.). Sibling Python imports and quoted C++ includes are auto-discovered; this field is the escape hatch for files that cannot be discovered automatically. |
[]
|
Source code in rbx/box/schema.py
CodeItemWithDigest
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
digest
|
str
|
The digest of the code file. |
required |
Source code in rbx/box/schema.py
EstimationSolutionTiming
#
Bases: BaseModel
What one solution measured during the estimation of a limits profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The solution, as named in |
required |
language
|
str
|
The language it was timed as, which decides its group. |
required |
role
|
InferenceRole
|
Which side of the limit it bounds: |
required |
time
|
int | None
|
Its running time, in milliseconds, when it finished. Absent for a slow solution that never finished, or was never run. |
None
|
survivedAt
|
int | None
|
For a slow solution that never finished: the highest limit, in milliseconds, it was seen still running at. Absent when it finished, or was never run. |
None
|
Source code in rbx/box/schema.py
ExpectedOutcome
#
Bases: AutoEnum
Source code in rbx/box/schema.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
ACCEPTED = alias('accepted', 'ac', 'correct')
#
Expected outcome for correct solutions (AC).
ACCEPTED_OR_TLE = alias('accepted or time limit exceeded', 'accepted or tle', 'ac or tle', 'ac/tle', 'ac+tle')
#
Expected outcome for solutions that finish with either AC or TLE.
Especially useful when you do not care about the running time of this solution, and want it to not be considered when calculating the timelimit for the problem.
ANY = alias('any')
#
Expected outcome for any outcome.
COMPILATION_ERROR = alias('compilation error', 'ce')
#
Expected outcome for solutions that finish with a compilation error verdict.
Only useful for checker tests.
INCORRECT = alias('fail', 'incorrect')
#
Expected outcome for solutions that finish with any non-AC verdict.
JUDGE_FAILED = alias('judge failed', 'jf')
#
Expected outcome for solutions that finish with a judge failed verdict.
Only useful for checker tests.
MEMORY_LIMIT_EXCEEDED = alias('memory limit exceeded', 'mle', 'ml')
#
Expected outcome for solutions that use more memory than allowed.
MLE_OR_RTE = alias('mle or rte', 'mle/rte', 'mle+rte', 'ml or re', 'ml+re')
#
Expected outcome for solutions that finish with either MLE or RTE.
Which of the two a memory-hungry solution gets depends on how the memory limit is enforced, and that differs by platform: on Linux the address space is capped, so the allocation fails inside the program and it dies of a runtime error, while on macOS the solution is killed once its resident memory crosses the limit. Use this to declare a solution that exceeds the memory limit without pinning it to one of them.
OUTPUT_LIMIT_EXCEEDED = alias('output limit exceeded', 'ole', 'ol')
#
Expected outcome for solutions that use more output than allowed.
PARTIALLY_CORRECT = alias('partially correct', 'partial', 'pc')
#
Expected outcome for solutions the checker awards part of a test's points
(testlib quitp). Pin how many points with the solution's score.
RUNTIME_ERROR = alias('runtime error', 'rte', 're')
#
Expected outcome solutions that finish with non-zero code (RTE).
TIME_LIMIT_EXCEEDED = alias('time limit exceeded', 'timeout', 'tle', 'tl')
#
Expected outcome for solutions that do not finish in time.
TLE_OR_MLE = alias('tle or mle', 'tle/mle', 'tle+mle', 'tl or ml', 'tl+ml')
#
Expected outcome for solutions that finish with either TLE or MLE.
Especially useful for brute force solutions, which run out of whichever resource
the test exhausts first. On Linux the address space is capped, so a solution that
runs out of memory dies of a runtime error instead; declare it TLE_OR_RTE if it
must pass there.
TLE_OR_RTE = alias('tle or rte', 'tle/rte', 'tle+rte', 'tle or re', 'tle+re')
#
Expected outcome for solutions that finish with either TLE or RTE.
Especially useful for environments where TLE and RTE are indistinguishable.
WRONG_ANSWER = alias('wrong answer', 'wa')
#
Expected outcome for solutions that finish successfully, but the produced output are incorrect (WA).
FileAttachment
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The file to attach, relative to the package directory. |
required |
name
|
str | None
|
Name of the file inside the attachments archive. Defaults to the basename of |
None
|
stripSecret
|
bool
|
Derive the contestant version of a C/C++ source: every |
False
|
Source code in rbx/box/schema.py
Generator
#
GeneratorCall
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the generator to call. |
required |
args
|
str | None
|
The arguments to pass to the generator. |
None
|
Source code in rbx/box/schema.py
GeneratorScript
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
The root directory where the generators should be fetched from. |
<dynamic>
|
format
|
Literal['rbx', 'box']
|
The format of the generator script. |
'rbx'
|
Source code in rbx/box/schema.py
Grader
#
Bases: CodeItem
A grader compiled together with every solution (IOI function-call tasks).
In a batch problem it owns main(), reads the test and prints what the
checker reads. In a communication problem it is the stub that talks to the
interactor on the contestant's behalf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
secret
|
str
|
The secret the grader's hidden test header and output framing are derived from. Use a long random string, and keep it out of anything participants receive: changing it changes every judge test and answer. |
required |
Source code in rbx/box/schema.py
InferenceRole
#
Bases: AutoEnum
Source code in rbx/box/schema.py
LOWER = alias('lower')
#
The solution bounds the inferred time limit from below.
The limit will be large enough for this solution to comfortably pass.
UPPER = alias('upper')
#
The solution bounds the inferred time limit from above.
The limit will be small enough for this solution to comfortably time out.
Interactor
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
legacy
|
bool
|
Whether this interactor is a legacy interactor and needs a checker to be specified. |
False
|
capture
|
bool
|
Whether the interactor should capture the pipes. |
True
|
processes
|
int | None
|
How many copies of the solution run at once against this interactor, as in CMS
|
None
|
Source code in rbx/box/schema.py
LimitModifiers
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeMultiplier
|
float | None
|
Multiplier for time limit. |
None
|
time
|
int | None
|
Value to override time limit with, in milliseconds. |
None
|
memory
|
int | None
|
Value to override memory limit with, in MB. |
None
|
Source code in rbx/box/schema.py
LimitsProfile
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inheritFromPackage
|
bool
|
Whether to inherit limits from the package. |
False
|
timeLimit
|
int | None
|
Time limit of the problem, in milliseconds. |
None
|
memoryLimit
|
int | None
|
Memory limit of the problem, in MB. |
None
|
outputLimit
|
int | None
|
Output limit of the problem, in KB. |
None
|
modifiers
|
Dict[str, LimitModifiers]
|
Limit modifiers that can be specified per language. |
{}
|
formula
|
str | None
|
A formula to estimate the time limit for the problem. |
None
|
multipliers
|
TimingMultipliers | None
|
The multipliers this profile was estimated from, when it was estimated from ratios instead of a formula. Presentation-only; never used for limit resolution. |
None
|
groups
|
List[TimingGroupReport] | None
|
Metadata describing the language grouping used when this profile was estimated. Presentation-only; never used for limit resolution. |
None
|
baseEstimate
|
TimingGroupReport | None
|
Metadata describing how the base (fallback) time limit was estimated, pooled across every solution. Presentation-only; never used for limit resolution. |
None
|
estimationChecksum
|
str | None
|
A checksum of everything this estimate was computed from -- the solutions that
bound the limit, and, when the tests were built, the interactor and the test
inputs. Written by Presentation-only; never used for limit resolution. Absent on a profile whose limit was not estimated (inherited from the package, or set by hand). |
None
|
runner
|
str | None
|
The runner the estimate was measured on ( |
None
|
solutions
|
List[EstimationSolutionTiming] | None
|
The timing of every solution the estimate was computed from. Written by
|
None
|
runs
|
List[LimitsProfileRun] | None
|
The verdict of every solution the estimate did not run, judged at the estimated
limit. Written by |
None
|
Source code in rbx/box/schema.py
1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 | |
LimitsProfileRun
#
Bases: BaseModel
How one solution fared when judged at the limit a profile estimated.
Not evidence the limit was computed from -- that is EstimationSolutionTiming
-- but the verdict the rest of the package got under it, recorded by
rbx time --run-all (and rbx preship) after the estimate was written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The solution, as named in |
required |
language
|
str
|
The language it ran as. |
required |
timeLimit
|
int
|
The time limit, in milliseconds, it was judged at: the estimated limit of its language at the time it ran. A limit changed by hand afterwards does not change it, so a run can be told apart from the limit it no longer describes. |
required |
expectedOutcome
|
ExpectedOutcome
|
The outcome |
required |
outcome
|
Outcome | None
|
The worst verdict it got. Absent when no testcase was judged. |
None
|
matchesExpectation
|
bool
|
Whether it behaved as |
required |
time
|
int | None
|
Its running time, in milliseconds, on its slowest testcase. Absent when no testcase reported a time. |
None
|
complete
|
bool | None
|
|
None
|
Source code in rbx/box/schema.py
OutputFromItem
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stderr
|
bool
|
Whether the output should be taken from stderr instead of the stdout. |
False
|
Source code in rbx/box/schema.py
OutputFromItemWithDigest
#
Bases: OutputFromItem, CodeItemWithDigest
Source code in rbx/box/schema.py
Package
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the problem. |
required |
titles
|
Dict[str, str]
|
Titles for the problem in each language. Languages should be specified as lowercase ISO 639-1 codes. |
{}
|
languages
|
List[str] | None
|
Languages this package ships statements in, as lowercase ISO 639-1 codes. Statements declared with |
None
|
type
|
TaskType
|
The type of the problem. |
BATCH
|
scoring
|
ScoreType | PointsScoring
|
BINARY
|
|
timeLimit
|
int
|
Time limit of the problem, in milliseconds. |
required |
memoryLimit
|
int
|
Memory limit of the problem, in MB. |
required |
outputLimit
|
int
|
Output limit of the problem, in KB. |
4096
|
timing
|
PackageTiming | None
|
Problem-level overrides for time limit inference. |
None
|
modifiers
|
Dict[str, LimitModifiers]
|
Limit modifiers that can be specified per language. |
{}
|
checker
|
Checker | None
|
The checker for this problem. |
None
|
interactor
|
Interactor | None
|
The interactor for this problem. |
None
|
grader
|
Grader | None
|
The grader of a function-call problem (C++ only). It is compiled together with
every solution: in a batch problem it owns |
None
|
attachments
|
List[FileAttachment | SamplesAttachment]
|
Files given to contestants, packed into one archive per problem (e.g. a public grader, the task header and a solution template). |
[]
|
validator
|
CodeItem | None
|
The validator for this problem. |
None
|
extraValidators
|
List[CodeItem]
|
Extra validators for this problem. |
[]
|
outputValidators
|
List[CodeItem]
|
A list of output validators to use to validate the output of the testcases of this problem. |
[]
|
visualizer
|
Visualizer | None
|
The visualizer for this problem. Used to produced visualizations for the testcases. |
None
|
solutionVisualizer
|
Visualizer | None
|
The solution visualizer for this problem. Used to produced visualizations for the outputs of the testcases. |
None
|
generators
|
List[Generator]
|
Generators for this problem. |
[]
|
generatorScript
|
GeneratorScript | None
|
A generator script used as the default for any test group or subgroup that does not specify its own test parameters (testcases, testcaseGlob, generators, generatorScript) and has no subgroups of its own. Useful when a single script -- usually partitioned with |
None
|
solutions
|
List[Solution]
|
All tested solutions for this problem. The first solution in this list should be the main solution -- the one
that is correct and used as reference -- and should have the |
[]
|
testcases
|
List[TestcaseGroup]
|
Testcases for the problem. |
[]
|
stresses
|
List[Stress]
|
Stress tests for the problem. |
[]
|
statements
|
List[Statement]
|
Statements for the problem. |
[]
|
tutorials
|
List[Statement]
|
Tutorials (editorials) for the problem. |
[]
|
vars
|
RecVars
|
Variables to be re-used across the package. |
{}
|
unitTests
|
UnitTests
|
Unit tests for components of this problem. |
<dynamic>
|
issues
|
IssuesConfig
|
Which issues |
<dynamic>
|
Source code in rbx/box/schema.py
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 | |
effective_languages
#
The languages wildcard statements expand to: own languages:, else
the enclosing contest's, else the distinct languages of the concrete
statement/tutorial entries in order of appearance.
fanout_processes
#
How many contestant processes the interactor talks to, when more than one.
group_dependencies
#
The groups each group depends on, scoring.dependencies included.
Read dependencies from here, never from TestcaseGroup.deps, which holds
only the declared ones.
is_communication
#
Whether an interactor judges this problem, with one process or several.
Ask this when the code needs an interactor (compile it, pass it along,
take the answer from its output); ask is_interactive / is_fanout
when it depends on how many processes it talks to.
is_fanout
#
A communication problem whose interactor talks to several processes.
is_interactive
#
A communication problem with a single contestant process.
points_scoring
#
The points configuration, or None for a binary problem.
aggregation_for(group_name)
#
How a group's test scores combine: its own aggregation, else the
problem's. Binary problems are min.
Source code in rbx/box/schema.py
expanded_vars_for_group(group_name)
#
Package vars with the named group's overrides applied.
The merge happens before expansion, so an override can feed the interpolation of any var derived from it.
Falls back to the package vars when group_name is None or names no
declared group (interactive validation, unit tests, samples).
Source code in rbx/box/schema.py
PackageTiming
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inferenceTimeout
|
int | None
|
Overrides the environment |
None
|
multipliers
|
TimingMultipliersOverride | None
|
Per-problem overrides of the environment's timing multipliers. Only the declared fields are overridden. |
None
|
Source code in rbx/box/schema.py
PointsScoring
#
Bases: BaseModel
Subtasks scoring, configured. Writing scoring: points means the defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dependencies
|
DependencyPolicy
|
Which dependencies between groups are added on top of the
|
MANUAL
|
aggregation
|
Aggregation
|
How the results of a group's tests combine into the group's score, unless the
group sets its own
|
MIN
|
Source code in rbx/box/schema.py
SamplesAttachment
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samples
|
str
|
Directory inside the attachments archive that receives every sample as |
required |
Source code in rbx/box/schema.py
ScoreType
#
Bases: AutoEnum
Source code in rbx/box/schema.py
Solution
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outcome
|
ExpectedOutcome
|
The expected outcome of this solution. |
ANY
|
outcomePerGroup
|
Dict[str, ExpectedOutcome]
|
The expected outcome of this solution for each testcase group, keyed by group name. Only available for problems with Keys must be top-level group names declared in The reserved key This is an extra layer of expectations, checked in addition to |
{}
|
inference
|
Literal[False] | InferenceRole | None
|
The role this solution plays when inferring the time limit. When unset, the role follows the expected outcomes of this solution: a solution
expected to be Set it explicitly to override that:
|
None
|
tags
|
List[str]
|
Tags to be associated with this solution. |
[]
|
score
|
float | Tuple[float | None, float | None] | None
|
The score of this solution in the final score. Should either be a number, which means the solution should have this exact score, or a tuple of two numbers, which means the solution should have a score between the two numbers (inclusive). Scores are compared rounded to two decimals. If one of the numbers is set to be null, it means that the solution should have a score between the other number and negative/positive infinity. |
None
|
Source code in rbx/box/schema.py
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | |
all_expected_outcomes()
#
Every expectation this solution declares, pooled and per-group.
Source code in rbx/box/schema.py
expected_outcome_for_group(group_name)
#
The expectation for a single group, or None if the group has none.
Source code in rbx/box/schema.py
Stress
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the stress test. |
required |
generator
|
GeneratorCall
|
Generator pattern to call during stress-test. |
required |
finder
|
str
|
Finder expression to be used to match against generated tests. |
required |
Source code in rbx/box/schema.py
TaskType
#
Bases: AutoEnum
Source code in rbx/box/schema.py
Testcase
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputPath
|
Path
|
The path of the input file. |
required |
outputPath
|
Path | None
|
The path of the output file. |
None
|
Source code in rbx/box/schema.py
TestcaseGroup
#
Bases: TestcaseSubgroup
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subgroups
|
List[TestcaseSubgroup]
|
A list of test subgroups to define for this group. |
[]
|
validator
|
CodeItem | None
|
A validator to use to validate the testcases of this group. If specified, will use this validator instead of the package-level validator. Useful in cases where the constraints vary across test groups. |
None
|
vars
|
RecVars
|
Variables that override the package-level Merged leaf-by-leaf onto the package |
{}
|
score
|
int
|
The score of this group in the final score. Useful for problems that have points. |
0
|
deps
|
List[str]
|
A list of other groups this group depends on to run and be considered accepted. Only these are dependencies unless |
[]
|
aggregation
|
Aggregation | None
|
How the results of this group's tests combine into its score; defaults to
|
None
|
model_solution
|
ForwardRef
|
The solution to be used to generate outputs for this testgroup. Can only be set for the "samples" testgroup. |
None
|
validateStatementFiles
|
bool
|
Whether the statement-only testcase files of this group should be validated. Statement-only files -- Setting this to Mostly useful in the |
False
|
Source code in rbx/box/schema.py
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 | |
TestcaseSubgroup
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the test group. |
required |
testcases
|
List[Testcase]
|
The path of testcases to add to this group, in the order they're defined. |
[]
|
testcaseGlob
|
str | None
|
A Python glob that matches input file paths relative to the package directory. The globbed files should end with the extension ".in", and their corresponding outputs, if defined, should have the same file name, but ending with ".ans". |
None
|
generators
|
List[GeneratorCall]
|
A list of generators to call to generate testcases for this group. |
[]
|
generatorScript
|
GeneratorScript | None
|
A generator script to call to generate testcases for this group. |
None
|
extraValidators
|
List[CodeItem]
|
A list of extra validators to use to validate the testcases of this subgroup. |
[]
|
outputValidators
|
List[CodeItem]
|
A list of output validators to use to validate the output of the testcases of this subgroup. |
[]
|
visualizer
|
Visualizer | None
|
The visualizer for this problem. Used to produced visualizations for the testcases. Has priority over the visualizer specified in the package. |
None
|
solutionVisualizer
|
Visualizer | None
|
The solution visualizer for this problem. Used to produced visualizations for the outputs of the testcases. Has priority over the solution visualizer specified in the package. |
None
|
allowDuplicate
|
bool | None
|
Whether the tests of this group may duplicate other tests, either by being generated by the same call or by having the same input. A duplicate pair is only warned about when neither of its tests allows it. A subgroup inherits the value of its group unless it sets its own. |
None
|
Source code in rbx/box/schema.py
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | |
TimingBound
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The bound, in milliseconds. A lower bound is the smallest
time limit it allows, before it is rounded up to |
required |
solution
|
str | None
|
The solution that set this bound, when it came from a measured solution of the group. Absent when the bound was derived from another group's limit. |
None
|
Source code in rbx/box/schema.py
TimingGroupReport
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
languages
|
List[str]
|
|
required |
timeLimit
|
int
|
|
required |
origin
|
TimingGroupOrigin
|
|
required |
solutionCount
|
int
|
|
0
|
fastest
|
int | None
|
|
None
|
slowest
|
int | None
|
|
None
|
relativeToLanguage
|
str | None
|
|
None
|
multiplier
|
float | None
|
|
None
|
increment
|
int | None
|
|
None
|
isLeftover
|
bool
|
|
False
|
lowerBound
|
TimingBound | None
|
The lower bound this group's time limit had to respect, when it was estimated from multipliers. Presentation-only. |
None
|
upperBound
|
TimingBound | None
|
The upper bound this group's time limit had to respect, when it was estimated from multipliers and some slow solution of the group bounded it. Presentation-only. |
None
|
upperValidation
|
TimingGroupUpperValidation | None
|
What checking this group's slow solutions against its estimated time limit found. Absent when the group has no slow solutions. Presentation-only. |
None
|
estimatedTimeLimit
|
int | None
|
The time limit |
None
|
lowerViolation
|
TimingBound | None
|
The smallest time limit this group's own accepted solutions
allow, recorded only when the group's time limit is below it -- that is, when the
limit was derived from a reference group or the base estimate instead of being
estimated from the group's own solutions, and the group's own solutions do not fit
in it. |
None
|
droppedUpper
|
List[str]
|
Deprecated: replaced by |
[]
|
Source code in rbx/box/schema.py
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | |
TimingGroupUpperValidation
#
Bases: BaseModel
What checking a group's slow solutions against its time limit found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
confirmed
|
List[str]
|
Solutions of this group expected to be too slow that were
confirmed to be so: they were still running once the estimated time limit times
|
[]
|
violating
|
List[TimingBound]
|
Solutions of this group expected to be too slow that finished
within the estimated time limit times |
[]
|
skipped
|
List[str]
|
Solutions of this group expected to be too slow that were not
run, either because |
[]
|
Source code in rbx/box/schema.py
TimingMultipliers
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acToTimeLimit
|
float
|
Minimum ratio between the time limit and the slowest accepted
solution, used to estimate the time limit from below: the slowest accepted solution
times |
required |
fastestToTimeLimit
|
float | None
|
Minimum ratio between the time limit and the fastest accepted
solution, an additional lower bound on top of |
None
|
timeLimitToTle
|
float | None
|
Minimum ratio between the fastest solution expected to be too
slow and the time limit: the time limit times |
None
|
inferenceTimeout
|
int | None
|
Deprecated: use |
None
|
timeResolution
|
int
|
Granularity (in milliseconds) of the estimated time limit. The estimate is the smallest multiple of this value that is valid. |
100
|
Source code in rbx/box/schema.py
uses_kattis_estimation
#
Whether these multipliers estimate by the Kattis rule alone: the limit is
the slowest accepted solution times acToTimeLimit, rounded up to
timeResolution. A fastestToTimeLimit adds a bound that rule does not
have, so a judge estimating by it (MOJ's TLMETHOD=kattis) would not land
where rbx does.
TimingMultipliersOverride
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acToTimeLimit
|
float | None
|
Overrides the environment |
None
|
fastestToTimeLimit
|
float | None
|
Overrides the environment |
None
|
timeLimitToTle
|
float | None
|
Overrides the environment |
None
|
inferenceTimeout
|
int | None
|
Deprecated: use |
None
|
timeResolution
|
int | None
|
Overrides the environment |
None
|
Source code in rbx/box/schema.py
UnitTests
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validator
|
List[ValidatorTest]
|
Unit tests for the validator. |
[]
|
checker
|
List[CheckerTest]
|
Unit tests for the checker. |
[]
|
Source code in rbx/box/schema.py
ValidatorOutcome
#
Bases: AutoEnum
Source code in rbx/box/schema.py
ValidatorTest
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
glob
|
str | None
|
A glob pattern for the input files to be used as unit test input for the validator. |
None
|
testplan
|
Path | None
|
A testplan to be used as unit test input for the validator. |
None
|
outcome
|
ValidatorOutcome | None
|
The expected outcome of the validator. |
None
|
validator
|
CodeItem | None
|
The validator to use for this test. If not specified, will use the package-level validator. |
None
|
Source code in rbx/box/schema.py
Visualizer
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extension
|
str
|
The extension of the visualization file generated by the visualizer. |
required |
answer_from
|
Literal['stderr'] | OutputFromItem | None
|
Program to generate additional answer file to pass to the visualizer. If not specified, the reference answer file will be used. |
None
|
Source code in rbx/box/schema.py
check_reserved_var_names(vars)
#
Reject top-level var names that collide with a testlib/rbx flag.
Only top-level primitive keys are checked: a nested var is emitted as
--<parent>.<key>=<value>, which no flag parser matches.
Source code in rbx/box/schema.py
Statements#
Statement
#
Bases: BaseStatement
A problem-level statement. Identified by (language, variant) — it has no
name (design §3.1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extends
|
str | StatementVariantRef | None
|
Another problem statement to inherit the build recipe from, referenced by language ( |
None
|
Source code in rbx/box/statements/schema.py
StatementType
#
Bases: AutoEnum
Source code in rbx/box/statements/schema.py
rbxTeX = alias('rbx-tex')
#
Statement written in rbxTeX format.
rbxMarkdown = alias('rbxMd', 'rbx-markdown', 'rbx-md')
#
Statement written in rbxMarkdown format.
TeX = alias('tex')
#
Statement written in pure LaTeX format.
Markdown = alias('md', 'markdown')
#
Statement written in pure Markdown format.
JinjaTeX = alias('jinja-tex')
#
Statement written in LaTeX format with Jinja2 expressions.
JinjaMarkdown = alias('jinja-md', 'jinja-markdown')
#
Statement written in Markdown format with Jinja2 expressions.
PDF = alias('pdf')
#
Statement is a PDF.
Conversion nodes#
BaseStatement
#
Bases: BaseModel
Fields shared by problem statements, contest statements and documents (design §2.5, "one shared schema").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
Language code of this statement (ISO 639-1). |
'en'
|
variant
|
str
|
Optional discriminator between formats of the same language. Together with |
'default'
|
title
|
str | None
|
Title as it appears in the statement. Can be left unset to fall back to the package/contest title. |
None
|
file
|
Path | None
|
Path to the input statement file. Required unless this statement |
None
|
type
|
StatementType
|
Type of the input statement file. |
rbxTeX
|
params
|
RecVars
|
This statement's own parameters, exposed to the template as the |
{}
|
samples
|
bool
|
Whether to build the statement with samples. |
True
|
assets
|
List[str]
|
Globs (relative to the package root) selecting files to ship as statement resources (e.g. images/PDFs). Inherited via |
<dynamic>
|
Source code in rbx/box/statements/schema.py
ConversionType
#
Bases: str, Enum
Source code in rbx/box/statements/schema.py
JinjaTeX = 'jinja-tex'
class-attribute
instance-attribute
#
Conversion from LaTeX with Jinja2 expressions to LaTeX.
TexToPDF = 'tex2pdf'
class-attribute
instance-attribute
#
Conversion from LaTeX to PDF using pdfLaTeX.
rbxMarkdownToTeX = 'rbx-md-tex'
class-attribute
instance-attribute
#
Conversion from rbxMarkdown to LaTeX.
rbxToTex = 'rbx-tex'
class-attribute
instance-attribute
#
Conversion from rbxTeX to LaTeX.
StatementKind
#
Bases: str, Enum
Which parallel section a statement build operates on (design §3): the
primary statements or the tutorials (editorials). Both share the
same models, engine and build paths — the kind only selects which list to
read on the problem and the contest, and the output filename prefix.
Source code in rbx/box/statements/schema.py
singular
property
#
Noun used in messages and output filenames (statement / tutorial).
StatementVariantRef
#
Bases: BaseModel
A problem-statement extends target referenced by (language, variant).
A bare string extends: en is shorthand for {language: en} with the
default variant (design §5).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
|
required |
variant
|
str
|
|
'default'
|
Source code in rbx/box/statements/schema.py
TexToPDF
#
Bases: BaseModel
Configures the conversion between LaTeX and PDF using pdfLaTeX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Literal['tex2pdf']
|
|
required |
externalize
|
bool
|
Whether to externalize TikZ graphics. |
False
|
demacro
|
bool
|
Whether to save macro definitions to a JSON file. |
False
|
Source code in rbx/box/statements/schema.py
rbxToTeX
#
Bases: BaseModel
Configures the conversion between rbxTeX and LaTeX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Literal['rbx-tex']
|
|
required |
template
|
Path
|
Path to the template that should be used to render the rbx-tex blocks. |
PosixPath('template.rbx.tex')
|
externalize
|
bool
|
Whether to externalize TikZ graphics. |
False
|