tqchen opened a new pull request, #583:
URL: https://github.com/apache/tvm-ffi/pull/583
The single SEqHashDef flag treated every nested free var inside a
def-region field as a fresh def. That conflates two different binding
shapes:
- Recursive (function parameters): the value var and any free vars
inside its sub-fields are co-introduced at the same binding site.
- Non-recursive (normal binding): only the immediate value var binds;
free vars in the var's sub-fields are use references that must
resolve against an outer-scope binding.
This PR splits the flag in two so each binding shape can be expressed
directly, and updates the structural-equal / structural-hash machinery
to distinguish them when descending into a FreeVar's own sub-fields.
The custom `__ffi_s_equal__` / `__ffi_s_hash__` callback signature
gains a typed kind for the def-mode argument; legacy callers passing
a bool continue to compile and preserve their meaning via the standard
bool->int coercion (true -> 1 = Recursive, false -> 0 = None).
The Cython / Python bindings mirror the rename and add the new
non-recursive flag to the dataclass field vocabulary. Regression tests
cover the four recursive / non-recursive corner cases on a new
`TDefHolder` test type whose `def_recursive` and `def_non_recursive`
fields hold a FreeVar with a nested FreeVar sub-field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]