Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 2y ago · link · parent

> All that said, serde_json is incredibly convenient and giving up to write your own parser is a big hammer for a problem that probably doesn't need it.

I had a thought in my reply [0] on this that actually might let him eat his cake and have it too in this regard. I think you can heavily abuse serde::de::Visitor to schema validate without actually parsing (or with less parsing, at any rate). I went into more detail in my comment but I wanted to ping you (@duped).

[0]: https://news.ycombinator.com/item?id=40357159

comment 2y ago · link · parent

Nice post, Dmitry!

Two suggestions: it’s not immediately obvious whether subsequent benchmark result tables/rows show deltas from the original approach or from the preceding one (it’s the latter, which is more impressive). Maybe call that out the first couple of times?

Second, the “using the single Vec but mutating it” option would presumably benefit from a reserve() or with_capacity() call. Since in that approach you push to the vector in both erroring and non-erroring branches, it doesn’t have to be exact (though you could do a bfs search to find maximum depth, that doesn’t strike me as a great idea) and could be up to some constant value since a single block memory allocation is cheap in this context. (Additionally, the schema you are validating against defines a minimum depth whereas the default vec has a capacity of zero, so you’re guaranteed that it’s a bad choice unless you’re validating an empty, invalid object.)

But I agree with the sibling comment from @duped that actually parsing to JSON is the biggest bottleneck and simply parsing to the minimum requirements for validation would be far cheaper, although it depends on if you’ll be parsing immediately after in case it isn’t invalid (make the common case fast, assuming the common case here is absence of errors rather than presence of them) or if you really do just want to validate the schema (which isn’t that rare of a requirement, in and of itself).

(Edit: I do wonder if you can still use serde and serde_json but use the deserialize module’s `Visitor` trait/impl to “deserialize” to an enum { Success, ValidationError(..) }` so you don’t have to write your own parser, get to use the already crazy-optimized serde code, and still avoid actually fully parsing the JSON in order to merely validate it.)

If this were in the real world, I would use a custom slab allocator, possibly from storage on the stack rather than the heap, to back the Vec (and go with the last design with no linked lists whatsoever). But a compromise would be to give something like the mimalloc crate a try!

comment 2y ago · link · parent

I can’t square this with the speed. A couple of layers doing STT are technically still part of the neural network, no? Because the increase in token base to cover multimodal tokenization would make even text inference slower, not twice as fast, as 4-turbo.

But I’m not an expert!

comment 2y ago · link · parent

Thanks, I missed that.

comment 2y ago · link · parent

Is the output stable across machines in the same architecture (i.e. with various simd features enabled/disabled, compiled in 32-bit vs 64-bit modes, etc) and across architectures (x86_64 to aarch64)?

comment 2y ago · link · parent

I have some questions/curiosities from a technical implementation perspective that I wonder if someone more in the know about ML, LLMs, and AI than I would be able to answer.

Obviously there's a reason in dropping the price of gpt-4o but not gpt-4t. Yes, the new tokenizer has improvements for non-English tokens, but that can't be the bulk of the reason why 4t is more expensive than 4o. Given the multi-model training set, how is 4o cheaper to train/run than 4t?

Or is this just a business decision, anyone with an app they're not immediately updating from 4t to 4o continues to pay a premium while they can offer a cheaper alternative for those asking for it (kind of like a coupon policy)?

comment 2y ago · link · parent

Theoretically? Sure. In practice? You really have to bear in mind second order ramifications. People will be disincentivized from holding a stock, especially one that has unrealized loss (theyll lose money AND pay for the privilege of doing so!). You’ll hurt long term stock holders but not tax day traders and wall street bros dealing in options. You’ll tax retirement portfolios more than the normal wealthy. If stocks take a haircut every year, holding onto cash and eating the inflation might become more attractive. P/Es will come crashing down, tanking the GDP as they go.

comment 2y ago · link · parent

You really don’t. Even setting aside income tax vs property tax, people misunderstand property taxes in the US considerably.

A budget is normally set and it is funded by property taxes as a ratio of the asset value compared to all other asset values in the county. If your home didn’t increase in value nor did anyone else’s you’d pay the same amount because that budget has to be realized one way or the other.

Some jurisdictions make this less transparent by taxing at a flat rate (x% of assessed home value) but that’s misleading because they determined that rate to set their budget to begin with. If there were a downturn in property values across the board that didn’t happen at the same time as a recession somehow such that the monetary outflow remained high (high employment for the local government, high costs, no deflation, etc) then there would be a budget crisis and they’d revisit that percentage.

comment 2y ago · link · parent

The debugger.

comment 2y ago · link · parent

The visual studio debugger is just leagues beyond the rest.

comment 2y ago · link · parent

“All” I want from Mycroft is first-class rust support in Visual Studio. The rumors that they’ve been working on it are several years old now.

comment 2y ago · link · parent

Amazing work, I'm impressed by the scope of your project!

I must say though, is it jina or bge-3/flag - the embeddings (and tokenizer?) do not do a good job on tech topics. It's fine for natural words, but searching for tech concepts like "xaml", "simd", etc cause it fall back to tokenizing the inputs and tries to grab similar sounding words.

Also, just some constructive feedback, if there were some way to stop it from showing the same "hn leaderboard" of results when there are no results because a topic is too niche would be nice. I get a lot of "Stephen Hawking has died" when searching for words the embeddings aren't familiar with.

Edit: I'm not so sure how well the sentiment analysis is working. I had the feeling that there was too much negative sentiment that didn't match up to reality, so I tried looking up things HN would feel overwhelmingly positive about like "Mr Rogers", I mean, who could feel negatively about him? The results show some serious negative spikes. Look up "Carter" and there's a massive negative peak associated with the passing of Rosalynn Carter. It was an HN submission talking about all the wonderful things the Carters did.

Also, I think the "popularity over time" needs to be scaled by the median number of votes a story got that month/year, because the trend lines just go up and up if you plot strictly the number of posts. Look at the popularity of "diesel" and you'll see what I mean - this is a term that peaked ten years ago! Or perhaps it should be some sort of keyword incidence rate or number of items with a cosine similarity index of less than x from the query rather than post score, maybe?

Edit2: The dynamic "click a post to remove and recalculate similarity threshold" is awesome.

comment 2y ago · link · parent

This is strictly polling, no push or long poll support?

comment 2y ago · link · parent

Looks like it's a declarative CMake so you don't have to interact with the CMake DSL yourself. Which is nice, but I've rarely had a non-sample/toy CMake project where I didn't have to hack something outside of the straightforward steps the docs make it look like you need to do, so my number concern with this is that it's going to end up being a (very) leaky abstraction. How much will cmkr get in the way and make it harder than if you had written out the CMake yourself to begin with? How much of the time will it "just work" vs end up being of little use?

It's great that it's self-bootstrapping, though. I thought they would have you install both this tool and CMake in order to build the project on end-user's machines.

comment 2y ago · link · parent

> energy density and power density seem to be roughly inversely related across technologies. i.e the more energy you can pack per unit mass the slower it is to get it in and out.

This sounds really elegant and simple to the point where people might take it as an axiomatic fact but the very existence of both nuclear fission and fusion stops it from being a general rule. They’re both discharging power from individual atoms and it would actually be great if we had a way to slow down the rate of discharge.

comment 2y ago · link · parent

> the limitation is in the amount of power that can be pumped into them

You could say that. You could also be more pedantic and say that this comes at the cost of some decrease in battery life (and efficiency) due to the resistance resulting in some amount of heat in order to facilitate this high-speed charging process.

But I don’t know if the ROI on improved battery life would be worth the complexity, size, weight, and cost of a two-stage charging process. As battery tech improves, that resistance continues to come down.

comment 2y ago · link · parent

Debian is one of the few distros still offering a tier-1, first-party i686 target in 2024. Even a lot of derivative distros (i.e. where it would be minimal effort to do the same) have dropped i686.

Given the enormous scope of this transition, I have to wonder how many will be benefiting from this 15 years from now. I don’t question it will have utility, but I wonder about the ROI.

comment 2y ago · link · parent

Cost optimization aside, that has always been the best way to use an ESP chip. Just go with one of their barebone models wired up as a peripheral to an ARM or RISC mcu.

comment 2y ago · link · parent

For those that are interested but perhaps not aware of this similar project, Dafny is a "verification-aware programming language" that can compile to rust: https://github.com/dafny-lang/dafny

comment 2y ago · link · parent

That seems almost like the instruction template is wrong.

comment 2y ago · link · parent

This is old and incorrect. China is leading the way in terms of electrification and EV-adoption, ahead of even the darling child Norway.

comment 2y ago · link · parent

Hey, you’re welcome! Looking forward to trying this at some point. Sooner if rust bindings are available, later if I have to contribute them.

My embedding is already binary, presumably I can bind a blob instead of the call to vec_quantize_binary?

comment 2y ago · link · parent

I guess this is an answer (not in answer, mind!) to the GitHub issue I opened against SQLite-vss a couple of months ago?

https://github.com/asg017/sqlite-vss/issues/124

comment 2y ago · link · parent

I only meant "not a raw pointer" because rust supports read and write operations on raw pointers with very different aliasing semantics.

It is an owned pointer, with emphasis on the "owned". You can have as many raw pointers to the same memory location as you like, you just can't have multiple native rust objects pointing to that same memory alive at once, though. It's also obvious because Box<T> implements Drop, so obviously it's not just something you can pass to a function in lieu of a pointer and if you do pass it to a function, you can no longer make any assumptions about the lifetime or validity of any pointers to the same data.

comment 2y ago · link · parent

Have you published your code to GH, by any chance?

comment 2y ago · link · parent

We use and maintain this cross-platform/cross-lang secrets management option: https://github.com/neosmart/securestore-rs

It keeps secrets out of your environment variables and lets you manage secrets the same way you do code (in lock-step with the code that uses it and as easy to update a secret just by pushing to git), but it's definitely for smaller teams or projects. It also has significantly fewer moving parts or dependencies.

comment 2y ago · link · parent

I have to disagree with the entire premise of the article. It's the fact that Box isn't unique that gives it this behavior. The author even says as much, but dismisses it because it gets in the way of their point:

> While it can be argued that box is like a T, but on the heap, and therefore moving it should invalidate pointers, since moving T definitely has to invalidate pointers to it, this comparison doesn’t make sense to me. While Box<T> usually behaves like a T, it’s just a pointer.

The "it's just a pointer" argument is moot (and pointers have nothing to do with the issue, it's a question of exclusive ownership and nothing more). It's a high-level object (i.e. not a pointer) to which rust's very clear aliasing and single name rules apply. Thou shalt not have multiple live T that point to the same memory address. QED.

It's the same reason this code is unsafe:

    struct Foo;
    impl Foo {
        fn bar(&mut self) { ... }
        fn baz(&self) { ... }
    }

    fn get_foo() -> &mut Foo {
        unsafe { static mut FOO_SINGLETON: Foo = Foo; }
        unsafe { &mut FOO_SINGLETON }
    }
Here we don't even have a pointer, only statically allocated data stored in .TEXT. We don't even create a second top-level instance of Foo, only an &mut reference to it. But it's unsafe because the compiler can't know whether or not it has exclusive access.

(As a refresher, in terms of "strength" of ownership from the most exclusively owned to the least so, it would go T -> &mut T -> &T.)

comment 2y ago · link · parent

The first Boeing whistleblower to “off himself” allegedly told his family shortly before he died that if anything happened to him, “it’s not suicide.”

https://www.newsweek.com/john-barnett-boeing-whistleblower-p...

comment 2y ago · link · parent

> Are RAG systems really so heavy they add 4x to the TTFT?

Only the pure python + unoptimized orm ones. So only most of them.

1
303132
277