Skip to content

feat: add opt-in SIMD paths and release verification - #1

Merged
micro-perceptron merged 4 commits into
mainfrom
codex/ufloat-simd
Aug 23, 2026
Merged

feat: add opt-in SIMD paths and release verification#1
micro-perceptron merged 4 commits into
mainfrom
codex/ufloat-simd

Conversation

@SnowCheetos

@SnowCheetos SnowCheetos commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a nightly-only, opt-in portable-SIMD bulk API for UF16, UF16E6M10, and UF32 conversion and arithmetic
  • preserve scalar-exact results by routing exceptional and rounding-boundary lanes through the existing scalar implementation
  • declare Rust 1.85 MSRV and add public-package CI: stable/MSRV/platform/no_std/nightly coverage plus extracted-crate verification
  • add tag/version/default-branch release validation before crates.io publication and ignore macOS .DS_Store files
  • publish with crates.io Trusted Publishing: the release job exchanges a GitHub OIDC identity for a short-lived token, with no stored registry secret

Trusted-publisher setup

After this PR merges, configure the crate on crates.io with GitHub owner MicroPerceptron, repository ufloat, and workflow filename publish.yml. The workflow runs for published GitHub Releases and permits OIDC only on its publish job.

Validation

  • cargo +stable clippy --lib --tests -- -D warnings
  • cargo +stable test --lib and cargo +stable test --doc
  • cargo +1.85.0 check/test plus docs
  • stable no_std checks for aarch64-unknown-none, riscv64gc-unknown-none-elf, and wasm32-unknown-unknown
  • cargo +nightly test --all-targets --all-features
  • cargo +nightly doc --all-features --no-deps with warnings denied
  • extracted package build, test, doc-test, and docs via ci/publish-dry-run.sh

The stable jobs intentionally exclude the benchmark target because it uses nightly's test feature; the nightly all-target gate covers it.

Copilot AI lite review requested due to automatic review settings August 23, 2026 01:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in nightly SIMD operations, expanded CI coverage, and release-package verification.

Changes:

  • Adds SIMD conversions and arithmetic with scalar fallbacks.
  • Declares Rust 1.85 MSRV and expands platform/no_std/nightly testing.
  • Adds extracted-package and release validation workflows.
  • Critical: Release validation must bind the tag to the immutable release event SHA.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Summary
src/simd.rs SIMD APIs, fallback logic, and tests
src/lib.rs SIMD module integration
README.md Feature and release documentation
ci/publish-dry-run.sh Extracted-package verification
ci/check-release.sh Release tag validation; requires immutable SHA verification
Cargo.toml MSRV and feature definitions
benches/arithmetic.rs SIMD benchmarks
.gitignore Ignores macOS metadata
.github/workflows/publish.yml Verified crates.io publishing
.github/workflows/ci.yml Expanded CI coverage
Suppressed comments (3)

benches/arithmetic.rs:530

  • This scalar baseline invokes black_box once per lane, while the SIMD baseline invokes it once for the whole slice. With 4,096 lanes this adds thousands of compiler barriers to the scalar timing and makes the comparison primarily measure black_box overhead rather than decode throughput. Black-box the input slice once before iterating, as the SIMD benchmark does.
    b.iter(|| {
        for (source, output) in source.iter().zip(&mut output) {
            *output = black_box(*source).to_f32();

benches/arithmetic.rs:586

  • As in the UF16 decode baseline, this loop pays for one black_box barrier per lane while the SIMD benchmark pays for one per slice. That makes the scalar UF32 result incomparable at 4,096 lanes; black-box the source slice once before the loop instead.
    b.iter(|| {
        for (source, output) in source.iter().zip(&mut output) {
            *output = black_box(*source).to_f64();

benches/arithmetic.rs:558

  • The scalar comparison black-boxes both operands for every lane, but the SIMD comparison black-boxes each input slice only once. This adds 8,192 barriers per iteration at the configured length and invalidates the reported scalar-vs-SIMD speedup. Black-box the two slices once and read the lanes normally inside the loop.
    b.iter(|| {
        for ((left, right), output) in left.iter().zip(&right).zip(&mut output) {
            *output = black_box(*left) + black_box(*right);

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ci/check-release.sh Outdated
Comment on lines +22 to +26
tag_commit="$(git rev-parse --verify "$tag^{commit}")"
head_commit="$(git rev-parse HEAD)"
if [[ "$tag_commit" != "$head_commit" ]]; then
echo "release tag $tag resolves to $tag_commit, not checked-out commit $head_commit" >&2
exit 1
@SnowCheetos SnowCheetos self-assigned this Aug 23, 2026
@SnowCheetos SnowCheetos added the performance Performance optimization label Aug 23, 2026
@micro-perceptron
micro-perceptron merged commit 3b29046 into main Aug 23, 2026
10 checks passed
@micro-perceptron
micro-perceptron deleted the codex/ufloat-simd branch August 23, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants