Better HN
topnewbestaskshowjobs
Log inSign up

sapiogram

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

Submissions

comment 3y ago · link · parent

Headline seems to contradict the article? It's predicting that prices will fall in the future.

comment 3y ago · link · parent

The primary source of the 3 magnitude dimming is this data: https://www.asteroidoccultation.com/2023_12/1212_319_82912_S...

It seems to be based on a very crude estimation, see the data near the bottom. It estimates Betelgeuse to have an angular diameter of 48.10 milli-arcseconds, and the astroid's angular diameter to 46.0 milli-arcseconds, which works out to a 11.7 dimming factor.

comment 3y ago · link · parent

None of the examples in the article would cause UB in analogous C code. A C compiler could still optimize away the useless check itself, but that's true for every language.

comment 3y ago · link · parent

I don't think the author was looking for this kind of example. Everything in your code is useful, so this category of linter would not complain.

Other linters might complain about `==`, though ;)

comment 3y ago · link · parent

> You can still write the same bug in Rust

I honestly don't think you can. If you try to iterate over values instead of references, you'll take ownership of the vector and not be able to use it again.

comment 3y ago · link · parent

Does thread per core necessarily imply message passing? I don't see why the two need to be related.

comment 3y ago · link · parent

Could you be more specific about your bottlenecks? Were you not able use the multithreaded scheduler for some reason, or did it not work properly?

comment 3y ago · link · parent

I had an absolutely awful experience when I tried using Sqlite through the sqlx crate. The work was mostly cpu-bound, but I didn't mind blocking the event loop for a few seconds here and there, so I thought I would just run it on Tokio's worker threads. Big mistake, I ended up getting extremely low CPU utilization due to a quirk (Or less charitably, a bug) in Tokio's scheduler.

I eventually rewrote the whole thing with rusqlite, but apart from being non-async, I found the API much less ergonomic to work with. But at least Rayon worked exactly as I expected.

comment 3y ago · link · parent

Rust does not protect against deadlocks, that is correct. It also doesn't fully prevent mistakes related to ref counting. But I don't get the impression that the post is claiming either of those things?

comment 3y ago · link · parent

It's only 25% speedup in actual Python code, in domains like data science this won't matter much, because your cpu cycles are mostly spent inside numpy.

comment 3y ago · link · parent

Does compiling the Linux kernel really scale to that many cores?

comment 3y ago · link · parent

Thanks! Do you know if the Rust compiler is able to pass this information to LLVM somehow?

comment 3y ago · link · parent

> Pokemon Red isn't a huge game if you have access to the state (not just pixels) and prune it properly.

I think the whole point of this project is to let the AI do the pruning

comment 3y ago · link · parent

> Naively we might see games like Go, Chess, StarCraft, and Dota as more "complex"

The strong AIs made for those games had access to some crucial human "help" though.

* AlphaStar (For StarCraft) was trained on a massive database of human games, while this project started Pokemon Red with a blank slate.

* AlphaZero and AlphaZero Chess did start blank slate, but had a hand-coded and domain-specific search algorithm (MCTS) to explore various actions (800 iterations IIRC) before actually making that action. There's no obvious way to do something similar for Pokemon Red.

comment 3y ago · link · parent

Your example changed the type of the function, though. I'm assuming there is no `&T` in the function's output type.

comment 3y ago · link · parent

Does anyone know what guarantees Rust functions have regarding escape analysis? In particular, is the `x` reference in `fn foo(x: &T)` guaranteed to not outlive the function, or would it be legal for `foo` to `transmute()` it into a `&'static T` and have to escape into a global?

comment 3y ago · link · parent

Do you have a source? I would expect the first pounds of muscle to affect metabolism more than the 100th pound, but that's my immediate intuituion.

comment 3y ago · link · parent

The standard answer is cost, but I'm not sure how significant that actually is in this day and age. Maybe it's just artificial market segmentation at this point.

comment 3y ago · link · parent

This is only true for generational and/or compacting garbage collectors, right? So not Go, for instance?

comment 3y ago · link · parent

You're confusing atomicity with sequential consistency. The former guarantee is perfectly compatible with caching.

comment 3y ago · link · parent

Interestingly, the Go memory model[1] does in fact guarantee atomicity of word-sized reads/writes:

> Otherwise, each read of a single-word-sized or sub-word-sized memory location must observe a value actually written to that location (perhaps by a concurrent executing goroutine) and not yet overwritten.

However, it allows the implementation to immediately exit and report an error as well.

[1]: https://go.dev/ref/mem

comment 3y ago · link · parent

Oof

comment 3y ago · link · parent

I'd say Apple got there with their M1 and M2 chips. But it took 10 years of incrementally improving on an already commercially viable cpu, unlike what tensortorrent is claiming.

comment 3y ago · link · parent

Given the choice between exaggerating the performance and getting funded, and not exaggerating and running out of money, I think everyone ends up choosing the former.

comment 3y ago · link · parent

I assume you're also still limited to dual-channel in both scenarios?

comment 3y ago · link · parent

> Rust's where each variant is its own type.

Is this... right? You can't use enum variants as types in function signatures, variable declarations, etc.

comment 3y ago · link · parent

The answer is always "it depends", which is exactly why I prefer the median in most cases. Once you choose to use the median, there are no more choices/degrees of freedom - it's just the median. On the other hand, "mean without outliers" requires you to make a subsequent value judgement on what exactly is an "outlier".

comment 3y ago · link · parent

1W is honestly not that great, though. A smartphone will do 10x that out of the box, and still pling for Facebook notifications.

comment 3y ago · link · parent

> If you must use average, then you should remove the top 5% from the average.

5% is too arbitrary, just use the median.

1
89101112