rbx.cp 0.5.18__py3-none-any.whl → 0.5.19__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/builder.py +1 -1
- rbx/box/main.py +2 -2
- rbx/box/solutions.py +47 -11
- rbx/grading/steps.py +10 -8
- {rbx_cp-0.5.18.dist-info → rbx_cp-0.5.19.dist-info}/METADATA +1 -1
- {rbx_cp-0.5.18.dist-info → rbx_cp-0.5.19.dist-info}/RECORD +9 -9
- {rbx_cp-0.5.18.dist-info → rbx_cp-0.5.19.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.18.dist-info → rbx_cp-0.5.19.dist-info}/WHEEL +0 -0
- {rbx_cp-0.5.18.dist-info → rbx_cp-0.5.19.dist-info}/entry_points.txt +0 -0
rbx/box/builder.py
CHANGED
rbx/box/main.py
CHANGED
@@ -215,7 +215,7 @@ def run(
|
|
215
215
|
print_run_report(
|
216
216
|
solution_result,
|
217
217
|
console.console,
|
218
|
-
verification,
|
218
|
+
VerificationLevel(verification),
|
219
219
|
detailed=detailed,
|
220
220
|
)
|
221
221
|
)
|
@@ -250,7 +250,7 @@ def _time_impl(check: bool, detailed: bool) -> Optional[int]:
|
|
250
250
|
print_run_report(
|
251
251
|
solution_result,
|
252
252
|
console.console,
|
253
|
-
verification,
|
253
|
+
VerificationLevel(verification),
|
254
254
|
detailed=detailed,
|
255
255
|
)
|
256
256
|
)
|
rbx/box/solutions.py
CHANGED
@@ -13,7 +13,7 @@ import rich.table
|
|
13
13
|
from pydantic import BaseModel
|
14
14
|
|
15
15
|
from rbx import console
|
16
|
-
from rbx.box import checkers,
|
16
|
+
from rbx.box import checkers, package
|
17
17
|
from rbx.box.code import SanitizationLevel, compile_item, find_language_name, run_item
|
18
18
|
from rbx.box.deferred import Deferred
|
19
19
|
from rbx.box.environment import EnvironmentSandbox, ExecutionConfig, VerificationLevel
|
@@ -539,6 +539,24 @@ def get_evals_formatted_time(evals: List[Evaluation]) -> str:
|
|
539
539
|
return f'{max_time} ms'
|
540
540
|
|
541
541
|
|
542
|
+
def get_capped_evals_formatted_time(
|
543
|
+
solution: Solution, evals: List[Evaluation], verification: VerificationLevel
|
544
|
+
) -> str:
|
545
|
+
pkg = package.find_problem_package_or_die()
|
546
|
+
|
547
|
+
max_time = _get_evals_time_in_ms(evals)
|
548
|
+
has_tle = any(eval.result.outcome == Outcome.TIME_LIMIT_EXCEEDED for eval in evals)
|
549
|
+
tl = pkg.timelimit_for_language(solution.language)
|
550
|
+
|
551
|
+
if verification.value >= VerificationLevel.FULL.value:
|
552
|
+
# Using double TL for verification.
|
553
|
+
tl = tl * 2
|
554
|
+
|
555
|
+
if has_tle and max_time > tl:
|
556
|
+
return f'>{tl} ms'
|
557
|
+
return f'{max_time} ms'
|
558
|
+
|
559
|
+
|
542
560
|
def get_evals_formatted_memory(evals: List[Evaluation]) -> str:
|
543
561
|
max_memory = _get_evals_memory_in_bytes(evals)
|
544
562
|
if max_memory < 1024 * 1024:
|
@@ -631,7 +649,9 @@ def _print_solution_outcome(
|
|
631
649
|
'[warning]WARNING[/warning] The solution had sanitizer errors or warnings, marked with [warning]*[/warning]. See their stderr for more details.'
|
632
650
|
)
|
633
651
|
|
634
|
-
console.print(
|
652
|
+
console.print(
|
653
|
+
f'Time: {get_capped_evals_formatted_time(solution, evals, verification)}'
|
654
|
+
)
|
635
655
|
console.print(f'Memory: {get_evals_formatted_memory(evals)}')
|
636
656
|
return len(unmatched_bad_verdicts) == 0
|
637
657
|
|
@@ -698,6 +718,7 @@ async def _render_detailed_group_table(
|
|
698
718
|
skeleton: SolutionReportSkeleton,
|
699
719
|
structured_evaluations: StructuredEvaluation,
|
700
720
|
console: rich.console.Console,
|
721
|
+
verification: VerificationLevel = VerificationLevel.NONE,
|
701
722
|
):
|
702
723
|
group_skeleton = skeleton.find_group_skeleton(group.name)
|
703
724
|
assert group_skeleton is not None
|
@@ -722,12 +743,16 @@ async def _render_detailed_group_table(
|
|
722
743
|
row.append('...')
|
723
744
|
continue
|
724
745
|
|
746
|
+
evals_per_solution[str(solution.path)].append(eval)
|
747
|
+
|
725
748
|
verdict = get_testcase_markup_verdict(eval)
|
726
|
-
time =
|
749
|
+
time = get_capped_evals_formatted_time(solution, [eval], verification)
|
750
|
+
memory = get_evals_formatted_memory([eval])
|
751
|
+
full_item = f'{verdict} {time} / {memory}'
|
727
752
|
if eval.result.sanitizer_warnings:
|
728
|
-
|
729
|
-
|
730
|
-
row.append(
|
753
|
+
full_item = f'{full_item} [warning]*[/warning]'
|
754
|
+
|
755
|
+
row.append(full_item)
|
731
756
|
table.add_row(*row)
|
732
757
|
|
733
758
|
if table.row_count > 0:
|
@@ -738,7 +763,11 @@ async def _render_detailed_group_table(
|
|
738
763
|
if not non_null_evals:
|
739
764
|
summary_row.append('...')
|
740
765
|
continue
|
741
|
-
|
766
|
+
formatted_time = get_capped_evals_formatted_time(
|
767
|
+
solution, non_null_evals, verification
|
768
|
+
)
|
769
|
+
formatted_memory = get_evals_formatted_memory(non_null_evals)
|
770
|
+
summary_row.append(f' {formatted_time} / {formatted_memory}')
|
742
771
|
table.add_section()
|
743
772
|
table.add_row(*summary_row)
|
744
773
|
return table
|
@@ -763,6 +792,7 @@ async def _print_detailed_run_report(
|
|
763
792
|
console: rich.console.Console,
|
764
793
|
structured_evaluations: StructuredEvaluation,
|
765
794
|
timing: bool = True,
|
795
|
+
verification: VerificationLevel = VerificationLevel.NONE,
|
766
796
|
):
|
767
797
|
for group in result.skeleton.groups:
|
768
798
|
console.print(f'[bold][status]{group.name}[/status][/bold]')
|
@@ -772,6 +802,7 @@ async def _print_detailed_run_report(
|
|
772
802
|
result.skeleton,
|
773
803
|
structured_evaluations,
|
774
804
|
console,
|
805
|
+
verification=verification,
|
775
806
|
)
|
776
807
|
continue
|
777
808
|
|
@@ -788,6 +819,7 @@ async def _print_detailed_run_report(
|
|
788
819
|
solution,
|
789
820
|
all_evals,
|
790
821
|
console,
|
822
|
+
verification=verification,
|
791
823
|
)
|
792
824
|
ok = ok and cur_ok
|
793
825
|
console.print()
|
@@ -802,7 +834,7 @@ async def _print_detailed_run_report(
|
|
802
834
|
async def print_run_report(
|
803
835
|
result: RunSolutionResult,
|
804
836
|
console: rich.console.Console,
|
805
|
-
verification:
|
837
|
+
verification: VerificationLevel,
|
806
838
|
detailed: bool = False,
|
807
839
|
timing: bool = True,
|
808
840
|
) -> bool:
|
@@ -811,7 +843,11 @@ async def print_run_report(
|
|
811
843
|
)
|
812
844
|
if detailed:
|
813
845
|
return await _print_detailed_run_report(
|
814
|
-
result,
|
846
|
+
result,
|
847
|
+
console,
|
848
|
+
structured_evaluations,
|
849
|
+
verification=verification,
|
850
|
+
timing=timing,
|
815
851
|
)
|
816
852
|
|
817
853
|
ok = True
|
@@ -836,7 +872,7 @@ async def print_run_report(
|
|
836
872
|
solution_evals.append(eval)
|
837
873
|
|
838
874
|
console.print(
|
839
|
-
f'({
|
875
|
+
f'({get_capped_evals_formatted_time(solution, group_evals, verification)}, {get_evals_formatted_memory(group_evals)})',
|
840
876
|
end='',
|
841
877
|
)
|
842
878
|
console.print()
|
@@ -845,7 +881,7 @@ async def print_run_report(
|
|
845
881
|
solution,
|
846
882
|
solution_evals,
|
847
883
|
console,
|
848
|
-
verification=
|
884
|
+
verification=verification,
|
849
885
|
)
|
850
886
|
console.print()
|
851
887
|
|
rbx/grading/steps.py
CHANGED
@@ -436,19 +436,21 @@ def _check_for_sanitizer_warnings(
|
|
436
436
|
return any(_check_for_sanitizer_warnings_in_line(line.decode()) for line in f)
|
437
437
|
|
438
438
|
|
439
|
-
_WARNING_RE = re.compile(r'[^:]
|
439
|
+
_WARNING_RE = re.compile(r'([^:]+):\d+:\d+:[ ]+warning:.*')
|
440
440
|
|
441
441
|
|
442
442
|
def _check_for_compilation_warnings_in_line(line: str) -> bool:
|
443
443
|
if line.startswith('./'):
|
444
444
|
return False
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
445
|
+
match = _WARNING_RE.match(line)
|
446
|
+
if match is None:
|
447
|
+
return False
|
448
|
+
file = match.group(1).strip().lower()
|
449
|
+
if 'testlib' in file or 'jngen' in file or 'stresslib' in file:
|
450
|
+
return False
|
451
|
+
if file.endswith('.h'):
|
452
|
+
return False
|
453
|
+
return True
|
452
454
|
|
453
455
|
|
454
456
|
def _check_for_compilation_warnings(
|
@@ -2,7 +2,7 @@ rbx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
rbx/annotations.py,sha256=Z3jBUyZoXkrz34jko3Rft0bnMME6nWb0vsV5I3HlgR0,3064
|
3
3
|
rbx/autoenum.py,sha256=cusv8ClXRlDVvhZ8eDrtYcL_2peXlHugAey_ht8roXk,12025
|
4
4
|
rbx/box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
rbx/box/builder.py,sha256=
|
5
|
+
rbx/box/builder.py,sha256=0TiRQJoHqLHAI8QwBrscbaJmhdcmialVtP_oEkfHcs0,3260
|
6
6
|
rbx/box/cd.py,sha256=9a_SOnzoJBXxxffp4Wbf3UKXIwKuN3Hvj7K6SocALwE,1194
|
7
7
|
rbx/box/checkers.py,sha256=VpgDzevOK7hrffG2zJGxquNiu-a9Fl3wquLn7xadcK0,6285
|
8
8
|
rbx/box/code.py,sha256=XUyE8QY9qgKC6AwoRvnjo1TodchMzNL2EAXeXHT4mYM,9815
|
@@ -22,7 +22,7 @@ rbx/box/environment.py,sha256=GjwnJwtkTdkHmUh1b23zagjLsTiJQAOpP36A93mA-zc,11159
|
|
22
22
|
rbx/box/extensions.py,sha256=gIC73VbF1897er3iIMhaIw6GE8o1t43M7q97Iz7-_lg,503
|
23
23
|
rbx/box/generators.py,sha256=YpwtT-SmbiBMdnNSGsJ6kXuF4vOEoqXOq9MC9T92Sng,16157
|
24
24
|
rbx/box/generators_test.py,sha256=mQqHepAMYa6zV_PseQALI0nIX6AdQktt6lh94muFhNw,1758
|
25
|
-
rbx/box/main.py,sha256=
|
25
|
+
rbx/box/main.py,sha256=oMwHflfh4Ei6fgJbmFeszza6TW76lCi0dwEhhZFpBbk,21986
|
26
26
|
rbx/box/package.py,sha256=gaqqiRL2l91GydJc4nrLQvhFNcxt7Di7KquiNJq6AiQ,11129
|
27
27
|
rbx/box/packaging/boca/extension.py,sha256=hQhcbocNfW2ESv5RalS1wf6uvOoOfOnR_gHvbXUbSzY,852
|
28
28
|
rbx/box/packaging/boca/packager.py,sha256=FOhSRg5K5Y4qNB0WyTR3DKgrpObf9I0JbyGpJHOtxpo,10673
|
@@ -39,7 +39,7 @@ rbx/box/presets/schema.py,sha256=mZmSPkQsw7eQM0lQN6er1MO_LiW1ObwwAZFDK0F5fxE,196
|
|
39
39
|
rbx/box/sanitizers/warning_stack.py,sha256=RI97_GJgdjTKIXY_r0EKp5h0qQQSDSdNDh5K7zINrqs,2861
|
40
40
|
rbx/box/schema.py,sha256=MerNqhIeOxRBUw0CEbtfNFsHEJVsILilAjEGwW0nujQ,13227
|
41
41
|
rbx/box/setter_config.py,sha256=6nGTPMvnJ7y1sM-EBuI493NSZOIiOZ1DTypSXrL-HRY,3686
|
42
|
-
rbx/box/solutions.py,sha256=
|
42
|
+
rbx/box/solutions.py,sha256=ndx1O5ez_GSus70QvTBDgfLoNLW5DpAiMTMJRdnDwR0,32266
|
43
43
|
rbx/box/solutions_test.py,sha256=Cx7Goon_0sz_PaUcD8qa8gmjgzOVub6VHss3CB0GaA0,1524
|
44
44
|
rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
45
|
rbx/box/statements/build_statements.py,sha256=24ZUM5H33NhmqnDL0ofA1anUKWxuZG1paA1tCV4AKns,11911
|
@@ -81,7 +81,7 @@ rbx/grading/judge/sandboxes/timeit.py,sha256=xScfasI2lsSQGZVpIZ7qBZfi0IaKC-1k8wO
|
|
81
81
|
rbx/grading/judge/storage.py,sha256=FirqjwDqb0m0h2OTFyWrZL7CQ4XjZNxhqB4JpnDIhZY,9485
|
82
82
|
rbx/grading/judge/test.py,sha256=ll0Iw7zyOpGdKPD_PGH7dvUkb4stQLu-ikbQnqJvuAc,944
|
83
83
|
rbx/grading/judge/testiso.py,sha256=v14DtkWiZFJ9AKMzrb0_vZKPWDt8jz8iIw1Z2O-Advk,1397
|
84
|
-
rbx/grading/steps.py,sha256=
|
84
|
+
rbx/grading/steps.py,sha256=Qx5DC5tQfH_1tIlsTXQtmtyYRW9tEgGeKKhF_1YGbQQ,22710
|
85
85
|
rbx/grading/steps_with_caching.py,sha256=5cI71VSjEaDzCPQikpamG_EjZqkkFKKdBtyJeA4QB7Q,1531
|
86
86
|
rbx/grading/steps_with_caching_run_test.py,sha256=nRzB4OcXkb-kQ4WCj0iTGVfBACllxZ0Ek5RSwfoJRgo,15262
|
87
87
|
rbx/grading_utils.py,sha256=lL2KtSkOsMElqrRoApQTbFcqVOeHVWUDTMCa3IsLpC4,4484
|
@@ -162,8 +162,8 @@ rbx/testdata/caching/executable.py,sha256=WKRHNf_fprFJd1Fq1ubmQtR3mZzTYVNwKPLWuZ
|
|
162
162
|
rbx/testdata/compatible,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
163
163
|
rbx/testing_utils.py,sha256=ZZLKMUHlZ4HwsuNY50jqSBJ9HhpnFdba7opjDsvXE1U,2084
|
164
164
|
rbx/utils.py,sha256=WlmnF4whc0-6ksVZoOhmom2bR2spT6zETFHjnpJOCsA,4383
|
165
|
-
rbx_cp-0.5.
|
166
|
-
rbx_cp-0.5.
|
167
|
-
rbx_cp-0.5.
|
168
|
-
rbx_cp-0.5.
|
169
|
-
rbx_cp-0.5.
|
165
|
+
rbx_cp-0.5.19.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
166
|
+
rbx_cp-0.5.19.dist-info/METADATA,sha256=_BOq9SuxvkOSIc4FbRmoeQV_wjuB9l0ALHeZKBpYGtE,3290
|
167
|
+
rbx_cp-0.5.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
168
|
+
rbx_cp-0.5.19.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
|
169
|
+
rbx_cp-0.5.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|