Grader-less communication task type
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
Currently, communication tasks always require a grader header file. Batch tasks, on the other hand, can be configured to instead use stdin/stdout. Would you be interested such an option for communication tasks?
Unfortunately, this is not entirely trivial:
When the manager terminates (because of an illegal query, for example) and the solution keeps reading (ignoring EOF errors), strange things might happen. We might not receive the expected "wrong answer" verdict, but instead get segmentation fault or TLE.
So, when the manager finishes, we want to kill the solution without its cooperation.
Since we still prefer stdin/stdout in our selection camps, we've already implemented this a while ago. It required changes to Communication.py and isolate (small change), and you always need to include a specific header (managerframework.h) in your manager. The idea is as follows:
The manager and the code in Communication.py communicate via an additional set of two fifos. When the manager is done (wrong answer/correct), it tells Communication.py. Then, Communication.py sends SIGINT to isolate, which will kill the submission. Communication.py waits for the sandbox to terminate, then tells the manager, which ultimately exits.
(Even if you use a grader header file, it's also important to remember to open the manager<->submission pipes in the correct order to avoid deadlocks and to ignore SIGPIPE signals in the manager in case the submission terminates or closes stdin early.)
As I said, we've already implemented it, but I wanted to ask if this is a desired feature and you like our approach, before cleaning up the code for a pull request.
https://github.com/ioi-germany/cms/blob/new_merge/cms/grading/tasktypes/Communication.py
https://github.com/ioi-germany/cms/blob/new_merge/cmscontrib/gerpythonformat/lib/include/managerframework.h
https://github.com/ioi-germany/isolate/blob/master/isolate.c
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading cms/grading/tasktypes/Communication.py and compare it with the linked new_merge implementation. Then inspect cmscontrib/gerpythonformat/lib/include/managerframework.h and the isolate changes to understand the proposed FIFO and termination flow. Done means communication tasks can use stdin/stdout without a grader header and terminate non-cooperating submissions safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100