HNHacker News
TopNewBestAskShowJobs

tuetuopay

1,764 karma · joined December 23, 2021

submissionscomments
tuetuopay··on Isn't WSL2 just a VM?
My guess would be something akin to VirGL where they forward opengl/vulkan commands to the host. I've never dug into the nitty gritty, but VMware workstation is recognized as a GPU accelerated app, and exposes a virtual GPU in the VM.

On the linux side, the vmwgfx kernel driver and DRM drivers are used. For X11 you use modesetting, and for Wayland whatever it auto-selects. I don't use KDE but I can confirm Debian's Gnome works out-of-the-box with the default Wayland backend (to be fair, the only other compositor I tried was Sway, which is known for being picky about the GPU used). Copy/paste works properly, as do general acceleration.

I use those VMs daily, fullscreen on a 1440p monitor, so acceleration is not optional :)

tuetuopay··on Isn't WSL2 just a VM?
I’ve found VMware to work well, though it’s degrading quickly. X11 is sorta broken, and not all Wayland compositors run.

As an example, I can run KiCAD just fine under X11 with the modesetting driver, including the 3D board view.

tuetuopay··on Airbus A320 – intense solar radiation may corrupt data critical for flight
I had a similar story on my NAS that got one btrfs path corrupt. Plopped in on the btrfs IRC, one of the devs noticed the inconsistency was one bitflip away from the right value. Incredibly they were able to give me the right commands to fix it! Got to give credit where it is due, btrfs took the safe path and refused to touch the affected directory until fixed, and has enough tooling to fix this.

I won’t blame cosmic rays but more likely dying RAM. The NAS now runs ECC memory.

tuetuopay··on How to use Linux vsock for fast VM communication
> It's therefore convenient for things like guest agents where you want them to "just work" without reconfiguration hassle.

This. The point of vsock is not performance, it's the zero-configuration aspect of them. No IP address plan. No firewall. No DHCP. No nothing. Just a network-like API for guest-host communication for guest agents and configuration agents. Especially useful to fetch a configuration without having a configuration.

IMHO the "fast" in the original article should be read as "quick to setup", not as "high bandwidth".

tuetuopay··on Android and iPhone users can now share files, starting with the Pixel 10
That's the thing, this was the very beginning of the smartphone era, 2007-2009. UX was not fleshed out yet. Conventions neither. Simple gallery apps were an Apple and iPhone thing.

There were cases where phones were not consistent. Pictures from the camera, or saved from MMS, or saved from the Web, or screenshots, did not all go in the same place. Just like you would have on a desktop :) I don't remember that well the pre-2010 android, but it had some issues too.

Even to this day, WhatsApp saves photos to the gallery, but in its own album. At least on iOS those are part of the regular gallery so you'll always find them (an album is just a "tag" on the photo). Android has a dedicated album too, but the picture set is distinct from the main picture gallery. So are screenshots. That's more control and power, but utterly confusing for older people. Younger relatives are fine, older fail to navigate around this and find "the picture your auntie sent to me through whatsapp". Yup, it's there, but not in the main camera roll.

This is what I mean by "you know where the pictures are going".

PS: Apple botched the UX of the gallery app in the last two iOS versions so much that even I, a young tech-inclined person, loses my way around. So do my relatives. They're sorta catching up /s

tuetuopay··on Android and iPhone users can now share files, starting with the Pixel 10
Despite others thinking you’re crazy, I think you are right. I remember the start of the smartphone era where many of my relatives switched to iPhone because "you know where the pictures are going and where to find them". The worst offender was my dad that had a Samsung phone running windows phone 6 (with an actual start menu) where you had to dig through folders to find jpeg files.
tuetuopay··on Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple
Zig's memory safety has nothing in common with Rust. I'd even say, it mostly has barely more than C. It gets reliability from proper error handling.

It has a very weird feeling complaining about build.rs when any semi-serious Zig project comes with a build.zig that's always more complex than any build.rs.

tuetuopay··on The Death of Arduino?
Ah so the Oracle syndrome, where the engineering is a sidekick in the lawyer business?

In all seriousness, this is just appalling. This would make a good poison pill to prevent an opensource project from being used in such a corporation /s

Thanks for sharing! The sad part is, it's the qualcomm customers that pay for the end result.

tuetuopay··on The Death of Arduino?
As we have in France: Père castor, raconte-nous une histoire !

For the rest of the world: it's a children cartoon with a grandpa beaver telling stories to his grandchildren, and has been immensely popular for decades.

So yeah, please do! War stories are always cool

tuetuopay··on The Death of Arduino?
Welp Qualcomm gonna Qualcomm. It was expected, but I did not expect it to be that blunt.

It takes a serious pair to "forbid reverse-engineering" on a platform aimed at tinkerers.

tuetuopay··on Cloudflare outage on November 18, 2025 post mortem
Given the context and what the configuration file contains, I'd argue it's mission-critical for the software to keep running with the previous configuration. Otherwise you might shutdown the internet. Honestly, I'm pretty sure their pre-rewrite version had such logic, and it was forgotten or still on the TODO pile for the rewrite version.

At a previous job (cloud provider), we've had exactly this kind of issue, with exactly the same root cause. The entrypoint for the whole network had a set of rules (think a NAT gateway) that were reloaded periodically from the database. Someone rewrote that bit of plumbing from Python to Go. Someone else performed a database migration. Suddenly, the plumbing could not find the data, and pushed an empty file to prod. The rewrite lacked "if empty, do nothing and raise an alert", that the previous one had. I'll let you imagine what happened next :)

tuetuopay··on Show HN: I made a down detector for down detector
well they're not comparable to hetzner anymore, both in terms of features and price. only their dedibox brand could compare, as it's the classic hosting approach vs cloud.

for the hobby crowd it's a shame, for a corporation it's still cheaper than aws with the extra bonus of not having any tie to the us.

tuetuopay··on Cloudflare outage on November 18, 2025 post mortem
> I read it top-to-bottom out loud for Doug, John, and John’s son. None of us were happy — we were embarrassed by what had happened — but we declared it true and accurate.

I'm so jealous. I've written postmortems for major incidents at a previous job: a few hours to write, a week of bikeshedding by marketing and communication and tech writers and ... over any single detail in my writing. Sanitizing (hide a part), simplifying (our customers are too dumb to understand), etc, so that the final writing was "true" in the sense that it "was not false", but definitely not what I would call "true and accurate" as an engineer.

tuetuopay··on Cloudflare outage on November 18, 2025 post mortem
That may be me, but `.unwrap()` is much more obvious than `_`:

- it's literally written out that you're assuming it to be Ok

- there are no indications that the `_` is an error: it could very well be some other return value from the function. in your example, it could be the number of appended features, etc

That's why Go's error handling is indeed noisy: it's noise and you reduce noise by not handling errors. Rust's is terse yet verbose: if you add stuff it's because you're doing something wrong. You explicitly spelled out the error is being ignored.

tuetuopay··on Cloudflare outage on November 18, 2025 post mortem
They would also tell you that .unwrap() has no place in production code, and should receive as much scrutiny as an `unsafe` block in code review :)

The point of option is the crash path is more verbose and explicit than the crash-free path. It takes more code to check for NULL in C or nil in Go; it takes more code in Rust to not check for Err.

tuetuopay··on Cloudflare outage on November 18, 2025 post mortem
This would not have helped: the code would crash before doing anything useful at all.

If anything, the "crash early" mentality may even be nefarious: instead of handling the error and keeping the old config, you would spin on trying to load a broken config on startup.

tuetuopay··on Our investigation into the suspicious pressure on Archive.today
Oh trust me, if they could enforce the block at the browser level they would. We're well past the start of the slippery slope here in France when it comes to surveillance and control.

