Skip to content

Conversation

mpsijm
Copy link
Contributor

@mpsijm mpsijm commented Apr 20, 2025

Closes #351 and closes #459.

I've tested the example visualizers in the "maximal" problem with https://github.com/RagnarGrootKoerkamp/BAPCtools/tree/draft, with the following side-notes:

  • The visualizer in BAPCtools currently only generates images under data/ with a proper generators/generators.yaml, so I temporarily wrote one:

    Temporary generators/generators.yaml:
    solution: /submissions/accepted/accepted.py
    version: 2025-04
    
    data:
      sample:
        testdata.yaml:
          test_case_visualizer_args: [sample]
          output_visualizer_args: [sample]
        data:
          "1":
            in: "41"
    
      secret:
        testdata.yaml:
          test_case_visualizer_args: [secret]
          output_visualizer_args: [secret]
        data:
          "1":
            in: "13"
          "2":
            in: "-100"
          "3":
            in: "99"
          "4":
            in: "0"
  • BAPCtools does not support the include/ (yet?), so it should be invoked as bt generate --no-solution --no-validators

  • BAPCtools still uses testdata.yaml, I renamed this manually to test_group.yaml after running bt generate

    • Edit: BAPCtools uses test_group.yaml as well now! 🎉

Nonetheless, the "maximal" problem should be spec-compliant (and at some point in the future, BAPCtools should run it without issues as well) 😄

Comment on lines 1256 to 1257
it is recommended to include the test case visualizer source code in the directory `test_case_visualizer/` along with invocation instructions in a file such as `test_case_visualizer/README.txt`.
Tooling may make use of the `test_case_visualizer_args` key in the [test data configuration](#test-data-configuration) and [test case configuration](#test-case-configuration).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can test_case_visualizer_args be used if "invocation instructions" are needed?

It would be great if we could specify invocation, as we do with output visualizers.

@mpsijm mpsijm changed the title Rename input_visualizer to test_case_visualizer; add *_visualizer_args Add {input,output}_visualizer_args Aug 27, 2025
@mpsijm mpsijm changed the title Add {input,output}_visualizer_args Add {input,output}_visualizer_args and example visualizers Aug 27, 2025

## Output Visualizer

An output visualizer is an optional [program](#programs) that is run after every invocation of the output validator in order to generate images illustrating the submission output.
A visualizer program must be an application (executable or interpreted) capable of being invoked with a command line call. It is invoked using the same arguments as the output validator.
A visualizer program must be an application (executable or interpreted) capable of being invoked with a command line call. It is invoked using the same arguments as the output validator, except that `output_validator_args` is replaced with `output_visualizer_args`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't an input visualizer also a "visualizer program"?

Suggested change
A visualizer program must be an application (executable or interpreted) capable of being invoked with a command line call. It is invoked using the same arguments as the output validator, except that `output_validator_args` is replaced with `output_visualizer_args`.
An output visualizer program must be an application (executable or interpreted) capable of being invoked with a command line call. It is invoked using the same arguments as the output validator, except that `output_validator_args` is replaced with `output_visualizer_args`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, and I found some more inconsistencies when looking at the related phrases, thanks! 😄

mpsijm added a commit to RagnarGrootKoerkamp/BAPCtools that referenced this pull request Aug 28, 2025
@niemela
Copy link
Member

niemela commented Aug 28, 2025

@mpsijm Could you rebase?

@mpsijm
Copy link
Contributor Author

mpsijm commented Aug 29, 2025

Done! 😄

@niemela niemela merged commit 6ef354d into Kattis:master Aug 29, 2025
@mpsijm mpsijm deleted the visualizers branch August 29, 2025 19:27
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.

Specify invocation for input visualizers Example for output_visualizer is missing
3 participants