frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

The ITTAGE indirect branch predictor

https://blog.nelhage.com/post/ittage-branch-predictor/
30•Bogdanp•4h ago

Comments

nynx•3h ago
I must be missing something here. How would this help predict interpreter dispatch? Those won’t be a function of previous branch history or pc, which may very well be independent of the next opcode. They’d be a function of state in memory or registers.
achierius•3h ago
"very well may be" but oftentimes isn't. Branch history does in practice do a very good job of predicting what target you're going to take for an indirect branch.
nynx•3h ago
Sure. I can easily see that often being the case for arbitrary code but not interpreter dispatch loops.
brigade•3h ago
In a hot loop, the next opcode can be predicted quite well from the history of previous opcodes executed, especially once have a couple iterations available in your history. And the opcodes executed in an interpreter are generally equivalent to the dispatch branch target.
saagarjha•2h ago
Interpreters are just like normal programs, but splatted out a bit. In particular, they have branches and loops just like normal programs. The challenge for processors is that these high level constructs are far apart and dispatched through an interpreter loop, which obfuscates them. Being able to reach further back in history lets you recover this kind of information "through" the intervening bits.
dzaima•2h ago
If your interpreter is interpreting a program with unpredictable branches, of course no predictor will magically make your interpreter get branches better predicted than an equivalent compiled program will.

The question here is about all other branching the interpreter will do. i.e. even if you have a unpredictable `if (a+b < 0)`, there's still the dispatching to the "load-variable" and "add" and "load-constant" and "less-than" and "do-branch" opcodes, that still will benefit from being predicted, and they could very well if you have it repeated in a loop (despite still having a single unpredictable branch), or potentially even if you just have a common pattern in the language (e.g. comparison opcodes being followed by a branch opcode).

saagarjha•2h ago
If the author is around, the final link points to http://localhost:1313/post/cpython-tail-call/#further-weirdn....
jonstewart•2h ago
I learned about computed goto a dozen years ago, tried it out in my interpreter, and got worse performance in that Haswell era than with a trusty switch statement. Branch predictors have made computed goto less compelling for a good long time.

Tail call is a different matter…

burnt-resistor•2h ago
Some architectures have/had branch hint instructions.

https://arcb.csc.ncsu.edu/~mueller/cluster/ps3/SDK3.0/docs/a...

The impact of a branch miss is a particular pipeline stalls to flush the incorrect prediction. If there were resources available for the other branch to be speculatively executed concurrently and in parallel it might take less wall time.

pbsd•1h ago
The Pentium 4 had branch hints in the form of taken/not taken prefixes. They were not found to be useful and basically ignored in every subsequent Intel microarchitecture, until Redwood Cove brought back the branch taken prefix in 2023.

'I'm being paid to fix issues caused by AI'

https://www.bbc.com/news/articles/cyvm1dyp9v2o
2•tareqak•3m ago•0 comments

Ask HN: What are non-social media ways to share photography/art

2•rPlayer6554•7m ago•1 comments

OpenAI Hits the Panic Button

https://gizmodo.com/openai-hits-the-panic-button-2000624271
2•uladzislau•11m ago•0 comments

China Has Paid a High Price for Its Dominance in Rare Earths

https://www.nytimes.com/2025/07/05/business/china-rare-earth-environment.html
1•defrost•13m ago•1 comments

Billy Bass Realtime AI – Home Assistant Test [video]

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

Fireworks Injury and Death Statistics in US, 2024

https://www.cpsc.gov/Safety-Education/Safety-Education-Centers/Fireworks
2•jamesgill•24m ago•0 comments

Thermal Notes

https://github.com/ben-gy/thermalnotes
1•ben-gy•26m ago•0 comments

The Government's Astonishing Constitutional Claims on TikTok

https://www.lawfaremedia.org/article/the-government-s-astonishing-constitutional-claims-on-tiktok
3•colinprince•31m ago•0 comments

AI 'thinks' like a human – after training on 160 psychology studies

https://www.nature.com/articles/d41586-025-02095-8
2•Bluestein•39m ago•1 comments

The most mysterious bug I solved at work

https://cadence.moe/blog/2025-07-02-the-most-mysterious-bug-i-solved-at-work
1•thunderbong•41m ago•0 comments

Is core PHP still relevant in 2025? I am not talking frameworks Laravel, Symfony

1•junebuggerz•43m ago•1 comments

Why do languages fade from us?

https://www.bbc.com/audio/play/w3ct5rhs
2•Bluestein•1h ago•0 comments

Running Linux on my Amiga 4000

http://sandervanderburg.blogspot.com/2025/01/running-linux-on-my-amiga-4000.html
1•marcodiego•1h ago•0 comments

The Liar (A Logic Song)

https://www.youtube.com/watch?v=VvcPGE_gs94
1•FillMaths•1h ago•0 comments

How to Use JSONPath to Query and Extract JSON Data Efficiently

https://www.postpilot.dev/blog/how-to-use-jsonpath-to-query-and-extract-json
1•anlac96_it•1h ago•0 comments

Show HN: ASCII Fireworks

https://asciifireworks.com/
2•theli0nheart•1h ago•0 comments

ChatGPT solved a 10 year problem no doctors could figure out

https://old.reddit.com/r/ChatGPT/comments/1lrmom4/chatgpt_solved_a_10_year_problem_no_doctors_could/
5•latchkey•1h ago•0 comments

A fast and powerful iTunes replacement with mpd, ncmpcpp, beets, and Alfred

https://ssrubin.com/posts/music-library-with-mpd-ncmpcpp-beets.html
2•tambourine_man•1h ago•1 comments

Show HN: Rhome – I made a recommendation platform for long-form media

https://rhomeapp.com
1•rohannihalani•1h ago•0 comments

Amiga Linux (1993)

https://groups.google.com/g/comp.sys.amiga.emulations/c/xUgrpylQOXk
2•marcodiego•1h ago•0 comments

Flint, Michigan finally replaced its lead pipes

https://www.washingtonpost.com/climate-environment/2025/07/01/flint-lead-pipes-replacement/
2•MilnerRoute•1h ago•2 comments

AI job substitution is real, but narrow, per new study

https://www.axios.com/2025/06/30/ai-job-vibe-coding-upwork
1•handfuloflight•1h ago•0 comments

The trick for ultra-fast S3 bucket discovery

https://celes.in/posts/s3_dns_enum
2•celesian•1h ago•0 comments

Gone in 40 days: US drops ban on export of chip design tools to China

https://www.theregister.com/2025/07/03/us_eda_export_ban_lifted/
7•thebeardisred•1h ago•0 comments

ADXL345 Die Analysis

https://www.tinytransistors.net/2024/08/25/adxl345/
15•picture•2h ago•0 comments

Show HN: We made a tool to reduce echo chambers on social media

https://www.tandfonline.com/doi/full/10.1080/29974100.2025.2517191
2•academic_84572•2h ago•0 comments

Why AO3 Was Down

https://www.reddit.com/r/AO3/s/67nQid89MW
20•danso•2h ago•1 comments

Cats Confuse Reasoning LLM: Query Agnostic Adversarial Triggers for Reasoning

https://arxiv.org/abs/2503.01781
1•felineflock•2h ago•0 comments

Claude.md: one big file vs. linking to project docs

https://ntharani.com/posts/2025/claude-code-md-inference-vs-length/
1•probablynish•2h ago•0 comments

Remember API

https://rememberapi.com/
2•handfuloflight•2h ago•0 comments