I started with telling ISPs to block websites at the DNS level. The people started using 1.1.1.1, 8.8.8.8, 9.9.9.9 and so on. So now they pressure those third-party DNS providers to do the same. This is why 9.9.9.9 is now unavailable here: they stopped serving France because they did not want to comply.

tuetuopay··on Our investigation into the suspicious pressure on Archive.today
Let's say our dear politicans view most illicit contents as nails, and view DNS as a hammer. Unfortunately they are now aware that people can trivially get around the ISP restrictions by using another DNS provider, and have started to pressure third-party providers to apply the same blockings as the ISP ones. This is why a few "neutral" providers have outright blocked France because they refuse to block websites.
tuetuopay··on Rust in Android: move fast and fix things
I mentioned it because I often hear people (not in this thread though) that thanks to its GC preventing memory leaks, Go is memory safe. The GC's role in memory safety is preventing dangling pointers though.
tuetuopay··on Rust in Android: move fast and fix things
My Go is a bit rusty (pun intended), so I may have misremembered, especially with the pointer offsets. (just googled it, I did remember it, sorry for the confusion).

>> It's absolutely possible to reinterpret memory the wrong way. > Again, without the unsafe package? How?

Again my go is rusty, but I saw quite a bit of shenanigans in go with pointer casting from what's essentially a collection of void*. However perhaps those casts blow up at runtime? I'm too used to rust where it's explicit where it'll blow up.

>> It's absolutely possible to dereference nil. > Yeah, but that's safe defined behavior in go equivalent to "unwrap"ing a None option in rust. It reliably crashes. It's not like C where it's undefined behavior and you might crash of you might just corrupt random memory or have the optimizer make your code do something even stranger.

Agreed. I conflated "safety" and "robustness" here. The existence of nil is a thorn in the language.

Thanks for the corrections!

tuetuopay··on Rust in Android: move fast and fix things
Uuuh how so?

Cargo is a blessing for any source-available project. All bundled up, a `cargo build` away. Because don't you dare say CMake or autotools are better, that's just the stockholm syndrome kicking in because you're familiar with it.

Seriously, how a CMakeLists.txt can even be compared to a Cargo.toml file? One is imperative full of arcane conditions everywhere filled with boilerplate, while Cargo.toml is a declarative manifest of the package?

Though there is one very sore point when distributing software, and that is for distribution package maintainers, because the whole ecosystem has been built around the C model and dynamic linking. That is not even the fault of cargo, since Rust's ABI is not stable thus dynamic linking would not work most of the time. Another thorn is generic stuff, which needs to be monomorphized, and as such don't work with dynamic linking (without Box<dyn>); C++ actually has the same issue and is why there are so many "header only" libraries for it.

tuetuopay··on Rust in Android: move fast and fix things
How is Go memory safe? Memory safety does not mean "leaking memory".

It's absolutely possible to compute wrong pointer offsets. It's absolutely possible to dereference nil. It's absolutely possible to bork ownership and have multiple thread trample a struct. It's absolutely possible to reinterpret memory the wrong way.

I do agree that UAF is not possible (in most cases) due to the GC. That array indexing out of bounds is not possible. But it is by no means "memory safe" to the level Rust is.

tuetuopay··on Rust in Android: move fast and fix things
If you want something more comparable, they estimate that only 5% of their Rust code is within unsafe blocks. That makes only 5% of the code with potential for memory safety issues: that's already a 20x improvement. Let's make it 10x because unsafe blocks tend to be trickier, but you still get a lot of Rust guarantees.

The thing is with Rust, you know where to look for memory safety issues: the unsafe blocks. C and C++? GLHF that's your whole codebase. As they mentioned, you don't opt-out of all of Rust guarantees by going the unsafe route. Of course you can ditch them, but that'll be hugely visible during code review. Overall, you can be much more confident saying "yup there's no bug there" in Rust than in C or C++.

tuetuopay··on The Linux Kernel Looks to “Bite the Bullet” in Enabling Microsoft C Extensions
From first hand experience, swapping the endianness is a non-issue in network processing performance-wise (it is headache-wise though). When processing packets in software, the cost is dominated by the following:

- memory bandwidth limits: for each packet, you do pkt NIC -> RAM, headers RAM -> cache, process, cache -> RAM, pkt RAM -> NIC. Oh and that's assuming you're only looking at headers for e.g. routing; performing DPI will have the whole packet do RAM -> cache.

- processing limits: route lookup, ACL evaluation, checksumming, etc

- branch predictor limits: if you have enough mixed traffic, the branch predictor will be basically useless. Even performing RPS will not save you if you have enough streams

So yeah, endianness is a non-issue processing-wise. So more so that one of the most expensive operations (checksumming) can be done on a LE CPU without swapping the byte order.

tuetuopay··on An eBPF loophole: Using XDP for egress traffic
Pretty much, which was incredible for a half day rewrite, learning ebpf in rust included. The effort to result ratio is simply incredible. A few cleanups and optimizations later and I was pretty much convinced I would not need to touch DPDK again (so was the company). Following this experiments, I wrote some actual production grade eBPF routers at this company that are in production, much more complex, but still able to reach 200Mpps on a $500 CPU (EPYC 9015).

As for why Cloudflare uses eBPF where the GFW uses DPDK I can see a few reasons:

- DPDK was the only game in town when the GFW started, while eBPF was the hot new thing for Cloudflare's recent endeavors. GFW did not have any choice.

- Cloudflare has a performance focus, but still has a bit of "hardware is cheap, engineers are expensive", making eBPF more than fine.

- The GFW runs on dedicated machines on the traffic path, while I would expect most of Cloudflare's eBPF endeavors run directly on mixed-workloads machines. One of their first blogpost about it (dropping x Mpps) specifically calls the reason was to protect an end machine directly on said machine, by preventing bad packets from reaching the kernel stack

- Most of the operational advantages I already mentioned. GFW is fine with a "drop traffic if DPDK down", but Cloudflare is absolutely not, making the operational simplicity a bit win.

I bet Cloudflare does have quite a hefty DPDK application used for the traffic scrubbing part of their anti-ddos; but they don't publicize it because it's not as shiny as eBPF.

There are also other advantages to eBPF that makes it better suited to a multi-product company like cloudflare that don't weigh as much as in a mono-product org like the GFW. Take for example the much easier testing, dev env on any laptop, ... Or that eBPF probes can be written in Rust, getting the same featureful language to run in the kernel and in userspace (the classic combo is Go in userspace, C in kernelspace).

tuetuopay··on An eBPF loophole: Using XDP for egress traffic
The kernel will allocate, merge packets in skbs if needed, extract data, and do quite a lot. XDP runs as early as possible in the datapath. Pretty much all drivers have to do is call the XDP code when they receive an IRQ from the NIC.

You'll bypass a memory copy (ringbuf -> kernel memory), allocations (skb), parsing (ips & such), firewalling, checking if the packet is local, checksum validation, the list goes on...

The following diagram helps seeing all the things that happens: https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilte...

(yes, xdp is the leftmost step, literally after "card dma'd packet in memory")

tuetuopay··on An eBPF loophole: Using XDP for egress traffic
Yup, I don't really get it either. I've had this exact setup in my mind for a while to make an hypervisor dataplane (thus on TAPs, not VETHs). It's working as designed, and it's precisely for this usecase the veth driver has had quite a lot of care as far as XDP is concerned, getting optimizations and multiqueue support over time.

Honestly, the real news is that they're doing it in production, not that they found anything unique.

Heck, all the XDP development I've ever done was against a veth interface on my laptop, to run later on server metal.

