Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Simplify generator spec #1202

Open
kiritofeng opened this issue Feb 22, 2025 · 0 comments
Open

Simplify generator spec #1202

kiritofeng opened this issue Feb 22, 2025 · 0 comments

Comments

@kiritofeng
Copy link
Member

kiritofeng commented Feb 22, 2025

The current generator spec consists of several hacks to handle previous unintended use cases (primarily that if the generator crashed, the input/output files would be passed directly to the program).

This has led to an opaque generator spec that is not documented and has several counterintuitive behaviours.
For example, specifying input_file and no output_file will run the generator with the input file passed to the generator via stdin, but if an output file is then specified, the generator will be totally bypassed.

I propose rewriting the spec for generator behaviour to the following. For an init.yml with a valid generator node:

  • If generator_args are specified, the generator is run with arguments (and no file input). Including input_file or generator_input_file will result in an InvalidInitException.
    • If output_file is included, it will be passed as the judge output.
  • Otherwise:
    • If generator_input_file is specified, the generator is fed the input file. Including input_file will result in an InvalidInitException.
      • If output_file is included, it will be passed as the judge output.
    • Otherwise:
      • If input_file is specified, the generator is ignored for that test case, and the files are passed directly to the submission
      • Otherwise, the generator is run with empty stdin, and output_file is passed as judge output if it exists.

This should hopefully result in more intuitive and well-documented behaviour.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant