Skip to content

Special limits - #1731

Merged
veluca93 merged 4 commits into
cms-dev:mainfrom
fagu:special-limits
Oct 18, 2026
Merged

veluca93 merged 4 commits into
cms-dev:mainfrom
fagu:special-limits

Conversation

@fagu

@fagu fagu commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

We would like a way for administrators to run submissions with increased time / memory limits. This would be very useful for unit tests as well as for testing specific submissions during the contest. This pull request would add two optional fields to each submission specifying the special time and memory limits. They can only be set by submitting a solution via api as an administrator.

It is theoretically possible to emulate this behavior by creating extra datasets with different limits, but one would have to manually trigger an evaluation of the submission on the dataset, and it seems quite error-prone and confusing.

I wasn't sure what database updaters would need to be written. (Maybe none as we are only adding two fields, which have default values?)

There is no indication of the special time / memory limits in the admin interface. We'd be happy to add some if you like.

One thing one needs to be aware of is that this in interactive tasks, the controller wall limit is not automatically adjusted to accommodate the larger solution time limit. But we think it can be set to a large value in the first place as it seems to be only a guard against controller bugs.

The code was written with @PH111P.

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.84%. Comparing base (3277ca5) to head (cfbba73).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cms/grading/Job.py 0.00% 2 Missing ⚠️
cms/server/contest/submission/workflow.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1731      +/-   ##
==========================================
+ Coverage   56.72%   56.84%   +0.12%     
==========================================
  Files         344      344              
  Lines       28314    28360      +46     
==========================================
+ Hits        16060    16122      +62     
+ Misses      12254    12238      -16     
Flag Coverage Δ
functionaltests 0.00% <0.00%> (ø)
unittests 56.84% <91.48%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@veluca93

Copy link
Copy Markdown
Contributor

This seems reasonable to me, but why not call the fields override_ instead of special_? It seems more consistent with the other API parameters and I think sounds more natural to me.

fagu added 2 commits October 18, 2026 15:58
Add nullable override_time_limit and override_mem_limit columns to
submissions.
When set, EvaluationJob.from_submission runs the submission with these
(usually larger) limits instead of the dataset's ones.
@fagu

fagu commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

This seems reasonable to me, but why not call the fields override_ instead of special_? It seems more consistent with the other API parameters and I think sounds more natural to me.

Good idea. Changed.

@prandla prandla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM other than the one nitpick

Comment thread cmscontrib/updaters/update_from_1.5.sql
@veluca93
veluca93 enabled auto-merge (squash) October 18, 2026 21:33
@veluca93
veluca93 merged commit a0597c8 into cms-dev:main Oct 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants