@pervognsen@mastodon.social avatar

pervognsen

@[email protected]

I like programming and understanding how stuff works. My background is in systems programming and game development.

This profile is from a federated server and may be incomplete. View on remote instance

@regehr@mastodon.social avatar regehr , to random

brb, shorting "cheesecake factory inc"

ALT
pervognsen ,
@pervognsen@mastodon.social avatar

@regehr Don't tell them that "takeout maybe once a week" is still bachelor behavior. :)

@equinox@chaos.social avatar equinox , to random

aw man, I broke rr [ https://rr-project.org/ ]…

[FATAL ./src/record_syscall.cc:6733:rec_process_syscall_arch()]
(task 1534979 (rec:1534979) at time 449)
-> Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold. Expected EINVAL for 'madvise' but got result 0 (errno SUCCESS); unknown madvise(102)

pervognsen ,
@pervognsen@mastodon.social avatar

@equinox Already complained about this here a while ago. :) I never found a solution that made me happy but if you have debug symbols you can set allocate_stack_mode in glibc before creating new threads, IIRC. Hopefully it gets added to the syscall handling in rr at some point.

@pervognsen@mastodon.social avatar pervognsen , to random

I think I already retooted @wingo 's https://wingolog.org/archives/2026/02/09/six-thoughts-on-generating-c but one thing I wanted to add is that dealing with warnings in the generated C code is really annoying and often forces you do a lot of additional work on the emitter side if you want to be warning-free. Not an issue if you control the CFLAGS but for some use cases you'd like it to be easy to drop generated code into existing code base builds without having to mess with per-file CFLAGS. Probably worth using pragma warning disables.

pervognsen OP , (edited )
@pervognsen@mastodon.social avatar

Not talking about "real" warnings like implicit narrowing casts which are easy to avoid on the emitter side (Andy already mentions this) but unused variables and other things that might require your emitter to do liveness analysis and dead code elimination. You're presumably generating C code partly so you don't have to deal with that in the first place.

@pervognsen@mastodon.social avatar pervognsen , to random

Towards Understanding the Costs of Avoiding
Out-of-Thin-Air Results, https://dl.acm.org/doi/10.1145/3276506

@azonenberg@ioc.exchange avatar azonenberg , to random

Anybody know of code autoformatters/linters that respect intentionally added whitespace (e.g. having a big table of values with each column aligned even if this means multiple whitespace characters, or indenting code inside a begin/end function pair even if it's not a new scope, etc)?

pervognsen ,
@pervognsen@mastodon.social avatar

@azonenberg I've never seen a tool that does that well (and trying to be too DWIM would probably be a disaster). I prefer to just locally disable formatting for cases like that, which good formatters support via directives in comments or attributes.

pervognsen ,
@pervognsen@mastodon.social avatar

@azonenberg I personally don't mind writing #[rustfmt::skip] in Rust or # fmt: off in Python in the few cases where I have strong opinions about legibility that run counter to the general rules.

@zeux@mastodon.gamedev.place avatar zeux , (edited ) to random

It's funny to see some folks advocate ECS but if you ask them what they think of GoF design patterns they'd bring out the pitchforks.

pervognsen ,
@pervognsen@mastodon.social avatar

@zeux The way that kind of ideological taint works in a supposedly objective technical context is very interesting. I've seen people have an involuntary reaction of disgust to any language with postfix call syntax (even if it's in a language like D with uniform function call syntax) because it brings all the ideological taint of object-oriented programming.

pervognsen ,
@pervognsen@mastodon.social avatar

@zeux That said, I don't think there is a lot to be redeemed from the GoF book and it's also pretty clear that architectural patterns like MVC are in a very different category from random ways of dealing with the limitations of Java-like languages. I think the real negative taint is from how people abused it in practice, which I guess is happening to a lesser extent with ECS.

@pervognsen@mastodon.social avatar pervognsen , to random

The Midlayer Mistake: https://lwn.net/Articles/336262/

@molecularmusing@mastodon.gamedev.place avatar molecularmusing , to random

I've been working on something new since August 2025 and have decided to finally spill the beans:
Introducing "Project Echo", a deterministic Record & Replay tool for PS5:
https://www.youtube.com/watch?v=K_sdN5-N4iA

Please read the video description and let me know your brutally honest feedback!

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes You capture the per-thread atomic load/store ordering without serializing the threads? I posted recently here about the two different approaches to doing this (rr-style thread serialization, TTD-style multi-threaded recording) so I'm now curious what you're doing for that.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes Ah. So you're doing that by wrapping the C-level PS5 APIs for atomic operations?

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes The reason I ask is that it seems like if all you have to go on is the raw x86 instruction stream for binary instrumentation then you can't really tell the difference between atomic and non-atomic loads/stores so it seems like you'd need to do it closer to the source level to capture that distinction and avoid recording too much.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes It sounds super cool what you're doing--not trying to poke holes at all, just trying to understand where you are on the trade-off curve since it's something I've been thinking about a lot recently.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes Okay, then that's the part I didn't understand--on x86 there's no instruction-level distinction between relaxed/acquire/release atomic loads/stores vs non-atomic loads/stores. You're only going to see mfence or lfence or similar when the user is requesting stronger ordering.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes Yup, I absolutely think you can find a potentially compelling point on the trade-off curve. My only worry from a product design perspective would be signaling the potential issues clearly since having to develop a paranoid distrust of your tools when debugging leads to a lot of frustration, but since you wouldn't have any competition (that I know of) in the console space, it seems like a good opportunity.

pervognsen , (edited )
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes One thing I did in my sandbox ISA is to explicitly tag atomic loads/stores at the instruction level so you could have both full determinism mode (synchronization for all loads/stores) and partial determinism mode (synchronization only for atomic operations) and it was partly to help with the semantic gap here so you could preserve some of that user intent from source level to instruction level.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes Absolutely on the first part, LLVM and gcc and all sane compiler IRs already represent atomic loads and stores as distinct instructions at the IR level even if the distinction sometimes gets lowered away at the target ISA level. Same with Wasm's atomic loads/stores, which is similar to what I'm doing: https://webassembly.github.io/threads/core/syntax/instructions.html#atomic-memory-instructions

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @jon_valdes By the way, I'm guessing you already know this, but one way you can detect nondeterminism is by validating events against the recorded trace log on replay, rather than just using it to supply external input on replay. As soon as there's a divergence from expected outputs during replay, it's a sign of nondeterminism (and hence later recorded inputs are desynced and meaningless). So, record external outputs, not just inputs, and validate it on replay.

@pervognsen@mastodon.social avatar pervognsen , to random

The other day I installed Windows 2000 SP4 on kvm/qemu after seeing @nothings 's stream and wanting to play around again with VC6 and Delphi 3. A few thoughts:

  1. With virt-manager, it's extremely easy to create, configure and manage desktop VMs. For some reason I had been under the impression that VirtualBox or VMWare was still the more ergonomic choice but that was not the case.
pervognsen OP ,
@pervognsen@mastodon.social avatar
  1. The Windows 2000 SP4 installer got randomly got stuck during installation. It turns out this is a known race condition in an IDE driver in the Windows 2000 installer. There's a hack flag you can set in your VM config (and disable after installation) which works around this, I think by adding artificial delays. See win2k-hack here: https://www.qemu.org/docs/master/system/qemu-manpage.html
@omar@social.omar.website avatar omar , to random

Is there something better/simpler than ZeroMQ for "I want a 'socket' that can deliver a multipart message atomically"

(that is, the parts all get delivered or none do, the parts can be arbitrary byte arrays, it communicates the part boundaries/lengths, and I can disconnect & reconnect client to reach a 'fresh' server state if things go wrong)

pervognsen ,
@pervognsen@mastodon.social avatar

@omar If you just need message framing, it's a few lines of code to add on top of TCP sockets yourself. Do you need the pub/sub stuff in zmq?

pervognsen ,
@pervognsen@mastodon.social avatar

@omar (The one and only time I used zmq, admittedly ages ago, it also fired asserts in data-dependent ways rather than signaling errors properly. That information is probably out of date but it made me never consider it again.)

@pervognsen@mastodon.social avatar pervognsen , to random

Remember when "top posting" was the ultimate online faux pax? I was just thinking that pretty much all the ways of interacting on social media nowadays are the equivalent of top posting.

pervognsen OP ,
@pervognsen@mastodon.social avatar

@floralia Surprisingly hard to find an explanation I can link to but here's one: https://www.mediawiki.org/wiki/Mailing_list_etiquette. I'm specifically referring to the problem of not replying to specific points in specific quoted excerpts. The only reason it's not an even worse problem now is that so much content is bite sized.

pervognsen OP ,
@pervognsen@mastodon.social avatar

@floralia LOL, that's definitely one of the worst examples I've seen.

@wolfpld@mastodon.gamedev.place avatar wolfpld , to random

Ah, the future.

pervognsen ,
@pervognsen@mastodon.social avatar

@wolfpld The paradox of tolerance but for coding agents: if you use coding agents, should you use coding agents written by coding agents?

@jdryg@mastodon.gamedev.place avatar jdryg , to random

I start to think that adding a 2nd (middle-level) IR to the compiler was a mistake.

The initial thought was to experiment with scheduling while still in SSA/slightly high-level IR. At the moment the scheduler I wrote is disabled because it's buggy after the latest changes to the high-level IR.

Now that I want to implement SSE intrinsics, this IR seems like a burden. I have to decide whether to lower intrinsics at this level, which means I have to introduce new instructions or...

pervognsen ,
@pervognsen@mastodon.social avatar

@jdryg Can't you use effect annotations on intrinsics to make them supported by the scheduler, similar to how inline asm constraints/clobbers work?

@dotstdy@mastodon.social avatar dotstdy , to random

I wonder how much of the bad reputation that "linux" debugging has, should really be attributed to using clang instead of using msvc. Like obviously the UI options are worse, but then I think people immediately after that people run into <value optimized out> and enter the pit of despair.

pervognsen ,
@pervognsen@mastodon.social avatar

@dotstdy When MS started more aggressively adopting Rust there was some insider rumors that they were working on their own rustc backend alternative to LLVM (I guess reusing the existing MSVC backend) because of the debuginfo issues. So, that's a large part of it--the MSVC debugger works fine with Rust on Windows aside from LLVM's very bad debuginfo preservation.

pervognsen ,
@pervognsen@mastodon.social avatar

@dotstdy They should just ditch that backend and spend those resources on fixing LLVM. Like, I can't imagine they have much of a real compiler team anymore.

pervognsen ,
@pervognsen@mastodon.social avatar

@dotstdy Yeah, I'm sure Live++ must help a lot.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @dotstdy FWIW, Sony already presented publicly at LLVM Dev Mtg years ago about their early efforts at improving clang/LLVM debuginfo. Not sure how much of it has gotten upstreamed, though.

pervognsen ,
@pervognsen@mastodon.social avatar

@molecularmusing @dotstdy Clang targeting ELF/DWARF is equally bad in my experience. The main issue here isn't with the lowering of LLVM debuginfo to DWARF vs PDB (if there's a difference, it hasn't been apparent to me as a user) but that a lot of optimization passes don't preserve/transform the middle-end LLVM IR debuginfo to reflect the transformed IR code.

pervognsen ,
@pervognsen@mastodon.social avatar

@pinskia @molecularmusing @dotstdy I wonder if it would be useful if a third party could write a test suite with something like automated gdb-based tests to help drive quality improvements across compilers. My sense from using both clang and gcc is that gcc does a much better job currently with optimized code when it comes to preserving debuginfo but it's still really far off from something like MSVC. But it's not a 100% fair comparison since MSVC is also far behind as an optimizing compiler.

pervognsen ,
@pervognsen@mastodon.social avatar

@pinskia @molecularmusing @dotstdy Or maybe lldb instead of gdb since it has proper PDB/CV support. But a third-party effort like that driven by community contributions seems like it could help drive some productive competition and would help the compiler developers to have specific issues to fix (even if they ultimately add compiler-specific regression tests rather than only relying on the end-to-end gdb/lldb tests).

@pervognsen@mastodon.social avatar pervognsen , to random

Tetris in a font with programmable text shaping: https://www.youtube.com/watch?v=Ms1Drb9Vw9M&t=1380s.

@pervognsen@mastodon.social avatar pervognsen , to random

Truly baffled by people who do technical presentations with VS Code or whatever and their actual code window is the size of a porthole on a ship while all the irrelevant side bars are taking up 80% of the real estate.

pervognsen OP ,
@pervognsen@mastodon.social avatar

@jkaniarz It's almost like 1960s editors that would print one line at a time and only when asking for it with a command. :)

@pervognsen@mastodon.social avatar pervognsen , to random

I was reminded of this by a thread on Lobsters: not counting Structure and Interpretation of Computer Programs as a book on Lisp/Scheme per se, easily my favorite book on Lisp proper is Lisp in Small Pieces by Christian Queinnec. I'm not sure why I don't hear it mentioned more often.

pervognsen OP ,
@pervognsen@mastodon.social avatar

I held onto my prized copy for years but finally had to get rid of it when I got rid of all my other physical books. It's a truly unique book in its technical content and the quirks of the translation from the French original just amplify the charm.

pervognsen OP ,
@pervognsen@mastodon.social avatar

Quirks like "pretreater". You can tell the translation is by a highly competent professional translator who just doesn't know the idiomatic English equivalents of a lot of highly domain-specific technical terms. "Sites of call" and so on.

pervognsen OP ,
@pervognsen@mastodon.social avatar

Or for that matter "diluting" for what should probably be "lowering".

@rygorous@mastodon.gamedev.place avatar rygorous , to random

[x] Go up in flames and take the entire product team who worked on this with you

ALT
pervognsen ,
@pervognsen@mastodon.social avatar

@rygorous You don't want an AI-assigned fursona?

@pervognsen@mastodon.social avatar pervognsen , to random

My Coke Zero consumption had crept up again so I've been trying to reduce it. One thing I've found helpful in the past for that kind of thing, in case others might find it helpful: I force myself to consume water and Coke Zero in a certain minimum ratio, e.g. I have to finish a 1L bottle of water before I can have a can of Coke Zero. I really love ice cold water but for some reason once I've built a habit of drinking mostly water it slips over time if I don't explicitly re-establish it.

@meowray@hachyderm.io avatar meowray , to random

Quality, Velocity, Open Contribution — pick two. If you try for all three, you get none — the maintainers burn out, the project becomes unsustainable.
Lua and SQLite picked quality, and dropped both velocity and open contribution.
When your project is mature enough, you can afford to.
For a project like LLVM, open contribution is not optional — so you're really choosing between quality and velocity.
LLM-aided development dramatically increases contribution volume without increasing reviewer capacity.
LLM-aided review may help at the margins — catching mechanical issues, summarizing patches — but the core bottleneck is human judgment.

pervognsen ,
@pervognsen@mastodon.social avatar
@zwarich@hachyderm.io avatar zwarich , to random

@joe I started writing some code in the "flow-sensitive explicit tag" style of struct/variant types, and the main feature I was missing was the ability to force downstream consumers to consider new fields. Obviously, you could still have both explicit tags and pattern matching that desugars into them, but it hurts the case a bit.

The other thing I noticed with the explicit tag approach is a bit more syntactic: you are forced to define an enum for the tag and then define the variant type and repeat all of the tag members again. You could probably just add some syntax to generate the tag type from the list of variants in the struct.

pervognsen ,
@pervognsen@mastodon.social avatar

@joe @zwarich I think it's cool the Hylo/MVS folks are doggedly pursuing a different approach but it will be pretty sad if they end up re-capitulating the complexity of Rust in a different model to ultimately support the same kinds of features. Unless you're fundamentally okay with chewing off a different, smaller problem space, I'm skeptical of the "you're not going to need it 99.99% of the time" arguments I keep seeing from them (including in the linked thread), based on my Rust experience.

pervognsen ,
@pervognsen@mastodon.social avatar

@joe @zwarich We already know how to do a lot of the simpler things in different models. Even C# has ref structs now, so if you can't do something that basic, you're getting lapped by 2020s Microsoft.

pervognsen ,
@pervognsen@mastodon.social avatar

@zwarich @joe Yeah, I was going to say the same thing you're mentioning there at the end. Once the next gen model that Niko and co have been conceptualizing ends up landing, you're going to see a major leap in both capabilities and ergonomics. Also, I haven't looked at Mojo recently, but their borrow checking approach, last I checked, was a lot closer to that (origin sets, etc).