Skip to content

I1169 Deliver run testcases as they happen to clients reading the event feed - #1279

Merged
johnbrvc merged 10 commits into
pc2ccs:developfrom
johnbrvc:i1169_ef_realtime_runs
Jul 28, 2026
Merged

johnbrvc merged 10 commits into
pc2ccs:developfrom
johnbrvc:i1169_ef_realtime_runs

Conversation

@johnbrvc

Copy link
Copy Markdown
Collaborator

Description of what the PR does

Optionally send CLICS (Version 2023-06 and greater) "runs" testcase results on the event feed as they are judged instead of waiting until all testcases have been judged and the final judgment is sent. This is primarily for downstream event feed clients that would like to render testcase results visually as they occur (eg. ICPCLive).

The use of this functionality is controlled by 2 new configuration parameters that may be specified in the system.pc2.yaml file.

batch_testcases_on_event_feed - boolean value - Default value: false

  • true: batch the testcase results and send them altogether at the submission's judgment is complete. This is the backward compatibility option so that PC2 works the way it used to.
  • false: send testcase results (CLICS "runs") as the happen in real-time instead of at the end of the submission's judgment.

send_begin_judgment_on_event_feed - boolean value - Default value: true

  • true: send a "judgements" notification prior to starting the judging of a submission. This notification will not contain a judgement_type_id, nor will it contain the end times or max_run_time properties. The purpose of sending this is to let downstream clients know that "runs" notifications are about to happen for a submission in addition, it provides referential integrity, as required by the CLICS specification, since the judgement_id is included in the "runs" notifications, so, the judgments record must be sent before using its ID.
  • false: Only send a "judgements" notification when judging of the submission is complete, followed by the "runs" notifications. The "runs" must be sent after the "judgements" notification to provide referential integrity.

Delivering of testcase results as they occur is only supported for the initial judging of a submission. Any re-judging or manual judging will cause the testcase results ("runs") to be sent after the final judgement is complete with a valid judgement_type_id.

An example event feed snippet of using the default settings for the new configuration flags above would be:

{"type":"judgements","token":"pc2-413","id":"Run--8806968035566460297","data": {"id":"Run--8806968035566460297","submission_id":"8","start_time":"2026-06-13T12:56:38.033-04","start_contest_time":"00:07:55.513"}}
{"type":"runs","token":"pc2-414","id":"TestCase--850437131685954149","data": {"id":"TestCase--850437131685954149","judgement_id":"Run--8806968035566460297","ordinal":1,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.095-04","contest_time":"00:07:59.078","run_time":0.19}}
{"type":"runs","token":"pc2-415","id":"TestCase--6200108298200192156","data": {"id":"TestCase--6200108298200192156","judgement_id":"Run--8806968035566460297","ordinal":2,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.212-04","contest_time":"00:07:59.195","run_time":0.03}}
{"type":"runs","token":"pc2-416","id":"TestCase--2043175037023414279","data": {"id":"TestCase--2043175037023414279","judgement_id":"Run--8806968035566460297","ordinal":3,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.352-04","contest_time":"00:07:59.335","run_time":0.03}}
{"type":"runs","token":"pc2-417","id":"TestCase-3993686871129291503","data": {"id":"TestCase-3993686871129291503","judgement_id":"Run--8806968035566460297","ordinal":4,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.463-04","contest_time":"00:07:59.446","run_time":0.028}}
{"type":"runs","token":"pc2-418","id":"TestCase--8571761662835315430","data": {"id":"TestCase--8571761662835315430","judgement_id":"Run--8806968035566460297","ordinal":5,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.571-04","contest_time":"00:07:59.554","run_time":0.025}}
{"type":"runs","token":"pc2-419","id":"TestCase--7160769431106293365","data": {"id":"TestCase--7160769431106293365","judgement_id":"Run--8806968035566460297","ordinal":6,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.664-04","contest_time":"00:07:59.647","run_time":0.02}}
{"type":"runs","token":"pc2-420","id":"TestCase-7241395232048011705","data": {"id":"TestCase-7241395232048011705","judgement_id":"Run--8806968035566460297","ordinal":7,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.768-04","contest_time":"00:07:59.751","run_time":0.022}}
{"type":"runs","token":"pc2-421","id":"TestCase-5090466230578772221","data": {"id":"TestCase-5090466230578772221","judgement_id":"Run--8806968035566460297","ordinal":8,"judgement_type_id":"AC","time":"2026-06-13T12:56:42.901-04","contest_time":"00:07:59.884","run_time":0.029}}
{"type":"runs","token":"pc2-422","id":"TestCase-7572623435938913091","data": {"id":"TestCase-7572623435938913091","judgement_id":"Run--8806968035566460297","ordinal":9,"judgement_type_id":"AC","time":"2026-06-13T12:56:43.035-04","contest_time":"00:08:00.018","run_time":0.028}}
{"type":"runs","token":"pc2-423","id":"TestCase-8244178370829366014","data": {"id":"TestCase-8244178370829366014","judgement_id":"Run--8806968035566460297","ordinal":10,"judgement_type_id":"AC","time":"2026-06-13T12:56:43.479-04","contest_time":"00:08:00.462","run_time":0.158}}
{"type":"runs","token":"pc2-424","id":"TestCase-375264539964437084","data": {"id":"TestCase-375264539964437084","judgement_id":"Run--8806968035566460297","ordinal":11,"judgement_type_id":"AC","time":"2026-06-13T12:56:43.998-04","contest_time":"00:08:00.981","run_time":0.159}}
{"type":"runs","token":"pc2-425","id":"TestCase-5084142937208406971","data": {"id":"TestCase-5084142937208406971","judgement_id":"Run--8806968035566460297","ordinal":12,"judgement_type_id":"AC","time":"2026-06-13T12:56:44.451-04","contest_time":"00:08:01.434","run_time":0.164}}
{"type":"runs","token":"pc2-426","id":"TestCase--5711794357171350182","data": {"id":"TestCase--5711794357171350182","judgement_id":"Run--8806968035566460297","ordinal":13,"judgement_type_id":"AC","time":"2026-06-13T12:56:44.587-04","contest_time":"00:08:01.570","run_time":0.03}}
{"type":"runs","token":"pc2-427","id":"TestCase-5267130586818423891","data": {"id":"TestCase-5267130586818423891","judgement_id":"Run--8806968035566460297","ordinal":14,"judgement_type_id":"TLE","time":"2026-06-13T12:56:46.610-04","contest_time":"00:08:03.593","run_time":2.006}}
{"type":"judgements","token":"pc2-457","id":"Run--8806968035566460297","data": {"id":"Run--8806968035566460297","submission_id":"8","judgement_type_id":"TLE","start_time":"2026-06-13T12:56:38.033-04","start_contest_time":"00:07:55.513","end_time":"2026-06-13T12:56:59.715-04","end_contest_time":"00:08:17.195","max_run_time":2.006}}

Issue which the PR addresses

Fixes #1169

Environment in which the PR was developed (OS,IDE, Java version, etc.)

java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)
and
Ubuntu 24.03.1 with Java 21.0.4

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

This PR supplies additions to the sample clics_sumithello contest (samps/contests/clics_sumithello). These additions include fixing the problem.yaml files for both problems to readFromSTDIN set to true, adding the default setting of the new configuration parameters in the system.pc2.yaml file and adding more test cases to the sumit problem (there used to be just one test case which isn't very useful testing most things, including this PR.)

  1. Load up a clean version of the (new) clics_sumithello contest. (pc2server is now running)
  2. Start up the event feed feeder1 (ef1) client and press the Start button to start it serving.
  3. Start up judge3 which is configured as an autoudge for both problems.
  4. Start the contest.
  5. From a command prompt, start a curl command to monitor the event feed: curl -k https://administrator1:administrator1@localhost:50443/contests/SumH/event-feed
  6. You should see the basic configuration information scroll by after starting the curl. If not, then you have something wrong. STOP.
  7. In order to use the built-in Submit Samples feature in PC2, you'll need to put sample source files in the correct spot. First, create the following folders in the samps/contests/clics_sumithello/config folder: sumit/submissions, hello/submissions, sumit/submissions/accepted, hello/submissions/accepted.
  8. Copy samps/src/hello.cpp to the samps/contests/clics_sumithello/config/hello/submissions/accepted folder.
  9. Copy samps/src/isumit.cpp to the samps/contests/clics_sumithello/config/sumit/submissions/accepted folder.
  10. Start an admin client (administrator1).
  11. Edit the administrator1 account on the Configure Contest->Accounts tab, and add (check) the "Shown on scoreboard displays" permission in the right pane. This will allow you to make submissions as an administrator and have them appear on the event feed. Normally, system accounts do not appear when they make submissions.
  12. On the Run Contest->Submit Samples tab, press the Filter button. You should see 3 columns, Problems, Languages and Solution Type. In the Problems column check Sumit only for now.
  13. VERY IMPORTANT: Check the Filter On check box (VERY IMPORTANT!).
  14. Press Ok to close the filter dialog.
  15. Press the Submit button on the main administrator window. It should pop up a dialog that says "Submit 1 judge sample submission". Click the Yes button.
  16. This will submit the isumit.cpp submission, and it should be autojudged right away.
  17. If you check your curl cmd window, you should see the following:
{"type":"submissions","token":"pc2-48","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-06-13T16:27:55.769-04","contest_time":"00:00:18.451","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-49","id":"Run-6603073848755750724","data": {"id":"Run-6603073848755750724","submission_id":"1","start_time":"2026-06-13T16:27:57.012-04","start_contest_time":"00:00:19.660"}}
{"type":"runs","token":"pc2-50","id":"TestCase-598821222953973226","data": {"id":"TestCase-598821222953973226","judgement_id":"Run-6603073848755750724","ordinal":1,"judgement_type_id":"AC","time":"2026-06-13T16:27:59.533-04","contest_time":"00:00:22.183","run_time":0.069}}
{"type":"runs","token":"pc2-51","id":"TestCase--864379013978663983","data": {"id":"TestCase--864379013978663983","judgement_id":"Run-6603073848755750724","ordinal":2,"judgement_type_id":"AC","time":"2026-06-13T16:27:59.783-04","contest_time":"00:00:22.433","run_time":0.045}}
{"type":"runs","token":"pc2-52","id":"TestCase--7779252905253158820","data": {"id":"TestCase--7779252905253158820","judgement_id":"Run-6603073848755750724","ordinal":3,"judgement_type_id":"AC","time":"2026-06-13T16:27:59.970-04","contest_time":"00:00:22.620","run_time":0.026}}
{"type":"runs","token":"pc2-53","id":"TestCase-1186898042478519698","data": {"id":"TestCase-1186898042478519698","judgement_id":"Run-6603073848755750724","ordinal":4,"judgement_type_id":"AC","time":"2026-06-13T16:28:00.180-04","contest_time":"00:00:22.830","run_time":0.024}}
{"type":"runs","token":"pc2-54","id":"TestCase-3983301074221001054","data": {"id":"TestCase-3983301074221001054","judgement_id":"Run-6603073848755750724","ordinal":5,"judgement_type_id":"AC","time":"2026-06-13T16:28:00.424-04","contest_time":"00:00:23.074","run_time":0.05}}
{"type":"runs","token":"pc2-55","id":"TestCase-2971139755849562859","data": {"id":"TestCase-2971139755849562859","judgement_id":"Run-6603073848755750724","ordinal":6,"judgement_type_id":"AC","time":"2026-06-13T16:28:00.616-04","contest_time":"00:00:23.266","run_time":0.033}}
{"type":"runs","token":"pc2-56","id":"TestCase-871231731458203957","data": {"id":"TestCase-871231731458203957","judgement_id":"Run-6603073848755750724","ordinal":7,"judgement_type_id":"AC","time":"2026-06-13T16:28:00.787-04","contest_time":"00:00:23.437","run_time":0.026}}
{"type":"judgements","token":"pc2-57","id":"Run-6603073848755750724","data": {"id":"Run-6603073848755750724","submission_id":"1","judgement_type_id":"AC","start_time":"2026-06-13T16:27:57.012-04","start_contest_time":"00:00:19.660","end_time":"2026-06-13T16:28:02.065-04","end_contest_time":"00:00:24.713","max_run_time":0.026}}

Things to observe:

  1. The initial "null" judgements notification with no judgement_type_id property (and no end times properties).
  2. The individual runs notifications for each testcase (see the "ordinal" property).
  3. The final judgements notification with the submission's final judgment (judgement_type_id).

The above instructions should provide you with enough information now to perform other tests, such as trying the "hello" sample. In addition, you can copy additional source files into the submissions/accepted folder and try them out too. You'll have to restart the administrator client if you add things to the submissions/accepted folder.

Some other tests you may want to try:

  1. Edit the system.pc2.yaml file to set the new configuration options to their opposite values so that PC2 will work the way it used to. Then, repeat the entire process above and note that the runs notifications come after the final judgment, and, there is no initial null judgment.
  2. Rejudge one of the completed auto-judge runs (either by editing the run and changing it to "QUEUED FOR COMPUTER JUDGEMENT", or by Rejudging it using the administrator client (select the run from the Runs tab, and press Rejudge). Remember that rejudging will not send out runs notifications as they happen, they will appear at the end of the judgement. Only the very first judging of a submission will use the new functionality.

johnbrvc added 4 commits June 11, 2026 19:50
Small changes to many modules to correctly handle runChanged() events - several of these should be fixed further to only handle the specific action they are expecting.  Right now, added code to not do various updates of the action is a testcase result.
Added new property to the RUN_STATUS packet (for the testcase ordinal).  Adjusted PacketHandler and PacketFactory accordingly.
Add configuration params for system.pc2.yaml to revert to sending all the testcases at the end of the judgment and to send a null judgment at the start of judging (*sigh*).
This code has not been tested - this is the initial push.
Add more test cases to the sumit problem (there used to be only 1).
Change problems to use STDIN as opposed to a file name.
Fix bugs found during testing.
Change sendToSpectatorsAndSites to sendToSpectatorsFeedersAndSites().  This is only used locally in PacketHandler to handle run status updates.  Feeders should see these too.
For rejudgings, send testcase in batch at the end, like before.   However, note that we changed the order so the testcases ("runs') will come out before the final judgment.
Only the VERY FIRST judging of a submission will generate real time testcase results ('runs") as they happen.
Added very detailed commenting of how the code works.
The judgements notification must be sent before the runs to preserve referential integrity (the judgement_id must be defined before referenced).
@johnbrvc johnbrvc added this to the 9.11.0 milestone Jun 13, 2026
@johnbrvc johnbrvc self-assigned this Jun 13, 2026
johnbrvc added 3 commits June 13, 2026 16:53
Forgot to add new virtual methods to NullController and MockController.
There was yet another Controller implementation that needed updating with the new methods.
@SamanwaySadhu

This comment was marked as resolved.

@johnbrvc

Copy link
Copy Markdown
Collaborator Author

image Except for one all other tests work as describe. When I was toggling the parameters in the system.pc2.yaml nothing shows up in the event-feed and for some reason the judging status shows up as "DEL Yes: AC". What does this mean?
Otherwise skimmed through the code changes, nothing out of the ordinary there. I will approve it once the above concern is addressed.

Whenever you change system.pc2.yaml, you have delete the current contest files, and reload a new contest. Those settings are only used when loading a clean contest. Changing the system.pc2.yaml, then restarting will have no effect.

DEL in a judgment means that the contest wasn't running when the run was judged (that is, it won't count toward the team's score). AC simply means if the contest was running the judgment would be accepted.

you want to Start the contest before running tests.

@SamanwaySadhu SamanwaySadhu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I reviewed all (45!) changed files. I made a few minor comments on several of them, most of which can be ignored (author's choice). However, there are several places where I made meaningful comments -- some of which may have to do (I think) with my lack of understanding of precisely how the PR is intended to work.

In addition, there are three changed files where I do not understand the changes at all (src/edu/csus/ecs/pc2/clics/API202306/EventFeedStreamer.java, src/edu/csus/ecs/pc2/core/model/InternalContest.java, and src/edu/csus/ecs/pc2/core/PacketHandler.java); I'll file separate comments on those.

Comment thread src/edu/csus/ecs/pc2/core/model/Run.java
Comment thread src/edu/csus/ecs/pc2/core/model/RunEvent.java Outdated
Comment thread src/edu/csus/ecs/pc2/core/model/RunExecutionStatus.java Outdated
Comment thread src/edu/csus/ecs/pc2/core/packet/PacketFactory.java
Comment thread src/edu/csus/ecs/pc2/core/packet/PacketFactory.java Outdated
Comment thread src/edu/csus/ecs/pc2/core/IInternalController.java Outdated
Comment thread src/edu/csus/ecs/pc2/core/IInternalController.java
Comment thread src/edu/csus/ecs/pc2/core/model/InternalContest.java Outdated
Comment thread src/edu/csus/ecs/pc2/core/model/InternalContest.java
Comment thread src/edu/csus/ecs/pc2/core/PacketHandler.java

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do not understand the changes made to src/edu/csus/ecs/pc2/clics/API202306/EventFeedStreamer.java; I think I need to have a conversation with the author.

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do not understand the removal of the three lines (around 1670) in src/edu/csus/ecs/pc2/core/model/InternalContest.java.

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As stated in a prior comment, I'm confused about the changes around line 3188 in src/edu/csus/ecs/pc2/core/PacketHandler.java. I don't understand the underlying intent of the PR in this regard; I think I need to have a conversation with the author.

@johnbrvc

Copy link
Copy Markdown
Collaborator Author

I do not understand the changes made to src/edu/csus/ecs/pc2/clics/API202306/EventFeedStreamer.java; I think I need to have a conversation with the author.

The idea is: if we are not sending test case results as they occur, it behaves like before, that is, when it receives a notification with the final judgment, it will send out the judgment, THEN all the run test cases. (Lines 562-575)

if we are sending test case results as they occur, then it will send out a null judgment record on the first test case result, followed by each test case result as it happens (RunEvent.Action.RUN_TESTCASE_RESULT). Note that if PC^2 is not configured to send individual test case results, then that case will never happen, that is, event.getAction() will never be RunEvent.Action.RUN_TESTCASE_RESULT.

The run.isJudged() if statement checks if the submission has already been judged, in which case it knows that individual test case results were not sent, and it has to send them after the final judgment (event.getAction() != RunEvent.Action.RUN_TESTCASE_RESULT).

The comments in the code, coupled with the above should make it clearer what is going on.

In addition, the configuration flags are tested to control if individual test case results are sent. (ci.isBatchTestCasesOnEF() and ci.isSendBeginJudgmentOnEF())

We can discuss at your leisure.

@clevengr

Copy link
Copy Markdown
Contributor

@johnbrvc
I'm doing runtime testing of the PR, including the "additional tests" suggested at the bottom of the "Steps for testing the PR". On the PC2 Admin I selected an already-submitted (and judged "AC") run, and clicked "Rejudge". I executed the run, then told it to change the judgement from "Yes" to "TLE". I got the following on the Event Feed:

{"type":"judgements","token":"pc2-62","id":"Run--4119278011271008162","data": {"id":"Run--4119278011271008162","submission_id":"2","judgement_type_id":"TLE","start_time":"2026-07-23T12:24:22.981-07","start_contest_time":"01:47:08.263","end_time":"2026-07-23T12:24:39.908-07","end_contest_time":"01:47:25.190","max_run_time":0.051}}
{"type":"runs","token":"pc2-63","id":"TestCase--6639541654848795401","data": {"id":"TestCase--6639541654848795401","judgement_id":"Run--4119278011271008162","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T12:24:28.616-07","contest_time":"01:47:13.902","run_time":0.051}}

This doesn't seem right to me. It correctly outputs the updated "TLE" judgement, but then it also outputs a "runs" event containing judgement "AC".

I was doing all of this using the system.pc2.yaml specified in the PR (i.e., the one contained in the clics_sumithello/config folder).

@johnbrvc

Copy link
Copy Markdown
Collaborator Author

@johnbrvc I'm doing runtime testing of the PR, including the "additional tests" suggested at the bottom of the "Steps for testing the PR". On the PC2 Admin I selected an already-submitted (and judged "AC") run, and clicked "Rejudge". I executed the run, then told it to change the judgement from "Yes" to "TLE". I got the following on the Event Feed:

{"type":"judgements","token":"pc2-62","id":"Run--4119278011271008162","data": {"id":"Run--4119278011271008162","submission_id":"2","judgement_type_id":"TLE","start_time":"2026-07-23T12:24:22.981-07","start_contest_time":"01:47:08.263","end_time":"2026-07-23T12:24:39.908-07","end_contest_time":"01:47:25.190","max_run_time":0.051}}
{"type":"runs","token":"pc2-63","id":"TestCase--6639541654848795401","data": {"id":"TestCase--6639541654848795401","judgement_id":"Run--4119278011271008162","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T12:24:28.616-07","contest_time":"01:47:13.902","run_time":0.051}}

This doesn't seem right to me. It correctly outputs the updated "TLE" judgement, but then it also outputs a "runs" event containing judgement "AC".

I was doing all of this using the system.pc2.yaml specified in the PR (i.e., the one contained in the clics_sumithello/config folder).

Yeah, that does not seem right, however, I would suspect that it does the same thing on regular PC^2 as well (not using the PR). I will check.

@clevengr clevengr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

During my runtime tests of the PR, I performed one test as follows:

  • I edited the system.pc2.yaml file so that instead of the defaults specified by the PR changes it contained:
batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: true

(the difference being that the first line was changed to true from its default of false).
I then ran the Steps to test the PR as specified.

On the event feed I got:

{"type":"submissions","token":"pc2-46","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T15:35:09.239-07","contest_time":"00:02:49.731","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-47","id":"Run-3466769724683919556","data": {"id":"Run-3466769724683919556","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T15:35:09.450-07","start_contest_time":"00:02:49.924","end_time":"2026-07-23T15:35:11.303-07","end_contest_time":"00:02:51.777","max_run_time":0.016}}
{"type":"runs","token":"pc2-48","id":"TestCase-3817760598047810668","data": {"id":"TestCase-3817760598047810668","judgement_id":"Run-3466769724683919556","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.500-07","contest_time":"00:02:50.973","run_time":0.067}}
{"type":"runs","token":"pc2-49","id":"TestCase--7704976196617855965","data": {"id":"TestCase--7704976196617855965","judgement_id":"Run-3466769724683919556","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.610-07","contest_time":"00:02:51.083","run_time":0.018}}
{"type":"runs","token":"pc2-50","id":"TestCase--956987229973535317","data": {"id":"TestCase--956987229973535317","judgement_id":"Run-3466769724683919556","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.721-07","contest_time":"00:02:51.194","run_time":0.017}}
{"type":"runs","token":"pc2-51","id":"TestCase--8315747617535842765","data": {"id":"TestCase--8315747617535842765","judgement_id":"Run-3466769724683919556","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.832-07","contest_time":"00:02:51.305","run_time":0.016}}
{"type":"runs","token":"pc2-52","id":"TestCase-4545006008921113308","data": {"id":"TestCase-4545006008921113308","judgement_id":"Run-3466769724683919556","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.934-07","contest_time":"00:02:51.407","run_time":0.016}}
{"type":"runs","token":"pc2-53","id":"TestCase--3686643062479133521","data": {"id":"TestCase--3686643062479133521","judgement_id":"Run-3466769724683919556","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.045-07","contest_time":"00:02:51.518","run_time":0.016}}
{"type":"runs","token":"pc2-54","id":"TestCase--7405859407175628848","data": {"id":"TestCase--7405859407175628848","judgement_id":"Run-3466769724683919556","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.149-07","contest_time":"00:02:51.622","run_time":0.016}}

It appears to have (correctly) batched the runs events, BUT: there is no "begin judgement" event on the event feed (as there should be according to the system.pc2.yaml settings; rather, there is a single judgements event which already has a judgement ("AC"). This doesn't seem correct to me (or at least, it's not consistent with the phrase send_begin_judgment_on_event_feed: true), since I'm not seeing a "begin judgement" event with no judgements field in it.

And I have a related question: why do we even need two different YAML directives to deal with the changes this PR is trying to accomplish? Wouldn't a single directive that specifies either "do it the old way" or "do it the new way" be sufficient? It's not clear to me why we need four combinations of "how to do it".

In particular, for example, I tried testing with the combination:

batch_testcases_on_event_feed: false
send_begin_judgment_on_event_feed: false

The resulting EF looked like:

{"type":"submissions","token":"pc2-45","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T16:32:09.058-07","contest_time":"00:01:42.210","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-46","id":"Run--1713066864958116477","data": {"id":"Run--1713066864958116477","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T16:32:09.330-07","start_contest_time":"00:01:42.472","end_time":"2026-07-23T16:32:10.866-07","end_contest_time":"00:01:44.008","max_run_time":0.018}}
{"type":"runs","token":"pc2-47","id":"TestCase-4728733945392224966","data": {"id":"TestCase-4728733945392224966","judgement_id":"Run--1713066864958116477","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T16:32:09.981-07","contest_time":"00:01:43.073","run_time":0.056}}
{"type":"runs","token":"pc2-48","id":"TestCase-4891886358027203752","data": {"id":"TestCase-4891886358027203752","judgement_id":"Run--1713066864958116477","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.132-07","contest_time":"00:01:43.224","run_time":0.024}}
{"type":"runs","token":"pc2-49","id":"TestCase-7499777627633890770","data": {"id":"TestCase-7499777627633890770","judgement_id":"Run--1713066864958116477","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.299-07","contest_time":"00:01:43.391","run_time":0.029}}
{"type":"runs","token":"pc2-50","id":"TestCase-8333069458314317264","data": {"id":"TestCase-8333069458314317264","judgement_id":"Run--1713066864958116477","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.439-07","contest_time":"00:01:43.531","run_time":0.02}}
{"type":"runs","token":"pc2-51","id":"TestCase-3788176202315816000","data": {"id":"TestCase-3788176202315816000","judgement_id":"Run--1713066864958116477","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.561-07","contest_time":"00:01:43.653","run_time":0.019}}
{"type":"runs","token":"pc2-52","id":"TestCase--1807112542352270722","data": {"id":"TestCase--1807112542352270722","judgement_id":"Run--1713066864958116477","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.679-07","contest_time":"00:01:43.771","run_time":0.017}}
{"type":"runs","token":"pc2-53","id":"TestCase-7430864510850296993","data": {"id":"TestCase-7430864510850296993","judgement_id":"Run--1713066864958116477","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.799-07","contest_time":"00:01:43.891","run_time":0.018}}

But this is precisely the same as the "old behavior" -- so I can't see why we need that combination, nor the combination:

batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: false

@johnbrvc

Copy link
Copy Markdown
Collaborator Author

@johnbrvc I'm doing runtime testing of the PR, including the "additional tests" suggested at the bottom of the "Steps for testing the PR". On the PC2 Admin I selected an already-submitted (and judged "AC") run, and clicked "Rejudge". I executed the run, then told it to change the judgement from "Yes" to "TLE". I got the following on the Event Feed:

{"type":"judgements","token":"pc2-62","id":"Run--4119278011271008162","data": {"id":"Run--4119278011271008162","submission_id":"2","judgement_type_id":"TLE","start_time":"2026-07-23T12:24:22.981-07","start_contest_time":"01:47:08.263","end_time":"2026-07-23T12:24:39.908-07","end_contest_time":"01:47:25.190","max_run_time":0.051}}
{"type":"runs","token":"pc2-63","id":"TestCase--6639541654848795401","data": {"id":"TestCase--6639541654848795401","judgement_id":"Run--4119278011271008162","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T12:24:28.616-07","contest_time":"01:47:13.902","run_time":0.051}}

This doesn't seem right to me. It correctly outputs the updated "TLE" judgement, but then it also outputs a "runs" event containing judgement "AC".
I was doing all of this using the system.pc2.yaml specified in the PR (i.e., the one contained in the clics_sumithello/config folder).

Yeah, that does not seem right, however, I would suspect that it does the same thing on regular PC^2 as well (not using the PR). I will check.

This is not a new issue. This is the way it currently works in the develop branch (production). I can fix it with this PR I suppose, or create a new issue, fix it, and close both issues when the PR is approved. Technically, as Doug would say, "Out of scope".

@clevengr

Copy link
Copy Markdown
Contributor

@johnbrvc I'm doing runtime testing of the PR, including the "additional tests" suggested at the bottom of the "Steps for testing the PR". On the PC2 Admin I selected an already-submitted (and judged "AC") run, and clicked "Rejudge". I executed the run, then told it to change the judgement from "Yes" to "TLE". I got the following on the Event Feed:

{"type":"judgements","token":"pc2-62","id":"Run--4119278011271008162","data": {"id":"Run--4119278011271008162","submission_id":"2","judgement_type_id":"TLE","start_time":"2026-07-23T12:24:22.981-07","start_contest_time":"01:47:08.263","end_time":"2026-07-23T12:24:39.908-07","end_contest_time":"01:47:25.190","max_run_time":0.051}}
{"type":"runs","token":"pc2-63","id":"TestCase--6639541654848795401","data": {"id":"TestCase--6639541654848795401","judgement_id":"Run--4119278011271008162","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T12:24:28.616-07","contest_time":"01:47:13.902","run_time":0.051}}

This doesn't seem right to me. It correctly outputs the updated "TLE" judgement, but then it also outputs a "runs" event containing judgement "AC".
I was doing all of this using the system.pc2.yaml specified in the PR (i.e., the one contained in the clics_sumithello/config folder).

Yeah, that does not seem right, however, I would suspect that it does the same thing on regular PC^2 as well (not using the PR). I will check.

This is not a new issue. This is the way it currently works in the develop branch (production). I can fix it with this PR I suppose, or create a new issue, fix it, and close both issues when the PR is approved. Technically, as Doug would say, "Out of scope".

My suggestion would be to create a new issue, since it is indeed "out of scope" for this PR...

@johnbrvc

Copy link
Copy Markdown
Collaborator Author

During my runtime tests of the PR, I performed one test as follows:

  • I edited the system.pc2.yaml file so that instead of the defaults specified by the PR changes it contained:
batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: true

(the difference being that the first line was changed to true from its default of false). I then ran the Steps to test the PR as specified.

On the event feed I got:

{"type":"submissions","token":"pc2-46","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T15:35:09.239-07","contest_time":"00:02:49.731","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-47","id":"Run-3466769724683919556","data": {"id":"Run-3466769724683919556","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T15:35:09.450-07","start_contest_time":"00:02:49.924","end_time":"2026-07-23T15:35:11.303-07","end_contest_time":"00:02:51.777","max_run_time":0.016}}
{"type":"runs","token":"pc2-48","id":"TestCase-3817760598047810668","data": {"id":"TestCase-3817760598047810668","judgement_id":"Run-3466769724683919556","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.500-07","contest_time":"00:02:50.973","run_time":0.067}}
{"type":"runs","token":"pc2-49","id":"TestCase--7704976196617855965","data": {"id":"TestCase--7704976196617855965","judgement_id":"Run-3466769724683919556","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.610-07","contest_time":"00:02:51.083","run_time":0.018}}
{"type":"runs","token":"pc2-50","id":"TestCase--956987229973535317","data": {"id":"TestCase--956987229973535317","judgement_id":"Run-3466769724683919556","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.721-07","contest_time":"00:02:51.194","run_time":0.017}}
{"type":"runs","token":"pc2-51","id":"TestCase--8315747617535842765","data": {"id":"TestCase--8315747617535842765","judgement_id":"Run-3466769724683919556","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.832-07","contest_time":"00:02:51.305","run_time":0.016}}
{"type":"runs","token":"pc2-52","id":"TestCase-4545006008921113308","data": {"id":"TestCase-4545006008921113308","judgement_id":"Run-3466769724683919556","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.934-07","contest_time":"00:02:51.407","run_time":0.016}}
{"type":"runs","token":"pc2-53","id":"TestCase--3686643062479133521","data": {"id":"TestCase--3686643062479133521","judgement_id":"Run-3466769724683919556","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.045-07","contest_time":"00:02:51.518","run_time":0.016}}
{"type":"runs","token":"pc2-54","id":"TestCase--7405859407175628848","data": {"id":"TestCase--7405859407175628848","judgement_id":"Run-3466769724683919556","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.149-07","contest_time":"00:02:51.622","run_time":0.016}}

It appears to have (correctly) batched the runs events, BUT: there is no "begin judgement" event on the event feed (as there should be according to the system.pc2.yaml settings; rather, there is a single judgements event which already has a judgement ("AC"). This doesn't seem correct to me (or at least, it's not consistent with the phrase send_begin_judgment_on_event_feed: true), since I'm not seeing a "begin judgement" event with no judgements field in it.

And I have a related question: why do we even need two different YAML directives to deal with the changes this PR is trying to accomplish? Wouldn't a single directive that specifies either "do it the old way" or "do it the new way" be sufficient? It's not clear to me why we need four combinations of "how to do it".

In particular, for example, I tried testing with the combination:

batch_testcases_on_event_feed: false
send_begin_judgment_on_event_feed: false

The resulting EF looked like:

{"type":"submissions","token":"pc2-45","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T16:32:09.058-07","contest_time":"00:01:42.210","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-46","id":"Run--1713066864958116477","data": {"id":"Run--1713066864958116477","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T16:32:09.330-07","start_contest_time":"00:01:42.472","end_time":"2026-07-23T16:32:10.866-07","end_contest_time":"00:01:44.008","max_run_time":0.018}}
{"type":"runs","token":"pc2-47","id":"TestCase-4728733945392224966","data": {"id":"TestCase-4728733945392224966","judgement_id":"Run--1713066864958116477","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T16:32:09.981-07","contest_time":"00:01:43.073","run_time":0.056}}
{"type":"runs","token":"pc2-48","id":"TestCase-4891886358027203752","data": {"id":"TestCase-4891886358027203752","judgement_id":"Run--1713066864958116477","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.132-07","contest_time":"00:01:43.224","run_time":0.024}}
{"type":"runs","token":"pc2-49","id":"TestCase-7499777627633890770","data": {"id":"TestCase-7499777627633890770","judgement_id":"Run--1713066864958116477","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.299-07","contest_time":"00:01:43.391","run_time":0.029}}
{"type":"runs","token":"pc2-50","id":"TestCase-8333069458314317264","data": {"id":"TestCase-8333069458314317264","judgement_id":"Run--1713066864958116477","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.439-07","contest_time":"00:01:43.531","run_time":0.02}}
{"type":"runs","token":"pc2-51","id":"TestCase-3788176202315816000","data": {"id":"TestCase-3788176202315816000","judgement_id":"Run--1713066864958116477","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.561-07","contest_time":"00:01:43.653","run_time":0.019}}
{"type":"runs","token":"pc2-52","id":"TestCase--1807112542352270722","data": {"id":"TestCase--1807112542352270722","judgement_id":"Run--1713066864958116477","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.679-07","contest_time":"00:01:43.771","run_time":0.017}}
{"type":"runs","token":"pc2-53","id":"TestCase-7430864510850296993","data": {"id":"TestCase-7430864510850296993","judgement_id":"Run--1713066864958116477","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.799-07","contest_time":"00:01:43.891","run_time":0.018}}

But this is precisely the same as the "old behavior" -- so I can't see why we need that combination, nor the combination:

batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: false

Whether right or wrong, this is "by design". The isSendBeginJudgmentOnEF() (flag) is ONLY checked if isBatchTestCasesOnEF() is in effect. The idea of the SendBeginJudgmentOnEF flag was to maintain some type of backward compatibility for system's that may not understand a null judgment. If Batch mode is not enabled, the idea was that PC^2 works as it "always has", absolutely no differences.

Of course, I can (easily) change that behavior and make it always check BOTH flags, even in so-called "legacy" mode (non-batch mode). Or, as you suggest, get rid of the SendBeginJudgmentOnEF flag and always send a null judgment if in batch mode.

Add comments to better explain test case indexes.
Add comments to better explain that sendToFeeders means CLICS Event Feeders.
Rename enums to more accurately explain their function: RUN_TESTCASE_RESULT->RUN_TESTCASE_COMPLETED, TESTCASE_RESULT->TESTCASE_COMPLETED.
@johnbrvc

johnbrvc commented Jul 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

@johnbrvc I'm doing runtime testing of the PR, including the "additional tests" suggested at the bottom of the "Steps for testing the PR". On the PC2 Admin I selected an already-submitted (and judged "AC") run, and clicked "Rejudge". I executed the run, then told it to change the judgement from "Yes" to "TLE". I got the following on the Event Feed:

{"type":"judgements","token":"pc2-62","id":"Run--4119278011271008162","data": {"id":"Run--4119278011271008162","submission_id":"2","judgement_type_id":"TLE","start_time":"2026-07-23T12:24:22.981-07","start_contest_time":"01:47:08.263","end_time":"2026-07-23T12:24:39.908-07","end_contest_time":"01:47:25.190","max_run_time":0.051}}
{"type":"runs","token":"pc2-63","id":"TestCase--6639541654848795401","data": {"id":"TestCase--6639541654848795401","judgement_id":"Run--4119278011271008162","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T12:24:28.616-07","contest_time":"01:47:13.902","run_time":0.051}}

This doesn't seem right to me. It correctly outputs the updated "TLE" judgement, but then it also outputs a "runs" event containing judgement "AC".
I was doing all of this using the system.pc2.yaml specified in the PR (i.e., the one contained in the clics_sumithello/config folder).

Yeah, that does not seem right, however, I would suspect that it does the same thing on regular PC^2 as well (not using the PR). I will check.

This is not a new issue. This is the way it currently works in the develop branch (production). I can fix it with this PR I suppose, or create a new issue, fix it, and close both issues when the PR is approved. Technically, as Doug would say, "Out of scope".

My suggestion would be to create a new issue, since it is indeed "out of scope" for this PR...

A new issue has been created for this, but I think the action will be "do nothing". #1283

It was decided we do not need this flag.  If RunTestCase results are sent as they occur, we will now always send a null judgment notification first (to maintain referential integrity which is required by the CLICS specification.
If we are batching RunTestCase results and sending them after the judgment for the run completes, (the way PC2 used to always operate), then we never send a null judgment notification.
@johnbrvc

johnbrvc commented Jul 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

During my runtime tests of the PR, I performed one test as follows:

  • I edited the system.pc2.yaml file so that instead of the defaults specified by the PR changes it contained:
batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: true

(the difference being that the first line was changed to true from its default of false). I then ran the Steps to test the PR as specified.
On the event feed I got:

{"type":"submissions","token":"pc2-46","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T15:35:09.239-07","contest_time":"00:02:49.731","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-47","id":"Run-3466769724683919556","data": {"id":"Run-3466769724683919556","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T15:35:09.450-07","start_contest_time":"00:02:49.924","end_time":"2026-07-23T15:35:11.303-07","end_contest_time":"00:02:51.777","max_run_time":0.016}}
{"type":"runs","token":"pc2-48","id":"TestCase-3817760598047810668","data": {"id":"TestCase-3817760598047810668","judgement_id":"Run-3466769724683919556","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.500-07","contest_time":"00:02:50.973","run_time":0.067}}
{"type":"runs","token":"pc2-49","id":"TestCase--7704976196617855965","data": {"id":"TestCase--7704976196617855965","judgement_id":"Run-3466769724683919556","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.610-07","contest_time":"00:02:51.083","run_time":0.018}}
{"type":"runs","token":"pc2-50","id":"TestCase--956987229973535317","data": {"id":"TestCase--956987229973535317","judgement_id":"Run-3466769724683919556","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.721-07","contest_time":"00:02:51.194","run_time":0.017}}
{"type":"runs","token":"pc2-51","id":"TestCase--8315747617535842765","data": {"id":"TestCase--8315747617535842765","judgement_id":"Run-3466769724683919556","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.832-07","contest_time":"00:02:51.305","run_time":0.016}}
{"type":"runs","token":"pc2-52","id":"TestCase-4545006008921113308","data": {"id":"TestCase-4545006008921113308","judgement_id":"Run-3466769724683919556","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T15:35:10.934-07","contest_time":"00:02:51.407","run_time":0.016}}
{"type":"runs","token":"pc2-53","id":"TestCase--3686643062479133521","data": {"id":"TestCase--3686643062479133521","judgement_id":"Run-3466769724683919556","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.045-07","contest_time":"00:02:51.518","run_time":0.016}}
{"type":"runs","token":"pc2-54","id":"TestCase--7405859407175628848","data": {"id":"TestCase--7405859407175628848","judgement_id":"Run-3466769724683919556","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T15:35:11.149-07","contest_time":"00:02:51.622","run_time":0.016}}

It appears to have (correctly) batched the runs events, BUT: there is no "begin judgement" event on the event feed (as there should be according to the system.pc2.yaml settings; rather, there is a single judgements event which already has a judgement ("AC"). This doesn't seem correct to me (or at least, it's not consistent with the phrase send_begin_judgment_on_event_feed: true), since I'm not seeing a "begin judgement" event with no judgements field in it.
And I have a related question: why do we even need two different YAML directives to deal with the changes this PR is trying to accomplish? Wouldn't a single directive that specifies either "do it the old way" or "do it the new way" be sufficient? It's not clear to me why we need four combinations of "how to do it".
In particular, for example, I tried testing with the combination:

batch_testcases_on_event_feed: false
send_begin_judgment_on_event_feed: false

The resulting EF looked like:

{"type":"submissions","token":"pc2-45","id":"1","data": {"id":"1","language_id":"cpp","problem_id":"sumit","team_id":"1","time":"2026-07-23T16:32:09.058-07","contest_time":"00:01:42.210","entry_point":null,"files":[{"href":"/contests/SumH/submissions/1/files","filename":"1.zip","hash":null,"mime":"application/zip"}]}}
{"type":"judgements","token":"pc2-46","id":"Run--1713066864958116477","data": {"id":"Run--1713066864958116477","submission_id":"1","judgement_type_id":"AC","start_time":"2026-07-23T16:32:09.330-07","start_contest_time":"00:01:42.472","end_time":"2026-07-23T16:32:10.866-07","end_contest_time":"00:01:44.008","max_run_time":0.018}}
{"type":"runs","token":"pc2-47","id":"TestCase-4728733945392224966","data": {"id":"TestCase-4728733945392224966","judgement_id":"Run--1713066864958116477","ordinal":1,"judgement_type_id":"AC","time":"2026-07-23T16:32:09.981-07","contest_time":"00:01:43.073","run_time":0.056}}
{"type":"runs","token":"pc2-48","id":"TestCase-4891886358027203752","data": {"id":"TestCase-4891886358027203752","judgement_id":"Run--1713066864958116477","ordinal":2,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.132-07","contest_time":"00:01:43.224","run_time":0.024}}
{"type":"runs","token":"pc2-49","id":"TestCase-7499777627633890770","data": {"id":"TestCase-7499777627633890770","judgement_id":"Run--1713066864958116477","ordinal":3,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.299-07","contest_time":"00:01:43.391","run_time":0.029}}
{"type":"runs","token":"pc2-50","id":"TestCase-8333069458314317264","data": {"id":"TestCase-8333069458314317264","judgement_id":"Run--1713066864958116477","ordinal":4,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.439-07","contest_time":"00:01:43.531","run_time":0.02}}
{"type":"runs","token":"pc2-51","id":"TestCase-3788176202315816000","data": {"id":"TestCase-3788176202315816000","judgement_id":"Run--1713066864958116477","ordinal":5,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.561-07","contest_time":"00:01:43.653","run_time":0.019}}
{"type":"runs","token":"pc2-52","id":"TestCase--1807112542352270722","data": {"id":"TestCase--1807112542352270722","judgement_id":"Run--1713066864958116477","ordinal":6,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.679-07","contest_time":"00:01:43.771","run_time":0.017}}
{"type":"runs","token":"pc2-53","id":"TestCase-7430864510850296993","data": {"id":"TestCase-7430864510850296993","judgement_id":"Run--1713066864958116477","ordinal":7,"judgement_type_id":"AC","time":"2026-07-23T16:32:10.799-07","contest_time":"00:01:43.891","run_time":0.018}}

But this is precisely the same as the "old behavior" -- so I can't see why we need that combination, nor the combination:

batch_testcases_on_event_feed: true
send_begin_judgment_on_event_feed: false

Whether right or wrong, this is "by design". The isSendBeginJudgmentOnEF() (flag) is ONLY checked if isBatchTestCasesOnEF() is in effect. The idea of the SendBeginJudgmentOnEF flag was to maintain some type of backward compatibility for system's that may not understand a null judgment. If Batch mode is not enabled, the idea was that PC^2 works as it "always has", absolutely no differences.

Of course, I can (easily) change that behavior and make it always check BOTH flags, even in so-called "legacy" mode (non-batch mode). Or, as you suggest, get rid of the SendBeginJudgmentOnEF flag and always send a null judgment if in batch mode.

The SendBeginJudgmentOnEF flag has been removed. null judgment notifications are always sent if sending RunTestCase results as they occur. null judgment notifications are never sent if in batch mode (sending RunTestCase results AFTER the final judgment is sent.) Addressed in commit: 2ac1e8d

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have reviewed the latest changes, and they all make sense. I have performed multiple runtime tests including using both batch_testcases_on_event_feed: false and batch_testcases_on_event_feed: true. All tests worked as expected.

However, I noted the following issues:

  • The file ContestSnakeYamlLoader was (properly) updated to no longer read a config value SEND_BEGIN_JUDGMENT_ON_EF, since that config value is no longer defined or meaningful. However, IContestLoader still contains a definition for that value:
    String SEND_BEGIN_JUDGMENT_ON_EF = "send_begin_judgment_on_event_feed";

To avoid possible future confusion I think IContestLoader should be updated by removing that definition, since it's no longer defined or being used for anything.

  • File samps/contests/clics_sumithello/config/system.pc2.yaml still contains the following lines:
# Default is true, but include it anyway
send_begin_judgment_on_event_feed: true

To avoid future confusion I think those lines should be removed since there's no longer any such configuration value defined.

Removed the definition for SEND_BEGIN_JUDGMENT_ON_EF in IContestLoader.
Removed send_begin_judgment_on_event_feed in clics_sumithello sample pc2v9.ini.

@clevengr clevengr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've reviewed the latest code, and performed all the tests suggested in the PR (plus a few of my own). Everything looks good; I approve the PR.

@johnbrvc
johnbrvc merged commit 41b67f3 into pc2ccs:develop Jul 28, 2026
3 checks passed
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.

Present Runs on Event Feed as they occur, not after submission judgment

3 participants