HNHacker News
TopNewBestAskShowJobs

jpgvm

10,011 karma · joined March 14, 2013

web: jpg.dev email: jpg@jpg.id.au twitter: @jpgvm github: josephglanville

Principal Software Engineer @ NVIDIA

Opinions are mine and not that of my employer, etc.

submissionscomments
jpgvm··on Steam, Itch.io are pulling ‘porn’ games. Critics say it's a slippery slope
I was in Belgrade aiport duty-free a few days ago and there was a Lelo stand in amongst the usual cosmetics. "Fly in Pleasure", definitely got a laugh out of me.

Personally I think this is a good thing.

jpgvm··on AMD CEO sees chips from TSMC's US plant costing 5%-20% more
It's really not just ecological concerns and tbh the mining really isn't that big of a deal. It's entirely the processing that is the problem, ecologically sure but mostly technically. Without the Chinese machines that do the processing because yes, you guessed it they are the only country in the world that makes most of them, you end up more than 20-30% less efficient. At that point on the world market you just aren't competitive at all.

This is all assuming you can get past the NIMBYs to build the plants in the first place.

jpgvm··on AMD CEO sees chips from TSMC's US plant costing 5%-20% more
If anything I could see the Chinese government moving to blocking import of Nvidia and AMD accelerators as time goes on. They can't afford to right now but you can bet they want to.
jpgvm··on Man wearing metallic necklace dies after being sucked into MRI machine
Yeah so this video shows exactly what I am talking about, the chair and other objects don't fall immediately, it takes ~15s for them to drop to the ground after the quench starts.
jpgvm··on Log by time, not by count
If you can can "log by time" then what you need is metrics, not logs.
jpgvm··on Man wearing metallic necklace dies after being sucked into MRI machine
> But then, why was someone able to walk into that room with metal around their neck if it was clearly so life-threatening?

Take a look at the Google Street View link someone posted. It's pretty clear this facility -shouldn't- have been able to acquire an MRI machine in the first place.

It also elucidates how such an accident could happen, i.e they clearly don't have the trained staff and protocols necessary given the danger of an MRI machine. It's very likely the poor gentleman didn't understand the immense danger the machine poses.

They are expensive and rare for a reason IMO. Yes it would be great to have more of them but the best place for more of them is within proper hospitals and leveraging economies of scale to share technicians across a fleet of them in a well run facility.

jpgvm··on Man wearing metallic necklace dies after being sucked into MRI machine
I wasn't going to click that link but now I have and honestly - that is mildly terrifying.

I don't understand how such a dangerous machine can end up in a place that looks like that.

jpgvm··on Man wearing metallic necklace dies after being sucked into MRI machine
Yeah I would say all modern MRIs do. However one misconception is that loss of field strength is instantanous, it's not. The field strength drops off over about 15s or so as the helium boils off and the magnet losses superconducting properties.

So the emergency quench is less useful than it sounds in these situations... it's very likely if an MRI is going to kill you it's going to do it fast enough for it not to be relevant.

jpgvm··on Man wearing metallic necklace dies after being sucked into MRI machine
I like to post this whenever the danger MRI magnetic field strength comes into question: https://www.youtube.com/watch?v=6BBx8BwLhqg
jpgvm··on Bun adds pnpm-style isolated installation mode
Would it be possible to make the default behavior of the isolated linker "nohoist" the same as pnpm?
jpgvm··on The Story of Mel, A Real Programmer, Annotated (1996)
I think going as far as assembly up front is probably not worth it, also it's hard to keep people engaged at that level as it's difficult to make the computer do exciting things with assembler.

However I strongly believe it's good to start with C. You can still rather quickly do interesting stuff, C is a small language so learning the language itself isn't a huge barrier.

A big benefit of the small language is that it leaves more time available to explore important concepts, not just the super low level ones (memory/pointers, etc) but really important parts of the stack that are infectious to everything else. Specifically things like syscalls and the libc interface that most other languages are essentially built on top of. Working with building blocks like pthreads directly is also very important IMO, both to get a handle on parallelism and concurrency primitives but also to learn why high level languages are so valuable. Similarly for stuff like important socket APIs ala select/epoll and implementing your own event loop.

I was lucky enough to learn all of this early in my career and luckier still to have been able to pass on this knowledge to many mentees over the years.

If there are any aspiring programmers here that want to build from a solid foundation then yeah, ignore the haters, write some C.

man pages and ironically ChatGPT are your friend, use them to explore the foundations of (most) modern code so when you start writing modern code in earnest/for money you will be substantially ahead of your peers in actual understanding.

jpgvm··on Removal of unwanted drivers from Windows Update
Yes and no. There is plenty of 20 year old HW that has drivers in Linux but their continued existence in the tree is predicated on them being maintained.
jpgvm··on LeetCode for System Design
They aren't meant to be but this will definitely force that.

In the past I have generally just had a list of dimensions to help the candidate explore, like separation of concerns, scalability on different system dimensions (concurrent txns, storage, memory, etc), analogies to existing systems/patterns, etc.

I usually have never had a script, merely a problem with a fairly generous solution space and a list of increasingly more difficult to satisfy requirements in order to pressure even the best candidates just a little.

HR has for the last decade tried to completely ignore that and instead try quantify candidates "goodness" with scores, scripts and other bullshit. This has had the rather obvious outcome in missing really good folks that didn't fit into their box and hiring utter trash that gamed their stupid metrics. They keep telling me this is "industry standard" and "how Google does it", but only the latter of that is actually true, the former was forced for no reason whatsover. They conveniently leave out that the reason Google did this for so long is they completely over-indexed on hiring fresh graduates with no experience, little to no intuition or real world knowledge and as such needed to entirely focus on IQ-test-esque questions to just try filter for the top X% of otherwise indistinguishable candidates. None of which is relevant for small teams hiring 10yr+ industry seniors with relevant domain expertise.

Interviews are meant to be about working out if someone will be successful on your team, that means determining if they have the technical chops, a decent enough communication style and enough experience/intuition to work in unfamiliar problem spaces effectively.

Really all you need is the vibe check, a good collaborative systems design exercise helps explore that vibe and quickly separates the pretenders from people with the required knowledge and intuition.

jpgvm··on TPU Deep Dive
They don't affect determinism of the results but different architectures have different determinism guarantees with respect to performance, as a result of scheduling and other things.

TPUs share a similar lineage to the Groq TPU accelerators (disclaimer: I work at Groq) which are actually fully deterministic which means not only do you get deterministic output, you get it in a deterministic number of cycles.

There is a trade off though, making the hardware deterministic means you give up HW level scheduling and other sources of non-determinism. This makes the architecture highly dependent on a "sufficiently smart compiler". TPUs and processors like them are generally considered VLIW and are all similarly dependent on the compiler doing all the smart scheduling decisions upfront to ensure good compute/IO overlap and eliminating pipeline bubbles etc.

GPUs on the other hand have very sophisticated scheduling systems on the chips themselves along with stuff like kernel swapping etc that make them much more flexible, less dependent on the compiler and generally easier to reach a fairly high utilisation of the processor without too much work.

TLDR: TPUs MAY have deterministic cycle guarantees. GPUs (of the current generation/architectures) cannot because they use non-deterministic scheduling and memory access patterns. Both still produce deterministic output for deterministic programs.

jpgvm··on Wrong ways to use the databases, when the pendulum swung too far
It really depends on the origin of the system to be replaced. If it was never designed to be replaceable you are usually in for a bad time. Similarly if the drive to replace it comes from new folk that simply don't understand the original system you are probably completely doomed.

I often write code with full intention of replacing it, generally by writing it in such a way it's replacement is forced. That latter bit is pretty important because systems generate inertia, you need to have some hard forcing function baked into prevent it ossifying.

i.e my current project is to replace a pretty awful pile of Bash I wrote last year and replace it with a much more sophisticated and automated system in Golang. The new system is already in production and the old tools are being phased out.

