Skip to content

Simplify generator spec #1202

@kiritofeng

Description

@kiritofeng

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions