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/04/24 06:17:02 UTC

[GH] (tvm-ffi/junrushao/2026-04-23/enum-enhance): Workflow run "CI" failed!

The GitHub Actions job "CI" on tvm-ffi.git/junrushao/2026-04-23/enum-enhance has failed.
Run started by GitHub user junrushao (triggered by junrushao).

Head commit for run:
3fdb42679b147e92d0f885a2ae60b3d284802fb6 / Junru Shao <ju...@nvidia.com>
feat(enum): add payload enum compatibility behavior

TL;DR:
- Make IntEnum and StrEnum variants behave like their raw payloads for common Python enum operations while preserving FFI singleton identity through same_as.

Examples:
- Priority.low.name == "low" and repr(Priority.low) == "Priority.low".
- Priority.low == 10, str(Priority.low) == "10", and hash(Priority.low) == hash(10).
- Priority(10).same_as(Priority.low) and Priority("low").same_as(Priority.low).
- Opcode("+").same_as(Opcode.add) and Opcode("add").same_as(Opcode.add).

Details:
- Install payload-only instance dunders after py_class/c_class generation so payload semantics override generated object defaults without clobbering explicit user methods.
- Gate payload behavior on __ffi_enum_payload_value_type__ so plain Enum does not interpret arbitrary class-body values as public payloads.
- Keep single-argument member lookup in _EnumMeta.__call__ for existing variants, raw payloads, and names.
- Document why these methods are dynamically installed and what identity/equality contract they preserve.
- Add enum tests covering name, repr, str, equality, hashing, and construction from payload/name.
- Tests: uv run --with pytest pytest tests/python/test_dataclass_enum.py::test_payload_enum_compat_behaviors; uv run --with pytest pytest tests/python/test_dataclass_enum.py; uv run ruff check python/tvm_ffi/dataclasses/enum.py tests/python/test_dataclass_enum.py; uv run ruff check python/tvm_ffi/dataclasses/enum.py; git diff --cached --check.

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

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