Better HN
topnewbestaskshowjobs
Log inSign up

sapiogram

922 karma · joined Aug 18, 2014 (12y ago) · 345 submissions

Submissions

151.

Valve developers announce "Frog Protocols" to try speed up Wayland development(gamingonlinux.com ↗)

5 points · by sapiogram · 2y ago · discuss

comment 2y ago · link · parent

Ah okay, not the same symptoms as we had, then.

comment 2y ago · link · parent

I'm extremely curious, what kinds of problems? We had entire Kubernetes nodes becoming unresponsive, and I think io_uring in Node 18.18.0 was responsible, but they had lots of stuff running on them so I was never able to pinpoint the exact cause.

comment 2y ago · link · parent

Why? They're going to be making this for years, and the issue must surely affect sales.

comment 2y ago · link · parent

> I wish I could see the perf chart of these.

For thread creation, the author of the original post said "somewhere between 10 and 20 microseconds". This matches my own (very simple) benchmarks on my Ubuntu desktop, which was able to create and destroy just over 100k threads/second.

Depending on your use case, using a thread pool could mitigate this cost entirely.

comment 2y ago · link · parent

Although there's always luck involved, it was discovered by the Catalina Sky Survey, a survey specifically designed to spot near-earth objects.

Their main telescope has a very large field of view (20 square degrees), and takes only 30 seconds per exposure, giving it many chances to get "lucky".

comment 2y ago · link · parent

> Wonder if any of the RISC-V cpus are fast enough as a daily driver running Linux?

Short answer: Absolutely not, and you pretty much summarized it in your comment. RISC-V cpus are still at the performance level of Raspberry Pi 4, a $50 computer from five years ago.

comment 2y ago · link · parent

Does anyone know why they're building a high-capacity cable to Singapore instead of Sidney? Sounds politically much easier to use the power domestically.

comment 2y ago · link · parent

> I don’t think you mean that. By undefined, I was referring to C-style undefined behaviour stemming from reading uninitialised memory

You're right, I was referring to Javascript-style `undefined`, where it's basically a 2nd `null` value.

> The easiest way to represent this in Go is to use pointers to the type, which have the zero-value of nil.

This certainly works, but it has some serious drawbacks imo:

* Performance overhead

* The integer field is no longer copied along with the struct. The resulting aliasing shenanigans can easily trip up experienced developers, because "why would anyone store an `*int` in a struct instead of a plain `int`?"

* Other silly mistakes that no linters catch, such as comparing the pointers when you meant to compare the raw values.

comment 2y ago · link · parent

I've worked in Go for two years, and I hate zero values with a passion. I would much prefer undefined/nil/whatever as a default value. At least that obviously represents an invalid value, and will crash on use, become `null` in the database and when serialized to JSON. `0`, however, is indistinguishable from "missing data", and will just sit there and slowly poison your production data over time.

comment 2y ago · link · parent

You've clearly never opened Kubernetes' source code.

comment 2y ago · link · parent

> - A Go program runs single-threaded, unless you explicitly tell it not too, so I don't quite see that as a plus for Typescript.

I don't think this is a fair comparison. Almost all software needs some kind of concurrency, and multi-threading is the only way to do concurrency in Go. For example, the http server in Go's stdlib runs each request in its own goroutine, which I guess you technically asked for, but also can't be avoided.

comment 2y ago · link · parent

It's better in Swift or Rust. Go channels are the worst thing about the language, even trivial use cases are difficult to get right.

comment 2y ago · link · parent

I'd still be more inclined to blame a software issue. Do you have the exact same software installed on both?

comment 2y ago · link · parent

What you're suggesting is basically a worse version of adding built-in min() and max() to the C spec. Which, to be fair, would be quite nice, but I guess the working group didn't want it in the standard.

comment 2y ago · link · parent

How did that end up happening? Did you define addition recursively or something?

comment 2y ago · link · parent

Rust cross-compilation isn't great, but this seems a bit hyperbolic:

> On Rust you need to curl-sh rustup

Yes, but you do that once per computer, probably when you installed the compiler

> switch to nightly,

No

> add new targets,

Fair. But this is also one-time setup.

>add target to your cargo

Not sure what you're talking about here tbh

> and cross fingers it works this week.

Don't use the nightly compiler and you're good

comment 2y ago · link · parent

> Well, clearly there is a need for a special value that is not part of the set of legal values.

There's a neat trick available here: If you make zero an illegal value for the pointer itself, you can use zero as your "special value" for the std::optional wrapper, and the performance overhead goes away.

This is exactly what Rust does, and as a result, Option<&T>, Option<Box<T>>, etc are guaranteed to have zero overhead: https://doc.rust-lang.org/std/option/index.html#representati...

comment 2y ago · link · parent

No, the question is definitely applying a theoretical definition of C. The problem is that pointers are required to have a finite (but arbitrary) length, meaning addressable memory is also finite.

comment 2y ago · link · parent

Makes perfect sense to me, it just means the language was already a year behind when it launched.

comment 2y ago · link · parent

Disclaimer: I don't work in this field, just an enthusiast.

As far as I can tell, branch predictors have always been too good for it to be worth it. Moderns CPUs have instruction reorder buffers that are hundreds of instructions deep, so even if only 8 of those instructions are conditional jumps, there's 256 different paths your program could take. If your branch predictor predicts all 8 correctly >50% of the time (It does), doing 256x the work to cover your ass is not worth it.

comment 2y ago · link · parent

I don't think AlphaZero is related to this work, apart from both being NN-based. AlphaZero and its training pipeline fundamentally only works for "chess-like" two-player games, where the agent can play against itself and slowly improve through MCTS.

comment 2y ago · link · parent

Only slightly more general. It only works for games that are zero-sum, deterministic, have no hidden information, and discrete game state and moves. Other examples include connect-4.

comment 2y ago · link · parent

64GB ddr5 memory modules don't even exist yet, so going 128GB would require four memory DIMMs.

comment 2y ago · link · parent

> For example, Go uses (or at least one point it did) its own thread management and variable-size stacks.

Go developer here: Yup, the language still works like that, and probably always will.

comment 2y ago · link · parent

WaitGroup/ErrGroup doesn't even work here, because the functions return data. I mean, you can use ErrGroup, but it requires additional error-prone concurrency orchestration to work.

comment 2y ago · link · parent

What? Source?

comment 2y ago · link · parent

Non-native speaker here, what does "hard G" even mean? G as in "go", or G as in "gin"?

comment 2y ago · link · parent

https://en.wikipedia.org/wiki/Shadow_IT

comment 2y ago · link · parent

As strange as it sounds, this just seems way to sophisticated to be malicious.
1
567
12