Open
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,7 @@ services:
volumes:
- /var/lib/mysql
domjudge:
image: docker.io/domjudge/domjudge-contributor
image: as6325400/domjudge-contributor:8.3.1
hostname: domjudge-contributor
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -1424,12 +1424,18 @@

// Try to read metadata from file
$runtime = null;
$optscore = null;
$metadata = read_metadata($testcasedir . '/program.meta');
$compareMeta = read_metadata($testcasedir.'/compare.meta');

if (isset($metadata['time-used'])) {
$runtime = @$metadata[$metadata['time-used']];
}

if (isset($compareMeta['opt-score'])) {
$optscore = @$compareMeta['opt-score'];

Check failure on line 1436 in judge/judgedaemon.main.php

View workflow job for this annotation

Actions / phpcs

Line indented incorrectly; expected at least 8 spaces, found 7
}

if ($result === 'compare-error') {
if ($combined_run_compare) {
logmsg(LOG_ERR, "comparing failed for combined run/compare script '" . $judgeTask['run_script_id'] . "'");
Expand All@@ -1446,6 +1452,7 @@
$new_judging_run = [
'runresult' => urlencode($result),
'runtime' => urlencode((string)$runtime),
'optscore' => urlencode((string)$optscore),
'output_run' => rest_encode_file($testcasedir . '/program.out', $output_storage_limit),
'output_error' => rest_encode_file($testcasedir . '/program.err', $output_storage_limit),
'output_system' => rest_encode_file($testcasedir . '/system.out', $output_storage_limit),
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -233,6 +233,19 @@ if [ $COMBINED_RUN_COMPARE -eq 0 ]; then
-f $SCRIPTFILELIMIT -s $SCRIPTFILELIMIT -M compare.meta -- \
"$COMPARE_SCRIPT" testdata.in testdata.out feedback/ $COMPARE_ARGS < program.out \
>compare.tmp 2>&1

# match optscore
if grep -q '^OPT_SCORE=' compare.tmp ; then
score="$(grep -m1 '^OPT_SCORE=' compare.tmp | cut -d= -f2-)"
case "$score" in
''|*[!0-9.-]*|*.*.*|*.-*)
echo "Invalid OPT_SCORE value: $score" >&2
;;
*)
echo "opt-score: $score" >> compare.meta
;;
esac
fi
fi

# Make sure that all feedback files are owned by the current
Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250517062145 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest ADD similarity_as_score_tiebreaker TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Use similarity-based scoring instead of exact match\', ADD similarity_order VARCHAR(10) DEFAULT \'asc\' NOT NULL COMMENT \'Order to apply for similarity-based scoring: asc or desc\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest DROP similarity_as_score_tiebreaker, DROP similarity_order');
}

public function isTransactional(): bool
{
return false;
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250517084703 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest ADD opt_score_as_score_tiebreaker TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Use objective-score–based ranking instead of exact match\', ADD opt_score_order VARCHAR(10) DEFAULT \'asc\' NOT NULL COMMENT \'Order to apply for objective score: asc(smaller-better) or desc(larger-better)\', DROP similarity_as_score_tiebreaker, DROP similarity_order');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest ADD similarity_as_score_tiebreaker TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Use similarity-based scoring instead of exact match\', ADD similarity_order VARCHAR(10) DEFAULT \'asc\' NOT NULL COMMENT \'Order to apply for similarity-based scoring: asc or desc\', DROP opt_score_as_score_tiebreaker, DROP opt_score_order');
}

public function isTransactional(): bool
{
return false;
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250517085220 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest CHANGE opt_score_as_score_tiebreaker opt_score_as_score_tiebreaker TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Use optimization score ranking instead of exact match\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contest CHANGE opt_score_as_score_tiebreaker opt_score_as_score_tiebreaker TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Use objective-score–based ranking instead of exact match\'');
}

public function isTransactional(): bool
{
return false;
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250517145253 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE judging_run ADD optscore DOUBLE PRECISION DEFAULT NULL COMMENT \'optimization score\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE judging_run DROP optscore');
}

public function isTransactional(): bool
{
return false;
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250519130014 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rankcache ADD totaloptscore_max_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Total max optscore (restricted audience)\', ADD optscore_max_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Max optscore (public audience)\', ADD optscore_min_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (restricted audience)\', ADD optscore_min_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (public audience)\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rankcache DROP totaloptscore_max_restricted, DROP optscore_max_public, DROP optscore_min_restricted, DROP optscore_min_public');
}

public function isTransactional(): bool
{
return false;
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250519134327 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rankcache ADD totaloptscore_max_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Total max optscore (public audience)\', ADD totaloptscore_min_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Total min optscore (restricted audience)\', ADD totaloptscore_min_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Total min optscore (public audience)\', DROP optscore_max_public, DROP optscore_min_restricted, DROP optscore_min_public');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rankcache ADD optscore_max_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Max optscore (public audience)\', ADD optscore_min_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (restricted audience)\', ADD optscore_min_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (public audience)\', DROP totaloptscore_max_public, DROP totaloptscore_min_restricted, DROP totaloptscore_min_public');
}

public function isTransactional(): bool
{
return false;
}
}
Loading
Loading