frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

From Rust to reality: The hidden journey of fetch_max

https://questdb.com/blog/rust-fetch-max-compiler-journey/
67•bluestreak•2h ago

Comments

IshKebab•1h ago
Yeah this comes from ARM and AXI, which has atomic max (and min, add, set, clear and xor). I assume ARM has all the corresponding instructions. RISC-V also has all of these in Zaamo.
yshui•1h ago
That's a cool find. I wonder if LLVM also does the other way around operation, where it pattern matches handwritten CAS loops and transform them into native ARM64 instructions.
jerrinot•56m ago
That's a very good question. A proper compiler engineer would know, but I will do my best to find something and report back.

Edit: I could not find any pass with a pattern matching to replace CAS loops. The closest thing I could find is this pass: https://github.com/llvm/llvm-project/blob/06fb26c3a4ede66755... I reckon one could write a similar pass to recognize CAS idioms, but its usefulness would be probably rather limited and not worth the effort/risks.

jerrinot•1h ago
Hi, author here. My superpower is spending unreasonable amounts of time researching things with no practical purpose. Occasionally I blog about it - as a warning to others.
Ethee•57m ago
It's these kinds of posts that I appreciate reading the most, so thank you for sharing!
owls-on-wires•36m ago
“…no practical purpose” Nonsense, I learned something about compilation today. Thank you for sharing.
trws•24m ago
I liked the article. I saw your PS that we added it to the working draft for c++26, we also made it part of OpenMP as of 5.0 I think. It’s sometimes a hardware atomic like on arm, but what made the case was that it’s common to implement it sub-optimally even on x86 or LL-SC architectures. Often the generic cas loop gets used, like in your lambda example, but it lacks an early cutout since you can ignore any input value that’s on the wrong side of the op by doing a cheap atomic read or just cutting out of the loop after the first failed CAS if the read back shows it can’t matter. Also can benefit from using slightly different memory orders than the default on architectures like ppc64. It’s a surprisingly useful op to support that way.

If this kind of thing floats your boat, you might be interested in the non-reading variants of these as well. Mostly for things like add, max, etc but some recent architectures actually offer alternate operations to skip the read-back. The paper calls them “atomic reduction operations” https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p31...

tux3•16m ago
This blog sent me into a memory models rabbit hole again. Each time I end up feeling like I'm finally starting to get it, only for a 6 line litmus test with 4 loads and 2 stores to send me crashing back down.

It makes me feel a little better reading about the history of memory models in CPUs. If this stuff wasn't intuitive to Intel either, I'm at least in good company in being confused (https://research.swtch.com/hwmm#path_to_x86-tso)

I actually knew about fetch_max from "implementing" the corresponding instruction (risc-v amomax), but I haven't done any of the fun parts yet since my soft-CPU still only has a single core.

RPM 6.0 Released with OpenPGP Improvements and Signature Checking by Default

https://www.phoronix.com/news/RPM-6.0-Released
1•westurner•55s ago•0 comments

GitHub's plan for a more secure NPM supply chain

https://github.blog/security/supply-chain-security/our-plan-for-a-more-secure-npm-supply-chain/
1•gnabgib•1m ago•0 comments

NYC Telecom Raid: What's Up with Those Weird SIM Banks?

https://tedium.co/2025/09/23/secret-service-raid-sim-bank-telecom-hardware/
2•coloneltcb•4m ago•0 comments

Louise Vincent, 49, Drug User Who Led Harm Reduction Movement, Dies

https://www.nytimes.com/2025/09/22/health/louise-vincent-dead.html
1•mitchbob•4m ago•1 comments

SEC Chief Eyes Rule Exemptions for Crypto Trading by December

https://www.bloomberg.com/news/articles/2025-09-23/sec-chief-eyes-rule-exemptions-for-crypto-trad...
2•petethomas•4m ago•1 comments

Automotive Owners' Manuals

https://books4cars.com/
1•bookofjoe•4m ago•0 comments

What Turns Some Scholars into Frauds?

https://www.chronicle.com/article/what-turns-some-scholars-into-frauds
1•pseudolus•4m ago•1 comments

Acting Chairman Pham Launches Tokenized Collateral and Stablecoins Initiative

https://www.cftc.gov/PressRoom/PressReleases/9130-25
1•petethomas•7m ago•0 comments

Show HN: Thehomeschoolingcompany.com, fast, easy, personalized learning

https://www.thehomeschoolingcompany.com/
1•garberchov•11m ago•0 comments

Are Blue Light Blocking Glasses a $3B Scam? [video]

https://www.youtube.com/watch?v=LR6V2s9pKT0
3•pedalpete•13m ago•2 comments

Eight years of organizing tech meetups

https://notes.eatonphil.com/eight-years-of-tech-meetups.html
1•ibobev•14m ago•0 comments

When "no" means "yes": Why AI chatbots can't process Persian social etiquette

https://arstechnica.com/ai/2025/09/when-no-means-yes-why-ai-chatbots-cant-process-persian-social-...
2•jnord•15m ago•1 comments

Circle of Thirds

https://circleofthirds.com/
1•JMiao•16m ago•0 comments

Rules of Thumb

https://www.rulesofthumb.org/
1•bookofjoe•16m ago•0 comments

FT: Nvidia's $100B deal with OpenAI: an Alphaville FAQ

https://www.ft.com/content/7f1426ab-9f70-44e0-bb06-d83df348b64b
1•snake_doc•17m ago•0 comments

Qwen3-Max is here–no preview, just power

https://twitter.com/Alibaba_Qwen/status/1970599097297183035
1•sergiotapia•17m ago•0 comments

Kaidan 0.13.0: Multi-Account Support and Secure Password Storage – XMPP Client

https://www.kaidan.im/2025/09/21/kaidan-0.13.0/
1•neustradamus•18m ago•0 comments

9 Linux certifications to boost your career

https://www.networkworld.com/article/4060215/9-linux-certifications-to-boost-your-career.html
2•dxs•19m ago•2 comments

GitHub powered Y Combinator phishing campaign

https://y-comblnator.com/apply
3•nickphx•20m ago•2 comments

Show HN: BX Live Server – VS Code live reload with embedded preview

https://marketplace.visualstudio.com/items?itemName=Thinkback.tbx-live-server
2•th3mailman•21m ago•0 comments

Microsoft is building an AI marketplace to pay publishers for content

https://www.neowin.net/news/microsoft-is-reportedly-building-an-ai-marketplace-to-pay-publishers-...
1•bundie•21m ago•0 comments

From Prison to Helping the FBI to a TV Miniseries, to Google-Hallucinated Libel?

https://reason.com/volokh/2025/09/23/from-prison-to-helping-the-fbi-to-an-apple-tv-miniseries-to-...
1•anonymousiam•29m ago•0 comments

MCP is missing secure auth

https://blog.arcade.dev/mcp-server-authorization-guide
1•shawneechase•30m ago•1 comments

Walking Around the Compiler

https://bernsteinbear.com/blog/walking-around/
1•chunkles•32m ago•0 comments

Daslang

https://daslang.io/
1•Stevvo•33m ago•0 comments

Sonhadores

https://apenasumsonhador.substack.com/
1•danitzsche•33m ago•1 comments

Sonhador

1•danitzsche•34m ago•0 comments

Deploy your own AI vibe coding platform – in one click

https://blog.cloudflare.com/deploy-your-own-ai-vibe-coding-platform/
2•felipevolpatto•35m ago•0 comments

Show HN: A Live Map for Running Seattle's Light Rail

https://raceconditionrunning.com/light-rail-relay-25/
1•nickswalker•38m ago•0 comments

'SIM Farms' Are a Spam Plague. A Giant One in NY Threatened US Infrastructure

https://www.wired.com/story/sim-farm-new-york-threatened-us-infrastructure-feds-say/
4•petethomas•39m ago•0 comments