Enforce sample numbering (controversial?)#30
Enforce sample numbering (controversial?)#30Matistjati wants to merge 1 commit intoKodsport:masterfrom
Conversation
984f56b to
cf61c90
Compare
|
For reference, Kattis has implemented the correct behavior for Legacy: https://www.kattis.com/problem-package-format/spec/legacy.html#test-data-groups But this will be fixed in 2025-09. https://www.kattis.com/problem-package-format/spec/2025-09.html#test-cases I'm considering closing this. |
|
IIRC we use 1.in, 2.in, ... because it is required by some other tool, maybe problem2pdf? We could solve this by using a different name for the symlink than for the actual file. |
Can't believe I missed that. That's a great solution! Also, problemtools already warns for ans files without |
|
I'm not sure that that's the solution we want either. If we do this, we lose the property that two files should have the same content iff they have the same name. For example, this triggers Problemtool's warning: |
|
I thought that check was already symlink-aware. hashes = collections.defaultdict(list)
for root, dirs, files in os.walk(self._datadir):
for filename in files:
filepath = os.path.join(root, filename)
if filepath.endswith('.in') and not os.path.islink(filepath):
...
hashes[filehash].append(os.path.relpath(filepath, self._problem.probdir))
for _, files in hashes.items():
if len(files) > 1:
self.warning(f"Identical input files: '{str(files)}'") |
|
...right, I didn't even my own error message... What do you think, should we make this change? |
|
Sure, why not. |
|
Just make sure that compiling a full problemset with the tex template class
works, as Simon mentioned.
…On Mon, 22 Dec 2025, 15:17 Simon Lindholm, ***@***.***> wrote:
*simonlindholm* left a comment (Kodsport/testdata_tools#30)
<#30 (comment)>
Sure, why not.
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHIMXPMZ26HK6JT3N7X4ZT4C74Q5AVCNFSM6AAAAACPXSD5BCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMOBSGI3TGNRUGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Closes #25.
First, a minor sanity check: check that every .ans file in sample has a corresponding
.infile.For the controversial part: Kattis is now exposing more details about testcases in their UI.

Here, it seems like the participant was 3 test cases off from AC. However, they are actually only one testcase off: the two testcases at the end are the sample, because i named them
1.inand2.in. I think that this is somewhat common, and that the fix is to number samples.Because
testdata_toolsuses sample both as the "input" and "output" folder for samples, we don't really have any choice but to rename the samples.Thus, this is not backwards-compatible, in the sense that you if you use the new
gen.shon old problems, you will be forced to do some cleanup.Sample run: