HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ot

18,730 karmajoined 16 năm trước
Giuseppe Ottaviano

  - Twitter: @ot_y
  - LinkedIn: www.linkedin.com/in/giuseppe-ottaviano-497b7b3

Submissions

Core dump epidemiology: fixing an 18-year-old bug

openai.com
1 points·by ot·17 giờ trước·0 comments

The Future Worth Building Is Human

thinkingmachines.ai
2 points·by ot·18 giờ trước·0 comments

Muse Spark 1.1

ai.meta.com
404 points·by ot·Hôm kia·211 comments

Exposing the Solid State Donut Battery. It's over [video]

youtube.com
2 points·by ot·tháng trước·0 comments

The Tax of Living in a Low-Trust Society: How Collapsed Trust Costs You

yourbrainonmoney.substack.com
61 points·by ot·2 tháng trước·42 comments

The Story of VaccinateCA

worksinprogress.co
1 points·by ot·2 tháng trước·0 comments

Max/MSP external for running neural amplifier captures

github.com
9 points·by ot·2 tháng trước·0 comments

Elon Musk's court battle with Sam Altman exposes Silicon Valley secrets

washingtonpost.com
5 points·by ot·3 tháng trước·0 comments

Generate evolving textures by blending images

github.com
1 points·by ot·4 tháng trước·0 comments

Apache Iggy's migration to thread-per-core architecture powered by io_uring

iggy.apache.org
2 points·by ot·4 tháng trước·0 comments

The Anthropic Hive Mind

steve-yegge.medium.com
4 points·by ot·5 tháng trước·1 comments

Designing AI resistant technical evaluations

anthropic.com
3 points·by ot·6 tháng trước·0 comments

In search of the least viewed article on Wikipedia

colinmorris.github.io
213 points·by ot·4 năm trước·68 comments

comments

ot
·4 ngày trước·discuss
In Linux everything is XOrCrash, since allocations never fail but the OOM killer can get you later.
ot
·4 ngày trước·discuss
This is a great article but it goes into a lot of detail that can be intimidating at first.

For me, the reading that made asymmetric fences "click" is this: https://pvk.ca/Blog/2019/01/09/preemption-is-gc-for-memory-r...

It might be easier to read that first, as it also goes into practical applications, and then this one.
ot
·23 ngày trước·discuss
> GNU deadline

I think you mean readline?
ot
·tháng trước·discuss
Yeah the number sounds a lot less impressive if you say that you only get 2^61.44 integers out of 2^64. In other words, a 4% entropy loss.

Information quantities are more meaningfully expressed in number of bits.
ot
·4 tháng trước·discuss
That's a false dichotomy: you optimize both the application and the allocator.

A 0.5% improvement may not be a lot to you, but at hyperscaler scale it's well worth staffing a team to work on it, with the added benefit of having people on hand that can investigate subtle bugs and pathological perf behaviors.
ot
·4 tháng trước·discuss
It's not just that zeroing got cheaper, but also we're doing a lot less of it, because jemalloc got much better.

If the allocator returns a page to the kernel and then immediately asks back for one, it's not doing its job well: the main purpose of the allocator is to cache allocations from the kernel. Those patches are pre-decay, pre-background purging thread; these changes significantly improve how jemalloc holds on to memory that might be needed soon. Instead, the zeroing out patches optimize for the pathological behavior.

Also, the kernel has since exposed better ways to optimize memory reclamation, like MADV_FREE, which is a "lazy reclaim": the page stays mapped to the process until the kernel actually need it, so if we use it again before that happens, the whole unmapping/mapping is avoided, which saves not only the zeroing cost, but also the TLB shootdown and other costs. And without changing any security boundary. jemalloc can take advantage of this by enabling "muzzy decay".

However, the drawback is that system-level memory accounting becomes even more fuzzy.

(hi Alex!)
ot
·4 tháng trước·discuss
RSA was also not given that name by its authors, the name came later, which is usually the case.

In the original paper they do not give it any name: https://people.csail.mit.edu/rivest/Rsapaper.pdf
ot
·4 tháng trước·discuss
Here RE2 does not fall back to the NFA, it just resets the Lazy DFA cache and starts growing it again. The latency spikes I was mentioning are due to the cost of destroying the cache (involving deallocations, pointer chasing, ...)
ot
·4 tháng trước·discuss
> are there eviction techniques to guard against this?

RE2 resets the cache when it reaches a (configurable) size limit. Which I found out the hard way when I had to debug almost-periodic latency spikes in a service I managed, where a very inefficient regex caused linear growth in the Lazy DFA, until it hit the limit, then all threads had to wait for its reset for a few hundred milliseconds, and then it all started again.

I'm not sure if dropping the whole cache is the only feasible mitigation, or some gradual pruning would also be possible.

Either way, if you cannot assume that your cache grows monotonically, synchronization becomes more complicated: the trick mentioned in the other comment about only locking the slow path may not be applicable anymore. RE2 uses RW-locking for this.
ot
·5 tháng trước·discuss
This is drawing broad conclusions from a specific RW mutex implementation. Other implementations adopt techniques to make the readers scale linearly in the read-mostly case by using per-core state (the drawback is that write locks need to scan it).

One example is folly::SharedMutex, which is very battle-tested: https://uvdn7.github.io/shared-mutex/

There are more sophisticated techniques such as RCU or hazard pointers that make synchronization overhead almost negligible for readers, but they generally require to design the algorithms around them and are not drop-in replacements for a simple mutex, so a good RW mutex implementation is a reasonable default.
ot
·5 tháng trước·discuss
Glad that Moby Dick is in there.
ot
·6 tháng trước·discuss
> Presumably you mean you just double check the page value after the rdtsc to make sure it hasn't changed and retry if it has?

Yes, that's exactly what a seqlock (reader) is.
ot
·6 tháng trước·discuss
Yes you need some lazy setup in thread-local state to use this. And short-lived threads should be avoided anyway :)
ot
·6 tháng trước·discuss
You can do even faster, about 8ns (almost an additional 10x improvement) by using software perf events: PERF_COUNT_SW_TASK_CLOCK is thread CPU time, it can be read through a shared page (so no syscall, see perf_event_mmap_page), and then you add the delta since the last context switch with a single rdtsc call within a seqlock.

This is not well documented unfortunately, and I'm not aware of open-source implementations of this.

EDIT: Or maybe not, I'm not sure if PERF_COUNT_SW_TASK_CLOCK allows to select only user time. The kernel can definitely do it, but I don't know if the wiring is there. However this definitely works for overall thread CPU time.
ot
·6 tháng trước·discuss
If you look below the vDSO frame, there is still a syscall. I think that the vDSO implementation is missing a fast path for this particular clock id (it could be implemented though).
ot
·6 tháng trước·discuss
That's probably true for small primitive types, but if your objects are expensive to move (like a large struct) it might be beneficial to minimize swaps.
ot
·6 tháng trước·discuss
Yeah, was just about to edit the comment :)
ot
·6 tháng trước·discuss
The query is incorrect, it will return any posting that contains the words "vision" and "pro", not necessarily consecutive.

It looks like phrasal search is supported, searching "vision pro" in quotes only returns 212 results worldwide

https://jobs.apple.com/en-us/search?search=%22vision+pro%22&...

Spot-checked a few and they all seem to be Vision Pro related.

--

EDIT: Actually even this is not accurate, as it matches postings with sentences like

> Fundamental to the success of iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and Mac ...

but not specific to Vision Pro.

However we can filter on products and services for Vision Pro and visionOS, and it gives 106 results:

https://jobs.apple.com/en-us/search?search=%22vision+pro%22&...
ot
·7 tháng trước·discuss
> can avoid or defer a lot of the expected memory allocations of async operations

Is this true in realistic use cases or only in minimal demos? From what I've seen, as soon as your code is complex enough that you need two compilation units, you need some higher level async abstraction, like coroutines.

And as soon as you have coroutines, you need to type-erase both the senders and the scheduler, so you have at least couple of allocations per continuation.
ot
·7 tháng trước·discuss
Is it so hard for people to understand that Europe is a continent, EU is a federation of European countries, and the two are not the same?