tuetuopay··on An eBPF loophole: Using XDP for egress traffic
Yes, but it does so once. Additionally, you're likely to have a much heavier network path in the main network namespace of e.g. a k8s node than within the container: firewalls, connection tracking, multiple interfaces/bridges/taps/etc, NAT, and so on.
tuetuopay··on An eBPF loophole: Using XDP for egress traffic
DPDK will give you the absolute best performance, period. But it will do so with tradeoffs that are far from negligible, especially on mixed-workload machines like a docker host/k8s node/hypervisor.

1. to get the absolute best performance, you're running in poll-mode, and burning cpu cores just for packet processing

2. the network interface is invisible to the kernel, making non-accelerated traffic on said interface tricky (say, letting the kernel perform arp resolution for you).

3. your dataplane is now a long-lived process, which means that stopping said process equates to no more network (hello restarts!)

Alleviating most of those takes a lot of effort or some tradeoffs making it less worth it:

1. can be mitigated by adaptive polling at the cost of latency.

2. by using either a software bifurcation by re-injecting non-accelerated traffic in a tap, or with NICs with hardware bifurcation (e.g. connectx) and installing the flows in its flow engine. Both are quite time consuming to get right

3. by manually writing a handoff system between new and old processes, and making sure it never crashes

DPDK also needs its own runtime, with its own libraries. Some stuff will be manual (e.g. giving it routing tables). XDP gives all of those for free:

1. All modern NIC drivers will already perform adaptive polling and interrupt moderation; so you're not burning CPU cycles on polling the card outside of high packet rate scenarios (on which you'd burn CPUs on IRQs and context switches anyways).

2. It's just an extra bit of software in the driver's path, and the XDP program decides whether to handle it itself or pass id down to the kernel. Pretty useful to keep ARP, ICMP, BGP, etc without extra code.

3. XDP is closer to a lambda than anything: the code runs once for every single packet, meaning its runtime is extremely short. This also means that the long-running process is your kernel; and that updating the code is an atomic operation that done on the fly.

4. A lot of facilities are already provided, and the biggest of them is maps. The kernel handles all the stateful things to feed data (routing tables, arp tables, etc) to your dataplane code. CPU affinity is also handled by the kernel in the sense that XDP runs on the CPU responsible for the NIC queue, whose mapping is controlled through standard kernel interfaces, unrelated to XDP (meaning: not on your mind).

Now, speaking purely of optimizations. Yes, DPDK will always be better CPU-wise because you can compile it with -march native while eBPF is JIT-ed when available (and pretty poorly, having already looked at it). However, from experience, the parts that actually take time are map lookups (looking up the nexthop, looking up the mac address, etc), and those are written in C in the kernel, thus are as optimized as the kernel can be. Recompiling the kernel for your CPU can boost performance, but I've never done it myself.

Today, I would consider that unless you absolutely need the absolute best performance, XDP is more than fine. Modern CPUs are so fast that it's not worth it to consider DPDK for most cases.

- container routing like there? the dpdk runtime is a no-go, and the operational flexibility of xdp is a killer.

- network appliances like switches/routers? shell out a few extra bucks and buy a slightly better CPU. if latency is paramount, or you're doing per-packet processing that cannot fit in an ebpf probe, then go the dpdk route.

At a previous job, I rewrote for fun a simple internal dpdk routing application using xdp: only half the performance (in packets per second, not bits per second) on the same hardware with no optimizations whatsoever, in 100 lines or ebpf. Mind you, I could saturate a 100Gbps link with 100 bytes packets, not 64 bytes, what a tragedy /s. On more modern hardware (latest EPYC), I trivially reached 200Mpps on an 8 core CPU using XDP.

Long story short, you'll know when you need DPDK.

tuetuopay··on LM8560, the eternal chip from the 1980 years
I would also expect a grammar phase to be part of the training, with an RL pass where the output is fed to a grammar check engine.
← PreviousPage 7 of 20Next →