Skip to content

refactor(math): merge float kernels into ailego math - #34

Merged
zhenghaoz merged 4 commits into
mainfrom
refactor/merge-floats-into-ailego-math
Sep 1, 2026
Merged

refactor(math): merge float kernels into ailego math#34
zhenghaoz merged 4 commits into
mainfrom
refactor/merge-floats-into-ailego-math

Conversation

@zhangzhenghao

@zhangzhenghao zhangzhenghao commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • move the allocation-free float32 distance kernels from internal/floats into internal/ailego/math
  • replace the amd64 L2, inner-product, and dot/norm kernels with direct C ports of Alibaba zvec's SSE, AVX, and AVX-512 implementations, preserving the *_distance_matrix_fp32_*.c source names
  • dispatch SSE as the amd64 baseline, retain AVX small-dimension fallback behavior, and keep AVX-512 gated by AVX/FMA/AVX512F
  • merge GoAT generation and QEMU test targets into internal/ailego/math/Makefile while retaining the existing checked and prevalidated Go APIs
  • update GoAT to the merged float-return frame-size fix; use -fno-jump-tables for the currently unsupported amd64 switch jump table and retain arm64 output-pointer adapters

Verification

  • go generate ./internal/ailego/math followed by git diff --exit-code
  • go test ./... -count=1
  • go test -tags noasm ./... -count=1
  • go vet ./...
  • make -C internal/ailego/math test-rvv
  • make -C internal/ailego/math test-lasx
  • Linux arm64 cross-compile + go vet, then complete math test binary under qemu-aarch64 -cpu max
  • Windows amd64 and arm64 math test cross-compiles
  • Clang -Wall -Wextra -Werror compilation for SSE, AVX, AVX-512, and NEON C sources
  • git diff --check
  • independent pre-commit review: passed

GoAT follow-ups

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
xvec ba4bb98 Aug 31 2026, 11:48 AM

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.33%. Comparing base (d488a95) to head (67ceb41).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/ailego/math/distance_utility_amd64.go 71.42% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
- Coverage   82.45%   82.33%   -0.13%     
==========================================
  Files         122      122              
  Lines       26066    26068       +2     
==========================================
- Hits        21494    21463      -31     
- Misses       4572     4605      +33     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhenghaoz
zhenghaoz merged commit 5386a36 into main Sep 1, 2026
7 of 8 checks passed
@zhenghaoz
zhenghaoz deleted the refactor/merge-floats-into-ailego-math branch September 1, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants