HN user

EmberTwin

14 karma
Posts0
Comments3
View on HN
No posts found.

The SWAR (SIMD-within-a-register) numbers are strictly better than the SIMD versions as well as the standard library baseline. Why is that? SIMD should be strictly faster if the machine supports it, since the SWAR max bitwidth is 64, while SIMD starts at 128 bits.

The Java SIMD API used here must not result in using actual SIMD machine code.

ChatGPT is not de-obfuscating this code. For one thing:

basic cellular automaton algorithm

is completely wrong. A cellular automaton is a standard approach to level-generation in a roguelike, but this code implements a different approach, the rooms-and-corridors one.

Another issue here is that ChatGPT is using a few key context clues to make its (incorrect but plausible) guess. Robert Nystrom, aka munificient, is well-known in the roguelikedev community for his game programming tutorials. I confirmed that ChatGPT knows who he is by asking "Who is @munificentbob and what is he known for?" The name of the function, "cave", that carves rooms makes it clear that this is some kind of level-generation algorithm - in fact, that's probably where the incorrect guess about cellular automata came from, because those algorithms are often used for "caves" (versus "dungeons" made with rooms-and-corridors). The characters printed are also roguelike standards.

If I remove @munificient's name and rename "cave" to "X", ChatGPT's output is worse. It says: "This code is a compact implementation of a simple game where characters move around a grid.", which is...vaguely in the ballpark.

HHVM is not a drop-in replacement for a PHP interpreter. The semantics of Hack and PHP have diverged, typically in the direction of eliminating dynamic behavior from Hack that existed in PHP (examples: string -> function coercion, the PHP dual vector-hash-table array type, and non-throwing out-of-bounds array accesses are all gone from Hack). The semantics changes both simplify static analysis and make it easier to JIT fast code.