-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Automatic validation of solution's subtask status #34
Comments
I'd cast a vote for proposal A, possibly with an implicit-AC semantics. If a solution is expected to be accepted on all subtasks, unless stated otherwise, adding a new one potentially requires only to list its name in the solutions it affects. In any case, even without this, I think that the costs are negligible compared to the benefits this proposal would bring. |
Thanks Luca, and thanks also to all the others that spent some time answering my questions! I'll recap here the various opinions I received:
Feedback received:
† Federico was kind enough to propose a format for C:
This file is kept up-to-date with some tools provided by task-maker:
If this file is broken (wrong format, not existing solution, invalid subtasks, ...) task-maker should not fail, but just warn. This somewhat implies that the subtasks have to be named, for example using a |
It seems that Solution A has a lot more consensus than the other options. We will try to stick with A! Here it is a somewhat formal specification of the format. Definition of subtask's nameThe grammar of the gen/GEN file (ref) is extended with the following syntax:
Examples:
The subtask name must:
Definition of solution checksInside each solution there could be lines defining the checks to perform on the results of that solution. The checks may be added inside comment lines. The checks have a format that is based on the following regex: ^
.* # ignore any prefix (allowing to be in a comment of any language)
@check- # signal the start of a check
(?P<result>accepted|wrong-answer|time-limit-exceeded|memory-limit-exceeded|runtime-error)
:
(?P<subtasks>
(?:
[\t ]*? # spaces between subtask names
[^\s]+? # subtask name
)*? # allow a check without any subtask listed
)
[\t ]*? # ignore spaces after the last subtask
$ Examples: /*
* // Check that the solution gets AC in examples and quadratic
* @check-accepted: examples quadratic
* // Checks may be repeated
* @check-accepted: tree
* @check-time-limit-exceeded: linear
* // The same subtask can appear in many checks
* @check-runtime-error: linear
* // Spaces can be used as you wish (e.g. for alignment)
* @check-runtime-error:crazy with spaces
*/ # // Asterisks can be used as wildcards
# @check-wrong-answer: *
# // Empty checks are also allowed
# @check-run-time-error: The list of subtask names is split by whitespaces (spaces and tabs), and each subtask name is matched against the list of subtasks defined in the gen/GEN file. Asterisks in the subtask name in the check will match any sequence of characters when searching the gen/GEN (like a wildcard). Note that the following format of comments is not supported since the list of subtask names is read until the end of the line: /* @check-accepted: foo */ Checking logicGiven a solution S, each check is analyzed independently. If the check is
Sanity checksMissing subtask names If not all the subtasks have a name, emit a warning. Solutions with no checks If all the subtasks have a name, but at least a solution (that is not symlinked in att/, i.e. not a template) has no checks, emit a warning with the list of all such solutions. Invalid check Emit an error for all the malformed checks in the solutions. A malformed check is a line that contains Invalid subtask name Emit an error for all the checks with a non-existent (or invalid, or non-matching) subtask name, including a list of the valid subtask names. |
I want to introduce in the
italian_yaml
format the association solution-subtask-status. This will allow task-maker to:The status of a testcase can be one of the following:
The status of a subtask is the set of statuses of its testcases.
There are many possibile ways to store this association:
Solution A: Name the subtasks, tag the solutions
Inside
gen/GEN
, after the definition of a subtask, there is the name of the subtask with aSTNAME
directive. Inside each solution there are comments that are parsed by task-maker to extract the set of subtasks and statuses the solution should get.Example
Notes:
@check-accepted
= all the testcases of the subtask are AC@check-time-limit
= at least one testcase of the subtask is TLE (same for the other non-AC statuses)Pros:
Cons:
#STNAME
and fail to parsegen/GEN
Open questions:
#STNAME: name
?@check-accepted
/@check-...
?Solution B: List solution names inside
gen/GEN
After the definition of a subtask in
gen/GEN
, list the solutions that should get a given status.Example
Pros:
Cons:
#AC
/#WA
/... and fail to parsegen/GEN
Open questions:
#AC
,#TLE
,#WA
,#MLE
,#RE
or something more verbose?oii
andois
repo there are no such solutions)Solution C: Additional file
Write the association solution-subtask-status in a new file.
Pros:
Cons:
Open questions:
The text was updated successfully, but these errors were encountered: