HNHacker News
TopNewBestAskShowJobs

zwegner

1,066 karma · joined February 12, 2013

https://github.com/zwegner https://twitter.com/zwegner zwegner@gmail.com
submissionscomments
zwegner··on Bespoke Synth 1.0 – open-source software modular synthesizer
No problem! Maybe I'm just being too negative, after all there are lots of people having fun creating stuff with it (and I like having the devices I've made). But there was definitely a big impedance mismatch of what I had in my head vs. how to implement it, so I wouldn't personally use it for any exploratory sandbox-y type stuff.
zwegner··on Bespoke Synth 1.0 – open-source software modular synthesizer
I only found out about Bespoke a few minutes ago, but I will say using Max as a programmer can be incredibly frustrating. I've made a handful of nontrivial M4L devices and have run up into tons of weird decisions, limitations, bugs, and plenty of Ableton crashes. (Caveat: this information in this post is mostly from a couple years ago and might be out of date, I haven't gotten the latest Ableton)

The JS support is really weird. It's only JS 1.6 (from 2005), and had weird glitches (like loading two instances of the same device causing the first device to stop working), and I couldn't get the timing tighter than about 30ms. Ideally you could write code that runs at audio rate.

There's also "gen", which is a Max-specific scripting language that is presumably real-time suitable through a JIT. Unfortunately you need a separate Max license to use it, even the full Ableton Live Suite doesn't give you gen support. You can sorta hack around and use it by manually editing the .maxpat files (which are almost JSON), copying from a device that uses gen, but there are lots of weird glitches going this route.

A list of a few annoying things about M4L:

* Documentation is pretty sparse and/or low quality, and weirdly split into two (help and references).

* All variables are global across devices by default, local (device-specific) variables need the prefix "---", which is barely documented

* Tons of annoying UX issues, like entering an invalid value in the inspector just reverts to the old value. You can't enter an empty string for parameter values, that reverts too (you need to enter a literal ""). Certain functionality is only available depending on whether the device is "locked", so you have to lock/unlock the view all the time if you're working with e.g. subpatchers

* Abstraction is quite annoying to do. There's three different types of patches, and it's not really clear what the difference is between them. Creating subpatches and then duplicating them creates two different subpatches--changes in one are not shared with others.

* ...and a ton of other things. I have a big text document of these gripes I was intending to turn into a blog post, but haven't gotten around to it.

Maybe I'm wrong and there's better ways to do some of these things, but overall my experience learning M4L was pretty bad. If it wasn't the only way to do certain advanced things in Ableton, I'd never touch it again.

zwegner··on Ask HN: How do I reliably prevent autoplay in Firefox 91?
Right, and as the wiki mentions, it's not a great solution overall. But at least it works for me for Twitter (and Twitter is still trying to autoplay on scroll, the play button on videos disappear while scrolling only to reappear). Not sure why it works actually, but it's better than going in the Twitter settings all the time or dealing with autoplay.
zwegner··on Ask HN: How do I reliably prevent autoplay in Firefox 91?
The solution I use is to set media.autoplay.blocking_policy to 2 in about:config (I found this on the Mozilla wiki [1]). This setting requires a click to play media.

Incidentally, I browse Twitter while logged in, but the autoplay settings are "per-browser", and Firefox's anti-fingerprinting mode makes Twitter think you're using a new browser on each visit, and thus keeps autoplaying all the time without the above setting. Pretty irritating.

[1] https://wiki.mozilla.org/Media/block-autoplay

zwegner··on Facebook still ‘secretly’ tracks your iPhone
You can still use messaging on the basic mobile site, https://mbasic.facebook.com, which doesn't even need Javascript.
zwegner··on From Vim to Emacs in fourteen days (2015)
FWIW Neovim has shipped with libvterm as a built-in terminal emulator for years now, I think since 2015? It's the main reason I switched from vim to neovim. Vim itself integrated libvterm somewhat later, too.
zwegner··on Open source projects should run office hours
Oh, don't get me wrong, I definitely think it's helpful to explain the idiom for those not familiar. I just found the description "a lot of the comments..." rather weird when I didn't see any.
zwegner··on Open source projects should run office hours
Do any of the comments actually make that conclusion? The other comment you replied to is the only one I saw that even comes close, but it mentions "if you can offer office hours..." so the poster clearly knew the "office hours" idiom.
zwegner··on Siliconpr0n: High Resolution Chip Maps
If you like this, I'd highly recommend also checking out Fritzchens Fritz's flickr account: https://www.flickr.com/photos/130561288@N04/albums

There's a ton of gorgeous high resolution die shots of (mostly) modern chips, all in the public domain.

zwegner··on Is this Mahler? This sounds like Mahler
You can at least search by label in Spotify, using "label:X" as a search term. Not perfect but it's better than nothing...
zwegner··on What is the PDP-11 instruction set?
Just curious: is there a use case for rotations where the integer size isn't important? It's perhaps a bit annoying to need size-specific rotation functions, but all the uses of rotations I know of need specific integer sizes anyways.
zwegner··on αcτµαlly pδrταblε εxεcµταblε
There's also this compiler (with accompanying paper/video), that compiles C89 to x86 with the output executable restricted even further, to only printable ASCII bytes: http://tom7.org/abc/
zwegner··on Writing a simple Python to C compiler: hello, fibonacci
This is similar to Nuitka in that it generates code that binds with the Python C API, so it's easy to get compatibility/interoperability.

I have an old, abandoned project that translates Python to C++ "from scratch", with no runtime dependencies beyond the STL[0]. It's very incomplete, and probably has plenty of bugs, but might be interesting for anybody looking for something more self-contained/embeddable. It has its own implementations of lists, dicts, etc., and a basic garbage collector.

[0] https://github.com/zwegner/pythonc

zwegner··on Reverse-engineering the Intel 8086's instruction register
That would indeed be a pretty good topic to hear about.

An interesting story related to rep movsb was how the original Pentium-based Larrabee supported gather/scatter, as described in this slide deck from Tom Forsyth: http://tomforsyth1000.github.io/papers/LRBNI%20origins%20v4%... (gather/scatter info on slides 48-61, important background about virtual memory/pipeline in slides 21-28)

A summary:

The original Pentium had a very simple pipeline that could only access one cache line per instruction, and had to determine if there was a page fault early in the pipeline. This presented a problem for the Larrabee design, which needed to support gathers/scatters (which are vectorized loads/stores, and can read/write up to 16 different cache lines in one instruction). Additionally, the Pentium microcode system was quite slow, and gather/scatter performance was very important for many workloads.

To solve this, they looked at how rep movsb (which can read/write an arbitrary number of cache lines) works: as it executes, rep movsb modifies the cx, si, and di registers in place (or their 32/64-bit counterparts). This side effect actually helps keep the implementation simple, because if an interrupt occurs in the middle of the instruction, the registers keep all the state needed to continue executing after control returns to the instruction--it just keeps copying from where it left off.

So gathers/scatters used the mask registers from the Larrabee vector instructions to keep state: a bit in the mask indicates that a vector lane still needs to be read/written. The instruction is then run in a manual loop (not a microcoded rep prefix) until all bits in the mask are cleared. Interestingly, this implementation can be faster than gather/scatter in a modern AVX-512 out-of-order core: whenever multiple vector lanes point to addresses in the same cache line, those loads/stores can all execute at once; in contrast, in the big cores gather/scatter are split into one load/store micro-op for each lane, that each execute independently. And the masking isn't taken into account before the uop split, so gathering with only a single address unmasked can still take more than 16 uops (see https://mobile.twitter.com/trav_downs/status/122333322625875...)

zwegner··on Why Apple believes it’s an AI leader–and why it says critics have it all wrong
I recently discovered a neat trick for fixing the duck problem, that is, adding swear words to the iOS dictionary: add a contact with the chosen words in the name fields. E.g. I have a contact named "shit shitty fuck fuckin fucking oh shit"
zwegner··on Intel’s port 7 AGU blunder (2019)
Thanks for pointing out that link (I didn't click on it when I originally read the article). Deep in the comments, there's a hint of the reason for this port 7 AGU weakness: not because of the extra gates for another adder, but due to the wiring of the scheduler/bypass network, which is presumably much simpler when port 7 only handles latency-1 instructions (at least if I'm understanding that correctly).

Looking forward to that paper, too!

zwegner··on The radix 2^51 trick (2017)
You're right, but only for pre-Haswell chips, where al etc. are renamed separately. From Haswell onwards, they aren't, and depend on the old value. So movzx eax, al gets you mathematical independence, but not out-of-order independence. There's a bunch more detail in this Stack Overflow question (referenced in the one you linked): https://stackoverflow.com/questions/45660139/how-exactly-do-...
zwegner··on The radix 2^51 trick (2017)
No, setcc actually does depend on the previous value of the register, because it only comes in the low-byte variants (i.e. al, bl, cl, dl etc)--the top 7 bytes of the destination are left unmodified.

A one-instruction variant I've seen that gets you the negated value of the carry flag is sbb rax, rax. This doesn't depend on the previous value of rax in a mathematical sense, though I'm unsure if it depends in an out-of-order sense; that is, if it's recognized as a zeroing idiom (or rather, zeroing or all-one-ing in this case). Probably not.

EDIT: did a quick test, and sbb rax, rax etc are not recognized to be a zeroing idiom, at least on my old Haswell. So it's still one instruction, but has a dependency on the previous register value.

zwegner··on The Miracle Sudoku [video]
In case anybody sees this comment before the video: I'd highly recommend trying to solve the puzzle yourself. After you see the rules stated in the video, click the link in the info. It took me a bit longer than this guy, but it was a very fun puzzle.
zwegner··on Git wishlist: aggregate changes across non-contiguous commits (2019)
Right, or there's always git stash. Either way, it's a pretty expensive and cumbersome operation.
zwegner··on Git wishlist: aggregate changes across non-contiguous commits (2019)
As the article notes, this is hard to do cleanly, depending on the exact semantics of what you want. And even with a full spec in hand, I don't think git's data model makes it particularly easy to compute this information.

One method for doing this manually is to do an interactive rebase and re-order all the relevant commits to the end. You basically create a new branch that has all the other commits first, and then you can diff between that point and the branch head. With the example commits from the post, you'd order them A B D F G C E H; then git diff G H would show just the changes from C E H.

This is a bit annoying in that it needs to use the working tree to apply all the commits in sequence, and you have to manually resolve any conflicts that arise, which gets more difficult the larger and more-intertwined the commits get. But maybe it's better than nothing...

zwegner··on Automatic Chess Board Design
Quick note:

> the now-defunct "chessprogramming.wikispaces.com"

It's not defunct, it moved to https://www.chessprogramming.org

zwegner··on Calls to Cancel SXSW Intensify as Facebook, Twitter Pull Out, 30K Sign Petition
I mostly agree, but you're forgetting an important part of the tech presence: a lot of those companies hold public parties with free beer and food. I've had plenty of VC-subsidized consumables through the years (though I don't know that I could remember a single one of the sponsoring companies... so maybe not very effective advertising).
zwegner··on Facebook's Download-Your-Data Tool Is Incomplete
Great post! Thanks for all the details.

Do you have any plans to release this? I could understand if you don't want to, since it might violate fb's ToS or get blocked in some way. But certainly many others would find it useful.

zwegner··on Year Without a Summer
I'd highly recommend the TV series Connections[0], which explores the history of science and technology through the lens of this sort of butterfly effect. There were a couple later reboots of the series that are not as good IMO, but still worth a watch.

[0] https://en.wikipedia.org/wiki/Connections_(TV_series)

zwegner··on The story of ispc: all the links (2018)
This is a great series of posts, highly recommended.

From my perspective, as someone who was once on one of the Larrabee graphics teams (but not the same one as Matt), I'd agree that the programming model was a big issue. For us, even C++ with intrinsics wasn't fast enough for the most important code, since we didn't control the compiler (note that I'm only speaking anecdotally here, these decisions pre-date my involvement). So we had our own programming language that was more like Python with intrinsics, that hooked into the back end of the shader compiler (which handled register allocation and scheduling).

This probably wasn't the best call for a Larrabee programming model "for the masses" (even lots of people on the team were skeptical of it)... But damn, that was a fun project. We needed the ability to try any crazy idea we could think of, because that's the only thing that could work.

zwegner··on Gathering Intel on Intel AVX-512 Transitions
Note that the 512-bit Larrabee instructions (on Knight's Ferry/Corner) had different encodings (and IIRC different encodings between KNF and KNC), but it was essentially the same instruction set. The few differences there were between LRBNI and AVX-512 had (AFAIK) almost nothing to do with the move from the old Pentium in-order core to Silvermont.

I think it's also safe to assume that, given the lead time to design an ISA and integrate it into an architecture (many years), the merging of AVX-512 into Skylake wasn't done "in a desperate attempt to give KL more software".

These slides from Tom Forsyth provide lots of interesting background on the evolution of the instructions: http://tomforsyth1000.github.io/papers/LRBNI%20origins%20v4%...

zwegner··on Gathering Intel on Intel AVX-512 Transitions
But what about instructions like vpermi2b, which does 64 parallel 128 byte table lookups? The AVX shuffle instructions were hamstrung by the split into two 16-byte halves...
zwegner··on Show HN: Tired of mobile games with IAP and ads, I made No-Bullshit Games
Ah yes, this would be kind of confusing in that case :)

Simply put, it's to move the blue-greenish block off the right side of the grid. You clear the path by moving all the other pieces around as necessary. Each piece can only slide horizontally or vertically, depending on its orientation (they move along their longer dimension).

zwegner··on Show HN: Tired of mobile games with IAP and ads, I made No-Bullshit Games
Cool list!

I'll throw in one I made for myself and never really showed to anyone. It's a clone of Unblock Me/Rush Hour, but with no ads and undo+redo support. It's only a website since I don't want to bother with app stores (I just save the page to my home screen).

https://zwegner.github.io/slidey-blocky-thingy/base.html

The puzzle variety isn't great, my generation method sorta sucks. I had started to build an exhaustive generator after reading Michael Fogleman's article[1] on it, but haven't finished.

https://www.michaelfogleman.com/rush/

← PreviousPage 2 of 11Next →