rbx.cp 0.5.58__py3-none-any.whl → 0.5.60__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rbx/box/checkers.py +13 -7
- rbx/box/code.py +1 -0
- rbx/box/environment.py +9 -0
- rbx/box/schema.py +0 -16
- rbx/box/solutions.py +9 -5
- rbx/box/tasks.py +3 -2
- rbx/grading/limits.py +26 -0
- rbx/grading/steps.py +3 -1
- {rbx_cp-0.5.58.dist-info → rbx_cp-0.5.60.dist-info}/METADATA +1 -1
- {rbx_cp-0.5.58.dist-info → rbx_cp-0.5.60.dist-info}/RECORD +13 -12
- {rbx_cp-0.5.58.dist-info → rbx_cp-0.5.60.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.58.dist-info → rbx_cp-0.5.60.dist-info}/WHEEL +0 -0
- {rbx_cp-0.5.58.dist-info → rbx_cp-0.5.60.dist-info}/entry_points.txt +0 -0
rbx/box/checkers.py
CHANGED
@@ -60,8 +60,6 @@ def _any_failed(logs: List[Optional[RunLog]]) -> bool:
|
|
60
60
|
|
61
61
|
|
62
62
|
def _check_pre_output(run_log: Optional[RunLog]) -> CheckerResult:
|
63
|
-
pkg = package.find_problem_package_or_die()
|
64
|
-
|
65
63
|
is_sanitized = (
|
66
64
|
run_log is not None
|
67
65
|
and run_log.metadata is not None
|
@@ -71,7 +69,11 @@ def _check_pre_output(run_log: Optional[RunLog]) -> CheckerResult:
|
|
71
69
|
if run_log is None:
|
72
70
|
return CheckerResult(outcome=Outcome.INTERNAL_ERROR)
|
73
71
|
|
74
|
-
timelimit =
|
72
|
+
timelimit = (
|
73
|
+
run_log.metadata.limits.get_expanded_tl()
|
74
|
+
if run_log.metadata is not None
|
75
|
+
else None
|
76
|
+
)
|
75
77
|
is_tl_unbounded = (
|
76
78
|
run_log is not None
|
77
79
|
and run_log.metadata is not None
|
@@ -81,7 +83,7 @@ def _check_pre_output(run_log: Optional[RunLog]) -> CheckerResult:
|
|
81
83
|
if (
|
82
84
|
run_log.time is not None
|
83
85
|
and timelimit is not None
|
84
|
-
and run_log.time * 1000 > timelimit
|
86
|
+
and run_log.time * 1000 > timelimit
|
85
87
|
and not is_sanitized
|
86
88
|
and not is_tl_unbounded
|
87
89
|
):
|
@@ -104,12 +106,16 @@ def _convert_tle(result: CheckerResult, run_log: Optional[RunLog]) -> CheckerRes
|
|
104
106
|
if result.outcome == Outcome.TIME_LIMIT_EXCEEDED:
|
105
107
|
# This already is a TLE outcome.
|
106
108
|
return result
|
107
|
-
pkg = package.find_problem_package_or_die()
|
108
109
|
is_sanitized = (
|
109
110
|
run_log is not None
|
110
111
|
and run_log.metadata is not None
|
111
112
|
and run_log.metadata.is_sanitized
|
112
113
|
)
|
114
|
+
timelimit = (
|
115
|
+
run_log.metadata.limits.time
|
116
|
+
if run_log is not None and run_log.metadata is not None
|
117
|
+
else None
|
118
|
+
)
|
113
119
|
is_tl_unbounded = (
|
114
120
|
run_log is not None
|
115
121
|
and run_log.metadata is not None
|
@@ -118,8 +124,8 @@ def _convert_tle(result: CheckerResult, run_log: Optional[RunLog]) -> CheckerRes
|
|
118
124
|
if (
|
119
125
|
run_log is not None
|
120
126
|
and run_log.time is not None
|
121
|
-
and
|
122
|
-
|
127
|
+
and timelimit is not None
|
128
|
+
and run_log.time * 1000 >= timelimit
|
123
129
|
and not is_sanitized
|
124
130
|
and not is_tl_unbounded
|
125
131
|
):
|
rbx/box/code.py
CHANGED
rbx/box/environment.py
CHANGED
@@ -11,6 +11,7 @@ from rbx.box.extensions import Extensions, LanguageExtensions
|
|
11
11
|
from rbx.grading.judge.sandbox import SandboxBase, SandboxParams
|
12
12
|
from rbx.grading.judge.sandboxes.isolate import IsolateSandbox
|
13
13
|
from rbx.grading.judge.sandboxes.stupid_sandbox import StupidSandbox
|
14
|
+
from rbx.grading.limits import Limits
|
14
15
|
|
15
16
|
T = TypeVar('T', bound=BaseModel)
|
16
17
|
|
@@ -104,6 +105,9 @@ class ExecutionConfig(BaseModel):
|
|
104
105
|
# Sandbox configuration to use when executing for this language.
|
105
106
|
sandbox: Optional[EnvironmentSandbox] = None
|
106
107
|
|
108
|
+
# Original limits of the problem.
|
109
|
+
problemLimits: Limits = Field(default_factory=Limits)
|
110
|
+
|
107
111
|
|
108
112
|
class EnvironmentLanguage(BaseModel):
|
109
113
|
model_config = ConfigDict(extra='forbid')
|
@@ -280,6 +284,7 @@ def merge_execution_configs(
|
|
280
284
|
) -> ExecutionConfig:
|
281
285
|
merged_cfg = ExecutionConfig()
|
282
286
|
merged_cfg.sandbox = EnvironmentSandbox()
|
287
|
+
merged_cfg.problemLimits = Limits()
|
283
288
|
for cfg in execution_configs:
|
284
289
|
if cfg is None:
|
285
290
|
continue
|
@@ -288,6 +293,10 @@ def merge_execution_configs(
|
|
288
293
|
merged_cfg.sandbox = _merge_shallow_models(
|
289
294
|
EnvironmentSandbox, merged_cfg.sandbox, cfg.sandbox
|
290
295
|
)
|
296
|
+
if cfg.problemLimits is not None:
|
297
|
+
merged_cfg.problemLimits = _merge_shallow_models(
|
298
|
+
Limits, merged_cfg.problemLimits, cfg.problemLimits
|
299
|
+
)
|
291
300
|
return merged_cfg
|
292
301
|
|
293
302
|
|
rbx/box/schema.py
CHANGED
@@ -325,22 +325,6 @@ class Stress(BaseModel):
|
|
325
325
|
)
|
326
326
|
|
327
327
|
|
328
|
-
class Limits(BaseModel):
|
329
|
-
time: Optional[int] = Field(
|
330
|
-
default=None, description='Value to override time limit with, in milliseconds.'
|
331
|
-
)
|
332
|
-
memory: Optional[int] = Field(
|
333
|
-
default=None, description='Value to override memory limit with, in MB.'
|
334
|
-
)
|
335
|
-
output: Optional[int] = Field(
|
336
|
-
default=None, description='Value to override output limit with, in KB.'
|
337
|
-
)
|
338
|
-
|
339
|
-
isDoubleTL: bool = Field(
|
340
|
-
default=False, description='Whether to use double TL for this language.'
|
341
|
-
)
|
342
|
-
|
343
|
-
|
344
328
|
class LimitModifiers(BaseModel):
|
345
329
|
timeMultiplier: Optional[float] = Field(
|
346
330
|
default=None, description='Multiplier for time limit.'
|
rbx/box/solutions.py
CHANGED
@@ -36,7 +36,6 @@ from rbx.box.generators import (
|
|
36
36
|
from rbx.box.schema import (
|
37
37
|
ExpectedOutcome,
|
38
38
|
GeneratorCall,
|
39
|
-
Limits,
|
40
39
|
Solution,
|
41
40
|
TaskType,
|
42
41
|
Testcase,
|
@@ -53,6 +52,7 @@ from rbx.box.testcase_utils import (
|
|
53
52
|
parse_interaction,
|
54
53
|
print_interaction,
|
55
54
|
)
|
55
|
+
from rbx.grading.limits import Limits
|
56
56
|
from rbx.grading.steps import (
|
57
57
|
Evaluation,
|
58
58
|
Outcome,
|
@@ -736,10 +736,12 @@ def get_capped_evals_formatted_time(
|
|
736
736
|
max_time = _get_evals_time_in_ms(evals)
|
737
737
|
has_tle = any(eval.result.outcome == Outcome.TIME_LIMIT_EXCEEDED for eval in evals)
|
738
738
|
timelimits = [
|
739
|
-
eval.log.metadata.
|
739
|
+
eval.log.metadata.limits.get_expanded_tl()
|
740
740
|
for eval in evals
|
741
|
-
if eval.log.metadata is not None
|
741
|
+
if eval.log.metadata is not None
|
742
742
|
]
|
743
|
+
timelimits = [tl for tl in timelimits if tl is not None]
|
744
|
+
|
743
745
|
tl = None
|
744
746
|
if timelimits:
|
745
747
|
tl = min(timelimits)
|
@@ -954,10 +956,12 @@ async def _print_timing(
|
|
954
956
|
# Get solution TL.
|
955
957
|
solution_time = _get_evals_time_in_ms(all_evals)
|
956
958
|
solution_tls = [
|
957
|
-
eval.log.metadata.
|
959
|
+
eval.log.metadata.limits.get_expanded_tl()
|
958
960
|
for eval in all_evals
|
959
|
-
if eval.log.metadata is not None
|
961
|
+
if eval.log.metadata is not None
|
960
962
|
]
|
963
|
+
solution_tls = [tl for tl in solution_tls if tl is not None]
|
964
|
+
|
961
965
|
solution_tl = 0
|
962
966
|
if solution_tls:
|
963
967
|
solution_tl = min(solution_tls)
|
rbx/box/tasks.py
CHANGED
@@ -5,8 +5,9 @@ from rbx.box import checkers, package, state
|
|
5
5
|
from rbx.box.code import CommunicationItem, run_communication, run_item
|
6
6
|
from rbx.box.environment import EnvironmentSandbox, ExecutionConfig, VerificationLevel
|
7
7
|
from rbx.box.retries import Retrier
|
8
|
-
from rbx.box.schema import
|
8
|
+
from rbx.box.schema import Solution, Testcase
|
9
9
|
from rbx.grading.judge.sandbox import SandboxBase
|
10
|
+
from rbx.grading.limits import Limits
|
10
11
|
from rbx.grading.steps import (
|
11
12
|
DigestOrDest,
|
12
13
|
DigestOrSource,
|
@@ -146,7 +147,7 @@ def _get_execution_config(
|
|
146
147
|
sandbox.wallTimeLimit = sandbox.timeLimit * 2
|
147
148
|
sandbox.memoryLimit = limits.memory
|
148
149
|
sandbox.fileSizeLimit = limits.output
|
149
|
-
return ExecutionConfig(sandbox=sandbox)
|
150
|
+
return ExecutionConfig(sandbox=sandbox, problemLimits=limits)
|
150
151
|
|
151
152
|
|
152
153
|
async def _run_communication_solution_on_testcase(
|
rbx/grading/limits.py
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
|
3
|
+
from pydantic import BaseModel, Field
|
4
|
+
|
5
|
+
|
6
|
+
class Limits(BaseModel):
|
7
|
+
time: Optional[int] = Field(
|
8
|
+
default=None, description='Value to override time limit with, in milliseconds.'
|
9
|
+
)
|
10
|
+
memory: Optional[int] = Field(
|
11
|
+
default=None, description='Value to override memory limit with, in MB.'
|
12
|
+
)
|
13
|
+
output: Optional[int] = Field(
|
14
|
+
default=None, description='Value to override output limit with, in KB.'
|
15
|
+
)
|
16
|
+
|
17
|
+
isDoubleTL: bool = Field(
|
18
|
+
default=False, description='Whether to use double TL for this language.'
|
19
|
+
)
|
20
|
+
|
21
|
+
def get_expanded_tl(self) -> Optional[int]:
|
22
|
+
if self.time is None:
|
23
|
+
return None
|
24
|
+
if self.isDoubleTL:
|
25
|
+
return self.time * 2
|
26
|
+
return self.time
|
rbx/grading/steps.py
CHANGED
@@ -15,7 +15,7 @@ from enum import Enum
|
|
15
15
|
from typing import IO, Any, Dict, Iterable, List, Optional, Tuple, Union
|
16
16
|
|
17
17
|
import typer
|
18
|
-
from pydantic import BaseModel
|
18
|
+
from pydantic import BaseModel, Field
|
19
19
|
from rich.text import Text
|
20
20
|
|
21
21
|
from rbx import utils
|
@@ -24,6 +24,7 @@ from rbx.console import console
|
|
24
24
|
from rbx.grading import processing_context
|
25
25
|
from rbx.grading.judge.sandbox import SandboxBase, SandboxParams
|
26
26
|
from rbx.grading.judge.storage import Storage, copyfileobj
|
27
|
+
from rbx.grading.limits import Limits
|
27
28
|
|
28
29
|
MAX_STDOUT_LEN = 1024 * 1024 * 128 # 128 MB
|
29
30
|
|
@@ -188,6 +189,7 @@ class TestcaseIO(BaseModel):
|
|
188
189
|
class RunLogMetadata(BaseModel):
|
189
190
|
language: Optional[str] = None
|
190
191
|
is_sanitized: bool = False
|
192
|
+
limits: Limits = Field(default_factory=Limits)
|
191
193
|
timeLimit: Optional[int] = None
|
192
194
|
memoryLimit: Optional[int] = None
|
193
195
|
retryIndex: Optional[int] = None
|
@@ -4,9 +4,9 @@ rbx/autoenum.py,sha256=cusv8ClXRlDVvhZ8eDrtYcL_2peXlHugAey_ht8roXk,12025
|
|
4
4
|
rbx/box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
rbx/box/builder.py,sha256=MDm2qqmhedAbhn3rWP6cDwbBsGhV6sz_2sg1zLkPDw0,3613
|
6
6
|
rbx/box/cd.py,sha256=9a_SOnzoJBXxxffp4Wbf3UKXIwKuN3Hvj7K6SocALwE,1194
|
7
|
-
rbx/box/checkers.py,sha256=
|
7
|
+
rbx/box/checkers.py,sha256=aGciafGNQ39UqndTEJRT3J8ngv_UigYxOT30yMzCwEI,12752
|
8
8
|
rbx/box/cli.py,sha256=QnErJWp6OmBX5iC3tsjeOTHqX58tTpBFQRun9Y9a5UA,26892
|
9
|
-
rbx/box/code.py,sha256=
|
9
|
+
rbx/box/code.py,sha256=PJJyw00iT9G7I9yyCWLOUY9R280qyE4YyMTxBZ38IcI,18900
|
10
10
|
rbx/box/compile.py,sha256=OJLthDQ921w9vyoE6Gk1Df54i5RwtRJ2YG-8XEfefcs,2489
|
11
11
|
rbx/box/conftest.py,sha256=sEmciXSeDC-wmrZ1JSxbsUenKNP_VWW32mrCun2pY3I,1070
|
12
12
|
rbx/box/contest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -20,7 +20,7 @@ rbx/box/creation.py,sha256=Evz7K6JoarD-4JJQsZsgoxU9FgCF9Z7-LfuroG4Cqls,2444
|
|
20
20
|
rbx/box/deferred.py,sha256=II3X9e87JCOZtmspnHh-n4PFqh-FsH_oc0XJHZ9ZYVQ,691
|
21
21
|
rbx/box/download.py,sha256=DxAiAk4lDYWEz1C9UTvZzHTq6hgm4fxGezApm2IkCTM,2601
|
22
22
|
rbx/box/dump_schemas.py,sha256=3j5t47_vJmXj0BCczxDX6ByOcsfolGEDNCBXlPpk86w,593
|
23
|
-
rbx/box/environment.py,sha256=
|
23
|
+
rbx/box/environment.py,sha256=Kp69MekUwwoVpupnafUcN5KAbP-ZTCwe0OQXt1h0FN8,11859
|
24
24
|
rbx/box/extensions.py,sha256=Von8kIeXvNFTkGlMRMTvL2HIHPwlkuiMswr-ydbGV1w,519
|
25
25
|
rbx/box/formatting.py,sha256=3phFRHzqVXj4Ok1yDhCq6Clbw6KlqwJNpMhs--oTWFI,405
|
26
26
|
rbx/box/generators.py,sha256=RE0-D91BB-3rNDQXvCFWzU9iMhKIc_ALp960oGfM-rY,13780
|
@@ -49,9 +49,9 @@ rbx/box/presets/lock_schema.py,sha256=6sRPnyePOC8yy-5WcD5JRZdDJHf8loqbvpQ1IPiOU9
|
|
49
49
|
rbx/box/presets/schema.py,sha256=mZmSPkQsw7eQM0lQN6er1MO_LiW1ObwwAZFDK0F5fxE,1962
|
50
50
|
rbx/box/retries.py,sha256=tRk2K1bXw2xnwkAj2CsktRHTEhw7YKcPxMQTT6mCy-E,4707
|
51
51
|
rbx/box/sanitizers/warning_stack.py,sha256=RI97_GJgdjTKIXY_r0EKp5h0qQQSDSdNDh5K7zINrqs,2861
|
52
|
-
rbx/box/schema.py,sha256=
|
52
|
+
rbx/box/schema.py,sha256=y736-wZdGw56T6eDC_m7NAm2XRUdauBXJRQkQO79fpc,16264
|
53
53
|
rbx/box/setter_config.py,sha256=s53talhwM6FTGDCcBhY7IlZ6_6mJ3PMp6V4kTtaSs50,4262
|
54
|
-
rbx/box/solutions.py,sha256=
|
54
|
+
rbx/box/solutions.py,sha256=P5DTKsVMBYL_-gv-F1jt6aap1Y1hy2CcVUGT23qPpmk,45170
|
55
55
|
rbx/box/solutions_test.py,sha256=TCowbxBG3SvDlFO5-qtBj_M_HrAHe0IJaI1XwoQ1d00,1718
|
56
56
|
rbx/box/state.py,sha256=MMf3DvfQji0jKEliCHct2Tpp_0epL1tvP8HbHNArQIc,166
|
57
57
|
rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -65,7 +65,7 @@ rbx/box/stresses.py,sha256=k-m8Q2IVd5dap2fSDCbVqLj2LKqXzz6rIR8j9F8sLhY,12310
|
|
65
65
|
rbx/box/stressing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
66
|
rbx/box/stressing/finder_parser.py,sha256=jXpYNa4FyugzmHi3r96Uv4rU1krRQJc5Ihr9jf1cvNo,11918
|
67
67
|
rbx/box/stressing/generator_parser.py,sha256=oHZryjR3YohgaSO9WEirQ7b2e-98WgZStF0N99W4Thw,7380
|
68
|
-
rbx/box/tasks.py,sha256=
|
68
|
+
rbx/box/tasks.py,sha256=v05vJsOg6bVfV3sY7JNAfXVyJVGteUXrgDhCXzMO_2c,10195
|
69
69
|
rbx/box/testcase_extractors.py,sha256=J43eG7vpxc5nP_2yhrXJODkd4EYlV4WiYVbM6hzipY4,11944
|
70
70
|
rbx/box/testcase_utils.py,sha256=31rvCpLi681R6Xm1WpG8HPDOkTtF0bRWa8IsmdWGLCk,7556
|
71
71
|
rbx/box/testcases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -106,8 +106,9 @@ rbx/grading/judge/sandboxes/timeit.py,sha256=0qs3RD2LmFMg0wolGPSl5sg8HRMHsnZEgUE
|
|
106
106
|
rbx/grading/judge/storage.py,sha256=3vv0HvtenbUZBH33CB5ZzX66ppL22G6munBaAA9BgwQ,9418
|
107
107
|
rbx/grading/judge/test.py,sha256=ll0Iw7zyOpGdKPD_PGH7dvUkb4stQLu-ikbQnqJvuAc,944
|
108
108
|
rbx/grading/judge/testiso.py,sha256=v14DtkWiZFJ9AKMzrb0_vZKPWDt8jz8iIw1Z2O-Advk,1397
|
109
|
+
rbx/grading/limits.py,sha256=ev312UTOo8S4-3AAVibQdXZclWCxS96CdbZxqW4y1kE,770
|
109
110
|
rbx/grading/processing_context.py,sha256=EOxsRTKB_JEgcKNodDWPIYaBramANU-6QnDkqdF8tEk,2556
|
110
|
-
rbx/grading/steps.py,sha256=
|
111
|
+
rbx/grading/steps.py,sha256=qt-ozgLpWpu5dFZGr5HlbfdStqbfFDXj6gpoSlXdxp0,27259
|
111
112
|
rbx/grading/steps_with_caching.py,sha256=nez2YwgauGXKRjhk6tQxTDGQ-HEk7KfZOeAPhsxi5iw,3150
|
112
113
|
rbx/grading/steps_with_caching_run_test.py,sha256=mh4DRInrOGhnQFWD1SlcjDm_HvcSDFTDMSpAlG-Q5SI,15570
|
113
114
|
rbx/grading_utils.py,sha256=lL2KtSkOsMElqrRoApQTbFcqVOeHVWUDTMCa3IsLpC4,4484
|
@@ -201,8 +202,8 @@ rbx/testcase.py,sha256=yKOq3CAJZ1YTmInvnoIs0u1iJnRj_X85XiWbLI-p9d8,1951
|
|
201
202
|
rbx/testcase_rendering.py,sha256=nfmv6dSEqd4aR3TsaODwkKGK6AXty_DDKtWf_ejiQpI,2084
|
202
203
|
rbx/testing_utils.py,sha256=x_PqD8Zd2PkN91NxVHUnSTs044-1WK5KKtttKQBXpFs,2083
|
203
204
|
rbx/utils.py,sha256=SfR844_i0ebRDMkmS_w1YdZiWPc6h2RGADygewlWRbA,4845
|
204
|
-
rbx_cp-0.5.
|
205
|
-
rbx_cp-0.5.
|
206
|
-
rbx_cp-0.5.
|
207
|
-
rbx_cp-0.5.
|
208
|
-
rbx_cp-0.5.
|
205
|
+
rbx_cp-0.5.60.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
206
|
+
rbx_cp-0.5.60.dist-info/METADATA,sha256=g9YRO-uCwylD64Cq_6H6LLfzA_DDb232QKjkEFtR1b0,3604
|
207
|
+
rbx_cp-0.5.60.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
208
|
+
rbx_cp-0.5.60.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
|
209
|
+
rbx_cp-0.5.60.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|