HackerTrans
TopNewTrendsCommentsPastAskShowJobs

mumblingdrunk

no profile record

comments

mumblingdrunk
·vor 2 Jahren·discuss
All CPUs commit in order and except precisely, because most other options are insane, or would drive you to it. However: single thread commit order =/= observability order.

Observability order of memory operations --- which are the only operations that matter --- are governed by the memory consistency model of the architecture. x86 has what's generally referred to as strong ordering on memory operations.

On x86, part of it means that stores from the same core cannot be observed out of order from each other, nor can loads.

So assuming the compiler does not move the `tail++` up, or move the assignment out of the if-statement (both of which are achieved by marking them `volatile`), the code should actually work on x86. The `tail++` change cannot be observed before the write to the queue and the reading from the queue cannot be observed before the reading of the `tail` and `head` variables.

On RISC-V and Arm, you need more as they have substantially weaker memory consistency. The RISC-V specs have some examples of interesting outcomes you can have. Some of it involves time-travel.

But in the end: yes the reordering done by the CPU is the issue. The compiler can and does reorder stuff when it thinks that it'll unlock more instruction-level parallelism, but no amount of volatile is going to make that queue universally usable on RISC-V. No matter what the compiler does. Even perfectly preserving the single-thread semantics of the code, not reordering a single instruction, the CPU can move stuff around in terms of observability. The alternative is that the compiler inserts a barrier/fence after every instruction.

There are trade-offs. Poorly written code for x86 can absolutely tank performance because of ordering violations requiring code to be replayed, though that is sometimes a problem in even weaker consistency models as well.
mumblingdrunk
·vor 3 Jahren·discuss
This is why I switched to Helix. The configuration is practically non-existent, and it has default configs for all the language servers I could ever want to interact with. I just put the language server binary in my path and I'm ready to go with autocomplete and all the other features.
mumblingdrunk
·vor 3 Jahren·discuss
I never got the impression that the developers had an attitude. The discussion I've seen has been mostly people making demands or saying Helix will fail if it doesn't support AI tool integration right now, but none of the devs are interested in using that kind of tooling with Helix, so they don't implement it. When they have poked fun at someone, it has been because that someone is very quick to demand the feature, but unwilling to submit a PR.

There is an open PR for getting copilot support, though it's currently just a hotfix and likely won't be accepted into core. You can still patch your own version and compile it.
mumblingdrunk
·vor 3 Jahren·discuss
> Many are allergic to basic scripting, don't bother to learn how their tools work, and have an elitist attitude towards other design responsibilities (ex. layout, verification).

In my very limited experience, most people don't learn new stuff until they're forced to; either by their employer, by their university, or by needing to learn it for something they want to accomplish. This is why you'll have self-taught developers go for years using strings as enums, linear-searching in huge sorted arrays, because it works and why would you seek out something else? I think the solution is to introduce more software development in EE education; forcibly expose them to it. My EE bachelor's degree contained a whopping ONE class that was focused entirely on Python programming. The rest just used cobbled-together C code for microcontrollers, or arcane languages with dumb IDEs for PLCs.

I'll take your hint on Vivado, thanks!
mumblingdrunk
·vor 3 Jahren·discuss
This is just true for a whole lot of the industry tooling. Xilinx Vivado is a bloated piece of crap that'll crash all the time unless you have half a terabyte of RAM. Same goes for lots of other EE-tooling in general. The L and B in MATLAB stand for Legacy and Bloat. People still write programs for PLCs in Ladder, where programs still cannot be portable between vendors, or even different products from the same vendor.

All the companies that produce anything invent their own language for the thing and write their own compiler for it. These compilers are clearly not written by compiler experts.

I don't blame EEs for building bad software. They weren't trained to do it and aren't paid to do it. I blame the "if it works, it works" culture that the industry seems to have. Never go back to refine anything, just keep pushing more plugins, more software; create a patchwork of programs until you get the job done.
mumblingdrunk
·vor 3 Jahren·discuss
This reminds me of an article I read a while ago https://alastairreid.github.io/mrs-at-scale/

MRSs would enable much more of the formal verification parts to be generated.
mumblingdrunk
·vor 3 Jahren·discuss
I can also highly recommend a visit to The National Museum of Computing.

https://www.tnmoc.org/

While you're there, take a stroll around Bletchley Park as well. Last time I checked, you get a discount when visiting both, and they're right next to each other.