From 6534475fa1bd39a991da4dc113138f80cfab0bc0 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 13 Nov 2025 07:50:10 -0800 Subject: [PATCH] Fixing a non-reproducibility issue in "lutmin". --- src/base/abci/abcLutmin.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/abci/abcLutmin.c b/src/base/abci/abcLutmin.c index 449bbd512..b23b8bfa9 100644 --- a/src/base/abci/abcLutmin.c +++ b/src/base/abci/abcLutmin.c @@ -1083,8 +1083,10 @@ Abc_Obj_t * Abc_NtkBddDecompose( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int nLu } // cofactor w.r.t. the bound set variables vCofs = Abc_NtkBddCofactors( dd, (DdNode *)pNode->pData, nLutSize ); - vUniq = Vec_PtrDup( vCofs ); - Vec_PtrUniqify( vUniq, (int (*)(const void *, const void *))Vec_PtrSortCompare ); + // collect unique cofactors in the order they appear + vUniq = Vec_PtrAlloc( Vec_PtrSize(vCofs) ); + Vec_PtrForEachEntry( DdNode *, vCofs, bCof, i ) + Vec_PtrPushUnique( vUniq, bCof ); // only perform decomposition which it is support reducing with two less vars if( Vec_PtrSize(vUniq) > (1 << (nLutSize-2)) ) { @@ -1257,4 +1259,3 @@ void Abc_NtkBddDecExplore( Abc_Obj_t * pNode ) {} ABC_NAMESPACE_IMPL_END -