Writing the original in Bash was how I basically ensured it would get rewritten and not continually upgraded/morphed into something grotesque. There was a ton of pushback, lots of people saying "why not Go! why not Python! This is an awful decision, 3k LOC of Bash is an unmaintainable nightmare!". Literally all of those people missed the point.

Building simple systems that you 100% will replace (not intend, that really isn't the same thing) is a really good pattern to find a real understanding of the solution space before building something gold plated/spaceship-like.

It generally means once you implement the follow up it very rarely becomes "legacy" software without horrible mismanagement, i.e bringing in new management that wants to rewrite things for the sake of rewriting them, usually in some FoTM nonsense.

jpgvm··on Ultra Ethernet Specification v1.0 [pdf]
Yeah I may have underestimated how recent the formation of UEC was but IMO the efforts started around the period you are indicating with a lot of the libfabric guys proposing stuff like this.
jpgvm··on Ultra Ethernet Specification v1.0 [pdf]
UltraEthernet predates the AI boom. I don't blame them for adding the AI buzzwords, for this to succeed people need to think about it in the same vein as IB/RoCE/etc and a lot of the decision makers are unfortunately not technical enough to understand what this is or does.

Ultimately it's just a different (IMO slightly more refined) look at how to support RDMA on Ethernet vs RoCE which is a more ham fisted implementation.

RoCE took an encapsulation approach that has some drawbacks (namely it's reliance on PFC/ECN for congestion management).

This takes a different approach that attempts to actually do first-class re-implementations of Infiniband-ish congestion control with end-to-end credit based flow control similar to Infiniband virtual lanes.

jpgvm··on Containerization is a Swift package for running Linux containers on macOS
It's the other way around, the Apple code is FOSS, Apache 2 to be specific.

Presumably it's not as good right now but where it ends up depends entirely on Apple's motivation. When they are determined they can build very good things.

jpgvm··on Why We're Moving on from Nix
Nix generally speaking has a global "nixpkgs" version (I'm greatly over-simplifying here ofc) in which there is a single version of each package.

This is likely the source of their commit based versioning complaint/issue, i.e the commits in question are probably https://github.com/NixOS/nixpkgs versions if they aren't maintaining their own overlay of derivations.

This is in contrast to systems that allow all of the versions to move independently of each other.

i.e in the Nix world you don't just update one package, you move atomically to a new set of package versions. You can have full control over this by using your own derivations to customise the exact set of versions, in practice most folk using Nix aren't deep enough in it for that though.

jpgvm··on UK tech job openings climb 21% to pre-pandemic highs
Deep AI/math talent pool. Also a sizeable chunk of HW/FPGA folk too. Given the salary difference vs the bay area I'm surprised more AI focused companies haven't setup London satellite offices.
jpgvm··on Startup enables 100-year bridges with corrosion-resistant steel
Galvanized rebar is about 20% more expensive and is actually widely used in highway construction, particularly when salt is a major concern.

Epoxy coated rebar turned out to have much poorer efficacy than originally expected as you noted but the same is not true of galvanizing which is a much more durable coating.

jpgvm··on High Available Mosquitto MQTT on Kubernetes
Definitely not. Stream is an ordered log, a queue is a heap.

A stream has cumulative acknowledgement, i.e I have read up to X offset on partition Y, if I restart unexpectedly please redeliver all messages since X. This means that if any message on Y is failing you can't update the committed offset X without a) dropping it into the ether or b) writing it to retry topic. b) sounds like a solution but it's really just kicking the can down the road because you face the same choice there until it ends up in a dead-letter topic that you send stuff that can't be automatically dealt with. In the literature this is called head of line blocking.

Queues are completely different. Usually instead of having a bunch of partitions with exclusive consumers you want a work-stealing approach that has consumers rip whatever work items they can get and stay as well fed as possible and be able to deal with failing items by Nack'ing them and sending them back to the queue. In order to facilitate this though the queue needs to implement the ability to selectively Ack(nowledge) messages and keep track of which messages haven't been successfully consumed.

This is easy with a traditional queuing system because they usually don't offer any ordering guarantees (or if they do they are per key or something and pretty loose) and they store the set of messages "yet to be delivered" rather than "all messages in order" like a streaming system does. This makes it trivial to acknowledge a message has been processed (delete it) or nack it (remove the processing lock, start a redelivery timer for it). Naturally though this means the ability to re-consume already acknowledged messages pretty much doesn't exist in most queue systems as they are long-gone once they have been successfully processed.

Mixing the two is the magic of Pulsar. It has the underlying stream storage approach, with it coming ordering properties and a whole bunch of stuff that is good for scaling and reliability but layers on a queue based consumption API by storing subscription state durably on the cluster i.e it tracks which individual messages have been Ack'd rather than offsets like Kafka consumer groups or similar APIs.

Building this yourself on Kafka/Redpanda is possible but it's extremely difficult to do correctly and you need to be very careful about how you store the subscription state (usually on a set of compacted topics on the cluster). I say this because I took this path in the past and I don't recommend it for anyone that isn't sufficiently brave. :)

jpgvm··on High Available Mosquitto MQTT on Kubernetes
With Redpanda you would need to build something external. With Pulsar the protocol handlers run within the Pulsar proxy execution mode and all of your authn/authz can be done by Pulsar etc.

Redpanda might be more resource efficient however and less operational overhead than a Pulsar system.

Pulsar has some very distinct advantages over Redpanda when it comes to actually consuming messages though. Specifically it enables both queue-like and streaming consumption patterns (it is still a distributed log underneath but does selective acknowledgement at the subscription level).

jpgvm··on High Available Mosquitto MQTT on Kubernetes
I built a high scale MQTT ingestion system by utilising the MQTT protocol handler for Apache Pulsar (https://github.com/streamnative/mop). I ran a forked version and contributed back some of non-proprietary bits.

A lot more work than Mosquitto but obviously HA/distributed and some tradeoffs w.r.t features. Worth it if you want to run Pulsar anyway for other reasons.

jpgvm··on What Every Programmer Should Know About Enumerative Combinatorics
To add to this HyperLogLog, sketches and bloom filters are the magic that make most of modern distributed databases tick.
jpgvm··on Coffee for people who don't like coffee
We don't really have sketchy diner drip coffee but we do have fancy approximations like batch brew that sort of capture the idea but taste better heh.

I think -actually- serving crappy diner coffee in Melbourne might be considered a hate crime against our culture though lol.

jpgvm··on Coffee for people who don't like coffee
Australia not growing coffee is somewhat ironic, given we worship the stuff. Melbourne in particular, it's our religion and we have temples on every corner.
jpgvm··on Wyze pays $255k of tariffs on $167k of floodlights
The TTP was structured as the economic equivalent of the Island Chain containment. It's conception lead to Made in China 2025 which wasn't rolled back just because USA withdrew from TPP.

Obama had the right idea, Trump if he understood it (lol) would have used it to screw China instead of giving China a free pass by withdrawing from it.

Note that China <-> US relations soured under Obama, well before Trump came into the picture and most of it was a direct result of TPP and policies like it designed to contain China economically.

jpgvm··on U.S. Economy Contracts at 0.3% Rate in First Quarter
What happened to the economy? Well the front fell off.
jpgvm··on Atuin Desktop: Runbooks That Run
Full reproducibility isn't easy, there is a cost to it.

However the payoff is rather significant so if you can temper that cost a bit and make it less inconvenient to achieve then you have a winning solution.

I have cooked this up based on Bazel, rules_oci and rules_distroless: https://github.com/josephglanville/images Specifically this file is a busybox based image with some utilities included from a Debian snapshot: https://github.com/josephglanville/images/blob/master/toolbo...

More difficult than Dockerfile? Sure. However better in pretty much every way otherwise including actual simplicity.

← PreviousPage 4 of 34Next →