Implement fat runtime for hyperscan bzlmod build#3672
Closed
Conversation
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Copilot
AI
changed the title
[WIP] Implement fat runtime for Hyperscan bzlmod build
Implement fat runtime for hyperscan bzlmod build
Jan 31, 2026
…3674) Signed-off-by: Ryan Northey <ryan@synca.io>
bcd9e66 to
da99e5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current hyperscan overlay builds with
-march=native, causing SIGILL crashes when binaries built on newer CPUs (AVX-512) run on older CPUs (AVX2). Implement fat runtime with multiple architecture variants and runtime dispatch.Implementation
Architecture variants (5 total):
core2(-march=core2) - SSSE3 baselinecorei7(-march=corei7) - SSE4.2 + POPCNTavx2(-march=core-avx2)avx512(-march=skylake-avx512)avx512vbmi(-march=icelake-server)Symbol renaming (
rename_symbols.sh):.ofiles from each variant's archivehs_scan→core2_hs_scan,avx2_hs_scan)hs_*_alloc,hs_*_freeRuntime dispatch (
dispatcher.c):Config updates:
FAT_RUNTIME,BUILD_AVX512,BUILD_AVX512VBMIdefines-Wno-unqualified-std-cast-call,-Wno-redundant-move,-fvisibility=hiddenFiles
fat_runtime.bzl- Macro for compiling and renaming each variantdispatcher.c- Upstream dispatcher (GNU ifunc resolvers)rename_symbols.sh- Symbol prefixing via objcopyBUILD.bazel- Replaced single runtime with 5 variants + dispatchersource.json- Updated overlay hashesResult
Single binary runs on any x86-64 CPU (SSSE3+) with optimal SIMD dispatch. Matches upstream CMake
FAT_RUNTIME=ONbehavior.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.