Skip to content

Commit 93a3e9c

Browse files
Essozclaude
andcommitted
fix: miscellaneous online checker bug fixes
- consistency_relation: use .get() instead of direct key access in online_check to avoid KeyError when a variable lacks a tracked attribute - contain_relation: use ASCII arrow in to_display_name for terminal safety - collect_trace: demote InputOutputParam warning to debug to reduce noise Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent db9bf45 commit 93a3e9c

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

traincheck/collect_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def merge(a: dict, b: dict, path=[]):
104104
func_instr_opts[func_name]["dump_args"] = True
105105
func_instr_opts[func_name]["dump_ret"] = True
106106
# TODO: convert the arguments to instr_opts_dict (currently not possible as the index indicates the index of the argument/ret value among other tensors not all arguments)
107-
logger.warning(
107+
logger.debug(
108108
"Currently not supporting fine-grained dumping of arguments and return values for InputOutputParam"
109109
)
110110

traincheck/invariant/consistency_relation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def get_check_attr(param, varid):
626626
for var2 in checker_data.type_map[ref_param.var_type]:
627627
if var2 == varid:
628628
continue
629-
if checker_data.varid_map[var2][ref_param.attr_name] is None:
629+
if checker_data.varid_map[var2].get(ref_param.attr_name) is None:
630630
logger.debug(
631631
f"Attribute {ref_param.attr_name} not found in variable {var2}"
632632
)

traincheck/invariant/contain_relation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _fmt_val(v: object) -> str:
371371
return "non-zero" if v == "non_zero" else str(v)
372372

373373
if pre is not _NOT_SET and post is not _NOT_SET:
374-
return f"{parent_short}() changes {var_short}.{attr}: {_fmt_val(pre)} {_fmt_val(post)}"
374+
return f"{parent_short}() changes {var_short}.{attr}: {_fmt_val(pre)} --> {_fmt_val(post)}"
375375
if const is not _NOT_SET:
376376
return f"{parent_short}() sees {var_short}.{attr} = {const}"
377377
return f"{parent_short}() accesses {var_short}.{attr}"

0 commit comments

Comments
 (0)