-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make program (validators et.c.) environment more strictly defined. #330
Comments
My main use case for this has been linking to a library with C++ for the output validator where it saves a massive amount of time and ensures quality of the validator. The most recent use case was the use of the library Eigen for https://open.kattis.com/problems/flaedasmidi because our original validator was numerically unstable, and we needed something more robust. That being said, this sort of thing I encounter very rarely, but sometimes I need to do it and the only other way to make the problem work would be to either implement the library myself or try to retrofit it to the problem package, both of which would take much more time than reasonable. In Python 3 you can simply add the library as a directory within your validator and import it, but in C and C++ it's much nicer to be able to build the library as needed and link to it. I do think this is something that may be best handled by allowing the things we know we need and then if we encounter more needs in the future we can add those to the spec with great hesitance to avoid too many required dependencies. |
There is always the possibility to add more languages in the future. |
I think @Tagl's case is already an important one: you might need to include a library: eigen, libgmp, matplotlib, etc that is not and should not be available in a contest language, and it doesn't make sense to add a contest language just to be able to build your validator (or other type of program). Another example I've seen, are custom validators that consist of multiple programs chained together with a shell script. For example, first a checktestdata program to validate the syntax and then another program to validate the semantics. We've in the past also combined two separate validators into a single script. OTOH, I don't think that the submission compilation environment is (much) better defined. If you specify C++ as language for your program, you still don't know which compiler, version and flags will be used, so it might still fail to compile. |
I feel like I'm missing something here. How does the
I agree that it gives flexibility, but I feel like it's so underspecified that it's very unclear to me how one would actually (safely) make use of that flexibility when one writes validators. For instance, in your example with I think it would be beneficial if someone has example(s) of use cases and could contribute one to https://github.com/Kattis/problem-package-format/tree/master/examples . I think it would both be a valuable contribution for problem authors to have an example to start from, and I sure would love to have an example to start from when building Kattis support that gives me at least some hint on what people in practice are gonna assume from the environment.
I see it as way less problematic to just assume that judge systems will have a somewhat sane C++ compiler with somewhat sane settings than trying to build portable shell scripts where my only guarantee is that As someone building a judge system, I want to choose how my system compiles C++ submissions, but I don't see how I can support arbitrary shell scripts in a good way (I'm guessing that if I provide a sandbox literally only giving what's guaranteed by the standard, most non-trivial |
I think the entire point of For output validators:
While all these can be solved in other ways, it's much more convenient to just fully control the build step. For visualizers (which are only run locally during development, not on the judge):
|
It's a balancing act though. If we allow for too generic "whatever" then the usage will never be portable, and the format becomes useless. OTOH, of we allow too little, too many cases will be unreasonably cumbersome, and people will work around the fomat.... and it becomes useless. The completely generic
That's true for input visualizers, not necessarily output visualizers. It seems to me that all the examples you listed only need "POSIX", python, and g++ (or equivalent). Can we define exactly what should be available, and is it only that? |
I'm not sure how that solves the use case above where one needs to link libraries (e.g., eigen), but I haven't seen any responses to my question "How does the build script ensure/know that the library it needs is available within the sandbox we run it in?," so maybe I'm missing something. |
Sorry for the slow reply. I think
So, bottom line, I think that we can't really think of these programs' sandbox requirement the same way as for normal submissions, and I don't think we lose much by using That said, I do agree that it makes sense to specify a base set of dependencies that such a program should be able to expect, and I think that a C/C++ compiler, python and POSIX shell should be among them. Maybe we should recommend such program writers to document in a |
In our case with eigen, we provided the code for the library, built it separately and then linked to it. |
Comment from @gkreitz:
@eldering I think you have been pushing mostly for the necessity of this? @Tagl you as well?
The text was updated successfully, but these errors were encountered: