fix(diff): bugs on diff stdin and numerics #16
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JOJ/JOJ3-config-generator#16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/diff"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix problems in #15
@ -5,7 +5,6 @@ from joj3_config_generator.models.common import Memory, Time
DEFAULT_CPU_LIMIT = Time("1s")
DEFAULT_MEMORY_LIMIT = Memory("256m")
DEFAULT_FILE_LIMIT = Memory("32m")
DEFAULT_CASE_SCORE = 5
why is it removed?
added a field in toml named
diff.default_score
and this 5 is now directly written numerically here:added back now.
why not
yes, this is the case now, sorry :)
do we need to also create a
DEFAULT_PROC_LIMIT
?good idea, maybe we can also have
DEFAULT_CLOCK_LIMIT_MULTIPLIER
both added now.
@ -238,6 +246,7 @@ def fix_diff(
)
parser_cases.append(parser_case)
executor.with_.cases = stage_cases
executor.with_.default.stdin = None
Should be removed. It should be fixed from JOJ3 side. Also in
InputFile = Union[LocalFile, MemoryFile, PreparedFile, Symlink, None]
done
@ -202,2 +202,3 @@
cmd.args = None
if cmd.cpu_limit == executor.with_.default.cpu_limit:
# duplicate with the fallback case in executor.with_
if cmd.cpu_limit == const.DEFAULT_CPU_LIMIT:
What if the
with_.default.cpu_limit
is not the same asDEFAULT_CPU_LIMIT
? Why do we need to set these fields to none?if the
with_.default.cpu_limit
is not the same asDEFAULT_CPU_LIMIT
it means its already been input before, and it is considered as the new default value for all cases (ta might want to control it). If I dont set these field to none, it will useDEFAULT_CPU_LIMIT
instead of those ta input, which is not intended. It solve the second problem in #15Which test case will show this problem?
We need another pydantic model for auto detected cases. Fields in these cases can be none, which means they are not set and should use
with_.default
values.@ -3,9 +3,11 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, field_validator
from joj3_config_generator.models.const import (
DEFAULT_CLOCK_LIMIT_MULTIPLIER,
Should be applied to other locations in
transformers/task.py
@ -210,3 +213,4 @@
if cmd.proc_limit == const.DEFAULT_PROC_LIMIT:
cmd.proc_limit = None
stage_cases.append(cmd)
parser_case = result.DiffCasesConfig(
better check if the
*.out
file exists in get_testcasesNot quite understand why would taht better?
If case*.out will always be used in diff parser, we want to ensure it exists to form a valid case.
ok, I see, indeed a good point.
done.
Please check if the current solution works.
@ -251,4 +260,7 @@ def get_testcases(
testcases_path.relative_to((task_root / task_path).parent)
).removesuffix(".in")
)
assert os.path.exists(
No. Just do not append it to the return value and log a warning.
okay
we can probably move some redundant functions like
get_testcaes
into autils.py
as file llines already bit largeleave it here now. we have not reused the logic.
@ -246,6 +256,9 @@ def get_testcases(
) -> Set[str]: # basedir here should be task_conf.root / task_conf.path
testcases = set()
for testcases_path in (task_root / task_path).parent.glob("**/*.in"):
if not os.path.exists(str(testcases_path).removesuffix(".in") + ".out"):
if not testcases_path.with_suffix(".out").exists():
done