Skip to content

Serialization bug causes ir.Method object comparisons to fail #598

@neelay893

Description

@neelay893

When comparing pre and post-serialization kernels (ir.Method objects), eq fails due to run_passes attribute not being set in deserialization. MWE:

from kirin.dialects import math
from kirin.prelude import basic_no_opt 
from kirin.serialization.base.serializer import Serializer


@basic_no_opt
def kirin_make_fn():
    return 5 + 3

if __name__ == "__main__":
    sr = Serializer()
    decoded1 = basic_no_opt.decode(sr.encode(kirin_make_fn))
    print(f"make_fn == make_fn_dc: {kirin_make_fn == decoded1}")  

The above raises: AttributeError: 'Method' object has no attribute 'run_passes'

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions