HNHacker News
TopNewBestAskShowJobs

bonzini

9,719 karma · joined August 16, 2011

submissionscomments
bonzini··on Microcode in Intel's 8087 floating-point chip: the scale instruction
That's a really vertical microcode. It looks more like a specialized assembly than microcode. I guess it makes sense, since the algorithms are so complex and executing one microinstruction per cycle (is that correct?) already provides almost an order of magnitude performance improvement.
bonzini··on Music Theory for the 21st-Century Classroom
Transposing is an important skill for all instruments. It's true that trombonists get some cases for free if they learn the tenor and alto clefs, but it's possible to learn it without knowing the C clefs.

And even trombonists have to learn how to handle sharps and flats in chromatic passages, so there's a lot more to transposing than using a different clef.

> Tenor clef shows up in modern musicals regularly.

This I didn't know, thanks!

bonzini··on Music Theory for the 21st-Century Classroom
FWIW, there's no real need for imagination here. The comment says "mostly", and added a parenthetical comment that was simply meant to name the viola as a prominent remaining use.

In particular, trombones have almost entirely stopped using the tenor clef in jazz.

bonzini··on Music Theory for the 21st-Century Classroom
Yes, I did write "mostly". Sometimes the bassoon uses the C clef as well. Still, overall it can be safely ignored in most cases.
bonzini··on Music Theory for the 21st-Century Classroom
The point is that to a player the mapping is more important than the core 12-note structure, because highly chromatic (12-note) passages happen but they are the exception.

At least in western music you pick the seven basic notes on the scale, and that gives you the sharps and flats you place at the beginning of each line. That choice, from the point of view of notation, is even more important than the exact scale. And the choice is constrained to 15 sets of sharps and flats because it implicitly tells the player (veeeery roughly) to expect some patterns that probably will occur.

It doesn't always work great, for example if you want to write the Simpsons theme the set of notes in the scale doesn't fit any of those 15 sets. But it uses an unfamiliar scale in any case, so there's not much to gain and as a player you just deal with it.

See around 32:30 in https://youtu.be/Eq3bUFgEcb4?t=1950

bonzini··on Music Theory for the 21st-Century Classroom
More like, only if you're playing Schoenberg it's about modulo 12.

Almost all sheet music that you play uses 5 or 7 unequal subdivisions of the octave, and occasionally the rest. Sure, sometimes you'll have one or two of the rest on a regular basis (blues, harmonic/melodic minor), but still most music won't use all twelve.

bonzini··on Music Theory for the 21st-Century Classroom
https://youtu.be/Eq3bUFgEcb4 explains why music notation is the way it is. There are very good reasons for it.

The parts that are really weird (like the C clef) have mostly been obsoleted, unless you play the viola I guess.

bonzini··on What algorithm did Windows XP use to choose your initial user picture?
You have to allocate memory and free it.

Interestingly, when reading Raymond Chen's article I thought "reservoir sampling would compare the random number (between 1 and n) to 1, not to n, because that extends more easily to picking more than one element" - and that's what the actual Windows code uses.

bonzini··on Music Theory for Programmers
It's not a scientific theory, but musical theory concepts are certainly used by players when playing. Would you rather it be called music ontology or something like that?
bonzini··on Music Theory for Programmers
Or maybe not... surely if you are shown figured bass you will be pissed, but on the other hand understanding triads and sevenths provides some intuition about inversions, voice leading, rootless voicings, upper structures, diatonic movement of voices. Certainly not enough to orchestrate a piece, but enough to listen to educational YouTube videos, follow lead sheets, think about what you're hearing.

Harmonics and temperament aren't really relevant to all this, though at some point you have to explain why certain intervals are naturally consonant but "boring", and others can be made to make sense but mostly within a more complex voicing (which reconnects to topics like inversions and voice leading).

(For disclosure I studied piano until ~20, both classical and jazz, and I would call my knowledge of jazz theory "decent" for someone with zero professional or academic experience. Obviously not comparable to yours and not even in English, so perhaps what I wrote above will sound really stupid).

bonzini··on Music Theory for Programmers
Are Peano's axioms number theory? No one really uses them directly (other than induction) when working on practical number theory problems, but they are considered part of it.

Scales and chords build the fundamental basic blocks for Western music (I would introduce equal temperament third but that's only a matter of ordering). They are taken for granted in musical practice, I agree, but only because musical practice concerns itself about how/what to play and why. If somebody comes from the point of view that clefs and stems (which are undoubtedly musical tools) are gatekeeping and all you need is a piano roll, this article explains from first principles enough musical building blocks to tell them why they're wrong.

bonzini··on Music Theory for Programmers
I think what he means as music theory is the next step after what this (blatantly AI-written, but passable) article talks about. This is the part that you take for granted, but it certainly is music theory in the same way that Peano's axioms are number theory even though you don't use them explicitly.

The AI style gets boring very quickly, but I liked the explanation of what Western music notation is optimized for. For more information on this, there's a great and long video at https://youtu.be/Eq3bUFgEcb4.

(Edit: I wrote this around the same time as the reply, which more or less confirmed my hunch)

bonzini··on Banca Etica Suspends A/I's Account While Condemning the Sanctions Behind It
That's the point.
bonzini··on Banca Etica Suspends A/I's Account While Condemning the Sanctions Behind It
It's still not "fairly clear".
bonzini··on RISC-V is now officially supported by CPython
They are minor but enough to complicate things. For example Intel rejects the SYSCALL instruction outside 64-bit mode.
bonzini··on What 2000 Buried Underpants Revealed About Where Soil Is Most Alive
Ig Nobel prize incoming?
bonzini··on RISC-V is now officially supported by CPython
Nope, there are subtle differences between Intel and AMD that make it a Bad Idea to fake the vendor.
bonzini··on RISC-V is now officially supported by CPython
Free threaded Python - optional but supported

https://docs.python.org/3/howto/free-threading-python.html

bonzini··on VMs won't contain cyber-capable agents
And an old one. It's only needed for Windows XP/2003 and honestly it should be retired.
bonzini··on VMs won't contain cyber-capable agents
Virtualization instructions are the easy part. x86 does have a need for yuckier instruction emulation than other architectures, but the really complex part where you find vulnerabilities is page table management which is only optimized to the extreme on x86 but, in reality, it has very similar needs across architectures.
bonzini··on IBM Unveils Next Generation Dual-Architecture Processor for IBM Z and LinuxONE
Mostly because big endian is the past.
bonzini··on IBM Unveils Next Generation Dual-Architecture Processor for IBM Z and LinuxONE
Millicode used custom extensions to the ISA but is otherwise regular s390 code. For example there is a separate register file and the "original" registers are available with either (I don't remember exactly) special instructions or special memory addresses.

Intel by the way did the same for SGX, they called it xucode.

bonzini··on VMs won't contain cyber-capable agents
Note that the author didn't use any QEMU guest-to-host vulnerability here. The agent found a logic bug that facilitated going straight for the hypervisor from inside the guest, but it isn't caused by the use a memory-unsafe language.

Here is the fix: https://lore.kernel.org/qemu-devel/20260826181552.848617-3-p...

bonzini··on VMs won't contain cyber-capable agents
QEMU has a secure subset, and the kitchen sink around it. For a properly configured VM, even better if wrapped in SELinux, it is not easy to escape even QEMU.

In this case, of the four bugs it found:

* Two were in libslirp, which is not part of that subset; user mode networking these days should use passt (https://passt.top/), an insanely cool hack that does user mode networking at many Gb/s and is secure

* One (which had already been patched upstream) was in VGA emulation; it is borderline but I think it should indeed count as being part of the secure subset. On the other hand it wasn't usable in the configuration under test because it was correctly configured without a VGA.

* The VAPIC bug is letting a guest do things that it shouldn't do such as bypassing secure boot (and in this case facilitating the exploitation of a KVM bug), but is not a full guest-to-host escape and is not specific to QEMU being written in C.

So the real issue here was not QEMU but libslirp. And in this case it was KVM that turned out to have the worst bugs, not QEMU. Crossing fingers, the initial wave of AI-assisted security reports seems to have slowed down for KVM on x86.

bonzini··on Don't Wordle
Got to the sixth attempt, 2 words remaining, of course I picked the right one.
bonzini··on The little-known winstart.bat batch file
Windows/386, and later 3.x and 9x, was a virtual machine monitor that could run 16-bit operating systems with 32-bit drivers.

The desktop environment you saw was nothing but the main virtual machine, and inside that was the green thread environment you describe. But the VMM on the outside was pretty solid.

bonzini··on AI didn't erase the junior engineer's value, it increased it it
Even if AI does the coding, I cannot understand the architecture of a change unless you split it in individual tasks that are "as small as possible but no smaller". And even if AI does the code review, the architecture review falls onto me.
bonzini··on Meta's blockbuster trial draws parallels to big tobacco
How do you distinguish engagement maximization and usability maximization?
bonzini··on Apple announces changes for apps in the European Union
Not knowing anything detailed about the acts, which terms are you referring to? Notarization?
bonzini··on Splitting a Git Commit
Or the opposite direction, with repeated "git checkout -p ..." and commit steps. Slightly less comfortable because you have to figure out (such as from "git rebase --edit-todo") the later commit, but it makes testing the pieces easier.
← PreviousPage 2 of 34Next →