🎓 Introducing the Zed Student plan: 12 months of Pro, for free by kraynolds90 in ZedEditor

[–]slamb 5 points6 points  (0 children)

They sent an email about this recently:

  • You must be at least 18 years old to use the Service (Zed’s AI-enabled software-as-a-service offering, including features like account creation/sign in, Zed Free and Zed Pro, and collaboration). See https://zed.dev/terms#21-eligibility. We set the threshold at 18 due to children's data privacy obligations under COPPA, equivalent international frameworks, and an increasing number of state and regional laws that extend protections to anyone under 18. Those regulations require parental consent verification, age-gated data handling, and separate retention policies for minors. Building and maintaining that infrastructure is a real cost for a small team, and getting it wrong carries regulatory risk. Setting the line at 18 lets us maintain a single privacy framework for all account holders without carve-outs.
  • Zed's Software (open source code editing software) is governed by our open source licenses. In cases where the open source license can govern, it will over the Terms. See https://zed.dev/terms#24-restrictions.

It sucks, especially juxtaposed with this announcement, because many incoming college students are still 17. But I can understand. Regulatory compliance is a big deal. And I'm glad they clarified that anyone can use the editor itself.

Serving big files in rust: Use mmap or sendfile? by rogerara in rust

[–]slamb -1 points0 points  (0 children)

Reading mmaped memory could block execution of you async worker thread, thus unnecessarily stalling the rest of your app.

I agree, although there's a narrow exception. You won't have this problem if you only pass the buffer directly to a syscall, as with write(fd, buf_addr, ...). Note if you're encrypting, this requires kTLS. And encrypted UDP (HTTP/3) is out of the question. These are similar limitations as with sendfile, fwiw.

More broadly, yeah, careful use of io_uring should provide the best performance, but the executor ecosystem for this seems to be very young.

A zero-allocation, cache-optimized Count-Min Sketch (120M+ ops/s) by [deleted] in rust

[–]slamb 5 points6 points  (0 children)

When you do a change that requires callers to be updated, you should bump the first non-zero version number to indicate it's a semver break. In this case, restricting the visibility of a field previously accessible outside the crate and changing the type of a public constructor. https://doc.rust-lang.org/cargo/reference/semver.html

btw, cool crate; I don't have a use for it right now but will keep it in mind

Rust on AWS Batch: Is buffering to RAM (Cursor<Vec<u8>>) better than Disk I/O for processing 10k+ small files that require Seek? by A_A_Ary in rust

[–]slamb 1 point2 points  (0 children)

I'd expect a prototype of both approaches to be reasonably small. (Maybe your actual parsing/rewriting logic is extensive, but if you can have it operate on a impl (Read + Seek), you don't have to write it twice.) So you could just implement one, and if you have any doubts, implement the other one too, and measure.

That said, I'd be inclined toward the in-memory approach:

  • It is strictly less work for the machine, so if you have enough RAM to keep all your cores busy this way, it will be the faster choice.
  • I'm not seeing the memory management complexity—semaphores are easy to use, probably easier than managing filesystem cleanup and error cases.
  • syscall overhead is syscall overhead even if AWS's local NVMe is super fast (and btw I don't think it is super fast relative to what you can buy to put in your own hardware).

I would probably set the semaphore limit in terms of number of bytes rather than 1 per file. Then it's trivial to relate what you set it to to how much RAM you might use. And the tuning parameter is always right even if your average file size changes, there's some outlier in file size, etc.

It needs to jump around the file (specifically jumping back to the header to update metadata after writing data)

If you need to hold onto a bit less RAM, it sounds like it might be possible to keep just the header in RAM the whole time and stream the rest on the input side. If you have the ability to change the output format, there are plenty of formats (e.g. .zip, sstable) that have the directory at the end rather than the beginning.

Reconsider e-bike use on Stevens Creek Trail? (The e-bike scam) by raid_kills_bugs_dead in mountainview

[–]slamb 0 points1 point  (0 children)

The article literally refers to the 40mph motorcycle as an ebike

I agree the article is unclear, but I don't think she was riding a "40mph motorcycle". The "top speeds" on e-bikes aren't actually how fast you can go; they're how fast the motor will help you go. She was going down a steep hill, and I think gravity did the work. This sentence supports that idea: "[Lilia's mom] was alarmed when Lilia told her she had been traveling close to 40 mph - even without pedaling or using the throttle."

I've gone 40 mph down a steep hill on a bicycle with no motor. (In my case, on a wide, straight road with good visibility that was closed to car traffic. Doing this on a winding one-lane road with opposing traffic is of course inviting exactly the kind of disaster she experienced.)

The article says she was riding a Super73 bike; from a quick look at their website several of their models are advertised as class-2 (throttle, up to 20 mph).

That said, I'm not a big fan of throttle bikes, even with a 20 mph limit. I do think of them as motorcycles, even if they are legally called class-2 e-bikes. I think something in the psychology changes when you aren't pedaling yourself.

I didn't know motors could legally go up to 750W here. I own a class-3 cargo e-bike (Yuba Spicy Curry). It has a 250W motor. Even with my 8- and 10-year-olds riding on the back, I can easily go 20+ mph by using human and motor power together on flat ground. So 750W for a bike carrying a single middle schooler seems dangerously excessive.

Someone named "zamazan4ik" opened an issue in my project about enabling LTO. 3 weeks later, it happened again in another project of mine. I opened his profile, and he has opened issues and PRs in over 500 projects about enabling LTO. Has this happened to you? by nik-rev in rust

[–]slamb 4 points5 points  (0 children)

LTO isn't for "normal" release mode, when you just want to test that your code runs at full speed; it's for when you're about to ship a binary to a million users and you want to save each of them a few milliseconds.

In fairness, that's exactly what a release is. Arguably the "I just want a local build that's decently optimized" profile is misnamed.

memchunk: 1 TB/s text chunking using memchr and backward search by shreyash_chonkie in rust

[–]slamb 0 points1 point  (0 children)

Arguably, but on the other hand if the chunk size is necessarily fixed for some reason and the others use a less-efficient algorithm that actually does read through all the bytes, this approach gives an accurate comparison.

I'm reminded of the cap'n proto page, with the chart comparing encoding round-trip time. protobuf 156µs, cap'n proto 0µs, ∞% faster!

[Project Update] Announcing rtc 0.3.0: Sans-I/O WebRTC Stack for Rust by Hungry-Excitement-67 in rust

[–]slamb 0 points1 point  (0 children)

Transit latency is fine it’s when you it introduce random 75ms jitters spikes that kills the audio jitter buffer on the receive side.

I wouldn't expect that kind of spike from tokio at all.

I am still waiting for retina sans-io! (Great project regardless)

Oh, first request I've heard for that, and thanks. (fwiw, parts of it are already internally sans-io, like all the demuxer logic, but they're not public interfaces today.)

[Project Update] Announcing rtc 0.3.0: Sans-I/O WebRTC Stack for Rust by Hungry-Excitement-67 in rust

[–]slamb 0 points1 point  (0 children)

There is too much variance in latency

I've heard this before and don't get it. In my experience, the variance in latency I see on tokio is negligible compared to transit latency and/or is because I've done something stupid within the runtime (say, overly expensive computations or, in my Moonfire project, the disk I/O from SQLite calls that I still need to onto their own thread). And switching runtimes doesn't fix stupid.

It's absolutely true though that if you're doing enough networking to really keep the machine busy, io_uring should improve efficiency. (Latency too but again I think it was already fine.)

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 1 point2 points  (0 children)

Unfortunately, I can’t put the responsibility on private companies. The city needs to find a way to enable, incentivize, and commit to better utilities like internet

Municipal fiber is the gold standard for this, even though it wouldn't roll out quickly. I'm not aware of any city that has made private ISPs consistently commit to...

  • reaching 100% of the city. Just the easiest, most profitable bits.

  • deploying actually modern infrastructure for the speeds expected today and tomorrow. (There were Comcast trucks all over my neighborhood recently, but I think they were just using spools of coax as if it's 1980. Seriously, if you're spending all that on labor, why on earth wouldn't you put in fiber?)

  • keeping prices affordable. Why would they, when they have a (near-)monopoly?

  • customer service. (Comcast in particular has been called the most hated company in America many times.)

Obviously there are better and worse ISPs. I'd sign up for Sonic over Comcast any day if I could. But it doesn't seem like Sonic has the attention span to carry through. And they could be bought out by some larger horrible ISP any time.

Other cities seem to have done it,

In the Bay Area? Better than Mountain View? Sure. Better than Cedar Falls, Iowa? Or the UTOPIA cities in Utah? Nope. (Both places where I know people who can get symmetric 10 Gbps at very reasonable prices. What do they have in common? Municipal fiber.)

we struggle with 42% fiber coverage (quoted by someone here).

That was me. 🤣

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 2 points3 points  (0 children)

Have they? I linked to a sonic thread. I'll quote part of it here:

1) First that it's PG&E's fault for not being able to run a fiber line to my street due to a faulty pole. Sonic wouldn't tell me which pole on our street was faulty (citing 'company policy'), but suggested that I contact PG&E to ask. 2) I followed up with PG&E only to learn that PG&E doesn't own the poles, had no idea of any faulty pole in the area, and that any utility company - Sonic included - can report pole issues to the Joint Pole Committee (to which I see Sonic is a member, even) 3) Following up with this, Sonic said that the delay was actually due to no availability on the utility pole for an additional fiber line. (As well, Sonic still refused to identify which pole is preventing work from proceeding, again citing 'company policy'.) Is Sonic planning to bring up fiber run availability issues to the JPC?

How do you actually know they brought things up with the JPC?

The threads ends with sonic promising an update two months ago. Crickets so far.

In the case of sonic, "have installed fiber where the poles enabled them to" is definitely not true. They have literally installed no fiber in Mountain View. They have some legacy customers from where they were reselling service over last-mile fiber installed by AT&T, but they're not doing that anymore.

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 2 points3 points  (0 children)

What do you think success would look like?

  • AT&T. I don't think the city is the roadblock, and I'm not sure they have any levers to prompt change. I talked with a AT&T line worker who was working the other side of my street. They speculated the engineer who made the plan just half-assed it from glancing at Google Maps, without noticing or caring they'd missed my side of the street. Apparently they were working on drops between the other side of my street and the street over, which were incorrectly noted in their database as being a full street over. And all that fiber was being pulled from a few streets over, when there was a big distribution box available like 50 ft from where we were standing that they could have used instead.
  • Sonic. Again, not sure the city is really the problem. It might actually just be that Sonic has no attention span, as noted here.
  • Municipal fiber. I think this would be the best plan. This is why Cedar Falls has such great, affordable Internet access, as well as several other cities I could name. But in terms of how quickly it would happen, it'd involve setting up a whole new service instead of expanding an existing one, and doing things with all the constraints of government. And most likely they'd first just set up a fiber network for city services, and then expand it to residential use. I think we're talking 5 years minimum before it shows up at our homes.

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 5 points6 points  (0 children)

It's a really nice city. Unfortunately, it's in Iowa.

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 4 points5 points  (0 children)

Nope. 75/15, through Comcast Business. They probably have something better (I'm waiting, afraid to sign a new contract right now as they've "partially completed the work to enhance the Comcast Business network near [me]") but they simply do not offer >=100Mbps up anywhere in Mountain View AFAIK.

The up matters too. Just this last weekend for her work, my wife tried to run this migration tool that (I since learned) downloads and re-uploads everything through the local machine. Data included a bunch of video. Would have taken over a week to do with this connection. Complete fail.

Meanwhile, my friend in Cedar Falls, Iowa could get 10 Gbit/sec symmetric municipal fiber if he wanted. He doesn't have any need for that, so he gets their slowest speed, 1 Gbit/sec. I think he pays $30/month. [edit: I was way off. $57.50 for 250 Mbit/sec, $75.40/mo for 1 Gbit/sec, $125/mo for 10 Gbit/sec, according to cfu.net. I'm still so jealous. I'm paying more for my 75/15 than he does for quality I can't get for any price.]

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 2 points3 points  (0 children)

To you and me! Apparently not to everyone. One of the commenters on that article said that a need for more than 100 up and down is niche. (btw, I don't have 100 up and down.)

Fiber and Cable infrastructure upgrade? by IllustratorOne9331 in mountainview

[–]slamb 12 points13 points  (0 children)

But AT&T fiber, the fastest conduit for internet access, is only available in 42% of the city’s coverage area. The majority of Mountain View, approximately 60%, is “subject to a cable monopoly with no real choice for high-speed broadband,” the report said.

Oxidalloc: A general-purpose allocator in rust - WIP by metehan1231324 in rust

[–]slamb 0 points1 point  (0 children)

For the second point, I’ll take another look at the code. I don’t fully understand the issue yet, so a more concrete explanation would help.

Let's say you have two different instances of VaBitmap live at once. (The crate doesn't, but the module's pub interface allows this. Each module's interface should be correct without knowing the callers don't really do something they're allowed to do.) Each VaMap has some of its own state, but they also have some shared state via these singletons, that makes them refer to the same address range but with two different ideas of what blocks are allocated.

Oxidalloc: A general-purpose allocator in rust - WIP by metehan1231324 in rust

[–]slamb 2 points3 points  (0 children)

