HNHacker News
TopNewBestAskShowJobs

mabster

280 karma · joined October 25, 2021

submissionscomments
mabster··on Don't build a spaced repetition startup
For my day job I'm either "Getting things done" or Zettelkasten anyway because it's more about retrieval than memory.

But for languages, SRS is great.

And I'm also glad I memorised a whole bunch of math formulas way back. E.g. Boolean algebra I keep using an identity that I couldn't find on identity sheets by web search.

mabster··on Don't build a spaced repetition startup
Totally expected the "desirable difficulties". For SRS to work effectively it has to "be yours" and that only works effectively if you're building your own cards.

With Duolingo it kind of encourage small bursts rather than the hour (minimum) per day you need with Anki for better or worse.

mabster··on Learning the soroban as an adult (2022)
Nice write up!

I've got a soroban but never got around to learning it. Definitely should pick that up again.

When I was at Uni (electrical engineering) I noticed that the Chinese students would reach for their calculator way less than western students and assumed that was because of the abacus.

Side note: they tried to shape a control theory subject (everyone was getting 100%) by disallowing calculators in tests. It was rough having to do things like long division for the first time in decades. Still everyone got 100% haha.

mabster··on Shipping textures as PNGs is suboptimal
We used to learn all this stuff by word of mouth back in the day, and it's been interesting watching young developers "rediscover" these things on YouTube, etc. Its great because now these techniques are part of public discourse rather than known only by a few.
mabster··on Cognitive load is what matters
I particularly don't like ternaries with side-effects or control flow. In particular with control flow I prefer it always tabbed in otherwise sometimes I miss it -- if statements are much better for this.
mabster··on Uncertain<T>
Yeah understood. In electronics: Resistor values are Gaussian but they test and bucket the resistors so that they can be treated as tolerances for similar reasons.
mabster··on Uncertain<T>
Yeah it's probably field specific and I guess Gaussian-based uncertainty would be more about statistical sampling rather than tolerances. I've noticed that if arithmetic is being done on it it's almost certainly Gaussian. I just mean whenever I see uncertainty like this, I don't know what is meant!
mabster··on Uncertain<T>
Something that's bugged me about this notation though is that sometimes it means "cannot exceed the bounds" and sometimes it means "only exceeds the bounds 10% of the time"
mabster··on Unexpected productivity boost of Rust
My favourite were older embedded systems where 0 was an address you actually do interact with. So for some portion of the code you WANT null pointer access. I can't remember the details but I do remember jumping to null to reset the system being pretty common.
mabster··on Tiny microbe challenges the definition of cellular life
"Alive / dead / iffy" still seems to hold up.
mabster··on Here be dragons: Preventing static damage, latchup, and metastability in the 386
Just a big thanks from someone lurking on your blog for a while now. Every article has been fascinating deep insights!
mabster··on The Amaranth hardware description language
It's been a while since I've done this stuff, but VHDL seemed like this to me: that generally if it compiles, it synthesises. I really battled with Verilog!
mabster··on Content-Aware Spaced Repetition
On the scheduling end, I'm surprised the article didn't mention https://github.com/fasiha/ebisu which uses Bayesian statistics.

When I was studying Japanese, I was thinking how it's always best to learn words in sentences and that it would be good if the sentences for a particular word were random.

Extending that, the sentences could be picked such that the other words are words scheduled for today meaning much more bang for buck per learning hour.

mabster··on Use Your Type System
I had kind of written off using types because of the complexity of physical units, so I will be having a look at that!

My biggest problem has been people not specifying their units. On our own code end I'm constantly getting people to suffix variables with the units. But there's still data from clients, standard library functions, etc. where the units aren't specified!

mabster··on No More Shading Languages: Compiling C++ to Vulkan Shaders [pdf]
Totally missed that, thanks! I don't know the library very well, but as far as I can tell they don't support .xyxy style sizzling with the SIMD Vec4 type.

They're using the same "proxy object" method I was doing for their sizzling which I'm pretty sure won't work with SIMD types but would love to be proven wrong!

I haven't deep dived into the library as I'm no longer doing this kind of code.

mabster··on No More Shading Languages: Compiling C++ to Vulkan Shaders [pdf]
Unfortunately GLM doesn't use SIMD instructions.

I really wanted something that's compatible with shaders and fast so we can quickly swap between CPU and GPU because it was time consuming to port the code.

I've been down this road before. If you aren't doing SIMD it's pretty easy to implement but relies on UB that works on all the compilers I tried (C++ properties would make this better and portable). I got something working with SIMD that unfortunately doesn't compile correctly on Clang!

mabster··on No More Shading Languages: Compiling C++ to Vulkan Shaders [pdf]
I haven't done a lot of shader programming, just modified stuff occasionally.

But one thing I miss in C++ compared to shaders is all the vector sizzling, like v.yxyx. I couldn't really see how they handle vectors but might have missed it.

mabster··on Machine Code Isn't Scary
As a low level performance guy I trust the compiler nowadays, especially with deep instruction pipelines. The compiler is beatable - a lot of the decisions are heuristic - but it takes a lot of work to beat it.
mabster··on Machine Code Isn't Scary
I started my career in assembly and it's reduced over time. Towards the end of the gamedev work I was still reading a lot of assembly but no longer writing it (using intrinsics instead). It was definitely a lot slower to write.

But there are a number of things we did that are not available or difficult in C:

- Guaranteed tail calls

- Returning multiple values without touching memory

- using the stack pointer as a general purpose pointer for writing to memory

- Changing the stack pointer to support co-routimes

- Using our own register / calling convention (e.g. setting aside a register to be available to all routines

- Unpicking the stack to reduce register setup for commonly used routines or fast longjmps

- VM "jump tables" without requiring an indirection to know where to jump to

mabster··on Typing 118 WPM broke my brain in the right ways
I wasn't getting RSI per se, more like my arms were fatigued after a day of development.

I did the pricey split keyboard thing. One advantage there is that my vertical mouse sits between the keyboard halves which means I don't have to "reach around" to grip it which has saved a whole bunch of muscle movement.

mabster··on Why old games never die, but new ones do
In Australia we used to have a few arcades dotted around the place but I haven't walked past one in a long time. But whenever I go to Japan I'm amazed at how vibrant their arcade scene is. It seems much more communal as well - go hang out at the arcade with your friends.
mabster··on Converting a Git repo from tabs to spaces (2016)
1. This problem is introduced by increasing the tab width, so this solution is basically "don't do that". 2. Line wrapping on something like C where you have braces is okay, but not with something like Python where the code now looks wrong.

I'm in the spaces camp, but I was musing about this for the tabs camp because wanting to adjust the indentation seems reasonable.

(My "favourite" convention was Luajit where the convention was: 2 spaces, until we got to 8 spaces, in which case tab.)

mabster··on Converting a Git repo from tabs to spaces (2016)
I would agree, except that only deals with the left hand side of the code. We are also making decisions on the right hand side of the code to deal with lime width as well which only really works if all developers have the same tab size.

Nowadays I just chuck format on save on all the code I deal with so I don't have to deal with any of this stuff anymore.

If we take this to its longer conclusion though, it would be pretty good if our tooling supporting a difference between the view (using your own preferences) and storage (consistent code for committing to git or whatever).

mabster··on Converting a Git repo from tabs to spaces (2016)
A big thank you! Blame history being correct is something i care quite a bit about and I always add one of these files when I do formatting changes. I think I'm probably the only developer on my teams with this configured on though haha!
mabster··on Migrating away from Rust
I'm not knocking indie development, the scene is very very vibrant. But indies don't typically push the hardware to its limits the same way.

And Java was a perfectly good choice of language for Notch for the same reasons.

I don't play Minecraft so I guess I'm outta touch. I knew about Bedrock and I've heard kids call Java the "old one". I didn't realise there's still an active community. Thanks for the correction :)

mabster··on Migrating away from Rust
We were using a modified Luajit, in assembly, with a bit of other assembly dotted around the place. That assembly takes a long time to write (to beat a modern C++ compiler).

Then we had C++ for all our low level code and Lua for gameplay.

We were floating a middle layer of Rust for Lua bindings and the glue code for our transformation pipeline, but there was always a little too much friction to introduce. What we were particularly interested in was memory allocation bugs (use after free and leaks) and speeding up development of the engine. So I could see it having a place.

mabster··on Migrating away from Rust
Minecraft was Indie then. And anyway, it's now in C++.
mabster··on Migrating away from Rust
I think the choice of C++ vs JVM depends on your project. If you're not using the benefits of "unsafe" languages then it probably doesn't matter.

But if you are after performance how do do the following in Java? - Build an AOS so that memory access is linear re cache. Prefetch. Use things like _mm_stream_ps() to tell the CPU the cache line you're writing to doesn't need to be fetched. Share a buffer of memory between processes by atomic incrementing a head pointer.

I'm pretty sure you could build an indie game without low-level C++, but there is a reason that commercial gamedev is typically C++.

mabster··on Migrating away from Rust
I'm in that camp. After shifting from commercial gamedev I've been itching to build something. I kept thinking "I wanna build a game" but couldn't really think what that came is. Then realised "Actually it's because I want to build an engine" haha
mabster··on How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
Thanks for the references - that was interesting reading, particularly that initialisation can be good for instruction pipelining.

A trick we were using with SSE was something like

__m128 zero = _mm_undefined_ps(); zero = _mm_xor_ps(zero, zero);

Now we were really careful with viewing our ops as data dependencies to reason about pipelining efficiency. But our profiling tools were not measuring this.

We did avoid _mm_set_ps(0.0f) which was actually showing up as cache misses.

I wonder if we were actually slower because cache misses are something we can measure?!

← PreviousPage 2 of 5Next →