Skip to content
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

fix validation #344

Merged
merged 5 commits into from
Feb 21, 2024
Merged

fix validation #344

merged 5 commits into from
Feb 21, 2024

Conversation

mzuenni
Copy link
Collaborator

@mzuenni mzuenni commented Feb 20, 2024

correctly verify which of the .in .ans and .out files inside the invalid_* directories should be rejected

@thorehusfeldt
Copy link
Collaborator

thorehusfeldt commented Feb 21, 2024

Here is a toy program to test invalidation (and constraints):
pickanumber.zip

It has several validators:

pickanumber> tree *_validator*
answer_validators
└── answerformat.py
input_validators
├── invala
│   ├── validate.cpp
│   └── validation.h
└── invalb
    ├── validate.cpp
    └── validation.h
output_validator
└── validate.py

5 directories, 6 files

You can run

bt generate --no-validators
bt validate --v --invalid

Here is the current output, with parallelisation switched off:

image

Much of this look ok. Note, e.g., that testcase neg_b passes the first input validator (invala) only to be rejected by the other invalb, which is therefore green. Testcases named actually_valid should trigger red lines; they were (deliberately) misplaced into invalid_ in order to check that invalidation works. Every validator is run on every testcase at most once.

But, while we’re here:

  1. I am not sure why invalb is run on too_many_tokens, there is no reason for that (invala just rejected it, as expected.)

  2. Also, for invalid_outputs/just_plain_wrong, both input and answer validation are expected to pass, so those lines should be green (not yellow).

  3. When the (singular) output_validator accepts invalid_outputs/actually_valid, it should be red, not yellow. The preceding three lines should be green, not yellow (their behaviour is expected.)

@thorehusfeldt
Copy link
Collaborator

Looks good to me.

@mzuenni mzuenni requested review from RagnarGrootKoerkamp and removed request for thorehusfeldt and RagnarGrootKoerkamp February 21, 2024 15:54
@mzuenni mzuenni merged commit 41912d2 into RagnarGrootKoerkamp:master Feb 21, 2024
2 checks passed
@mzuenni mzuenni deleted the fix-validation branch February 25, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants