Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. F-Droid 2.0 (f-droid.org)
    204comments
  2. Show HN: Make cursed fonts like Times New Bastard (mitpit.com)
    43comments
  3. Show HN: Whiteboard (YC W26) – An open-source IDE for thoughtful software design (github.com/devdotfast)
    53comments
  4. Rails World 2026 Opening Keynote [video] (youtube.com)
    148comments
  5. Fearless SIMD v1.0 (linebender.org)
    18comments
  6. My weird new hobby: Wandering around Tokyo on Google Maps (ahmedhossamdev.com)
    55comments
  7. Using LLMs to trace alchemical knowledge and decode 17th century letters (resobscura.substack.com)
    5comments
  8. Opus 5.5 is good at explainer videos (launchvideo.io)
    4comments
  9. Sourcehut account takeover via build logs (XSS in ansi2html) (blog.arusekk.pl)
    1comments
  10. Why is the liver so weirdly regenerative? (dynomight.substack.com)
    96comments
  11. Stable (YC W20) Is Hiring Product Engineers (usestable.com)
    —discuss
  12. Book review: Is parallel programming hard, and, if so, what can you do about it? (ahelwer.ca)
    14comments
  13. The forgotten battle of East Lansing (eastlansinginfo.news)
    8comments
  14. The Board Game of the Alpha Nerds (2014) (grantland.com)
    3comments
  15. Google’s Project Suncatcher to put ML infrastructure in space (blog.google)
    105comments
  16. Forging 1024-bit RSA signatures in nearly SNFS time [pdf] (iacr.org)
    5comments
  17. Two-tier encryption in the UK (macanorak.com)
    345comments
  18. Geothermal heat map of US hot springs (soakingsprings.com)
    21comments
  19. Vibe Coding Production Kit – a production workflow for AI coding agents (github.com/moeeryani)
    —discuss
  20. Show HN: AgentRun: DSL to turn agents into workflows (github.com/parcha-ai)
    3comments
  21. August 27 TCRF DDoS Attack Postmortem (xkeeper.net)
    1comments
  22. WaveDigger: Dig into wireless signals to discover their physical locations (github.com/christianrowlands)
    11comments
  23. 2DWillNeverDie (2dwillneverdie.com)
    —discuss
  24. Show HN: Treepeat – Code similarity detection using Tree-sitter (github.com/dsummersl)
    2comments
  25. A Million Agents Is a Distributed System Problem (instacloud.com)
    5comments
  26. Creatine uptake enhances antitumor immunity (cell.com)
    150comments
  27. Early rogue AI agent activity and attempts to hack found on urlquery.net (transluce.org)
    198comments
  28. Web-based IBM 1620 emulator and IPL-V from 1963 (github.com/pkimpel)
    11comments
  29. Security auditing in the age of (good enough) AI (trailofbits.com)
    1comments
  30. Security headers on 4,688 small-business websites: 49.7% met none of 7 criteria (rackcrunch.com)
    —discuss

Fearless SIMD v1.0

117 pointsby 2d agolinebender.org
18 comments
1d agoHN ↗

Pretty happy this broke the 0.x curse!

2h agoHN ↗

PuTTY out since 1999 and bumped to 0.82 in 2024 is pretty incredible

1h agoHN ↗

It's exactly what we were doing before the semver hype cycle, but with 0. in front!

2h agoHN ↗

Congratulations.

Nice work. Looking forward to it.

2h agoHN ↗

I started an early Rust SIMD crate with similar aims (SIMDeez) and so I know how hard it is to do this well, so wanted to say congratulations to everyone who worked on Fearless SIMD. Tools like this are really nice for being able to leverage the gigantic performance modern CPUs make available without having to write intrinsics for each platform.

2h agoHN ↗

I’m currently working on adding better SIMD support to Dart (https://github.com/dart-lang/sdk/issues/64170) and I have a question for the author or others here.

Does Rust or any other language support customizing the compiler so that interprocedural analyses can track custom subsets of, for example, doubles so that the compiler can choose the most efficient instruction sequence for example for min/max? If we know a double is never NaN then we can emit only one instruction on x86, but have to emit one more on arm64. If we know a double is never zero and never NaN, we can emit a single instruction on both.

This whole conversation between relaxed SIMD and deterministic SIMD seems to only exist because our compilers are not smart enough and/or their whole program analyses don’t support any plugin-like capabilities.

There are other examples where if we know a SIMD bitmask is canonical (all 1s per lane) then we can implement horizontal reductions more efficiently. This is very niche and I doubt that any language supports interprocedural analyses with such a rich domain, so it feels like a hole in the programming language space.

2h agoHN ↗

Last time i checked; no.

But I suspect you're overvaluing the potential savings. Knowing when a float is 0.0 or NaN beforehand is almost entirely impossible, except for the most trivial of cases - like when you first initialize a variable or first enter a loop. Everything after that is very hard or impossible with floats as they are.

Those cases can be const folded at compile time.

Those cases are never a measurable bottleneck.

The closest thing I know of in the realm of the optimization you're curious about is Rust NonZero* variants, but they're used for enum compression afaik.

2h agoHN ↗

I’m not sure I agree on the impossible part, I feel like a sufficiently smart interprocedural analysis that also implements range analysis interprocedurally could prove a lot to where it becomes useful.

I guess what I would like to see is SIMD libraries being able to confidently say nobody needs to use intrinsics (or differentiate between relaxed/normal SIMD on the user API level) because the language + high level SIMD APIs are smart enough to choose the right implementation.

IIRC IEEE min/max with proper NaN handling needs 8 instructions on x86 vs 1 on arm64 I find it very sad that we apparently haven’t really solved that yet without forcing the user to use different APIs.

57m agoHN ↗

You can do it with just 3 instructions for IEEE 754-2019 minimumNumber (ignores NaN):

        vminpd          ymm2, ymm1, ymm0
        vcmpunordpd     ymm0, ymm0, ymm0
        vblendvpd       ymm0, ymm2, ymm1, ymm0

If you want proper IEEE 754-2019 minimum (propagate NaN, -0.0 < +0.0, NaN bitpattern picked in the usual way) you can do it in 6:

        vminpd          ymm1, ymm0, ymm1
        vbroadcastsd    ymm2, qword ptr [rip + .LCPI0_0]
        vandpd          ymm2, ymm0, ymm2
        vorpd           ymm1, ymm2, ymm1
        vcmpunordpd     ymm2, ymm0, ymm0
        vblendvpd       ymm0, ymm1, ymm0, ymm2

I personally find this a load of nonsense I don't care about.

If you want propagating NaNs but don't care about signed zero or NaN payload/sign, you can use

        vminpd  ymm2, ymm0, ymm1
        vminpd  ymm1, ymm1, ymm0
        vorpd   ymm0, ymm1, ymm2

What I do in Polars is a bit different, there for propagating NaNs I do

    if (self < other) | self.is_nan() { self } else { other}

this isn't fully optimal on x86-64 but it's fairly simple and autovectorizes decently on various platforms, here's AVX2:

        vcmpltpd        ymm2, ymm0, ymm1
        vcmpunordpd     ymm3, ymm0, ymm0
        vorpd           ymm2, ymm3, ymm2
        vblendvpd       ymm0, ymm1, ymm0, ymm2
51m agoHN ↗

Anything without range analysis is not worth it.

Note that:

NonZerof32 * NonZerof32 -> NonNanf32

NonZerof32::from_bits(1) multiplied with itself is zero.

Doing range analysis needs the language to support it at compile time, and the dev to specify what range it is.

The only 'stable' thing i can think of is a type for 'greater-eq-one' using only addition and multiplication. Practically every other operation breaks most of the type knowledge up to that point.

2h agoHN ↗

Not yet that I know of, though perhaps LLVM might be able to infer simple cases (when loading from a known constant for example).

Pattern types could potentially maybe in the future allow for the compiler to know more details though. They are a nightly feature, and afaik only for enums, integers and pointers so far. The idea would be that you can define a custom type such as "an integer between 7 and 45" and everything else become niches for niche optimisation (e.g. for `Option<MyFunkyInt>` some of those impossible values would be used to represent the None case of the wrapping Option).

But I could envisage a future in which you could say "f64 without NaN" which would both make those available for niches and potentially tell LLVM about this. However, we are very far from any of that currently. And it might not be what you want, since you would need to add checks when you perform operations to ensure the value doesn't suddenly become a NaN. Which is way more complicated than ensuring integers don't become, say, zero. It will likely be much harder to optimise away the checks.

2h agoHN ↗

Pattern types could potentially maybe in the future allow for the compiler to know more details though.

Thanks, I’ll take a look!

2h agoHN ↗

That is a big maybe though. It is very experimental (didn't even have non-placeholder syntax last I looked), and as far as I know nobody has yet even discussed it for floats.

1h agoHN ↗

How does the crate’s SIMD performance compare to ISPC, which already has very easy dynamic dispatching?