linebender / linebender/fearless_simd

Expose `Level::new()` on `no_std`?

Open
#117 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
457
Forks
30
Avg merge
1d 10h
Merged PRs (30d)
25

Description

The `Level::try_detect()` documentation says says:

> Should be used in libraries if they wish to handle the case where target features cannot be detected at runtime. Most users should prefer `new`.

This is not very helpful for `no_std` users, since they cannot use `Level::new()`. Instead, the proper pattern for `no_std` users is `Level::try_detect().unwrap_or(Level::baseline())`.

I believe `Level::new()` should behave similarly to `Level::try_detect().unwrap_or(Level::baseline())`, and be available even without the `std` feature enabled. This also opens up the possibility of [`no_std` runtime feature detection on x86 by directly parsing the CPUID](https://crates.io/crates/core_detect) (runtime feature detection on aarch64 isn't a big deal, since Neon is almost always statically enabled).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Level::new(), Level::try_detect(), and Level::baseline() entry points and their documentation, then inspect how the std feature controls their availability. Done means no_std users can call Level::new() with baseline fallback behavior, while the existing runtime-detection behavior and documentation remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.