C
Corsix
corsix.org · Personal blog · on HN since 2009
Corsix writes low-level posts on CPU instructions, SIMD, CRC performance, LuaJIT and processor architecture.
What HN saysHN links his posts on Galois field instructions, fast CRC32-C, ARM instructions and malicious LuaJIT bytecode as useful technical references.
35HN people shared it
12linked it in comments
49stories submitted
1.1Kstory points
6 months agolast shared
2009people per year2026
Most-shared posts
- 1Malicious LuaJIT bytecode6 people · 9 points · first shared 2015 · 2 comments on HN
- 2RISC-V Conditional Moves4 people · 88 points · first shared 2025 · 71 comments on HN
- 3Corsix – A whirlwind tour of AArch64 vector instructions4 people · 3 points · first shared 2023 · discussion on HN
- 4Galois field instructions on 2021 CPUs3 people · 164 points · first shared 2022 · 41 comments on HN
- 5What even is a pidfd anyway?3 people · 15 points · first shared 2024 · 3 comments on HN
- 6Higher Quality Random Floats3 people · 4 points · first shared 2023 · discussion on HN
- 7Faster CRC32-C on x862 people · 107 points · first shared 2022 · 21 comments on HN
- 8Contrasting Intel AMX and Apple AMX2 people · 65 points · first shared 2022 · 19 comments on HN
- 9__VA_OPT__ Minutiae2 people · 63 points · first shared 2024 · 6 comments on HN
- 10Tenstorrent Wormhole Series2 people · 10 points · first shared 2024 · discussion on HN
- 11Thoughts on No Graphics API2 people · 5 points · first shared 2026 · discussion on HN
- 12For Want of a Relative Path2 people · 2 points · first shared 2024 · discussion on HN
- 13Look lua 52 work32 people · first shared 2011
- 14My favourite small hash table1 people · 159 points · first shared 2025 · 36 comments on HN
- 15Linux/ELF .eh_frame from the bottom up1 people · 105 points · first shared 2024 · 11 comments on HN
What HN people wrote when they linked it
corsix · 2022-11-06
Alternatively, the following pair of articles, the first of which is already referenced as a footnote in the OP:
http://www.corsix.org/content/galois-field-instructions-2021-cpus
http://www.corsix.org/content/reed-solomon-for-software-raid
i336_ · 2015-12-04
A sidenote on JIT: I wrote the following while working out the structure of my post; I figured it wouldn't hurt too much to post it too. The bulk of my question is above; what follows is more or less incidental.
I understand that JIT has something of a role in performance, and that modern Javascript engines couple the performance gains of JIT execution with a mind-boggling slew of different security and sandboxing techniques that aim to prevent unwanted data colliding with the CPU's instruction pointer while still allowing near-C levels of performance. Thing is, what generally makes browsers' sometimes unbelievable JIT-powered performance[1] possible is the fact that the major JS engines - V8, JavaScriptCore, Chakra, Spidermonkey - have huge companies behind them that have the resources to fund continuous R&D to iterate on performance while keeping abreast of security issues.
[1]: http://www.gopherjs.org/blog/2015/09/28/surprises-in-gopherjs-performa…
But I'm not a browser manufacturer, or a computer science major (or even undergrad). I'm just a tinkerer who wants to play around with ideas that generally need safe remote code execution in a way that is transparent (to the extent a high-level competent end user could introspect all operations and control low-level settings) and trustable (for both the end user, who wants control of their device, and the developer, who wants a predictable environment).
I understand that JIT is generally incredibly hard to get right -…
loeg · 2025-12-09
He’s done some interesting work with crc32 ~recently:
https://www.corsix.org/content/fast-crc32c-4k
https://github.com/corsix/fast-crc32/
astrange · 2025-10-02
ARMv8.7 added some new instructions for int min/max to replace cmp+csel. (I'm surprised it took them so long to add popcnt.)
https://www.corsix.org/content/arm-cssc
myrmidon · 2025-01-31
Note that loading (maliciously crafted) bytecode is generally not safe in Lua; sandboxing can be escaped in more ways than what's possible when loading plaintext sourcecode, and there are no full mitigations for this currently as far as I know (and would probably be highly interpreter/version sensitive anyway)-- the only "real" mitigation strategy is to just not `load` bytecode at all.
But this is probably a non-issue for a lot of usecases.
See e.g.
https://gist.github.com/corsix/6575486
https://www.corsix.org/content/malicious-luajit-bytecode
anonymoushn · 2024-07-26
If you learn AVX2 programming via highload, my impression is that NEON is quite similar. The main difference is the lack of movemask. You can read these[0] articles[1] about what to do instead.
For SVE, prior to very recent versions of SVE, there was no tblq (pshufb equivalent) so I didn't have much hope for using it for general-purpose programming, though of course it would be fine for stuff like TFA.
[0]: https://community.arm.com/arm-community-blogs/b/infrastructure-solutio…
[1]: https://www.corsix.org/content/whirlwind-tour-aarch64-vector-instructi…
exikyut · 2020-06-24
A small history of LuaJIT sandbox escapes:
- 5.2, 2016: https://apocrypha.numin.it/talks/lua_bytecode_exploitation.pdf (9MB PDF)
- 5.2, 2016: https://github.com/erezto/lua-sandbox-escape
- 5.1, 2015: https://www.corsix.org/content/malicious-luajit-bytecode (warning: dense)
There's a "luarop" link (boop.i0i0.me/blog.lua/luarop) referenced in the PDF, but the link sadly seems to have died (IA never crawled the domain).
spc476 · 2017-08-18
There's a problem---you can break out of Lua with malformed bytecode [1] and the Lua team don't want to spend the time trying to validate Lua byte code [2]. That's why the latest Lua version has an option to ignore precompiled Lua scripts.
And sadly, I can see the same happening here.
[1] https://www.corsix.org/content/malicious-luajit-bytecode
[2] The overhead will eat any performance gained by using precompiled Lua code in the first place.
jepler · 2016-09-18
https://www.corsix.org/content/dll-injection-and-wow64 ... "The solution I've settled on is to create a 3rd process, which I call the proxy process. The proxy process is an x64 process which is connected to the x86 process via stdin/stdout pipes, and whose job is to call CreateRemoteThread."
bsg75 · 2013-03-10
http://www.corsix.org/content/look-lua-52-work3 (#19)
http://lua.2524044.n2.nabble.com/petition-to-keep-ipairs-alive-td50758…
Edit: both are from 2010. This never became final perhaps?
rlbaker · 2011-12-17
Any links to info on 5.1.4 -> 5.2 changes? I can't seem to find any.
EDIT: Found some information! http://www.corsix.org/content/look-lua-52-work3
zaphar · 2009-09-25
seriously?
You have to know perl's control flow ("unless"
unless is that difficult to understand? Its plain english has totally understandable semantics without reading a lick of documentation about perl.
you have to know perl references(->)
This is just like C++ and an arrow is pretty dang readable and plain to me. Perhaps even more informative than a period.
you have to know perl's variable prefixes.
I might be convinced to give you this one but really reading the perl code isn't that difficult even with 3 extra symbols to know. Even not knowing the symbols the code example you show is both readable and concise.
Yes perl may have some quirks but for the most part it "Does exactly what you think it would by reading it". That was a design goal of the language after all.
Of course anyone could write perl code that is incomprehensible and makes use of perls semantics to obfuscate their purpose (using every example you cite) but that is with effort on their part and significant effort in some cases. And just to drive the point home may I present lua code that is way harder to read than any perl code I've ever seen even in an obfuscated perl contest: http://www.corsix.org/content/obfuscated-lua
To reiterate, no one in their right mind would right lua code like that except as an exercize and experiment. Same thing goes for perl. The perl code you show above is perfectly readable. Unless does exactly what you expect it to. -> arrows mean exactly what you would…