HN user

zwegner

1,066 karma

https://github.com/zwegner https://twitter.com/zwegner zwegner@gmail.com

Posts7
Comments312
View on HN

There's a method entirely based on group theory, a version of the original computer algorithm created to solve the cube (the Thistlewaite algorithm) simplified for use by a human [1]. It iteratively solves the cube into simpler groups that need a smaller moveset to solve (the last step uses only half turns on each face, no quarter turns). It requires only a bit of memorization, and you can understand exactly how the algorithm works. It's not a great speedsolving method, but you can get relatively fast with it: in [2] there's a solve below 30 seconds.

[1] https://www.ryanheise.com/cube/human_thistlethwaite_algorith... [2] https://www.youtube.com/watch?v=GmjYWYDPhiM

Yeah my MoYu also has a face or two that sometimes desync. Really annoying.

I have a basic case recognition feature, though no statistics are tracked there yet. I also have some code for tracking splits (only CFOP), though I haven't integrated it into the app for tracking stats.

csTimer has a ton of features too, but I've completely stopped using it, since CubingB has everything I need for basic timing and lots of improvements (like not losing session data, easily moving solves between sessions, partial scramble diagrams).

Cubeast looks pretty awesome, but it only works in Chrome, which is a non-starter for me. So a few months back I started my own Python/Qt app, which is roughly similar to Cubeast, but less features as of now: https://github.com/zwegner/CubingB

I haven't had much time to work on it lately, and there's limitations like only supporting Bluetooth on macOS and only one type of cube (the MoYu AI), but it's open source and works pretty well as a timer (both for smart cubes and regular cubes).

For a case like that, I'll use rectangular block mode--it's really fast and intuitive, so I'll usually pick that over :s/a/b/g if it's applicable.

The whole thing would be something like <ctrl-v>5jecs<esc>. Ctrl-v starts rectangular block mode, go down 5 lines and to the end of the word, change selection to "s", return to normal mode.

The solution partitions the solution space exactly the way I want it to: it was designed for the site this thread is about. Obviously it doesn't work against an arbitrary adversary.

My solution is static and doesn't take any clues into account, so what you're saying just doesn't feel very relevant. The only "solution in general" to an arbitrary adversary, if you're not allowed to look at the clues it gives, is just to guess every single target word, which isn't very interesting.

Now, you could easily argue that the greedy strategy used by the site is suboptimal, and I'd agree, but AFAIK nobody's put up a site with a better one yet.

This uses different word lists than Wordle/Adversarial Wordle, but still has a 4-guess optimum, no 3-guess is possible.

My solver's found about a thousand so far, here's a good one: "abyes choup donut dingo" (note that there are a number of 'fake' words allowed for guesses).

Adversarial Wordle 5 years ago

Four is possible in many ways:

    aiery canst dolma offal
    realo tings dampy humph
    raine scold bulgy ought
    ureas gilpy cyton conic
    lutea prosy canid cigar
    leary ungot camis humph
    stale groin dampy humph
If you're wondering what some of those words mean, Wordle (and this variant) have a big list of fake words it allows for guesses.

I think 4 is probably optimal, but my solver is still running. :) There's probably way more fours as well, my solver only prints new bests found, and this list is from progressively allowing a wider and wider search, so each result is from a separate run. I wonder how many end in 'humph'.

Ha, looking at the pictures, I thought "that looks just like the records building in the middle of season 3 of Mr. Robot", and it's the same building.

BTW this is unrelated to the thread, but Mr. Robot is an incredible show, and the middle of season 3 (where this building is featured) in particular is probably the greatest television I've ever seen. Episodes 5 and 6 are like a full two-episode climax to a story arc that had been building since season 2. I generally avoid any "hacker" type shows/movies for the cheesiness/cringiness of the hacker portrayals (and Mr. Robot does start off a bit cheesy), but I'm glad I made an exception here.

Yeah, I see how the quoting complications make CLMUL pretty hard to use (or just useless). I have a few ideas about how to deal with the quoting/escaping, and if I get some free time in the near future I'll try and code something up.

I've also pinged Geoff and Daniel on Twitter, linking your library: https://mobile.twitter.com/zwegner/status/147340073352554497... ...maybe they'll have some ideas. (Geoff has mentioned that he had done some initial work on a simdcsv)

I'll also drop some more links that you might've already seen, but could be useful otherwise. For removing double quotes, rather than memmove, you could use the "pack left" operation on vectors. There's a handful of ways to do this pre-AVX-512-VBMI2 (where the magical vcompressb instruction was added), like in these SO questions:

https://stackoverflow.com/questions/36932240/avx2-what-is-th...

https://stackoverflow.com/questions/45506309/efficient-sse-s...

And for keeping the main lexer structure that ZSV uses now, but using a small DFA to maintain the lexer state, this other trick from Geoff might work: https://branchfree.org/2018/05/25/say-hello-to-my-little-fri...

Thread's getting a bit old, hope you see this :)

Referring to the OP, I'm not sure what exact dialect of csv they're using, but its quoting rules are nothing like Excel's: quotes are escaped with a separate character (possibly backslash), and quoted regions can start anywhere, not just the start of a field. This makes CLMUL much easier to apply, quite similarly to how it's used in simdjson. Finding escaped characters can be done branchlessly with a handful of scalar operations on the masks (this code is in simdjson too).

For proper Excel-style parsing, you're quite possibly right (and looking at ZSV, I trust that you've thought about this problem a lot more than me). I'm not certain that it can't all be done efficiently with very few branches, though, using mostly SIMD and some scalar operations on masks. CLMUL might not be useful here, since quotes are treated completely differently depending on whether the field started with a quote. Instead you'd have a first phase basically looking for a comma or newline followed by a quote, then looking for the next unescaped quote. Escaped quotes within quoted fields can be found with a similar sequence to simdjson's backslash support (and removed with something like vcompressb on newer AVX-512 chips).

Good points all around. Not sure what the OP's requirements are, but judging by their current code, CLMUL should do nicely (or they have a bug).

And also, thanks for that example. Clearly I don't know CSV well enough--are quotes in fields that don't start with a quote not special?

CLMUL in general is a bit weird to wrap your head around, but a CLMUL with -1 isn't too tricky: it's like a running 1-bit sum, or in other words, each bit in the result is the parity of all the bits up to that point in the multiplier.

In our tests, going byte to byte for more iterations to keep the alignment when hitting the "else case" performed worse than making the unaligned loads, but as you say "just use CLMUL" (as all loads will be aligned) :D

I was talking about using bitwise operations with the quote/escape/newline masks already computed (like in the blog post I linked), rather than a byte-by-byte loop. But yeah, CLMUL is better anyways :)

Pretty similar article from very recently: https://nullprogram.com/blog/2021/12/04/

Discussion: https://news.ycombinator.com/item?id=29439403

The article mentions in an addendum (and BeeOnRope also pointed it out in the HN thread) a nice CLMUL trick for dealing with quotes originally discovered by Geoff Langdale. That should work here for a nice speedup.

But without the CLMUL trick, I'd guess that the unaligned loads that generally occur after a vector containing both quotes and newlines in this version (the "else" case on lines 34-40) would hamper the performance somewhat, since it would eat up twice as much L1 cache bandwidth. I'd suggest dealing with the masks using bitwise operations in a loop, and letting i stay divisible by 16. Or just use CLMUL :)

Is the performance difference of PEXT vs. the classic 64-bit magic bitboards actually close to 50%? The very slight latency increase of and/multiply/shift instead of pext should be somewhat offset by somewhat smaller tables (since magic hashing can have helpful collisions), right?

I should probably know this, since I "discovered" PEXT bitboards, but I got out of computer chess before I got BMI-capable hardware, and so I never actually implemented them :)

If exceptions are being logged with any level of detail, and an attacker has the ability to provoke exceptions while varying error message content, then the thing that seems safe was just made quite unsafe.

Right, I would certainly include that in "user data" though. I was mainly responding to the idea that using two logging libraries is strictly worse than one: when log4j is only used for logging safe data, and another library elsewhere, this is better than using log4j everywhere.

zelda64.com was also the official website when Ocarina of Time came out, presumably because, at the time, the zelda.com domain was already taken by a porn site. That was an interesting discovery for 10-year-old me.

Or even without using any such new technology, it could at least take advantage of the fact that almost all human communication is mediated by computers, and coerce virtually the entire human race into helping it. I think the GP wasn't being nearly creative enough when thinking about the possibilities/dangers of AGI.

I enjoyed DK64 as a kid, but after replaying it recently, IMO it doesn't hold up too well. The collecting isn't bad (though the character switching makes it much worse). My main issue is the core gameplay/controls. Moving around feels unresponsive and sluggish, the action animations are really long, and hitboxes can be unintuitive. Banjo-Kazooie is better, but still not very snappy control-wise.

Super Mario 64, OTOH, holds up remarkably well: the controls flow so much faster and easier. It just feels natural to move around, with much less frustration. The camera is the biggest negative there, but that's a tough problem to solve for 3D open-world platformers, so I cut them some slack.

I really don't think being accessible to non-programmers is the cause of my issues. If anything, I'd say that targeting non-programmers might exacerbate these issues, because those users would be less likely to realize how unintuitive some aspects of Max are, thinking it's because programming in general is difficult.

I didn't touch too much on the specifics in my post, but there are lots of little design oddities I ran into when doing relatively simple tasks. Like creating a multiplexer for messages: the [switch] object has an "empty" channel for input 0 (and regular inputs are 1-indexed), so you'll often need an extra +1 object for the control input. And the inputs of [switch] have no memory, so every time the control changes, you need to send a bang to resend the message in the now-active channel. Or say you want to multiplex signals. That uses the [selector~] object (why not [switch~]?), and has the same +1 issue as [switch]. But what if you want a short crossfade when switching inputs to avoid harsh transients? "Good luck" is all I'll say here.

I'm not generally trying to do anything super-complicated with Max. I have indeed used the C extension API when it makes sense (building a wavetable synth), and it was OK. I still contend that the main visual programming environment is not very good, for programmers and non-programmers alike.

...anyways, all that said, Scheme For Max looks really cool :)