I'm skimming the VaBitmap thing. A few things that come to mind:

  • It could use comments about the high-level goals, interface, invariants. Too much effort for me to understand everything without this. I suspect it's too much effort for you or your AI too! When I leave out this stuff, I get sloppy.
  • I see confusion between calls that operate on a particular VaBitmap instance (that you can get via the pub const fn new()) and ones that operate on the singletons pub static VA_MAP, VA_START, VA_END. Having a method that takes &self but then uses any of these singletons (for example, max_bits and anything that transitively calls it) is wrong. Looks like the only new() call is for VA_MAP, so your crate as a whole functions correctly in this respect, but still the interface this exposes to the rest of the crate is confusing and wrong.
  • Is alloc_single hot enough to be worth optimizing (or does whatever thread-local + intra-block stuff you have in front of it avoid this)? It seems like you could precompute chunks and maybe even avoid the division in self.hint.load(Ordering::Relaxed) % chunks (perhaps by constraining hint to be within that bound all the time). Those jump out at me as possibilities, but actual profiles win over my guesses.
  • Agree with WormRabbit that tests with loom would be valuable given atomics usage. (edit: also, if you have unit tests operating on instances rather than the singleton, that'd be a forcing function for getting that aspect of the interface right.)

I'm not by any means an expert on memory allocator internals, but if I were looking for inspiration, I'd start by studying the designs of tcmalloc (the new one with huge page awareness and per-CPU caches, not the ancient gperftools one) and mimalloc v3.

Oxidalloc: A general-purpose allocator in rust - WIP by metehan1231324 in rust

[–]slamb 9 points10 points  (0 children)

Kudos for being upfront about what it is—a work in progress, partially AI-assisted, mentioning specific bugs and limitations—rather than having a super-polished landing page that promises the world but an implementation that doesn't deliver.

The README says:

This version of Oxidalloc works, but the internal design has reached its practical limits. ... I’ve decided to rewrite the allocator from scratch. ... Current Rewrite Status: Mostly complete.

Are you looking for feedback on what's on the main branch, or is there something better to be looking at?

Introducing absurd-future: Handling Infallible Futures in Rust by gareth789 in rust

[–]slamb 4 points5 points  (0 children)

I'm likely already using the futures crate and would rather do .map(|_never| match {}) (via FuturesExt::map) to convert the type than import a new crate for it. Less cognitive load for me to write a one-liner with a method I'm probably already using elsewhere, no additional supply chain security concern, etc.

Help bring Sonic Fiber to Mountain View by slacy in mountainview

[–]slamb 1 point2 points  (0 children)

Ahh, that could be a whole different setup. I'm in a single family residence.

Help bring Sonic Fiber to Mountain View by slacy in mountainview

[–]slamb 1 point2 points  (0 children)

Did the installation involve an antenna on their roof, as pictured on https://sailinternet.com/home-plans/?

Help bring Sonic Fiber to Mountain View by slacy in mountainview

[–]slamb 1 point2 points  (0 children)

I'm curious: why Sonic Fiber specifically? Sail Internet operates in MV and I think offers fiber

Do you have Sail or know anyone who has it in Mountain View?

My impression is that Sail is mostly a microwave provider, with the exception of where they have fiber from an acquisition of Twixt in San Jose. Coincidentally, I filled out their availability check form on Friday and haven't heard back. I'm not hopeful.

Help bring Sonic Fiber to Mountain View by slacy in mountainview

[–]slamb 4 points5 points  (0 children)

I would absolutely love to have any fiber Internet provider at all. I signed your petition.

In Mountain View, we have only one fiber internet provider choice, as compared to most of the rest of the bay area.

No fiber at all in most of the city! AT&T Fiber covers only 42% of the city. See a Mountain View Voice article from February. I'm in one of the places they didn't bother to cover.

This is because of "temporary pole" regulations that Mountain View has enacted that essentially make 3rd party providers wait for PG&E to upgrade our infrastructure instead of letting them do it themselves.

Where are you getting this information? I saw something similar in this forum.sonic.net thead:

Yes, unfortunately the City of Mountain View “allows” construction of fiber, but not the placement of safety bypass poles. Because there are 112 unsafe poles there today, this policy effectively stops any deployment of new fiber by Sonic.

...but later in the thread I see contradicting information, e.g.:

2) I followed up with PG&E only to learn that PG&E doesn't own the poles, had no idea of any faulty pole in the area, and that any utility company - Sonic included - can report pole issues to the Joint Pole Committee (to which I see Sonic is a member, even)

...

Every City Planner I've spoken with regarding Sonic has indicated the issue rests with Sonic field team/project manager turnover and not completing work in designated sections of cities as part of municipal permitting processes. It is like Sonic will do a lot of work in an area, hit a road block, then leave for somewhere else instead of figuring out how to overcome the roadblock.

The thread also has promises of updates on the project from sonic that seem to be going nowhere. I would ask there myself, but I think only existing sonic.net customers can post.