Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f1e5318
Add: UTF-8 boundary detection
ashvardanian Nov 18, 2025
febbdac
Make: Redefining `SZ_DEBUG=0` in CMake
ashvardanian Nov 18, 2025
f532ea2
Fix: Signed comparisons for UTF-8 boundaries
ashvardanian Nov 18, 2025
e7b4b9e
Add: UTF-8 bound checks for Rust
ashvardanian Nov 18, 2025
26b0074
Make: Build just 1 target for VS Code debug
ashvardanian Nov 18, 2025
a3c407f
Improve: Fast path for UTF-8 whitespaces
ashvardanian Nov 18, 2025
f979ed9
Improve: Avoid optimization in more benchmarks
ashvardanian Nov 18, 2025
aca0473
Fix: Skip U+001C, U+001D, U+001E
ashvardanian Nov 18, 2025
e0465d5
Add: `utf8.h` for new `valid` and `find_nth` interfaces
ashvardanian Nov 19, 2025
49d9da0
Add: UTF-8 length counting 15x faster
ashvardanian Nov 19, 2025
ced9636
Make: Tune Rust analyzer to use less RAM
ashvardanian Nov 19, 2025
3ea1857
Add: `sz_utf8_unpack_upto64` for iterators
ashvardanian Nov 20, 2025
c08dc0c
Add: Lazy UTF-8 views for Rust
ashvardanian Nov 20, 2025
aad09a4
Improve: Unlimited chunk size for UTF-8 iterators
ashvardanian Nov 20, 2025
dda7704
Make: Correct `env` fields for `.vscode/tasks.json`
ashvardanian Nov 20, 2025
2bceb8d
Fix: Out of bounds access in `sz_sha256_*_ice`
ashvardanian Nov 20, 2025
b6b7825
Chore: `let_assert` and `scope_assert`
ashvardanian Nov 20, 2025
849bff2
Improve: Test UTF-8 decoding ops
ashvardanian Nov 20, 2025
bb699e9
Fix: `no_std` builds and doctests
ashvardanian Nov 20, 2025
8bb0324
Improve: More UTF-8 whitespace tokenization tests
ashvardanian Nov 21, 2025
f1fcdc5
Add: NEON UTF-8 placeholders
ashvardanian Nov 21, 2025
35ed227
Add: `try_replace_all` for Rust
ashvardanian Nov 21, 2025
8c34baf
Fix: Compile-time AES/SHA dispatch for Apple
ashvardanian Nov 21, 2025
0259f58
Add: NEON UTF-8 tokenization kernels
ashvardanian Nov 22, 2025
73da441
Improve: Fast path for 1-byte whitespace in NEON
ashvardanian Nov 22, 2025
b583fa8
Improve: Faster `utf8_count_neon` w/out u64 unpacking in loop
ashvardanian Nov 22, 2025
958be10
Add: Skip-ahead UTF-8 iterator interface
ashvardanian Nov 22, 2025
0edc81f
Improve: Test CLRF corner cases
ashvardanian Nov 22, 2025
00bacfc
Fix: `short` implicit casts
ashvardanian Nov 22, 2025
d4504be
Add: SVE2 kernels for UTF-8
ashvardanian Nov 22, 2025
e52f4a1
Improve: Use fewer registers in SVE2 code
ashvardanian Nov 22, 2025
6f045aa
Fix: `svmatch`-ing zero characters in SVE2 kernels
ashvardanian Nov 22, 2025
b838127
Fix: Misplaced UTF-8 skip in StringZilla
ashvardanian Nov 22, 2025
b2b96f4
Make: Deprecate current UTF-32 unpacking code
ashvardanian Nov 23, 2025
65b652f
Add: UTF-8 serial case-folding
ashvardanian Nov 23, 2025
15bcc43
Add: UTF-8 case-folding placeholders
ashvardanian Nov 23, 2025
bf0ff0d
Improve: Check UTF-8 case-folding
ashvardanian Nov 23, 2025
567cf17
Make: Separate file for UTF-8 unpacking
ashvardanian Nov 23, 2025
c6888bd
Merge: Arm & x86 UTF-8 effors
ashvardanian Nov 23, 2025
82528a7
Improve: New case-folding ABI
ashvardanian Nov 23, 2025
ebc4296
Make: Bump Rust deps & drop ICU
ashvardanian Nov 23, 2025
ac5cb2f
Docs: On complexity of case-insensitive substring search
ashvardanian Nov 23, 2025
36fa527
Fix: UBSAN issues in `hash.h`
ashvardanian Nov 24, 2025
9daa2a7
Improve: Case-folding bump from Unicode 16 to 17
ashvardanian Nov 24, 2025
07c4d1c
Improve: Consistent split-iterator across languages
ashvardanian Nov 24, 2025
0279383
Improve: `skip_empty` arg for Python compatibility
ashvardanian Nov 24, 2025
5e0f3ea
Fix: Incorrect literal bound for test input
ashvardanian Nov 24, 2025
4f558e1
Improve: Include SVE2 benchmarks
ashvardanian Nov 24, 2025
302af92
Fix: Missing `svcompact_u8` in SVE2
ashvardanian Nov 24, 2025
31e4c8b
Fix: Aligned state compilation in NEON
ashvardanian Nov 24, 2025
5c6a32a
Improve: Consistent var. names in UTF-8 tokenizers
ashvardanian Nov 24, 2025
73023c3
Merge: Python & C++ tests
ashvardanian Nov 24, 2025
97cf851
Fix: MSVC-compatible `uint8x16_t` init
ashvardanian Nov 24, 2025
dd4c4b0
Fix: Missing `i8` greater-than in AVX2
ashvardanian Nov 24, 2025
786a322
Improve: UTF-8 equivalence checks
ashvardanian Nov 24, 2025
53bcef1
Merge branch 'main-dev' of https://github.com/ashvardanian/StringZill…
ashvardanian Nov 24, 2025
016c44a
Fix: NEON whitespace & newline equivalence
ashvardanian Nov 25, 2025
bd9ddf5
Improve: Faster SVE2 & Neon logic
ashvardanian Nov 25, 2025
5434ebf
Improve: Fewer registers for `e280xx` masks in SVE2
ashvardanian Nov 25, 2025
98b8802
Make: Bump macOS-13 → 15 in CI
ashvardanian Nov 25, 2025
a06583a
Improve: Fewer loads in SVE2 and no fast paths
ashvardanian Nov 25, 2025
da5687d
Make: `SZ_ENFORCE_SVE_OVER_NEON=0` by default
ashvardanian Nov 26, 2025
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/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, windows-2022]
os: [ubuntu-24.04, macos-15, windows-2022]
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:

