Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/05-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
Copy-Item $dll.FullName -Destination . -Force
Write-Host "Copied $dllName from $($dll.DirectoryName)"
} else {
Write-Error "$dllName not found anywhere under $buildDir"
Write-Host "WARNING: $dllName not found (all-in-one libs are static on MSVC, DLL not needed)"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ allure-*
!build_android.sh
!build_ios.sh

config/
doc/
examples/python/
examples/c_api/
logs/
10 changes: 6 additions & 4 deletions examples/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0077 NEW)
# Must be set BEFORE project() so MSVC compiler flags are generated with /MT.
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
project(zvec-example-c++)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -28,9 +32,7 @@ if(CMAKE_BUILD_TYPE)
list(APPEND ZVEC_LIB_SEARCH_DIRS ${ZVEC_CONFIG_LIB_DIR})
endif()
endif()
if(WIN32)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()


function(zvec_find_shared_library OUT_VAR LIB_NAME)
unset(${OUT_VAR} CACHE)
Expand Down
15 changes: 12 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ function(zvec_add_all_in_one_shared TARGET_NAME OUTPUT_NAME)
"// Auto-generated stub for ${TARGET_NAME}\n"
)

add_library(${TARGET_NAME} SHARED
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_stub.cc
)
# MSVC: build as STATIC to avoid LNK1189 (PE/COFF 65535 export limit).
# WINDOWS_EXPORT_ALL_SYMBOLS is silently ignored for static libraries.
# Consumers (fts_bench, examples) still link against this target normally.
if(MSVC)
add_library(${TARGET_NAME} STATIC
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_stub.cc
)
else()
add_library(${TARGET_NAME} SHARED
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_stub.cc
)
endif()

