Skip to content

Commit

Permalink
Double hard wall time limit for interactive problems. (#2144)
Browse files Browse the repository at this point in the history
This accounts for wall time spent in the validator. We may likely want
to make this configurable in the future. The current factor is under the
assumption that the validator has to do approximately the same amount of
work wall-time wise as the submission.
  • Loading branch information
meisterT authored Sep 18, 2023
1 parent aa7022c commit a88ba4c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions judge/judgedaemon.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1350,10 +1350,6 @@ function judge(array $judgeTask): bool
}

// do the actual test-run
$hardtimelimit = $run_config['time_limit'] +
overshoot_time($run_config['time_limit'], $overshoot);


$combined_run_compare = $compare_config['combined_run_compare'];
[$run_runpath, $error] = fetch_executable(
$workdirpath,
Expand Down Expand Up @@ -1383,6 +1379,16 @@ function judge(array $judgeTask): bool
}
}

$hardtimelimit = $run_config['time_limit'] +
overshoot_time($run_config['time_limit'], $overshoot);
if ($combined_run_compare) {
// This accounts for wall time spent in the validator. We may likely
// want to make this configurable in the future. The current factor is
// under the assumption that the validator has to do approximately the
// same amount of work wall-time wise as the submission.
$hardtimelimit *= 2;
}

// While we already set those above to likely the same values from the
// compile config, we do set them again from the compare config here.
putenv('SCRIPTTIMELIMIT=' . $compare_config['script_timelimit']);
Expand Down

0 comments on commit a88ba4c

Please sign in to comment.