Environment schema#
Environment#
BaseCompilationConfig
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
commands
|
List[str] | None
|
Commands to compile the program. |
[]
|
sandbox
|
EnvironmentSandbox | None
|
Sandbox configuration to use when compiling for this language. |
None
|
passthrough
|
bool | None
|
Whether to pass through the compilable as an executable file. |
None
|
Source code in rbx/box/environment.py
BaseExecutionConfig
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str | None
|
Command to run the program. |
None
|
sandbox
|
EnvironmentSandbox | None
|
Sandbox configuration to use when executing for this language. |
None
|
problemLimits
|
Limits
|
Original limits of the problem. |
<dynamic>
|
Source code in rbx/box/environment.py
CompilationConfig
#
Bases: BaseCompilationConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solutionOverrides
|
SolutionCompilationOverrides
|
Overrides to apply when compiling solutions for this language. |
<dynamic>
|
Source code in rbx/box/environment.py
Environment
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
defaultFileMapping
|
FileMapping | None
|
Default mapping for files within the sandbox. Fields in the mapping can be individually overridden in the language configuration. |
None
|
defaultCompilation
|
CompilationConfig | None
|
Default compilation configuration to use when compiling programs. Fields in the compilation config can be individually overridden in the language configuration. |
None
|
defaultExecution
|
ExecutionConfig | None
|
Default execution configuration to use when running programs. Fields in the execution config can be individually overridden in the language configuration. |
None
|
languages
|
List[EnvironmentLanguage]
|
Configuration for each language supported in this environment. |
[]
|
sandbox
|
str
|
Identifier of the sandbox used by this environment (e.g. "stupid") |
'stupid'
|
timing
|
TimingConfig
|
Timing configuration for the environment. |
<dynamic>
|
extensions
|
Extensions | None
|
Extensions to be added to the environment. |
None
|
buildDir
|
Path
|
Directory to store the build files. |
PosixPath('build')
|
Source code in rbx/box/environment.py
EnvironmentLanguage
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Identifier of this language within this environment. |
required |
readableName
|
str | None
|
Readable name for this language. |
None
|
extension
|
str
|
File extension supported by this language. If there's only one language that supports a certain file extension in the environment, the tool will automatically identify the language based on such extension. |
required |
extraExtensions
|
List[str]
|
Extra file extensions supported by this language. If not specified, the tool will automatically identify the language based on such extensions. |
<dynamic>
|
compilation
|
CompilationConfig | None
|
Compilation config to use when compiling programs for this language. |
None
|
execution
|
ExecutionConfig
|
Execution config to use when running programs for this language. |
required |
fileMapping
|
FileMapping | None
|
Mapping for files within the sandbox. If not specified, the default mapping for the environment will be used. |
None
|
extensions
|
LanguageExtensions | None
|
Extensions to apply for this language. |
None
|
linters
|
List[LinterConfig]
|
Linters to run for this language during compilation. |
<dynamic>
|
scanners
|
List[str]
|
Dependency scanners (by registry name) to apply for this language, in addition to the ones automatically selected by language kind. |
<dynamic>
|
timing
|
LanguageTimingConfig | None
|
Per-language overrides for timing configuration (e.g. wall time). |
None
|
Source code in rbx/box/environment.py
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 | |
EnvironmentSandbox
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
maxProcesses
|
int | None
|
Max. number of process to allow to run concurrently for the program. |
1
|
timeLimit
|
int | None
|
Time limit in milliseconds to allow the program to run. |
None
|
wallTimeLimit
|
int | None
|
Wall time limit in milliseconds to allow the program to run. |
None
|
memoryLimit
|
int | None
|
Memory limit in MiB. |
None
|
fileSizeLimit
|
int | None
|
File size limit in KiB |
None
|
stackLimit
|
int | None
|
Stack limit in MiB. |
None
|
preserveEnv
|
bool | None
|
Whether to preserve env. variables coming from the host. |
False
|
mirrorDirs
|
List[str] | None
|
Directories in the host that should be read-only exposed to the sandbox. |
[]
|
Source code in rbx/box/environment.py
ExecutionConfig
#
Bases: BaseExecutionConfig
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solutionOverrides
|
SolutionExecutionOverrides
|
Overrides to apply when executing solutions for this language. |
<dynamic>
|
Source code in rbx/box/environment.py
FileMapping
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str
|
Path where to copy the stdin file to before running the program, relative to the sandbox root. |
'stdin'
|
output
|
str
|
Path where to output the stdout file after running the program, relative to the sandbox root. |
'stdout'
|
error
|
str
|
Path where to output the stderr file after running the program, relative to the sandbox root. |
'stderr'
|
capture
|
str
|
Path where to output the capture file after running the program, relative to the sandbox root. |
'capture'
|
compilable
|
str
|
Path where to copy the compilable file to before compiling the program, relative to the sandbox root. |
'{source}'
|
executable
|
str
|
Path to where to output the executable file after compiling the program, relative to the sandbox root. |
'executable'
|
Source code in rbx/box/environment.py
LanguageGroup
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
languages
|
List[str]
|
rbx language names that share a single estimated time limit. |
required |
whenEmpty
|
LanguageGroupFallback | None
|
How to derive a TL for this group when it has no solutions. |
None
|
Source code in rbx/box/environment.py
LanguageGroupFallback
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
relativeTo
|
str | None
|
A language name whose group's estimated TL this empty group is relative to. If omitted, the multiplier is applied to the base estimate. |
None
|
multiplier
|
float
|
Slope applied to the reference TL when this group has no
solutions. The resolved TL is |
required |
increment
|
int | None
|
Constant offset (in milliseconds) added on top of the
multiplied reference TL when this group has no solutions. The resolved TL is
|
None
|
Source code in rbx/box/environment.py
LanguageTimingConfig
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wallTimeMultiplier
|
float | None
|
Overrides the environment wall-time multiplier |
None
|
wallTimeIncrement
|
int | None
|
Overrides the environment wall-time increment |
None
|
Source code in rbx/box/environment.py
LinterConfig
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the linter to run (see registry). |
required |
applies_to
|
List[AssetKind] | None
|
Asset kinds this linter applies to. None means all kinds. |
None
|
Source code in rbx/box/environment.py
SolutionCompilationOverrides
#
SolutionExecutionOverrides
#
TimingConfig
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formula
|
str
|
Formula to use to calculate the time limit for the environment. |
'step_up(max(fastest * 3, slowest * 1.5), 100)'
|
groups
|
List[LanguageGroup]
|
Groups of related languages that share an estimated time limit. |
<dynamic>
|
wallTimeMultiplier
|
float
|
Default multiplier |
2.0
|
wallTimeIncrement
|
int
|
Default increment |
0
|
Source code in rbx/box/environment.py
apply_walltime_formula(cpu_tl_ms, coeffs)
#
Applies wall = a*x + b, where x is the expanded CPU time limit (ms).
compute_walltime(cpu_tl_ms, language)
#
Computes the wall-time limit (ms) for a CPU time limit (ms) under the active environment's coefficients for the given language.
Source code in rbx/box/environment.py
get_walltime_coeffs_for_language(language)
#
Reads the active environment and resolves wall-time coefficients for the given language name (None -> environment defaults).
Source code in rbx/box/environment.py
is_interpreted(language, solution=False)
#
Whether the language runs its source directly (the compilable is the
executable) rather than producing a separate binary. This is exactly the
signal compile_item uses to take the passthrough path.
Source code in rbx/box/environment.py
language_kinds(language)
#
The set of :class:LanguageKind a language belongs to, derived from its
toolchain: the compilation commands if it compiles, else its execution command.
Deriving from the actual compiler/interpreter (not the language name) keeps
dispatch robust to custom language names.
Source code in rbx/box/environment.py
resolve_walltime_coeffs(timing, language)
#
Resolves the effective (wall_time_multiplier, wall_time_increment_ms), where a per-language override takes precedence field-by-field over the environment-level timing defaults.
Source code in rbx/box/environment.py
Extensions#
Extensions
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boca
|
BocaExtension | None
|
Environment-level extensions for BOCA packaging. |
None
|
Source code in rbx/box/extensions.py
LanguageExtensions
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boca
|
BocaLanguageExtension | None
|
Language-level extensions for BOCA packaging. |
None
|
polygon
|
PolygonLanguageExtension | None
|
Language-level extensions for Polygon packaging. |
None
|
Source code in rbx/box/extensions.py
BOCA#
BocaExtension
#
Bases: RejectsRemovedFields
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flags
|
Dict[Literal[c, cpp, cc, kt, java, py2, py3], str]
|
|
{}
|
minRunningTime
|
int | None
|
|
None
|
preferContestLetter
|
bool
|
|
False
|
usePypy
|
bool
|
|
False
|
languages
|
List[str] | None
|
|
None
|
maximumTimeError
|
float | None
|
|
None
|
Source code in rbx/box/packaging/boca/extension.py
BocaLanguageExtension
#
Bases: RejectsRemovedFields
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
languages
|
List[str] | None
|
|
None
|
template
|
str | None
|
|
None
|
bocaLanguage
|
str | None
|
|
None
|