22import functools
33import logging
44import subprocess
5- from typing import Any , List , Optional , TypedDict
5+ from typing import Any , List , NotRequired , Optional , TypedDict
66
77import discord
88from consts import Language , SubmissionMode
@@ -191,6 +191,7 @@ class LeaderboardItem(TypedDict):
191191 task : LeaderboardTask
192192 gpu_types : List [str ]
193193 forum_id : int
194+ secret_seed : NotRequired [int ]
194195
195196
196197class LeaderboardRankedEntry (TypedDict ):
@@ -266,18 +267,23 @@ def build_task_config(
266267 else :
267268 all_files [n ] = c
268269
270+ common = {
271+ "lang" : task .lang .value ,
272+ "arch" : arch ,
273+ "benchmarks" : task .benchmarks ,
274+ "tests" : task .tests ,
275+ "mode" : mode .value ,
276+ "test_timeout" : task .test_timeout ,
277+ "benchmark_timeout" : task .benchmark_timeout ,
278+ "ranked_timeout" : task .ranked_timeout ,
279+ "seed" : task .seed ,
280+ }
281+
269282 if task .lang == Language .Python :
270283 return {
271- "lang" : task .lang .value ,
272- "arch" : arch ,
273284 "main" : task .config .main ,
274285 "sources" : all_files ,
275- "benchmarks" : task .benchmarks ,
276- "tests" : task .tests ,
277- "mode" : mode .value ,
278- "test_timeout" : task .test_timeout ,
279- "benchmark_timeout" : task .benchmark_timeout ,
280- "ranked_timeout" : task .ranked_timeout ,
286+ ** common
281287 }
282288 else :
283289 sources = {}
@@ -289,17 +295,9 @@ def build_task_config(
289295 headers [f ] = all_files [f ]
290296
291297 return {
292- "lang" : task .lang .value ,
293- "arch" : arch ,
294298 "sources" : sources ,
295299 "headers" : headers ,
296- "tests" : task .tests ,
297- "benchmarks" : task .benchmarks ,
298300 "include_dirs" : task .config .include_dirs ,
299- "mode" : mode .value ,
300- "test_timeout" : task .test_timeout ,
301- "benchmark_timeout" : task .benchmark_timeout ,
302- "ranked_timeout" : task .ranked_timeout ,
303301 }
304302
305303
0 commit comments