build_wheels_stringzilla_macos:
name: Build StringZilla ${{ matrix.python-version }} for macOS
runs-on: macos-13
runs-on: macos-15
needs: versioning
strategy:
fail-fast: false
Expand All @@ -137,7 +137,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzilla-macos-13-${{ strategy.job-index }}
name: cibw-wheels-stringzilla-macos-15-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true

Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:

build_wheels_stringzillas_cpus_macos:
name: Build StringZillas-CPUs ${{ matrix.python-version }} for macOS
runs-on: macos-13
runs-on: macos-15
needs: versioning
strategy:
fail-fast: false
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzillas-cpus-macos-13-${{ strategy.job-index }}
name: cibw-wheels-stringzillas-cpus-macos-15-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true

Expand Down
52 changes: 52 additions & 0 deletions .vscode/build_current.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# build_current.cmake
# Cross-platform script to build the current file's target
#
# Usage: cmake -DFILE=<file> -DBUILD_TYPE=<Debug|Release> -P build_current.cmake

cmake_minimum_required(VERSION 3.14)

if (NOT DEFINED FILE)
message(FATAL_ERROR "FILE not specified. Usage: cmake -DFILE=path/to/file.cpp -P build_current.cmake")
endif ()

if (NOT DEFINED BUILD_TYPE)
set(BUILD_TYPE "Debug")
message(STATUS "BUILD_TYPE not specified, defaulting to Debug")
endif ()

# Extract basename without extension
get_filename_component(BASENAME "${FILE}" NAME_WE)

# Map filename patterns to CMake targets
if (BASENAME MATCHES "^bench_(.+)$")
# Benchmark files: bench_find.cpp -> stringzilla_bench_find_cpp20
set(TARGET "stringzilla_${BASENAME}_cpp20")
else ()
message(FATAL_ERROR "Unknown file pattern: ${BASENAME}\nSupported patterns:\n - bench_*.cpp\n - test_stringzilla.cpp\n - test_stringzillas.cpp")
endif ()

