rbx.cp 0.5.14__py3-none-any.whl → 0.5.16__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/generators.py +1 -7
- rbx/box/packaging/polygon/packager.py +2 -2
- rbx/box/schema.py +9 -9
- rbx/box/solutions.py +12 -2
- rbx/grading/judge/sandboxes/timeit.py +3 -3
- {rbx_cp-0.5.14.dist-info → rbx_cp-0.5.16.dist-info}/METADATA +1 -1
- {rbx_cp-0.5.14.dist-info → rbx_cp-0.5.16.dist-info}/RECORD +10 -10
- {rbx_cp-0.5.14.dist-info → rbx_cp-0.5.16.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.14.dist-info → rbx_cp-0.5.16.dist-info}/WHEEL +0 -0
- {rbx_cp-0.5.14.dist-info → rbx_cp-0.5.16.dist-info}/entry_points.txt +0 -0
rbx/box/generators.py
CHANGED
@@ -114,11 +114,8 @@ def generate_output_for_testcase(
|
|
114
114
|
if main_solution is None:
|
115
115
|
return
|
116
116
|
|
117
|
-
|
117
|
+
# Obey no limits when generating testcases.
|
118
118
|
sandbox = EnvironmentSandbox()
|
119
|
-
sandbox.timeLimit = timelimit * 2
|
120
|
-
sandbox.wallTimeLimit = timelimit * 2
|
121
|
-
sandbox.memoryLimit = pkg.memorylimit_for_language(main_solution.language)
|
122
119
|
sandbox.fileSizeLimit = pkg.outputLimit
|
123
120
|
extra_config = ExecutionConfig(sandbox=sandbox)
|
124
121
|
|
@@ -146,9 +143,6 @@ def generate_output_for_testcase(
|
|
146
143
|
if run_log is not None:
|
147
144
|
console.console.print(f'[error]Summary:[/error] {run_log.get_summary()}')
|
148
145
|
checker_result = checkers.check_with_no_output(run_log)
|
149
|
-
console.console.print(
|
150
|
-
f'[warning]Time: [item]{run_log.time:.2f}s[/item][/warning]',
|
151
|
-
)
|
152
146
|
console.console.print(
|
153
147
|
f'[warning]Verdict: [item]{checker_result.outcome.value}[/item][/warning]',
|
154
148
|
)
|
@@ -106,8 +106,8 @@ class PolygonPackager(BasePackager):
|
|
106
106
|
|
107
107
|
return polygon_schema.Testset(
|
108
108
|
name='tests',
|
109
|
-
timelimit=pkg.
|
110
|
-
memorylimit=pkg.
|
109
|
+
timelimit=pkg.timelimit_for_language(None),
|
110
|
+
memorylimit=pkg.memorylimit_for_language(None) * 1024 * 1024,
|
111
111
|
size=len(testcases),
|
112
112
|
inputPattern='tests/%03d',
|
113
113
|
answerPattern='tests/%03d.a',
|
rbx/box/schema.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
+
import os
|
3
4
|
import pathlib
|
4
5
|
from typing import Dict, List, Optional, Union
|
5
6
|
|
@@ -350,15 +351,14 @@ that is correct and used as reference -- and should have the `accepted` outcome.
|
|
350
351
|
|
351
352
|
def timelimit_for_language(self, language: Optional[str]) -> int:
|
352
353
|
res = self.timeLimit
|
353
|
-
if language is None:
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
return int(res * float(modifier.timeMultiplier))
|
354
|
+
if language is not None and language in self.modifiers:
|
355
|
+
modifier = self.modifiers[language]
|
356
|
+
if modifier.time is not None:
|
357
|
+
res = modifier.time
|
358
|
+
if modifier.timeMultiplier is not None:
|
359
|
+
res = int(res * float(modifier.timeMultiplier))
|
360
|
+
if 'RBX_TIME_MULTIPLIER' in os.environ:
|
361
|
+
res = int(res * float(os.environ['RBX_TIME_MULTIPLIER']))
|
362
362
|
return res
|
363
363
|
|
364
364
|
def memorylimit_for_language(self, language: Optional[str]) -> int:
|
rbx/box/solutions.py
CHANGED
@@ -491,14 +491,24 @@ def _get_evals_memory_in_mb(evals: List[Evaluation]) -> int:
|
|
491
491
|
return max(int(eval.log.memory or 0) // (1024 * 1024) for eval in evals)
|
492
492
|
|
493
493
|
|
494
|
+
def _get_evals_memory_in_bytes(evals: List[Evaluation]) -> int:
|
495
|
+
if not evals:
|
496
|
+
return 0
|
497
|
+
return max(int(eval.log.memory or 0) for eval in evals)
|
498
|
+
|
499
|
+
|
494
500
|
def get_evals_formatted_time(evals: List[Evaluation]) -> str:
|
495
501
|
max_time = _get_evals_time_in_ms(evals)
|
496
502
|
return f'{max_time} ms'
|
497
503
|
|
498
504
|
|
499
505
|
def get_evals_formatted_memory(evals: List[Evaluation]) -> str:
|
500
|
-
max_memory =
|
501
|
-
|
506
|
+
max_memory = _get_evals_memory_in_bytes(evals)
|
507
|
+
if max_memory < 1024 * 1024:
|
508
|
+
if max_memory < 1024:
|
509
|
+
return f'{max_memory} B'
|
510
|
+
return f'{max_memory // 1024} KiB'
|
511
|
+
return f'{max_memory // (1024 * 1024)} MiB'
|
502
512
|
|
503
513
|
|
504
514
|
def _print_solution_outcome(
|
@@ -5,7 +5,6 @@ import resource
|
|
5
5
|
import signal
|
6
6
|
import stat
|
7
7
|
import sys
|
8
|
-
from math import ceil
|
9
8
|
from time import monotonic
|
10
9
|
from typing import List, Optional
|
11
10
|
|
@@ -58,8 +57,9 @@ def parse_opts() -> Options:
|
|
58
57
|
|
59
58
|
|
60
59
|
def get_memory_usage(ru: resource.struct_rusage) -> int:
|
61
|
-
|
62
|
-
|
60
|
+
if sys.platform == 'darwin':
|
61
|
+
return ru.ru_maxrss // 1024 + ru.ru_ixrss
|
62
|
+
return ru.ru_maxrss + ru.ru_ixrss + ru.ru_idrss + ru.ru_isrss
|
63
63
|
|
64
64
|
|
65
65
|
def get_cpu_time(ru: resource.struct_rusage) -> float:
|
@@ -19,7 +19,7 @@ rbx/box/creation.py,sha256=mVHVVj8ozX9D5qpkLewE5WSjF6HtTm74Pkwubk-bATg,2259
|
|
19
19
|
rbx/box/download.py,sha256=MFP-R26JiYGAP89I0TK-0fYc69Fsd20tsBqgtRCy5AE,2234
|
20
20
|
rbx/box/environment.py,sha256=GjwnJwtkTdkHmUh1b23zagjLsTiJQAOpP36A93mA-zc,11159
|
21
21
|
rbx/box/extensions.py,sha256=p0iLaU28KswOBDX2HGVO_dR2gk-JSAWb6sXC6GZ1d0w,738
|
22
|
-
rbx/box/generators.py,sha256=
|
22
|
+
rbx/box/generators.py,sha256=e-kXtx8rFsvuHmW7bMsKiE6MOtwQosYgO5clZ624Vig,15997
|
23
23
|
rbx/box/generators_test.py,sha256=mQqHepAMYa6zV_PseQALI0nIX6AdQktt6lh94muFhNw,1758
|
24
24
|
rbx/box/main.py,sha256=id1YpYKb7GHWoEMdiRAwfT08kY-ol52ulGcaCaPhtqw,16411
|
25
25
|
rbx/box/package.py,sha256=Hds0WIvhAWXnYOmIXGULcLLVeFM1YkllOPSKHB5QSkk,10532
|
@@ -28,15 +28,15 @@ rbx/box/packaging/boca/packager.py,sha256=FOhSRg5K5Y4qNB0WyTR3DKgrpObf9I0JbyGpJH
|
|
28
28
|
rbx/box/packaging/contest_main.py,sha256=ypiBS8dd0yCqoFJIqiK1Fo02dQmUB_G-Z7G926jomrk,2746
|
29
29
|
rbx/box/packaging/main.py,sha256=CyjfuvwmRsJGk4lKVp2LT_WCQ5jZ5L_7NfZQEC40nuY,2228
|
30
30
|
rbx/box/packaging/packager.py,sha256=suCT_SLnWa915rV2j8VFqzH43HGKRTr9mGGlrvj45aw,3267
|
31
|
-
rbx/box/packaging/polygon/packager.py,sha256=
|
31
|
+
rbx/box/packaging/polygon/packager.py,sha256=HNpxP2nclLChSnrQtkT7tLwDdXHl1dzXMIF5RZwr9M4,10811
|
32
32
|
rbx/box/packaging/polygon/test.py,sha256=bgEju5PwudgyfwxXJagm8fM6CJVlWM6l_-2q1V-oKaQ,3069
|
33
33
|
rbx/box/packaging/polygon/xml_schema.py,sha256=-r24bCeRMGLrGGoT9FIgmqr87xHL-JzrFaR6bztbYtw,2703
|
34
34
|
rbx/box/presets/__init__.py,sha256=Wiegp1onXPaZs8RE1J3PKT5j3PFWKw2U2rkgOSbnYeM,17529
|
35
35
|
rbx/box/presets/fetch.py,sha256=F-BCOlvEBEyDqtOhiDuGPn4EDtA4Bwm-fqHJ7zZGlW8,1975
|
36
36
|
rbx/box/presets/lock_schema.py,sha256=6sRPnyePOC8yy-5WcD5JRZdDJHf8loqbvpQ1IPiOU9s,349
|
37
37
|
rbx/box/presets/schema.py,sha256=mZmSPkQsw7eQM0lQN6er1MO_LiW1ObwwAZFDK0F5fxE,1962
|
38
|
-
rbx/box/schema.py,sha256=
|
39
|
-
rbx/box/solutions.py,sha256=
|
38
|
+
rbx/box/schema.py,sha256=J6gUkVO1o2zT9UO1008N0CqMomdAyfmyXbB8LP-PFW0,12672
|
39
|
+
rbx/box/solutions.py,sha256=uO8mg0AbcG1doVQVoDJp1UMUJithFnkSxroUygRduos,27771
|
40
40
|
rbx/box/solutions_test.py,sha256=DetQj7ZVnV3tBXBpCrFeK_Yv3XUtdEf29y_6qnyeyfY,1496
|
41
41
|
rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
42
42
|
rbx/box/statements/build_statements.py,sha256=24ZUM5H33NhmqnDL0ofA1anUKWxuZG1paA1tCV4AKns,11911
|
@@ -74,7 +74,7 @@ rbx/grading/judge/sandbox.py,sha256=0h3YCmGabf9OfORJgx6v2Bed4kE-i8FyuZkPux-sDVk,
|
|
74
74
|
rbx/grading/judge/sandboxes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
rbx/grading/judge/sandboxes/isolate.py,sha256=9xgBuNfAvGtO2zME1FXRah2rcPvzDShsPG0TTuX_UDU,25649
|
76
76
|
rbx/grading/judge/sandboxes/stupid_sandbox.py,sha256=Gpu1I-VroS_NUSRUotZ72IFRaH8yxjp9860WiTkOvFw,10090
|
77
|
-
rbx/grading/judge/sandboxes/timeit.py,sha256=
|
77
|
+
rbx/grading/judge/sandboxes/timeit.py,sha256=Ct3pxY2Uawaz4O3xIufD49DSTZnbTOhYIch1QcHLVdY,6558
|
78
78
|
rbx/grading/judge/storage.py,sha256=FirqjwDqb0m0h2OTFyWrZL7CQ4XjZNxhqB4JpnDIhZY,9485
|
79
79
|
rbx/grading/judge/test.py,sha256=ll0Iw7zyOpGdKPD_PGH7dvUkb4stQLu-ikbQnqJvuAc,944
|
80
80
|
rbx/grading/judge/testiso.py,sha256=v14DtkWiZFJ9AKMzrb0_vZKPWDt8jz8iIw1Z2O-Advk,1397
|
@@ -157,8 +157,8 @@ rbx/testdata/caching/executable.py,sha256=WKRHNf_fprFJd1Fq1ubmQtR3mZzTYVNwKPLWuZ
|
|
157
157
|
rbx/testdata/compatible,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
158
|
rbx/testing_utils.py,sha256=ZZLKMUHlZ4HwsuNY50jqSBJ9HhpnFdba7opjDsvXE1U,2084
|
159
159
|
rbx/utils.py,sha256=wy8zQRb97n3lptilK7UxM4A44KjXb1W5Z1tD61a-K4A,4173
|
160
|
-
rbx_cp-0.5.
|
161
|
-
rbx_cp-0.5.
|
162
|
-
rbx_cp-0.5.
|
163
|
-
rbx_cp-0.5.
|
164
|
-
rbx_cp-0.5.
|
160
|
+
rbx_cp-0.5.16.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
161
|
+
rbx_cp-0.5.16.dist-info/METADATA,sha256=0aYK6Ake0EcUtZVVdXVY6IUIV9F76Jj_wM9yi2h_xz8,3249
|
162
|
+
rbx_cp-0.5.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
163
|
+
rbx_cp-0.5.16.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
|
164
|
+
rbx_cp-0.5.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|