set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME "${OUTPUT_NAME}"
Expand Down
2 changes: 1 addition & 1 deletion src/core/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cc_library(
NAME core_utility
STATIC SHARED STRICT ALWAYS_LINK
SRCS *.cc
LIBS zvec_ailego core_framework
LIBS zvec_ailego core_framework rabitqlib
INCS . ${PROJECT_ROOT_DIR}/src/core
LDFLAGS "${CORE_UTILITY_LDFLAGS}"
VERSION "${PROXIMA_ZVEC_VERSION}"
Expand Down
103 changes: 103 additions & 0 deletions src/core/utility/eigen_lnk1189_probe.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// Temporary LNK1189 probe: heavy Eigen template instantiation.
// If the component library is still built as SHARED with
// WINDOWS_EXPORT_ALL_SYMBOLS on MSVC, these symbols will push
// the .def file past the PE/COFF 65535-section limit → LNK1189.
// After confirming the fix works, REMOVE this file and revert
// the rabitqlib addition in CMakeLists.txt.

#include <vector>
#include <rabitqlib/third/Eigen/Dense>
#include <rabitqlib/third/Eigen/Sparse>

namespace zvec {
namespace core {

// Each explicit instantiation of Eigen operations generates many
// COMDAT sections (matrix ops, decompositions, solvers, etc.)

#define PROBE_EIGEN_TAG(SCALAR, TAG, ROWS, COLS) \
void _probe_eigen_impl_##SCALAR##_##TAG( \
const Eigen::Matrix<SCALAR, ROWS, COLS> &m) { \
auto a = m + m; \
auto b = m * 2.0f; \
auto c = m.transpose() * m; \
auto d = m.array() * m.array(); \
(void)a; \
(void)b; \
(void)c; \
(void)d; \
}

#define PROBE_EIGEN(SCALAR, ROWS, COLS) \
PROBE_EIGEN_TAG(SCALAR, ROWS##x##COLS, ROWS, COLS)

// Generate instantiations for various matrix sizes
// Each generates ~hundreds of COMDAT sections with Eigen
PROBE_EIGEN(float, 2, 2)
PROBE_EIGEN(float, 3, 3)
PROBE_EIGEN(float, 4, 4)
PROBE_EIGEN(float, 8, 8)
PROBE_EIGEN(float, 16, 16)
PROBE_EIGEN(float, 32, 32)
PROBE_EIGEN(float, 64, 64)
PROBE_EIGEN(float, 128, 128)
PROBE_EIGEN(float, 256, 256)
PROBE_EIGEN(float, 512, 512)
PROBE_EIGEN(float, 768, 768)
PROBE_EIGEN(float, 1024, 1024)
PROBE_EIGEN(float, 1536, 1536)
PROBE_EIGEN(float, 2048, 2048)
PROBE_EIGEN_TAG(float, Dyn, Eigen::Dynamic, Eigen::Dynamic)
PROBE_EIGEN(double, 2, 2)
PROBE_EIGEN(double, 3, 3)
PROBE_EIGEN(double, 4, 4)
PROBE_EIGEN(double, 8, 8)
PROBE_EIGEN(double, 16, 16)
PROBE_EIGEN(double, 32, 32)
PROBE_EIGEN(double, 64, 64)
PROBE_EIGEN(double, 128, 128)
PROBE_EIGEN_TAG(double, Dyn, Eigen::Dynamic, Eigen::Dynamic)

#undef PROBE_EIGEN

// More heavy operations: decompositions, solvers
void _probe_decomp_f(const Eigen::MatrixXf &m) {
Eigen::LLT<Eigen::MatrixXf> llt(m);
Eigen::JacobiSVD<Eigen::MatrixXf> svd(m);
Eigen::HouseholderQR<Eigen::MatrixXf> qr(m);
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXf> eigen(m);
(void)llt;
(void)svd;
(void)qr;
(void)eigen;
}

void _probe_decomp_d(const Eigen::MatrixXd &m) {
Eigen::LLT<Eigen::MatrixXd> llt(m);
Eigen::JacobiSVD<Eigen::MatrixXd> svd(m);
Eigen::HouseholderQR<Eigen::MatrixXd> qr(m);
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> eigen(m);
(void)llt;
(void)svd;
(void)qr;
(void)eigen;
}

// Sparse matrix operations
void _probe_sparse_f(const Eigen::SparseMatrix<float> &m) {
Eigen::SparseLU<Eigen::SparseMatrix<float>> lu(m);
(void)lu;
}

void _probe_sparse_d(const Eigen::SparseMatrix<double> &m) {
Eigen::SparseLU<Eigen::SparseMatrix<double>> lu(m);
(void)lu;
}

// Exported function to ensure this TU is linked
extern "C" int lnk1189_probe_trigger() {
return 42;
}

} // namespace core
} // namespace zvec
3 changes: 1 addition & 2 deletions src/db/index/common/index_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ namespace zvec {

std::string InvertIndexParams::to_string() const {
std::ostringstream oss;
oss << "InvertIndexParams{"
<< "enable_range_optimization:"
oss << "InvertIndexParams{" << "enable_range_optimization:"
<< (enable_range_optimization_ ? "true" : "false")
<< ", enable_extended_wildcard:"
<< (enable_extended_wildcard_ ? "true" : "false") << "}";
Expand Down
6 changes: 2 additions & 4 deletions src/db/index/common/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ Status FieldSchema::validate() const {

std::string FieldSchema::to_string() const {
std::ostringstream oss;
oss << "FieldSchema{"
<< "name:'" << name_ << "'"
oss << "FieldSchema{" << "name:'" << name_ << "'"
<< ",data_type:" << DataTypeCodeBook::AsString(data_type_)
<< ",nullable:" << (nullable_ ? "true" : "false")
<< ",dimension:" << dimension_;
Expand Down Expand Up @@ -354,8 +353,7 @@ Status CollectionSchema::validate() const {

std::string CollectionSchema::to_string() const {
std::ostringstream oss;
oss << "CollectionSchema{"
<< "name:'" << name_ << "'"
oss << "CollectionSchema{" << "name:'" << name_ << "'"
<< ",max_doc_count_per_segment:" << max_doc_count_per_segment_
<< ",fields:[";

Expand Down
4 changes: 2 additions & 2 deletions src/db/index/common/stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
namespace zvec {
std::string CollectionStats::to_string() const {
std::ostringstream oss;
oss << "CollectionStats{"
<< "doc_count:" << doc_count << ",index_completeness:{";
oss << "CollectionStats{" << "doc_count:" << doc_count
<< ",index_completeness:{";

size_t i = 0;
for (const auto &pair : index_completeness) {
Expand Down
Loading