-
Notifications
You must be signed in to change notification settings - Fork 23
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
Separate universally and problem-specifically invalid inputs #352
Comments
I think stress testing the input and output validators sense, and this is a reasonable way to do it. One thought: in NWERC we always use some library (header file), and it feels like all the invalid inputs here are rather tests of the library being used. Once the library is well tested, whitespace and encoding errors should be handled by it and are not really errors specific to the problem. On the other hand when every problem has it's own non-library-based validator, having extra tests makes a lot of sense. Another thing: I could imagine things like this are particularly interesting for problems with string input. But then the non-ascii strings should appear in the right place, and not in the first line when that first line contains an integer (the number of strings). But maybe then one should just write problem-specific invalid input. I think my preference is to not copy them to |
Your point is a good one. Since the skeleton is contest-specific, and contests typically come with their own validation traditions, the default skeleton should be optimised for how a BAPC jury wants to see their problems. Contests run by Thore (with bespoke validators) exactly can then overwrite |
Right yes, updating the contest |
How about this skeleton: sample:
data:
- '':
in: "15"
ans: 3 5
secret:
data:
- 'med-random-0': random_composite --lo 1000 --hi 3000 {seed:0}
- 'med-random-1': random_composite --lo 1000 --hi 3000 {seed:1}
invalid_inputs:
data:
prime:
in: "7"
out-of-bounds-lo:
in: "2"
out-of-bounds-hi:
in: "65538"
invalid_outputs:
data:
wrong_product:
in: "15"
ans: 3 5
out: 2 7
not_prime:
in: "30"
ans: 2 3 5
out: 5 6
invalid_answers:
data:
decreasing:
in: "15"
ans: 5 3 I think this is clear enough to deduce a lot of information from, and makes the difference between Not sure if you want |
This is pretty nice! Specific comments:
|
|
Some input files are invalid universally (for all problems, certainly all problem in a contest), others for this problem. I suggest to separate these issues.
For instance, a default
contest.yaml
could containand always generate the corresponding testcases. (It could do so explicitly, so that
data/invalid_inputs/latin-1.in
is indeed created bybt generate
.)An Icelandic contest would not forbid
latin-1
because it wants input files likejökulsá
.Invalid pseudotestcases that are particular to a problem instead belong to
generators.yaml
. An informative and easy-to-repurpose skeleton could look like this:Putting the above list into the skeleton would incentivise problem authors to provide those invalid inputs.
The text was updated successfully, but these errors were encountered: