frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Best 'mega-airports' in North America for reliability,TSA efficiency and more

https://www.cnbc.com/2025/10/19/msp-jfk-sfo-10-best-mega-airports-in-north-america-2025.html
1•pm2222•1m ago•1 comments

Easter Island statues may have 'walked' thanks to 'pendulum dynamics'

https://www.livescience.com/archaeology/easter-island-statues-may-have-walked-thanks-to-pendulum-...
2•5555624•6m ago•1 comments

From cloud to OCP? Be ready to wrangle firmware

https://www.thestack.technology/insurer-slashes-compute-costs-with-cloud-repatriation-shift-to-oc...
1•humanities•9m ago•0 comments

Original C64 Lode Runner Source Code

https://github.com/Piddewitt/Loderunner
3•indigodaddy•11m ago•0 comments

Show HN: Patty, Find Patents Instantly

https://f721ad1b01e9.ngrok-free.app/
1•zach_moore•12m ago•0 comments

The Rust-based Binder driver has now been merged into Linus' tree

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eafedbc7c050
3•weinzierl•15m ago•0 comments

Show HN: I made an AI tool to create production-ready images in one workflow

https://www.iley.app/
1•brightUiso•15m ago•0 comments

A Survey of Vibe Coding with Large Language Models

https://arxiv.org/abs/2510.12399
1•Anon84•17m ago•0 comments

Patat: Terminal-based presentations using Pandoc

https://github.com/jaspervdj/patat
2•walterbell•17m ago•0 comments

Virtual Enigma

https://enigma.virtualcolossus.co.uk/
3•austinallegro•18m ago•0 comments

The week private credit's 'golden' narrative got a little less shiny

https://www.businessinsider.com/private-credit-bad-week-concerns-dimon-cockroach-comment-2025-10
2•zerosizedweasle•18m ago•0 comments

The Parrot in the Machine

https://www.nybooks.com/articles/2025/07/24/the-parrot-in-the-machine-the-ai-con-bender-hanna/
1•mcovalt•19m ago•1 comments

The Shutdown Is Stretching On. Trump Doesn't Seem to Mind

https://www.nytimes.com/2025/10/18/us/politics/trump-democrats-shutdown-deal.html
4•zerosizedweasle•20m ago•0 comments

Doctor Who archive expert shares positive update on missing episode

https://www.radiotimes.com/tv/sci-fi/doctor-who-missing-episodes-update-teases-announcement-newsu...
2•gnabgib•20m ago•0 comments

Borders Don't Protect You

https://vp.net/l/en-US/blog/Borders-Don%27t-Protect-You
2•rasengan•21m ago•0 comments

Xi preparing to go toe to toe with Trump, there will only be one winner

https://www.theguardian.com/commentisfree/2025/oct/19/donald-trump-xi-jinping-china-trade-tariffs...
2•zerosizedweasle•21m ago•0 comments

An open letter to the Obsidian team

https://www.emilebangma.com/Writings/Blog/An-open-letter-to-the-Obsidian-team
1•birdculture•22m ago•0 comments

A New Challenge for China's Economy: 'Involution'

https://www.wsj.com/world/china/a-new-challenge-for-chinas-economy-involution-419500f1
2•mudil•22m ago•0 comments

The Scientific Mind of Leonardo da Vinci – With Martin Kemp [video]

https://www.youtube.com/watch?v=TlJ-FpVlgVI
1•jlg23•22m ago•1 comments

Nvidia and TSMC Celebrate First Nvidia Blackwell Wafer Produced in the US

https://blogs.nvidia.com/blog/tsmc-blackwell-manufacturing/
3•jonbaer•23m ago•0 comments

Andrej Karpathy: How I Use LLMs [video]

https://www.youtube.com/watch?v=EWvNQjAaOHw
1•behnamoh•23m ago•0 comments

Becoming AI-first: Lessons from 100s of conversations on building AI products

https://www.ashpreetbedi.com/articles/becoming-ai-first
3•bediashpreet•24m ago•0 comments

Industries being killed by millennials (2018)

https://www.the-independent.com/life-style/millennials-industry-casual-dining-weddings-beer-razor...
1•LouisLazaris•24m ago•0 comments

Speeding up C++ functions with a thread_local cache

https://lemire.me/blog/2025/10/19/speeding-up-c-functions-with-a-thread_local-cache/
1•jjgreen•26m ago•0 comments

Something from "space" may have just struck a United Airlines flight over Utah

https://arstechnica.com/space/2025/10/something-from-space-may-have-just-struck-a-united-airlines...
2•corvad•29m ago•1 comments

Après Moi, Le Déluge

https://en.wikipedia.org/wiki/Apr%C3%A8s_moi,_le_d%C3%A9luge
1•danielschreber•33m ago•0 comments

What Problem Is RAG Solving?

https://www.gojiberries.io/what-problem-is-traditional-rag-solving/
2•neehao•33m ago•0 comments

Liver fat, not weight, predicts health risks in obese children

https://medicalxpress.com/news/2025-09-liver-fat-weight-health-obese.html
3•PaulHoule•34m ago•0 comments

Show HN: Interactive Stress Toy

https://bigjobby.com/pendulum/
1•FatMike•36m ago•0 comments

Inside The Republican network behind big soda's bid to pit Maga against Maha

https://www.theguardian.com/us-news/2025/oct/19/inside-the-republican-network-behind-big-sodas-bi...
14•CrypticShift•42m ago•0 comments
Open in hackernews

Prepare your apps for Google Play's 16 KB page size compatibility requirement

https://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html
88•ingve•5mo ago

Comments

londons_explore•5mo ago
Letting userspace know the page size was IMO a design mistake.

Imagine a world where the page size is secret to userspace. Anything that needs page size alignment will be chosen by the kernel.

That in turn allows mixed page size, variable page size, heirarchical pages, etc.

Dylan16807•5mo ago
It's hard to hide all the details, especially when you involve varied permissions over different chunks of memory.
duskwuff•5mo ago
It's unavoidable. APIs like mprotect() operate on pages; there's no way to hide that from them.
viraptor•5mo ago
Also various performance characteristics graphs will have steps around the multiples of page sizes. People would find out anyway. (Although maybe the runtime detection is not a bad idea)
londons_explore•5mo ago
Just like cache size.

But when someone releases a new CPU with a larger or smaller cache, all old software continues to work.

Secret page size would offer the same benefit.

dataflow•5mo ago
Cache line size would be a better example.
Tuna-Fish•5mo ago
Yup.

And like with page sizes, the big problems with cache line sizes is not when people design things against a specific line size, but the (much more numerous) cases where they design something that only works well for a fixed size but they don't even know that, because they literally never thought about it, and it worked fine because every machine they used was similar.

It doesn't matter what apis you were provided or what analysis you did, you don't know your software works with different hardware until you test it on it.

londons_explore•5mo ago
you can simulate arbitrary sized mprotect() by having the kernel do the closest it can using the hardware, and then any pages crossing the boundary will be handled by page faults. The performance hit should be small as long as most mprotect regions are large (which they typically are).
dzaima•5mo ago
That'd fail horrifically for guard pages around a main region where the whole used region is reasonably expected to be used.

Considering that it'd be literally completely entirely unacceptable to ever hit such an emulated range in code of any significance as it'd be a slowdown in the thousands of times, it'd make mprotect entirely pointless and effectively broken. Unless of course you add "padding" of expected page size (not applicable for guard pages though, those are just SOL), which is basically status quo except that, instead of apps doing hard-coding crashing on unexpected page size, they just become potentially 1000x slower, but of course in practice there's no difference between a crash and 1000x slower. I'd even say a crash is better - means a bug report of it can't be dismissed as just a perf issue, and it's clear that something's going wrong in the first place.

The size of the mprotect region does not matter. What matters is worst-case behavior, and, regardless of the size, if a single critical byte of memory ends up in the emulated region, your program is dead to the user, causing data loss or whatever consequences from being, practically speaking, completely frozen your program has.

dwattttt•5mo ago
Emulating it would work quite terribly. With a 4kb page size you can write 4kb of memory as RW, then an adjacent 4kb of memory as RX, and have them interact.

Trying to emulate that under 16kb pages would fault every memory operation.

londons_explore•5mo ago
the mprotect API could have been designed more like malloc() - ie. you don't protect a preexisting memory range - instead the API returns a new memory range with the protections you've asked for, possibly copying a load of data into it for you incase you asked for a readonly range.

And that 'copy' might be zero-overhead remapping of the original pages.

duskwuff•5mo ago
There's some important use cases for mprotect(), like toggling W^X on JIT pages, which that wouldn't work for.
Jyaif•5mo ago
W^X would be supported by the API that they suggest:

"possibly copying a load of data into it for you incase you asked for a readonly range."

duskwuff•5mo ago
For JIT, you specifically need to be able to write some code to a page, then switch that page from writable to executable in place. Having the page move to a new location isn't acceptable, as the generated code will contain relative calls to other JIT generated code in other pages you've previously written to.
Jyaif•5mo ago
Oh right, good point!
PhilipRoman•5mo ago
You can probably replace some of those use cases by mapping the same physical page in two places with different permissions (W^X is per-address, not per physical page).
IshKebab•5mo ago
If you had a way of allocating pages of at least N bytes it would work.

  uint8_t* mem = malloc_pages(1024);
  mprotect_paged(mem, 1024);
fweimer•5mo ago
That's how mmap and mprotect work today. Sizes get rounded up to the next multiple of the page size. Many applications using mmap do not need to know about the page size.

I think it's even part of POSIX: “The system performs mapping operations over whole pages. Thus, while the parameter len need not meet a size or alignment constraint, the system shall include, in any mapping operation, any partial page specified by the address range starting at pa and continuing for len bytes.”

pjmlp•5mo ago
Yes, but that is a platform implementation detail, not something NDK apps should mess with.
plorkyeran•5mo ago
That API basically exists (you can use mmap() with a dummy backing file), and it is not useful for any of the things you use mprotect() for.
pjmlp•5mo ago
That isn't officially supported API, so if any app on NDK is making use of it, though luck.

https://developer.android.com/ndk/guides/stable_apis

duskwuff•5mo ago
I'm not sure how you get that idea - as a Linux system call, mprotect() is part of "the standard C11 library headers", and it's used internally by the dynamic linker. Android doesn't need to take any steps to support it, and there's little they could do to remove support for it.
pjmlp•5mo ago
I got that idea knowing ISO C standard, POSIX and not mixing themes.

By not being part of the official stable APIs, Google is free to break whatever userspace application they feel like.

There are seccomp and sandboxing filters in place for what is exposed to non-system apps, aka regular PlayStore apps.

forrestthewoods•5mo ago
Could not possibly disagree more. Trying to hide details from developers causes immense and suffering.
gertop•5mo ago
Absolutely. Breaking apps for all users when the system's page size changes is much better than inconveniencing the handful of developers that would have to work around a more abstracted page size.

Same reason why I think electron is great. Devex for 3 people is so much more important than ux for the 30M users.

forrestthewoods•5mo ago
> why I think electron is great

I take it back. It is possible for me to disagree more strongly.

You don’t need to abstract away page size. Abstraction isn’t the solution to all problems. You just have to expose it. Devs shouldn’t assume page size. They simply need to be able query whether it’s 4 or 16 or 64 or however large and voila.

nneonneo•5mo ago
That exists via sysconf(_SC_PAGESIZE). The problem is that hard coding the page size to 4k has worked just fine for much of the software written in the last few decades, which means that the 4k size has ossified to some extent (Hyrum’s Law).
jyrkesh•5mo ago
> Devex for 3 people is so much more important than ux for the 30M users.

I think they were being sarcastic, and you might agree more than you realize.

forrestthewoods•5mo ago
Ahh you are probably right. I was confused by that phrase. I am not a clever man.
jeffbee•5mo ago
This change doesn't break all apps. It breaks a small subset. Just like you wanted.
o11c•5mo ago
The underlying problem is that there are several different things, and many of them currently don't have APIs:

* the known-constant page size that must be passed so you won't get failure from `mmap(MAP_FIXED)`, `mprotect`, etc. (even if you don't call these directly, ELF relies on them and traditionally 4K was used on many platforms; raising it requires a version of ld.so with proper support). There is no macro for this. On platforms I know about, it varies from 4K to 64K. Setting it to a higher multiple of 2 is by design always safe.

* the known-constant page size that unconstrained `mmap` is guaranteed to return a multiple of. There is no macro for this. This is 4K on every platform I know about, but I'm not omniscient. Setting it to a lower multiple of 2 is by design always safe.

* the dynamic page size that the current kernel is actually using. You can get this using `getpagesize()` or `sysconf(_SC_PAGESIZE)` (incidentally the man page for `getpagesize(2)` is outdated by assuming page size only varies by machine, not at boot time)

The macro `PAGESIZE` is traditionally provided if the upper/lower bounds are identical, and very many programs rely on it. Unfortunately, there's no way to ask the kernel to increase the alignment that unconstrained `mmap` returns, which would safely allow defining PAGESIZE to the largest possible value.

Note that it is possible to get compiler errors for incompatible definitions of constants (or ranges thereof) by relying on `ld` magic (each value pulls in variable definied in a distinct object file that also defines an additional shared variable, causing multiple-definition errors), but this would need to be done by whoever provides the macros (which should be libc).

dataflow•5mo ago
> Letting userspace know the page size was IMO a design mistake.

How would you have had users handle SIMD tails?

pornel•5mo ago
Fixed-length SIMD was a design mistake too.

But realistically, you only need to know the lower bound for the page size, so pages larger by an unknown multiple are not a problem. Or use masked loads, and don't even worry about pages.

Wowfunhappy•5mo ago
So, do 4 KB page size apps work on these 16 KB page size phones? There are plenty of legacy apps (especially games I'd imagine) that will never updated for one reason or another. I would want to know if I was buying a phone that won't support those...
jsheard•5mo ago
That ship already sailed, most legacy Android games were killed by 32bit support being phased out both in hardware (newer SOCs are 64bit only) and software (Android 14 doesn't support 32bit apps even when running on an older SOC). They've done it before and they'll do it again.
mappu•5mo ago
Which is a shame, a modern SoC is fast enough to emulate 32-bit in userspace with same-or-better performance than the real 32-bit SoCs from that period.
iggldiggl•5mo ago
> Android 14 doesn't support 32bit apps even when running on an older SOC

Huh? Tell that to my phone. Maybe Google dropped support from their own OS builds even for older phones, but I don't think AOSP as such has dropped 32-bit-compatibility yet, and other OEMs have kept 32-bit-support for those phones whose hardware still supports it.

(And at least one or two Chinese OEMs have been shipping some sort of compatibility layer for phones without hardware support, though possibly only for the domestic market, not export models/OS builds.)

It's true though that Google isn't too heavily invested in binary compatibility for native code, though to some extent their hand might have also been forced by the SOC manufacturers, because apparently 32-bits hardware compatibility is more expensive to provide on ARM.

71bw•5mo ago
>(Android 14 doesn't support 32bit apps even when running on an older SOC).

Completely untrue and can be entirely circumvented by one ADB flag (--bypass-low-target-sdk-block) or a third-party .apk installer.

DiabloD3•5mo ago
In other words, completely true because this is HN and we know things that the other 99.999% of the world doesn't and never will and never even thinks to ask.

Instead, "Google took away my favorite software off my device that I paid money for, and fuck 'em for doing it" is a totally okay thing for normal people to do.

Wowfunhappy•5mo ago
Fwiw when I asked the question I was specifically wondering if the apps will work at all, not whether they're easily accessible or easy to install.
71bw•5mo ago
And yet this issue is brought up by everyone often enough for there to be multiple YouTube guides, XDA threads and other sources of information explaining this to what you would probably call 'normal people'.
aprilnya•5mo ago
Well, I wouldn’t call it “completely” untrue if you need to use an ADB flag or third-party installer… most users will get apps from the Play Store and nowhere else
surajrmal•5mo ago
WearOS devices are still predominantly 32bit. Android hasn't stopped supporting those in any way. They are trying to entice phones to no longer support 32bit but the support on Android still exists.
MBCook•5mo ago
I suspect it would depend on if they have problematic native code.

The executable format (if it’s native code) doesn’t actually specify what page size it wants right? So there would be no way for the OS to block 4 KB page apps.

I guess they could block stuff that targets an older API version, but that would block a lot of things that would otherwise work just fine.

comex•5mo ago
The executable format defines a number of segments, which must be on separate pages because they have different permissions, and can’t be slid relative to each other. So the page size can’t be larger than the segment alignment chosen at link time, though it can be smaller.
plorkyeran•5mo ago
There's probably something that'll break, but iOS switched to 16KB pages with zero publicity or warning and it caused very few problems. The vast majority of applications don't care about what the page size is at all, and cross-platform native code already has to handle different page sizes so hopefully people didn't do the stupid thing of hardcoding it for Android and only dynamically checking on iOS.
comex•5mo ago
Isn’t the biggest issue that compiled binaries have segments aligned only to 4kb, and those segments must be on different pages (because they have different memory protections) and can’t be slid relative to each other? I’m not sure how iOS dealt with this (maybe arm64 binaries always had 16kb aligned segments?), but apparently this is an issue on Android and requires all binaries to be recompiled.

https://source.android.com/docs/core/architecture/16kb-page-...

gsnedders•5mo ago
> maybe arm64 binaries always had 16kb aligned segments?

Yes — because the move to 16k pages happened at the same time as the move to arm64.

pjmlp•5mo ago
The NDK is a well of surprises, when I used to do Android native, I always thought it was a kind of 20% project at Google.
malkia•5mo ago
This makes it now 4x more expensive to catch memory issues by having guard pages around...
fulafel•5mo ago
In which currency? VA space is plentiful.
nolist_policy•5mo ago
Only 512Gb virtual address space an Android arm64...
entropicdrifter•5mo ago
Sorry, are you talking about a quantity of ram in bits, or did you just forget to capitalize the b in "GB"?
AStonesThrow•5mo ago
“GB” would also be wrong in terms of RAM: you’re looking for “GiB”.
shpx•5mo ago
bibibytes are not going to happen
junon•5mo ago
Not really. Guard pages don't actually cost any physical memory.
malkia•5mo ago
They do... each allocation that is protecting must be aligned by 4kb, and now by 16kb (ideally padded at end)

On top of that, adding 4kb (or 16kb) pages sprinkled across adds more to the TLB cache.

junon•5mo ago
Guard pages do not require physical pages, no. Just a page table entry.

All pages are aligned by 4kib (except for esoteric CPUs perhaps). That's what a page is.

Unless the guard page is on another page table boundary, no additional physical pages are required.

Further, TLB cost means nothing if it's a guard page. It shouldn't be accessed in any normal path barring a bug.

malkia•5mo ago
What I'm saying is that if you have relatively lots of small allocations, with the 4Kb page, they also have to be aligned by 4kb, and with the new android changes - it'll be 16kb (e.g. 4x more).
trebligdivad•5mo ago
Why is camera start so much quicker due to the larger page size - seems a surprising (nice) benefit.
greatgib•5mo ago
I'm wondering if it will not make the apps overall memory usage explode a little bit more by having a lot of objects bound to a single page with more empty space unused inside most pages for common cases.