You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Never render .in files in interactive problems #449
.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.
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?
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.
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.
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
I want Kattis to run it so contestants can get feedback in Kattis' environment using the official grader.
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.
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.
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.
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.
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).
Activity
gkreitz commentedon Aug 7, 2026
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.interactionor the override files (e.g.,.in.statement,.ans.statement). Defaulting to.inand.ansindeed 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. :)
Now, this has me confused. Your issue is titled "Never render
.infiles 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?Matistjati commentedon Aug 7, 2026
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.
gkreitz commentedon Aug 11, 2026
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.
Matistjati commentedon Aug 11, 2026
To be clear: I use an ad-hoc rendering of the sample, as
.interactionfiles are unsuitable, as they would mislead contestants into thinking that they are supposed to use stdin. Example: https://po.kattis.com/problems/huntI want Kattis to run it so contestants can get feedback in Kattis' environment using the official grader.
gkreitz commentedon Aug 11, 2026
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_feedbacksetting. 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
.interactionfor 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.gkreitz commentedon Aug 12, 2026
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
.interactionin 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.simonlindholm commentedon Aug 12, 2026
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.
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.
gkreitz commentedon Aug 12, 2026
In that problem package (the version I have), the directory
data/sampleis empty (aside from atestdata.yamlfor 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.simonlindholm commentedon Aug 12, 2026
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).