You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by GitBox <gi...@apache.org> on 2026/02/09 04:40:19 UTC

[GH] (tvm-ffi/2026-02-08/copy): Workflow run "CI" failed!

The GitHub Actions job "CI" on tvm-ffi.git/2026-02-08/copy has failed.
Run started by GitHub user junrushao (triggered by junrushao).

Head commit for run:
86aa7e86a7e63f70a536fd7ab7a77993aab81033 / Junru Shao <ju...@nvidia.com>
feat: add __copy__, __deepcopy__, and __replace__ for FFI objects

 ## Summary

- Add `refl::enable_copy()` to the C++ reflection API, which registers a `__ffi_shallow_copy__` method using the copy constructor
- Implement `ObjectDeepCopier` in `src/ffi/extra/copy.cc` that walks the object graph (DFS with explicit stack), then copies in topological order (leaves first) with field replacement
- Wire up Python `__copy__`, `__deepcopy__`, and `__replace__` for both `@register_object` and `@c_class` paths; types without `enable_copy()` raise `TypeError`

 ## Test plan

17 new tests in `tests/python/test_copy.py` covering:
- [x] `copy.copy()`: basic fields, new object identity, mutable fields, mutation isolation, derived type preservation, unsupported type error
- [x] `copy.deepcopy()`: basic fields, nested object copying, shared reference preservation, mutation isolation, unsupported type error
- [x] `__replace__()`: single/multiple field replacement, no-kwargs copy, original unchanged, readonly field error, unsupported type error

 ## Misc

- Add `--error-on-warning` to the `ty` pre-commit hook

Report URL: https://github.com/apache/tvm-ffi/actions/runs/21812418252

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org