HNHacker News
TopNewBestAskShowJobs

hajile

7,529 karma · joined October 4, 2013

submissionscomments
hajile··on macOS Tahoe
Doesn't MS still have screens rendered like Windows 3.1 or Win95 in some corners of the OS?
hajile··on Japan sets record of nearly 100k people aged over 100
I don't remember the source, but worldwide, most really old people have a couple things in common. First is that they live in countries with some kind of pension plan. Second, they generally come from poor neighborhoods where all the people around them statistically have lower lifespans.

The logical conclusion is fraud.

hajile··on Claude Code: Now in Beta in Zed
If the LLM isn’t getting its data about coding projects from those projects and their surrounding documentation and tutorials, what is it going to train with?

Maybe it also needs some amount of other training data for basic speech patterns, but I’d again show IBM Granite as an example that professional and to-the-point LLMs are possible.

hajile··on Claude Code: Now in Beta in Zed
I was somewhat surprised to find that Zed still doesn't have a way to add your own local autocomplete AI using something like Ollama. Something like Qwen 2.5 coder at a tiny 1.5b parameters will work just fine for the stuff that I want. It runs fast and works when I'm between internet connections too.

I'd also like to see a company like Zed allow me to buy a license of their autocomplete AI model to run locally rather than renting and running it on their servers.

I'd also pay for something in the 10-15b parameter range that used more limited training data focused almost entirely on programming documentation and books along with professional business writing. Something with the coding knowledge of Qwen Coder combined with the professionalism and predictability of IBM Granite 3. I'd pay quite a lot for such an agent (especially if it got updates every couple of months that worked in new documentation, bugfixes, github threads, etc to keep the answers up-to-date).

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
There's a lot to break down here. FP/SIMD vs int/ALU, package vs core power, percentage vs total, branching vs unbranching code, average IPC, etc.

Let's start with package vs core power. Package power is a terrible metric for core efficiency. The CPU cores on an M3 Max peak out at around 50w under a power virus which is around 40-50% of total package power. M3 CPU cores peak out at around 21w with a total package power of somewhere around 25-30w or 70-85% of package power.

Would you then assert that the M3 Max cores are TWICE as power efficient as the M3 cores? Of course not. They are the exact same CPU core design.

Package power changes based on the design and target market of the chip. Core power is the ONLY useful metric here. That number indicates that decoders use between 8% and 22% of total core power and this is going to be essentially true whether you are in a 30w TDP or a 300w TDP.

This ties directly into the percentage vs total hiding the truth. At 4.8w of power for the decoders in one core, an 8-core Haswell 5960x would use 38.4w of its 140w TDP on decoding (or a whopping 27.4% of TDP package power if you still believe that is relevant). On an 18-core server variant, this would theoretically be 86.4w out of a 165w TDP package power. Even if we cut down to the 1.8w you say is reasonable, that's still 14.4w for the 8-core and 32.4w for the 18-core (still 19.6% of package power).

Not only is this a significant percentage, but it is also significant in absolute watts. Quoting 3% is just an attempt to hide the truth of an ugly situation. Even if the 3% were true, chip companies spend massive amounts of money for less than 1% power savings, so it would still be important.

Next, let's discuss FP/SIMD vs int/ALU. SIMD takes more execution power than the ALU. This makes sense if you just look at a die shot. All 4 ALUs together are something like 10-20% the size of the SIMD units. When you turn a SIMD unit on, it sucks a lot of power. This is why SIMD throttles so often and Haswell is no exception. The ALUs are executing 2.3x more instructions while using 2.1x more power (which means the SIMD units are aggressively power-gating most of the SIMD execution units).

Notice the cache differences. SIMD is taxing the L1 cache more (4.8w vs 3.8w) and massively taxing the L2/L3 cache (11.2w vs 0.1w). The chip is hitting its power limits and downclocking the CPU core so it can redirect power to the caches. We see this in the FP code using 4.9w with the larger SIMD units while the ALU code used 10.4w. I'd also note that the power curve matters here because the power doesn't scale linearly with the clockspeed, so reducing the clockspeed has multiplicative effects on reducing decoder power

If we compute the decode/execution power ratios, we get .37 for SIMD and and .46 for ALU which shows that even in this ideal situation, the relative power draw isn't as good as you are led to believe.

Finally, there are 4 ALU ports, but only 2 SIMD ports. In practice, this means that half of the decoders will simply not turn on in this test or will turn on long enough to race way ahead in the uop cache then turn off.

If the core were not downclocking and there were 4 SIMD ports, the decoder power consumption would be higher than 1.8w.

You are basically correct about average IPC, but wrong about its impacts. SpecInt suite averages around 1.6-1.8 instructions/clock on Haswell[0] and is representative of most code out there (and why ARM designer's focus on very wide chips with very high IPC is important).

What it misses is branches. The CPU can't wait until a branch happens to start decoding. The branch predictor basically pre-fetches cache lines into I-cache. The decoders then take the next cache blocks and decode them into the uop cache lines. If a branch happens approximately every 5th instruction and cache lines are usually 64 bytes and average x86 instructions are 4.25 bytes long, then you can surmise that both sides of most local branches wind up being decoded even though both are not used. This means that the IPC of the decoders is higher than the IPC of the ALUs.

In all cases though, it can be stated pretty clearly that x86 decode isn't "free" and has a significant resource cost attached both in relative and absolute terms.

[0] https://tosiron.com/papers/2018/SPEC2017_ISPASS18.pdf

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
Cheese and Chips makes some bad arguments in that article.

Their claim that ARM decoders are just as complex wasn't true then and is even less true now. ARM reduced decoder size 75% from A710 to A715 by dropping legacy 32-bit stuff. Considering that x86 is way more complex than 32-bit ARM, the difference between an x86 and ARM decoder implementation is absolutely massive.

They abuse the decoder power paper (and that paper also draws a conclusion its own data doesn't support). The data shows that for integers/ALU, some 22% of total core power is used by the decoder for integer/ALU workloads. As 89% of all instructions in the entire Ubuntu repos are just 12 integer/ALU instructions, we can infer that the power cost of the decoder is significant (I'd consider nearly a quarter of the total power budget to be significant anyway).

The x86 decoder situation has gotten worse with Golden Cove (with 6 decoders) being infamous for its power draw and AMD fearing power draw so much that they opted for a super-complex dual 4-wide decoder setup. If the decoder power didn't matter, they'd be doing 10-wide decoders like the ARM designers.

The claim that ARM uses uops too is somewhere between a red herring and false equivalency. ARM uops are certainly less complex to create (otherwise they'd have kept around the uop cache) and ARM instructions being inherently less complex means that uop encoding is also going to be more simple for a given uarch compared to x86.

They then have an argument that proves too much when they say ARM has bloat too. If bloat doesn't matter, why did ARM make an entirely new ISA that ditches backward compatibility? Why take any risk to their ecosystem if there's no reward?

They also skip over the fact that objectively bad design exists. NOBODY out there defends branch delay slots. They are universally considered an active impediment to high-performance designs with ISAs like MIPS going so far as to create duplicate instructions without branch delay slots in order to speed things up. You can't argue that ISA definitely matters here, but also argue that ISA never makes any difference at all.

The "all ISAs get bloated over time" is sheer ignorance. x86 has roots going back to the early 1970s before we'd figured out computing. All the basics of CPU design are now stable and haven't really changed in 30+ years. x86 has x87 which has 80-bits because IEEE 754 didn't exist yet. Modern ISAs aren't repeating that mistake. x86 having 8 registers isn't a mistake they are going to make. Neither is 15 different 128-bit SIMD extensions or any of the many other bloated mess-ups x86 has made over the last 50+ years. There may be mistakes, but they are almost certainly going to be on fringe things. In the meantime, the core instructions will continue to be superior to x86 forever.

They also fail to address implementation complexity. Some of the weirdness of x86 like tighter memory timing gets dragged through the entire system complicating things. If this results in just 10% higher cost and 10% longer development time, that means a RISC company could develop a chip for $5.4B over 4.5 years instead of $6B over 5 years which represents a massive savings and a much lower opportunity cost while giving a compounding head-start on their x86 competitor that can be used to either hit the market sooner or make even larger performance jumps each generation.

Finally, optimizing something like RISC-V code is inherently easier/faster than optimizing x86 code because there is less weirdness to work around. RISC-V basically just has one way to do something and it'll always be optimized while x86 often has different ways to do the same thing and each has different tradeoffs that make sense in various scenarios.

As to PPC, Apple didn't sell enough laptops to pay for Motorola to put enough money into the designs to stay competitive.

Today, Apple macbooks + phones move nearly 220M chips per year. For comparison, total laptop sales last year were around 260M. If Apple had Motorola make a chip today, Motorola would have the money to build a PPC chip that could compete with and surpass what x86 offers.

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
In Haswell, 4.8w out of 22.1w for the core were used for the decoder for integer/ALU instructions[0]. According to this[1] analysis of the entire ubuntu repository, 89% of all instructions were composed of just 12 instructions (all integer/ALU).

From this we can infer that for most normal workloads, almost 22% of the Haswell core power was used in the decoder. As decoders have gotten wider and more complex in recent designs, I see no reason why this wouldn't be just as true for today's CPUs.

[0] https://www.usenix.org/system/files/conference/cooldc16/cool...

[1] https://oscarlab.github.io/papers/instrpop-systor19.pdf

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
Apple never used a uop cache in their designs. ARM dropped uop caches when they removed 32-bit support. Qualcomm also skipped uop cache.

uop made sense with 32-bit support because the 32-bit ISA was so complex (though still simple compared to x86). Once they went to a simplified instruction design, the cost to decode every single time was lower than the cost of maintaining the uop cache.

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
Apple made a big deal about this, but other iGPUs have done this for years.
hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
2. uops are a cope that costs. That uop cache and cache controller uses tons of power. ARM designs with 32-bit support had a uop cache, but they cut it when going to 64-bit only designs (look at ARM a715 vs a710) which dramatically reduced frontend size and power consumption.

3. The claim was never "stuck on 4-wide", but that going wider would incur significant penalties which is the case. AMD uses two 4-wide encoders and pays a big penalty in complexity trying to keep them coherent and occupied. Intel went 6-wide for Golden Cove which is infamous for being the largest and most power-hungry x86 design in a couple decades. This seems to prove the 4-wide people right.

4. This is only partially true. The ISA impacts which designs make sense which then impacts cache size. uop cache can affect L1 I-cache size. Page size and cache line size also affect L1 cache sizes. Target clockspeeds and cache latency also affect which cache sizes are viable.

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
Intel was working with Nokia to heavily invest into Meego OS until it was killed by Elop+Microsoft.

If it hadn't been killed, it may have become something interesting today.

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
Intel has proposed APX to address this. It does away with some of the 32-bit garbage that complicates design for no good payoff. Most importantly, it increases from 16 to 32 registers and allows 3-register instructions (almost all x86 instructions are 1-register or 2-register instructions). This would strip out tons of MOV instructions which was proven with AMD64 to have a decent impact on performance.

Reduced I-Cache, uop cache, and decoder pressure would also have a beneficial impact. On the flip side, APX instructions would all be an entire byte longer than their AMD64 counterparts, so some of the benefits would be more muted than they might first appear and optimizing between 16 registers and shorter instructions vs 32 registers with longer instructions is yet another tradeoff for compilers to make (and takes another step down the path of being completely unoptimizable by humans).

hajile··on Ask HN: Why hasn't x86 caught up with Apple M series?
M4 Pro was a massive step back in perf/watt over M3 Pro. To my knowledge, there aren't any M4 die shots around which has led to speculation that yields on M4 Max were predicted to be really bad, so they made the M4 Pro into a binned M4 Max, but that comes with tradeoffs like much worse leakage current.

That said Hardware Canucks did a review of the 395 in a mobile form factor (Asus ROG Flow F13) with TDP at 70w (lower than the max 120w TDP you see in desktop reviews). This lower-than-max TDP also gets you closer to the perf/watt sweet spot.

The M4 Pro scores slightly higher in Cinebench R24 despite being 10P+4E vs a full 16P cores on the 395 all while using something like a 30% less power. M4 Pro scores nearly 35% higher than the single-core R24 benchmark too. 395 GPU performance is than M4 Pro in productivity software. More specifically, they trade blows based on which is more optimized in a particular app, but AMD GPUs have way more optimizations in general and gaming should be much better with an x86 + AMD GPU vs Rosetta 2 + GPU translation layers + Wine/crossover.

M4 Pro gets around 50% better battery life for tasks like web browsing when accounting for battery size differences and more than double the battery life per watt/hr when doing something simple like playing a video. Battery life under full load is a bit better for the 395, but doing the math, this definitely involves the 395 throttling significantly down from it's 70w TDP.

hajile··on U.S. government takes 10% stake in Intel
I'm not talking about the plane. I'm talking about the weapon itself.

Imagine a next-generation fire-and-forget weapons with radar and broad-spectrum camera arrays and an AI trained on a fused version of all this data. Typical defenses like chaff or flares would be rendered almost entirely useless.

This kind of visual approach also renders modern stealth almost completely useless. When an unexpected plane is found on L-band (or some other low-frequency radar), the AD would simply fire a couple of missiles into the area with instructions to visually identify the large objects moving at fast speeds using the fusion of these different sensors (and ground+air-based radars) while in flight.

We are getting pretty close to being able to do this in realtime with cellphone-level chips.

hajile··on U.S. government takes 10% stake in Intel
The upcoming generation of weapons is going to use realtime sensor fusion done by AI. Cutting edge chips will matter for those weapons.
hajile··on U.S. government takes 10% stake in Intel
The major patents on all the most important parts of x86 expired years ago now. Nobody wants to take on a legacy ISA with tons of footguns everywhere when newer ISAs have learned a lot of lessons from x86 about how to do things better.
hajile··on U.S. government takes 10% stake in Intel
I believe the most modern TSMC fabs outside of Taiwan are in Arizona. They are just moving to 4nm which is nearly 5 years old and just a revision of 5nm which is getting close to 7 years old.

TSMC aims to have N3 in Arizona by 2028 at the earliest which is 6 years after it first released. By that time, TSMC will have released N3X, N2, N2P, N2X, A16, and A14.

TSMC is heavily sponsored by the Taiwanese government and was created with the express purpose of making Taiwan so valuable that the West would be forced to defend them against China. Moving newer processes out of the country is against their national interests and they've made it clear that there's no plan to do that.

hajile··on Mark Zuckerberg freezes AI hiring amid bubble fears
> Social media really seems to have settled into a means of following public figures. Individuals generally seem to interact with each other via group texts.

I wish Google circles were still a thing.

hajile··on Pixel 10 Phones
File System Access API has some serious issues. To quote Mozilla's position on the topic

> There's a subset of this API we're quite enthusiastic about (in particular providing a read/write API for files and directories as alternative storage endpoint), but it is wrapped together with aspects for which we do not think meaningful end user consent is possible to obtain (in particular cross-site access to the end user's local file system). Overall we consider this harmful therefore, but Mozilla could be supportive of parts, provided this were segmented better.

I think most users would probably be better off without this proposal.

hajile··on Build Your Own Lisp
I'd say that the best is probably the book "Lisp in Small Pieces".

Be aware that it's some 500 pages and makes several interpreters then a couple of compilers as I recall. If you read it though, you'll come out the other end with a pretty good understanding of how lisp implementations actually work.

hajile··on PHP 8.5 adds pipe operator
It used to be said that "Lisp programmers know the value of everything and the cost of nothing."

This applies to MOST devs today in my experience and doubly to JS and Python devs as a whole largely due to a lack of education. I'm fine with devs who never went to college, but it becomes an issue when they never bothered to study on their own either.

I've worked with a lot of JS devs who have absolutely no understand of how the system works. Allocation and garbage collection are pure magic. They also have no understanding of pointers or the difference between the stack and heap. All they know is that it's the magic that makes their code run. For these kinds of devs, spread just makes the object they want and they don't understand that it has a performance impact.

Even among knowledgeable devs, you often get the argument that "it's fast enough" and maybe something about optimizing down the road if we need it. The result is a kind of "slow by a thousand small allocations" where your whole application drags more than it should and there's no obvious hot spot because the whole thing is one giant, unoptimized ball of code.

At the end of the day, ease of use, developer ignorance, and deadline pressure means performance is almost always the dead-last priority.

hajile··on PHP 8.5 adds pipe operator
It seems like none of the really good language proposals have much traction. Proper Tail Calls have been in the language for TEN YEARS now, but v8 and Spidermonkey still violate the spec and refuse to implement for no good reason.

Record/tuple was killed off despite being the best proposed answer for eliminating hidden class mutation, providing deep O(1) comparisons, and making webworkers/threads/actors worth using because data transfer wouldn't be a bottleneck.

Pattern matching, do expressions, for/while/if/else expressions, binary AST, and others have languished for years without the spec committee seemingly caring that these would have real, tangible upsides for devs and/or users without adding much complexity to the JIT.

I'm convinced that most of the committee is completely divorced from the people who actually use JS day-to-day.

hajile··on US Coast Guard Report on Titan Submersible
I've heard both assertions. I tend to believe that Carbon Fiber is a fine material to use.

This submersible used untested techniques. They didn't adhere the layers together properly and apparently never bothered to X-ray the tube as that would have shown at least some of the defects. It also seems like there were other design issues with how the tube was paired to the ends.

Most importantly, the deaths were caused by negligence during operation and maintenance. They had the data showing when the hull was damaged on the previous expedition, but either never did their due diligence and analyze it or ignored the results. Even during their last expedition, they may well have avoided death if the alarms had been heeded.

EDIT: to answer the people who seem skeptical, there are companies making carbon fiber vessels that have successfully gone much deeper than those Titanic dives. We're still in the learning stages with the technology, but we'll eventually find the combinations and standards that can make it safe to use (at which point, it may become better than our current solutions). Until then, maybe we shouldn't be shoving people into damaged experimental vessels to see what happens.

https://www.compositeenergytechnologies.com/underwater-carbo...

https://www.researchgate.net/publication/376273321_Carbon_Fi...

hajile··on PHP 8.5 adds pipe operator
I'd rather write JS/TS than most of the other popular languages.
hajile··on PHP 8.5 adds pipe operator
Chaining requires creating a class and ensuring everything sticks to the class and returns it properly so the chain doesn't blow up. As you add more options and do more stuff, this becomes increasingly hard to write and maintain.

If I'm using a chained library and need another method, I have to understand the underlying data model (a leaky abstraction) and also must have some hack-ish way of extending the model. As I'm not the maintainer, I'm probably going to cause subtle breakages along the way.

Pipe operators have none of these issues. They are obvious. They don't need to track state past the previous operator (which also makes debugging easier). If they need to be extended, look at your response value and add the appropriate function.

Composition (whether with the pipe operator or not) is vastly superior to chaining.

hajile··on PHP 8.5 adds pipe operator
Closures won over OOP in Javascript a long time ago (eg, React switching from classes to functions + closures), but they still keep trying to force garbage like private variables on the community.

Loads of features have been added to JS that have worse performance or theoretically enable worse performance, but that never stopped them before.

Some concrete (not-exhaustive) examples:

* Private variables are generally 30-50% slower than non-private variables (and also break proxies).

* let/const are a few percent slower than var.

* Generators are slower than loops.

* Iterators are often slower due to generating garbage for return values.

* Rest/spread operators hide that you're allocating new arrays and objects.

* Proxies cause insane slowdowns of your code.

* Allowing sub-classing of builtins makes everything slow.

* BigInt as designs is almost always slower than the engine's inferred 31-bit integers.

Meanwhile, Google and Mozilla refuse to implement proper tail calls even though they would INCREASE performance for a lot of code. They killed their SIMD projects (despite having them already implemented) which also reduced performance for the most performance-sensitive applications.

It seems obvious that performance is a non-issue when it's something they want to add and an easy excuse when it's something they don't want to add.

hajile··on PHP: The Toyota Corolla of programming
JS devs who started around or just after covid are everywhere. JS devs with 10+ years of experience are a small fraction of the market at this point. JS devs with any number of years of experience who also understand JS (or even just CS in general) well are a minute fraction of JS devs.
hajile··on The many JavaScript runtimes of the last decade
There's something special about the JS specs and test suite.

There are very few languages where you can write/run the same piece of code across so many different runtimes without major issues.

hajile··on The many JavaScript runtimes of the last decade
Java was never going to replace JS in a practical way because of security and the Java JIT taking forever to load and warm up.
hajile··on The many JavaScript runtimes of the last decade
For the same reason someone would use Lua or MicroPython.

If you're moving from a $0.50 to a $1.00 chip due to the overhead of using the higher-level language and save just one $200,000/year dev in the development process, you'd have to sell 400,000 units before the $0.50 chip would save you any money.

Even if you are moving from a $0.50 chip to a $3.00 chip, you can probably still save a significant amount of money on a lot of projects when you put together all the dev-years saved.

← PreviousPage 8 of 34Next →