# Determine build directory
string(TOLOWER "${BUILD_TYPE}" build_type_lower)
set(BUILD_DIR "${CMAKE_CURRENT_LIST_DIR}/../build_${build_type_lower}")

# Verify build directory exists
if (NOT EXISTS "${BUILD_DIR}")
message(FATAL_ERROR "Build directory not found: ${BUILD_DIR}\nRun: cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B ${BUILD_DIR}")
endif ()

message(STATUS "Building target: ${TARGET}")
message(STATUS "Build directory: ${BUILD_DIR}")
message(STATUS "Build type: ${BUILD_TYPE}")

# Execute the build
execute_process(
COMMAND cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --target ${TARGET}
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..
)

if (result EQUAL 0)
message(STATUS "Build succeeded: ${TARGET}")
else ()
message(FATAL_ERROR "Build failed with exit code: ${result}")
endif ()
10 changes: 7 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@
"name": "ASAN_OPTIONS",
"value": "detect_leaks=0:atexit=1:strict_init_order=1:strict_string_checks=1"
},
{
"name": "STRINGWARS_TOKENS",
"value": "file"
},
{
"name": "STRINGWARS_DATASET",
"value": "utf8.txt"
}
],
"stopAtEntry": false,
"preLaunchTask": "Build Benchmarks: Debug",
"preLaunchTask": "Build Current File: Debug",
"linux": {
"MIMode": "gdb",
"setupCommands": [
Expand Down Expand Up @@ -149,7 +153,7 @@
}
],
"stopAtEntry": false,
"preLaunchTask": "Build Benchmarks: Debug",
"preLaunchTask": "Build Current File: Debug",
"linux": {
"MIMode": "gdb",
"setupCommands": [
Expand Down Expand Up @@ -182,7 +186,7 @@
}
],
"stopAtEntry": false,
"preLaunchTask": "Build Benchmarks: Debug"
"preLaunchTask": "Build Current File: Debug"
},
{
"name": "Current Python File",
Expand Down
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@
"editor.insertSpaces": true,
"editor.rulers": [120],
"editor.tabSize": 4,
// Rust analyzer memory optimizations
"rust-analyzer.checkOnSave.enable": true,
"rust-analyzer.checkOnSave.allTargets": false,
"rust-analyzer.cargo.allFeatures": false,
"rust-analyzer.cargo.buildScripts.enable": false,
"rust-analyzer.procMacro.enable": false,
"rust-analyzer.diagnostics.enable": true,
"rust-analyzer.diagnostics.experimental.enable": false,
"rust-analyzer.completion.autoimport.enable": false,
"rust-analyzer.lens.enable": false,
"rust-analyzer.inlayHints.enable": false,
"rust-analyzer.hover.actions.enable": false,
"rust-analyzer.assist.emitMustUse": false,
"rust-analyzer.cachePriming.enable": false,
"rust-analyzer.files.watcher": "client",
"rust-analyzer.updates.channel": "stable",
"files.associations": {
"__availability": "cpp",
"__bit_reference": "cpp",
Expand Down
91 changes: 55 additions & 36 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
"args": [],
"type": "shell",
"osx": {
"environment": [
{
"name": "CMAKE_CXX_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang++"
},
{
"name": "CMAKE_C_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang"
"options": {
"env": {
"CMAKE_CXX_COMPILER": "$(brew --prefix llvm)/bin/clang++",
"CMAKE_C_COMPILER": "$(brew --prefix llvm)/bin/clang"
}
]
}
}
},
{
Expand All @@ -25,16 +21,12 @@
"args": [],
"type": "shell",
"osx": {
"environment": [
{
"name": "CMAKE_CXX_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang++"
},
{
"name": "CMAKE_C_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang"
"options": {
"env": {
"CMAKE_CXX_COMPILER": "$(brew --prefix llvm)/bin/clang++",
"CMAKE_C_COMPILER": "$(brew --prefix llvm)/bin/clang"
}
]
}
}
},
{
Expand All @@ -49,16 +41,12 @@
"args": [],
"type": "shell",
"osx": {
"environment": [
{
"name": "CMAKE_CXX_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang++"
},
{
"name": "CMAKE_C_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang"
"options": {
"env": {
"CMAKE_CXX_COMPILER": "$(brew --prefix llvm)/bin/clang++",
"CMAKE_C_COMPILER": "$(brew --prefix llvm)/bin/clang"
}
]
}
}
},
{
Expand All @@ -67,16 +55,47 @@
"args": [],
"type": "shell",
"osx": {
"environment": [
{
"name": "CMAKE_CXX_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang++"
},
{
"name": "CMAKE_C_COMPILER",
"value": "$(brew --prefix llvm)/bin/clang"
"options": {
"env": {
"CMAKE_CXX_COMPILER": "$(brew --prefix llvm)/bin/clang++",
"CMAKE_C_COMPILER": "$(brew --prefix llvm)/bin/clang"
}
]
}
}
},
{
"label": "Build Current File: Debug",
"command": "cmake",
"args": [
"-DFILE=${file}",
"-DBUILD_TYPE=Debug",
"-P",
"${workspaceFolder}/.vscode/build_current.cmake"
],
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Build Current File: Release",
"command": "cmake",
"args": [
"-DFILE=${file}",
"-DBUILD_TYPE=Release",
"-P",
"${workspaceFolder}/.vscode/build_current.cmake"
],
"type": "shell",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
}
}
]
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ function (define_stringzillas_shared target source_file backend_flags)
target_include_directories(${target} PRIVATE fork_union/include)
target_compile_definitions(${target} PRIVATE "SZ_DYNAMIC_DISPATCH=1")
target_compile_definitions(${target} PRIVATE "SZ_AVOID_LIBC=0")
target_compile_definitions(${target} PRIVATE "SZ_DEBUG=0")
# Only define SZ_DEBUG=0 in Release builds; Debug builds inherit from types.h
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${target} PRIVATE "SZ_DEBUG=0")
endif ()

# Set backend-specific compilation flags
foreach (flag ${backend_flags})
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ rocm = ["std", "cpus"] # ROCm GPU backend (includes multi-threaded CPU backend)

[dependencies]
allocator-api2 = { version = "0.3.0", optional = true }
stringtape = { version = "2.0.3", optional = true }
stringtape = { version = "2.4.1", optional = true }

[build-dependencies]
cc = "1.2.40"
cc = "1.2.47"

[lints.clippy]
# Catch platform-specific type issues like `c_char` differences
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,13 @@ __`SZ_USE_CUDA`, `SZ_USE_KEPLER`, `SZ_USE_HOPPER`__:
> One can explicitly disable certain families of PTX instructions for compatibility purposes.
> Default values are inferred at compile time depending on compiler support (for dynamic dispatch) and the target architecture (for static dispatch).

__`SZ_ENFORCE_SVE_OVER_NEON`__:

> SVE and SVE2 are expected to supersede NEON on ARM architectures.
> Still, oftentimes the equivalent SVE kernels are slower due to equally small register files and higher complexity of the instructions.
> By default, when both SVE and NEON are available, SVE is used selectively only for the algorithms that benefit from it.
> If you want to enforce SVE usage everywhere, define this flag.

__`SZ_DYNAMIC_DISPATCH`__:

> By default, StringZilla is a header-only library.
Expand Down
8 changes: 5 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,16 @@ fn build_stringzilla() -> HashMap<String, bool> {
println!("cargo:rerun-if-changed=include/stringzilla/stringzilla.h");

// Constituent parts:
println!("cargo:rerun-if-changed=include/stringzilla/compare.h");
println!("cargo:rerun-if-changed=include/stringzilla/find.h");
println!("cargo:rerun-if-changed=include/stringzilla/hash.h");
println!("cargo:rerun-if-changed=include/stringzilla/sort.h");
println!("cargo:rerun-if-changed=include/stringzilla/utf8.h");
println!("cargo:rerun-if-changed=include/stringzilla/utf8_unpack.h");
println!("cargo:rerun-if-changed=include/stringzilla/types.h");
println!("cargo:rerun-if-changed=include/stringzilla/memory.h");
println!("cargo:rerun-if-changed=include/stringzilla/compare.h");
println!("cargo:rerun-if-changed=include/stringzilla/similarities.h");
println!("cargo:rerun-if-changed=include/stringzilla/small_string.h");
println!("cargo:rerun-if-changed=include/stringzilla/sort.h");
println!("cargo:rerun-if-changed=include/stringzilla/types.h");

// Rerun if SIMD backend environment variables change
for flag in flags_to_try.iter() {
Expand Down
Loading
Loading