Skip to content

I1175 final scoreboard wf rankings#1210

Open
johnbrvc wants to merge 3 commits intopc2ccs:developfrom
johnbrvc:i1175_final_scoreboard_WF_rankings
Open

I1175 final scoreboard wf rankings#1210
johnbrvc wants to merge 3 commits intopc2ccs:developfrom
johnbrvc:i1175_final_scoreboard_WF_rankings

Conversation

@johnbrvc
Copy link
Collaborator

@johnbrvc johnbrvc commented Jan 29, 2026

Description of what the PR does

In the case of the final public scoreboard using WF honors ranking (that is, obeyFreeze, contest is unfrozen and finalized), we generate the XML standings report slightly differently. We use honors grouping logic so all teams in an honors group have the same rank (except for medalists - they all have their own rank, unless really tied).
CI: Add Utilities method to return a default FinalizeData object (4g/4s/4b). Also charge ResultsFile to use the new method and remove its copy of the code.
CI: In the New Scoring Algorithm, there was a bug where it wasn't properly counting judged runs (CE's don't count as judged runs if CE's are set to be ignored).
CI: Add code to the index.xsl to generate the HTML page for the public final scoreboard with "HM" as the rank for Honorable Mention teams, rather than putting a bogus rank there.

Issue which the PR addresses

Fixes #1175

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

Windows 11
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)

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

The following steps presume that you've chosen to use the WF49Baku Finalized contest.

  • Create the folder path: /home/icpc/pc2 This is where PC2 will place the generated scoreboards. If you want, you can change this by running a PC2 Admin after starting the server (below) and changing the path on the Settings tab. If you do change the scoreboard paths, be sure to also Unfreeze the scoreboard again. Apparently, changing any setting clears the thawed status of the contest (Bug?)
  • Start the PC2 Server in Eclipse or using a command like ./bin/pc2server --login s1 --contestpassword contest. This will automatically load the WF49Baku (finalized) contest into PC2.
  • Start a PC2 board in Eclipse or using a command like ./bin/pc2admin --login b1.
  • This will generate a bunch of scoreboard HTML files in /home/icpc/pc2/wf49_finals_public. Look for "index.html" and double-click it to bring up a browser to view it. Note that the contest image (logo) will not appear at the top - there will be a blank place-holder since the contest header is not included by default.

Notes

I would like to have this in 9.11, or at least available for NAC2026 since it is possible they may decide to rank the teams using WF style ranking rather then normal ranking. We do not have to merge this into develop, however, I'd ilke to get it approved PRIOR to NAC2026 and I will make up a special "pc2board" that can be used in a pinch at NAC.

Sample Images

image

...

image

This commit is an incomplete solution.  While it does set the ranks according to the number of problems solved for "obeyFreeze" scoreboards, it does not maintain individual ranks for medalists.   In addition, the teams within a number solved grouping should be sorted alphabetically by institution - they are not.  This is a WIP.
In the case of the final public scoreboard using WF honors ranking (that is, obeyFreeze, unfrozen and finalized), we generate the XML standings report slightly differently.  We use honors grouping logic so all teams in an honors group have the same rank (except for medalists - they all have their own rank, unless really tied).
CI: Add Utilities method to return a default FinalizeData object (4g/4s/4b).  Also charge ResultsFile to use the new method and remove its copy of the code.
CI: In NSA, there was a bug where it wasn't properly counting Judged runs (CE's don't count as judged runs if CE's are set to be ignored).
CI: Add code to the index.xsl to generate the HTML page for the public final scoreboard with "HM" as the rank for Honorable Mention teams, rather than putting a bogus rank there.
Changes to support public final scoreboard for WF Honors rules.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Jan 29, 2026
@johnbrvc johnbrvc self-assigned this Jan 29, 2026
@johnbrvc
Copy link
Collaborator Author

@JoeTerlizzi reports teams within an honors group not sorted properly. Should be sorted by # solved, then alphabetical univ name. Currently sorted by # solved, #points, alphabetical univ. name.

Copy link
Contributor

@clevengr clevengr left a comment

Choose a reason for hiding this comment

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

I reviewed all the changed files; I added a few minor comments/questions but there's nothing in the code that would stop me from approving the PR.

However, when I pull the code from the branch, build a distribution on my machine, and run the "Test Steps" listed in the PR, I do not get the expected scoreboard. Rather, I get a scoreboard that has all the teams with separate ranks, as follows:

Image

I used the procedure of changing (both) the public and private scoreboard URLs via the PC2 admin; it generated HTML files in both my secret and my public locations -- but both scoreboards have ranks for all teams (as shown above; that one is the "secret" scoreboard).

Is it possible there's a missing step in the Test Steps?

finalizeData.setBronzeRank(12);
finalizeData.setCertified(false);
finalizeData.setComment("Preliminary Results - Contest not Finalized");
finalizeData.setUseWFGroupRanking(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really the case that we want the default for useWFGroupRanking to be true? It seems like we ONLY use that value for WF contests... in which case false might be a more logical default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, but I think that is out of scope for this issue and PR. I will open a new issue for changing the default ranking to non-WF Group Ranking. Issue #1219 created.

Comment on lines +540 to +541
if (finalizeData.getHonorSolvedCount() != 0) {
medianSolved = finalizeData.getHonorSolvedCount();
Copy link
Contributor

Choose a reason for hiding this comment

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

The new static method getDefaultFinalizeData() (in src/edu/csus/ecs/pc2/core/model/FinalizeData.java) doesn't set a default value for honorSolvedCount. (I realize that it's an int, and that it's initialized to zero in its declaration... but still, it seems like that method should explicitly set it -- just like it's already explicitly setting certified to false and useWFGroupRanking to true even though those are the values

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed. Also as a CI, created static final int's for gold, silver and bronze default last ranks.
Next push.

private void createStandingXML (TreeMap<StandingsRecord, StandingsRecord> treeMap, XMLMemento mementoRoot,
AccountList accountList, Problem[] problems, Hashtable<ElementId, Integer> problemsIndexHash, Group[] groups,
IInternalContest theContest, IMemento summaryMememento, boolean excludedGroups) {
IInternalContest theContest, IMemento summaryMememento, boolean excludedGroups, boolean isWFStandings, int medianSolved) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Trivial, but it would be nice if the misspelling summaryMememento was fixed (to be summaryMemento).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed.
Next push.

<xsl:value-of select="@rank"/>
</xsl:otherwise>
</xsl:choose>
</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

I reviewed the file data/xsl/index.xsl. I do not know very much about XSL; it "looks right" to me but that's all I can say.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does work... so, that's something.

@johnbrvc
Copy link
Collaborator Author

johnbrvc commented Feb 4, 2026

I reviewed all the changed files; I added a few minor comments/questions but there's nothing in the code that would stop me from approving the PR.

However, when I pull the code from the branch, build a distribution on my machine, and run the "Test Steps" listed in the PR, I do not get the expected scoreboard. Rather, I get a scoreboard that has all the teams with separate ranks, as follows:

Image I used the procedure of changing (both) the public and private scoreboard URLs via the PC2 admin; it generated HTML files in both my `secret` and my `public` locations -- but both scoreboards have ranks for all teams (as shown above; that one is the "secret" scoreboard).

Is it possible there's a missing step in the Test Steps?

I just ran through all the steps above and it works for me (that is, I get the correct scoreboard). I did make one change to the steps above and that is the path to where the scoreboard may be found is \home\icpc\pc2\wf49_finals_public (I had left off the wf49_finals_public before).

Did you run the test from within eclipse or the command line? If the latter, is it possible it's not using the correct pc2.jar file? I had that problem where the one on the classpath that gets computed is not the same one as the generated code for the PR. If you ran from the command line, might I suggest trying it from within eclipse?

To run from the command line, the way I tested it was pretty standard, I think: use package.xml, and use ant build "archiveSkipTests", then I took the zip from the "dist" folder, and extracted it to a clean folder, eg. \users\public. That will create the folder \users\public\pc2-9.11build-7981 and in that will be pc2-9.11build. Extract the WF49BakuFinalized zip file in the pc2-9.11build folder. Change to that folder, and then you can run the commands as described above.

@clevengr
Copy link
Contributor

clevengr commented Feb 4, 2026

I reviewed all the changed files; I added a few minor comments/questions but there's nothing in the code that would stop me from approving the PR.
However, when I pull the code from the branch, build a distribution on my machine, and run the "Test Steps" listed in the PR, I do not get the expected scoreboard. Rather, I get a scoreboard that has all the teams with separate ranks, as follows:
Image
I used the procedure of changing (both) the public and private scoreboard URLs via the PC2 admin; it generated HTML files in both my secret and my public locations -- but both scoreboards have ranks for all teams (as shown above; that one is the "secret" scoreboard).
Is it possible there's a missing step in the Test Steps?

I just ran through all the steps above and it works for me (that is, I get the correct scoreboard). I did make one change to the steps above and that is the path to where the scoreboard may be found is \home\icpc\pc2\wf49_finals_public (I had left off the wf49_finals_public before).

I did get scoreboards (HTML files) in the place(s) where I expected them, so I don't think that has anything to do with my problem.

Did you run the test from within eclipse or the command line? If the latter, is it possible it's not using the correct pc2.jar file? I had that problem where the one on the classpath that gets computed is not the same one as the generated code for the PR. If you ran from the command line, might I suggest trying it from within eclipse?

I opened Eclipse on your repo, pulled (updated) from the repo, switched to the i1175 branch, and ran package.xml to rebuild the entire system. Then I copied the resulting distribution file (pc2-9.11build-7981.zip) from Eclipse into a clean folder and unzipped it. I then downloaded and unzipped the wf49BakuFinalized into a totally different folder, then copied the wf49BakuFinalized profiles and profiles.properties into the unzipped pc2-9.11build folder. I started the PC2 Server in that folder from a command Windows command prompt; it loaded the contest as expected. I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder. I then started a PC2 Board from a (third) command prompt in the PC2 installation folder. It generated the HTML files, including the one (copied above) with separate rankings for each team.

I can try it from within Eclipse, but I can't see how that's going to make any difference... and anyway, I think it SHOULD have worked correctly based on the steps I followed above...

To run from the command line, the way I tested it was pretty standard, I think: use package.xml, and use ant build "archiveSkipTests", then I took the zip from the "dist" folder, and extracted it to a clean folder, eg. \users\public. That will create the folder \users\public\pc2-9.11build-7981 and in that will be pc2-9.11build. Extract the WF49BakuFinalized zip file in the pc2-9.11build folder. Change to that folder, and then you can run the commands as described above.

@johnbrvc
Copy link
Collaborator Author

johnbrvc commented Feb 4, 2026

I reviewed all the changed files; I added a few minor comments/questions but there's nothing in the code that would stop me from approving the PR.
However, when I pull the code from the branch, build a distribution on my machine, and run the "Test Steps" listed in the PR, I do not get the expected scoreboard. Rather, I get a scoreboard that has all the teams with separate ranks, as follows:
Image
I used the procedure of changing (both) the public and private scoreboard URLs via the PC2 admin; it generated HTML files in both my secret and my public locations -- but both scoreboards have ranks for all teams (as shown above; that one is the "secret" scoreboard).
Is it possible there's a missing step in the Test Steps?

I just ran through all the steps above and it works for me (that is, I get the correct scoreboard). I did make one change to the steps above and that is the path to where the scoreboard may be found is \home\icpc\pc2\wf49_finals_public (I had left off the wf49_finals_public before).

I did get scoreboards (HTML files) in the place(s) where I expected them, so I don't think that has anything to do with my problem.

Did you run the test from within eclipse or the command line? If the latter, is it possible it's not using the correct pc2.jar file? I had that problem where the one on the classpath that gets computed is not the same one as the generated code for the PR. If you ran from the command line, might I suggest trying it from within eclipse?

I opened Eclipse on your repo, pulled (updated) from the repo, switched to the i1175 branch, and ran package.xml to rebuild the entire system. Then I copied the resulting distribution file (pc2-9.11build-7981.zip) from Eclipse into a clean folder and unzipped it. I then downloaded and unzipped the wf49BakuFinalized into a totally different folder, then copied the wf49BakuFinalized profiles and profiles.properties into the unzipped pc2-9.11build folder. I started the PC2 Server in that folder from a command Windows command prompt; it loaded the contest as expected. I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder. I then started a PC2 Board from a (third) command prompt in the PC2 installation folder. It generated the HTML files, including the one (copied above) with separate rankings for each team.

I can try it from within Eclipse, but I can't see how that's going to make any difference... and anyway, I think it SHOULD have worked correctly based on the steps I followed above...

To run from the command line, the way I tested it was pretty standard, I think: use package.xml, and use ant build "archiveSkipTests", then I took the zip from the "dist" folder, and extracted it to a clean folder, eg. \users\public. That will create the folder \users\public\pc2-9.11build-7981 and in that will be pc2-9.11build. Extract the WF49BakuFinalized zip file in the pc2-9.11build folder. Change to that folder, and then you can run the commands as described above.

"I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder."

You didn't make it the same folder, did you? In that case, it would dump the secret scoreboard in the same folder as the public. The secret scoreboard is ranked always (never uses wf rules). You need to only look at the public one. I assume you did that?

@clevengr
Copy link
Contributor

clevengr commented Feb 4, 2026

"I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder."

You didn't make it the same folder, did you? In that case, it would dump the secret scoreboard in the same folder as the public. The secret scoreboard is ranked always (never uses wf rules). You need to only look at the public one. I assume you did that?

No, I didn't use the same folder. I created a single folder scoreboards, in the pc2 installation folder, then pointed to two different folders underneath that -- one for public and one for secret. Here's the Admin Settings showing that:

image

And File Explorer shows two different folders beneath "scoreboards":

image

And here's the index.html underneath the "public" folder (note the URL in the browser address bar, and that the teams all have individual ranks) :

image

@johnbrvc
Copy link
Collaborator Author

johnbrvc commented Feb 4, 2026

"I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder."

You didn't make it the same folder, did you? In that case, it would dump the secret scoreboard in the same folder as the public. The secret scoreboard is ranked always (never uses wf rules). You need to only look at the public one. I assume you did that?

No, I didn't use the same folder. I created a single folder scoreboards, in the pc2 installation folder, then pointed to two different folders underneath that -- one for public and one for secret. Here's the Admin Settings showing that:

image And File Explorer shows two different folders beneath "scoreboards": image And here's the index.html underneath the "public" folder (note the URL in the browser address bar, and that the teams all have individual ranks) : image

Wait - that's not the "Final" scoreboard. There should be no pendings, and it should say "Final Scoreboard" instead of "Scoreboard was frozen with...." It sounds like for whatever reason, the contest is not finalized, or it's not unfrozen. Can you check the Finalize tab to make sure it's finalized? The zip that was referred to is Finalized and Frozen. It's almost as if it's the wrong Profile you're loading - or something similar.
image

And to confirm its unfrozen, generate an Event Feed JSON report, and look at the 2nd line of the json (the "state" message) you should see a time for thawed and finalized - in fact it should be the same time as below:
image

If that is all correct, then I am at a loss. I might delete all the html files in both folders, then press "Refresh" on the pc2board client.

@clevengr
Copy link
Contributor

clevengr commented Feb 4, 2026

"I then started a PC2 Admin from a command prompt in that same folder, and used the Settings tab to change the Public and Secret HTML paths to point to an empty sub-folder beneath the PC2 installation folder."

You didn't make it the same folder, did you? In that case, it would dump the secret scoreboard in the same folder as the public. The secret scoreboard is ranked always (never uses wf rules). You need to only look at the public one. I assume you did that?

No, I didn't use the same folder. I created a single folder scoreboards, in the pc2 installation folder, then pointed to two different folders underneath that -- one for public and one for secret. Here's the Admin Settings showing that:
image
And File Explorer shows two different folders beneath "scoreboards":
image
And here's the index.html underneath the "public" folder (note the URL in the browser address bar, and that the teams all have individual ranks) :
image

Wait - that's not the "Final" scoreboard. There should be no pendings, and it should say "Final Scoreboard" instead of "Scoreboard was frozen with...." It sounds like for whatever reason, the contest is not finalized, or it's not unfrozen. Can you check the Finalize tab to make sure it's finalized? The zip that was referred to is Finalized and Frozen. It's almost as if it's the wrong Profile you're loading - or something similar. image

And to confirm its unfrozen, generate an Event Feed JSON report, and look at the 2nd line of the json (the "state" message) you should see a time for thawed and finalized - in fact it should be the same time as below: image

If that is all correct, then I am at a loss. I might delete all the html files in both folders, then press "Refresh" on the pc2board client.

Here's the Admin "Finalize" tab:

image

Looks correct to me (that is, it looks like it matches yours). Here's the "state" line from the Event Feed JSON report:

{"type":"state","token":"pc2-2","id": null,"data": {"started":"2025-09-03T23:48:46.003-07","frozen":"2025-09-04T03:48:46.003-07","ended":"2025-09-04T04:48:46.003-07","thawed":null,"finalized":"2026-01-27T08:25:39.473-08","end_of_updates":null,"paused":null,"resumed":"2025-09-03T23:48:47.227-07","contest_time":"05:00:00.317"}}

Note that "thawed" is null, which is different from your report. I assume that's the problem... which leads to the question I originally asked: is it possible there's a missing step in the "Steps for Testing the PR"?

@clevengr
Copy link
Contributor

clevengr commented Feb 4, 2026

Ok, adding the step "Unfreeze the Scoreboard" solves the problem outlined above; I can now see the expected scoreboard.

Copy link
Contributor

@clevengr clevengr left a comment

Choose a reason for hiding this comment

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

Once I added the step of unfreezing the scoreboard to the Test Steps, I was able to see the intended scoreboard.

I agree with the comment attributed to @JoeTerlizzi : I think the HM category shouldn't be strictly in alphabetical order; I think it should be sorted first by "Number Solved" and then in alphabetical order within teams solving the same number of problems. (This is not strictly speaking the "Bill Rule" -- but if we were going to strictly implement that rule then we should not be showing ANY details for the HM category -- no number solved, no score, no run details; just a list of team names. In THAT case, alphabetical by team would make sense... but I think it's better to show those details. So, I'd request a change so that HM teams with the same number solved are grouped together...

@johnbrvc
Copy link
Collaborator Author

johnbrvc commented Feb 4, 2026

Ok, adding the step "Unfreeze the Scoreboard" solves the problem outlined above; I can now see the expected scoreboard.

This is evidently a bug with the Settings tab. Apparently, when you FIRST changed the paths to something other than what I had them set to, it CLEARED the thawed state in the contest. (Which, by the way, is a neat trick.) Anyway, in order for it to work properly, you had to RE-Unfreeze it. If you hadn't changed the paths, it would have worked fine. By the way, I added a note in the test procedure saying that if you change the settings, then you have to also re-Unfreeze the contest.

Created new issue #1213

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.

Final scoreboard should show WF Honor's rankings

2 participants