Skip to content

Never render .in files in interactive problems #449

Open

Description

@Matistjati

.in and .ans files are shown in the statement if no .interaction file exists.
In the vast majority of interactive problems, the .in files are completely useless and undocumented. Even worse, what should the .ans file be? At that point, just use a .interaction file as we intended. This really feels like a footgun.

There are legitimate usecases for having .in files without a corresponding interaction, though: I ran into this when I had an interactive problem where a .interaction file was unsuitable (you call a function defined in an include runner, which is very common in IOI), but I still wanted the sample to be run. Of course we should still warn in the case where we hide it.

Activity

  1. added theissue type on Aug 5, 2026
  2. gkreitz commented on Aug 7, 2026

    @gkreitz
    Contributor

    This really feels like a footgun.

    I agree. This should probably be fixed in https://www.kattis.com/problem-package-format/spec/2025-09.html#samples-for-interactive-and-multi-pass-problems (which just strongly recommends a .interaction). My inclination would be to require samples for interactive/multi-pass problems to either have an .interaction or the override files (e.g., .in.statement, .ans.statement). Defaulting to .in and .ans indeed feels like a footgun.

    For problemtools, I think I'll need to do a larger rewrite for sample rendering to fix this. The logic for sample file rendering is mostly done in latex, which is... not great. :)

    There are legitimate usecases for having .in files without a corresponding interaction, though [...]

    Now, this has me confused. Your issue is titled "Never render .in files in interactive prolems", and then you say there are legitimate use cases where it sounds like you do want to render an in file? If you don't want to render anything in this case, why is it in sample?

  3. Matistjati commented on Aug 7, 2026

    @Matistjati
    ContributorAuthor

    To be clear, I want to run it, but not render it.

    In problems where you don't use STDIO for input/output, but instead call function using an include file, it is sometimes impossible to use a sample to describe the interaction. But you still want Kattis to run the samples.

  4. gkreitz commented on Aug 11, 2026

    @gkreitz
    Contributor

    Why is it in samples if you don't want to render anything? Samples are test cases we show as samples in the statement, and thus should all be rendered.

  5. Matistjati commented on Aug 11, 2026

    @Matistjati
    ContributorAuthor

    To be clear: I use an ad-hoc rendering of the sample, as .interaction files are unsuitable, as they would mislead contestants into thinking that they are supposed to use stdin. Example: https://po.kattis.com/problems/hunt

    Image

    I want Kattis to run it so contestants can get feedback in Kattis' environment using the official grader.

  6. gkreitz commented on Aug 11, 2026

    @gkreitz
    Contributor

    That problem has no samples (which is correct).

    If you want Kattis to run that test case and display result to users, you should use the full_feedback setting. Which would be nice to backport to the current version of the standard, cf. Kattis/problem-package-format#585 . I'm not going to add any support for samples which render nothing - things that render nothing are not samples.

    My conclusion from this issue is that we should require a .interaction for all samples in interactive problems. This is already a requirement in legacy, which we currently don't check. I doubt it was intentional to remove that requirement in the new version, so the standard should be fixed. I created an issue for that - Kattis/problem-package-format#589 .

    I think all we need to do in problemtools is to implement the check that all samples have an .interaction.

  7. gkreitz commented on Aug 12, 2026

    @gkreitz
    Contributor

    Apparently, this footgun is an intentional feature in 2025-09, Kattis/problem-package-format#589 (comment) .

    I'm not sure how we'll deal with that. For now, I'll add the strict requirement on .interaction in legacy. I'm not going to waste my time trying to argue for fixing the 2025-09 version, I already have way too many open tickets on the standard where absolutely nothing happens.

  8. simonlindholm commented on Aug 12, 2026

    @simonlindholm
    Member

    That problem has no samples (which is correct).

    Sorry, I don't follow. The problem has a sample (one hunt with treasure chest at (3, 2)), it's just not in a form that Kattis can render. I can totally understand not prioritizing this case or wanting to deal with the standardization aspect of it, but I don't agree with the not-a-sample argument.

    If you want Kattis to run that test case and display result to users, you should use the full_feedback setting.

    This would not put the test case in the sample group. It could also happen that the sample does not obey the constraints of any test group.

  9. gkreitz commented on Aug 12, 2026

    @gkreitz
    Contributor

    Sorry, I don't follow. The problem has a sample (one hunt with treasure chest at (3, 2)), it's just not in a form that Kattis can render.

    In that problem package (the version I have), the directory data/sample is empty (aside from a testdata.yaml for some reason). That's why I'm saying the problem has no samples.

    Not sure a philosophical discussion on what a sample is is of much use. As pertains to problemtools, I think we should add the check that each case in sample in legacy has an .interaction. And if someone wants to burn time discussing standardization of other aspects here, feel free to do so in the spec repo.

  10. simonlindholm commented on Aug 12, 2026

    @simonlindholm
    Member

    In that problem package (the version I have), the directory data/sample is empty (aside from a testdata.yaml for some reason). That's why I'm saying the problem has no samples.

    Ah, I see what you mean. The reason it doesn't have any samples is because of this exact issue (whose filing might have been inspired by Joshua adding that problem to Kattis).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions