tqchen opened a new pull request, #597:
URL: https://github.com/apache/tvm-ffi/pull/597

   ## Background
   
   `StructuralEqual::Equal` was registered as the `ffi.StructuralEqual` FFI 
global
   in #453, making the cheap boolean path available to cross-language callers
   (Python calls it via `tvm_ffi.structural_equal`). However, no C++ test
   exercised that global through the FFI registry — existing tests call either
   the C++ functor (`StructuralEqual()(lhs, rhs)`) or the static method
   (`StructuralEqual::Equal(...)`) directly, bypassing the registry dispatch 
path.
   
   Motivated by the Gemini review on apache/tvm#19613, which highlighted the
   efficiency win of calling `ffi.StructuralEqual` instead of
   `GetFirstStructuralMismatch(...) is None`.
   
   ## Changes
   
   - `tests/cpp/extra/test_structural_equal_hash.cc`: add
     `StructuralEqualHash.FFIGlobalStructuralEqual` which retrieves
     `ffi.StructuralEqual` and `ffi.GetFirstStructuralMismatch` via
     `Function::GetGlobalRequired` and verifies:
     - equal arrays → true
     - unequal arrays → false
     - boolean result is consistent with `GetFirstStructuralMismatch` returning
       nullopt for the same pair
   - Add `#include <tvm/ffi/function.h>` for `Function::GetGlobalRequired`.
   
   ## Test plan
   
   - [ ] `StructuralEqualHash.FFIGlobalStructuralEqual` passes
   - [ ] Full C++ test suite: 344/344 pass (2 disabled)


-- 
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]

Reply via email to