Lake update

Jun. 21st, 2025 10:18 pm
nosrednayduj: pink hair (Default)
[personal profile] nosrednayduj
It's summer! Officially, even, being the solstice and all.

The lake is lovely, I didn't measure it with a thermometer, but I measured it with my body, and I would say it was 78 today and 77 yesterday. Unfortunately, after it's 95 on Monday and 100 on Tuesday, the lake may get annoyingly warm.

The boat is working, because we replaced the propeller and it now works great. I have skied many times now, and obviously no more wetsuits are required. The lake got up to 75 a couple weeks ago, so I skied with no wetsuit, and then it was cold and rainy and it dropped to 71, and that time I did use a wetsuit. It's completely optional, but there would've been a lot more yelling about the cold had I not used it.

The dock is completely in. The power boat was too close to it. It is unclear whether heavy winds yesterday actually caused the anchor to drag, or if it just was too close after we put in the rest of the dock (making the dock bigger). I think it was dragging. I got my mask and snorkel out and went for a swim and hauled the anchor block about 20 feet away. If it was dragging, that is a sad too bad, because it means that we have to be worried if it's going to be windy all night or something. I don't really want to go swimming at night. And what if we are away for several days? We have a new anchor, which is an upside-down pyramid shape that is supposed to be good, because it lies on one side and then when the wind moves it lies on the other side and the edge of the pyramid is supposed to dig in to prevent dragging.

Previously we had a mushroom anchor, which is supposed to dig in even better, but does not do well with the wind changing directions and undoing the "digging". We got rid of the mushroom because 30 years of rusting had made the place you stick the shackle thin enough to likely break in a big storm. It had originally been a 100-pound anchor; I brought the scale down and weighed it, and it was 75 pounds in the end, so 25% of it rusted away. With the shackle place being the thinnest and also most likely to have the rust knocked off and more rust happen, so it would be easy most rapidly degrading area. (It was alarmingly thin.) Anyway, it's possible that the mushroom shape does superior digging in, even in the sandy soil we have at the bottom of the lake. They are designed for mud where they really dig in. Anyway, we are concerned. Maybe we will try to find something colorful and heavy that we can embed in the lake bottom so we can compare and see whether it actually is moving in the next windstorm.

Anyway, while I was wet anyway yesterday after noticing the boat gently hitting the dock (no damage to either), I took my first windsurf ride of the season. Windsurfing is a pain, because there's so much set up. Of course I was already tired from hauling the anchor around, and I don't do it often enough to be good at the set up so things went wrong and had to be fixed etc. But I did get a couple of good runs in before I was blown downwind and had to walk back a quarter mile in 3-4 feet of water towing the windsurfer. That also took a long time. But, I was well-exercised!
graydon2: (Default)
[personal profile] graydon2
Elsewhere I've been asked about the task of replaying the bootstrap process for rust. I figured it would be fairly straightforward, if slow. But as we got into it, there were just enough tricky / non-obvious bits in the process that it's worth making some notes here for posterity.

UPDATE: someone has also scripted many of the subsequent snapshot builds covering many years of rust's post-bootstrap development. Consider the rest of this post just a verbose primer for interpreting their work.

context


Rust started its life as a compiler written in ocaml, called rustboot. This compiler did not use LLVM, it just emitted 32-bit i386 machine code in 3 object file formats (Linux PE, macOS Mach-O, and Windows PE).

We then wrote a second compiler in Rust called rustc that did use LLVM as its backend (and which, yes, is the genesis of today's rustc) and ran rustboot on rustc to produce a so-called "stage0 rustc". Then stage0 rustc was fed the sources of rustc again, producing a stage1 rustc. Successfully executing this stage0 -> stage1 step (rather than just crashing mid-compilation) is what we're going to call "bootstrapping". There's also a third step: running stage1 rustc on rustc's sources again to get a stage2 rustc and checking that it is bit-identical to the stage1 rustc. Successfully doing that we're going to call "fixpoint".

Shortly after we reached the fixpoint we discarded rustboot. We stored stage1 rustc binaries as snapshots on a shared download server and all subsequent rust builds were based on downloading and running that. Any time there was an incompatible language change made, we'd add support and re-snapshot the resulting stage1, gradually growing a long list of snapshots marking the progress of rust over time.

time travel and bit rot


Each snapshot can typically only compile rust code in the rust repository written between its birth and the next snapshot. This makes replaying the entire history awkward (see above). We're not going to do that here. This post is just about replaying the initial bootstrap and fixpoint, which happened back in April 2011, 14 years ago.

Unfortunately all the tools involved -- from the host OS and system libraries involved to compilers and compiler-components -- were and are moving targets. Everything bitrots. Some examples discovered along the way:

  • Modern clang and gcc won't compile the LLVM used back then (C++ has changed too much -- and I tried several CXXFLAGS=-std=c++NN variants!)
  • Modern gcc won't even compile the gcc used back then (apparently C as well!)
  • Modern ocaml won't compile rustboot (ditto)
  • 14-year-old git won't even connect to modern github (ssh and ssl have changed too much)


debian


We're in a certain amount of luck though:

  • Debian has maintained both EOL'ed docker images and still-functioning fetchable package archives at the same URLs as 14 years ago. So we can time-travel using that. A VM image would also do, and if you have old install media you could presumably build one up again if you are patient.
  • It is easier to use i386 since that's all rustboot emitted. There's some indication in the Makefile of support for multilib-based builds from x86-64 (I honestly don't remember if my desktop was 64 bit at the time) but 32bit is much more straightforward.
  • So: docker pull --platform linux/386 debian/eol:squeeze gets you an environment that works.
  • You'll need to install rust's prerequisites also: g++, make, ocaml, ocaml-native-compilers, python.


rust


The next problem is figuring out the code to build. Not totally trivial but not too hard. The best resource for tracking this period of time in rust's history is actually the rust-dev mailing list archive. There's a copy online at mail-archive.com (and Brian keeps a public backup of the mbox file in case that goes away). Here's the announcement that we hit a fixpoint in April 2011. You kinda have to just know that's what to look for. So that's the rust commit to use: 6daf440037cb10baab332fde2b471712a3a42c76. This commit still exists in the rust-lang/rust repo, no problem getting it (besides having to copy it into the container since the container can't contact github, haha).

LLVM


Unfortunately we only started pinning LLVM to specific versions, using submodules, after bootstrap, closer to the initial "0.1 release". So we have to guess at the LLVM version to use. To add some difficulty: LLVM at the time was developed on subversion, and we were developing rust against a fork of a git mirror of their SVN. Fishing around in that repo at least finds a version that builds -- 45e1a53efd40a594fa8bb59aee75bb0984770d29, which is "the commit that exposed LLVMAddEarlyCSEPass", a symbol used in the rustc LLVM interface. I bootstrapped with that (brson/llvm) commit but subversion also numbers all commits, and they were preserved in the conversion to the modern LLVM repo, so you can see the same svn id 129087 as e4e4e3758097d7967fa6edf4ff878ba430f84f6e over in the official LLVM git repo, in case brson/llvm goes away in the future.

Configuring LLVM for this build is also a little bit subtle. The best bet is to actually read the rust 0.1 configure script -- when it was managing the LLVM build itself -- and work out what it would have done. But I have done that and can now save you the effort: ./configure --enable-targets=x86 --build=i686-unknown-linux-gnu --host=i686-unknown-linux-gnu --target=i686-unknown-linux-gnu --disable-docs --disable-jit --enable-bindings=none --disable-threads --disable-pthreads --enable-optimized

So: configure and build that, stick the resulting bin dir in your path, and configure and make rust, and you're good to go!
root@65b73ba6edcc:/src/rust# sha1sum stage*/rustc
639f3ab8351d839ede644b090dae90ec2245dfff  stage0/rustc
81e8f14fcf155e1946f4b7bf88cefc20dba32bb9  stage1/rustc
81e8f14fcf155e1946f4b7bf88cefc20dba32bb9  stage2/rustc


Observations


On my machine I get: 1m50s to build stage0, 3m40s to build stage1, 2m2s to build stage2. Also stage0/rustc is a 4.4mb binary whereas stage1/rustc and stage2/rustc are (identical) 13mb binaries.

While this is somewhat congruent with my recollections -- rustboot produced code faster, but its code ran slower -- the effect size is actually much less than I remember. I'd convinced myself retroactively that rustboot was produced abysmally worse code than rustc-with-LLVM. But out-of-the-gate LLVM only boosted performance by 2x (and cost of 3x the code size)! Of course I also have a faster machine now. At the time bootstrap cycles took about a half hour each (according to this: 15 minutes for the 2nd stage).

Of course you can still see this as a condemnation of the entire "super slow dynamic polymorphism" model of rust-at-the-time, either way. It may seem funny that this version of rustc bootstraps faster than today's rustc, but this "can barely bootstrap" version was a mere 25kloc. Today's rustc is 600kloc. It's really comparing apples to oranges.
siderea: (Default)
[personal profile] siderea
I have a question about eye safety, maybe someone here can advise me on.

Apropos of the protests going on, I've seen a lot of helpful pointers about preparing for getting tear gassed or pepper sprayed, such as not to wear contacts and to have tight-fitting chemists' goggles. But not wearing vision correction is not an option for those who need it, and the alternative to contacts is glasses, which are apparently incompatible with most eye protection from gas or particulates.

I am aware of the existence of some models of full-face gas mask that have internal mounting hardware for glasses, but in addition to being expensive themselves, they require getting lenses made and fitted to the gas mask (i.e. not compatible with regular glasses). I'm surmising the existence of these means that other, cheaper, spectacle-compatible eye protection doesn't really exist, but I thought I'd ask.

My personal interest in the topic is less about protecting myself from chemical ordnance at protests – I only wish I could attend protests (though if things got spicy in the right location I suppose I could collect my fair share of tear gas at home) – than from wildfire smoke. The conjunction of the No Kings protests and the local air quality alerts from fires in Canada reminded me I should really be doing some preparation in this space.

I'm allergic to smoke. (It turns out it wasn't con crud I kept getting at Pennsic.) My reactivity to smoke only seems to be gradually getting worse over time. So when I've heard reports or seen pictures from the left coast of the sorts of wildfire smog they have there, I'm like "...not enough steroids in the world." I mostly manage this threat by not crossing the Mississippi, but it could happen here. Or upwind of here. It has. If not quite so "blot out the sun" bad, certainly bad enough for me to feel it.

So I've been looking at half-face elastomeric respirators, but that leave eyes unprotected.

Any suggestions?

Edit: I'm getting a lot of suggestions that aren't really helpful because:

1) Most safety goggles are for protection against impact or splashes, and as such literally have vent holes that make them useless against gases and airborne particulates.

2) Involve buying a prescription eyepiece. The whole point of my question was looking for alternatives to buying additional prescription lenses. Like I said, I am already aware of options that entail ordering custom lenses, I am looking for alternatives that don't involve that and are compatible with regular glasses the wearer already has.

There may not be any*, which would be good to know, but that is the question.

Allow me to put a finer point on this. If there is no affordable, readily available option for eye protection against gas/powder attacks for people who are dependent on vision correction, then that implies something important about protest safety that is entirely missing from all of the discourse of the sort that recommends having a gas mask to go to a protest.

* Since posting, I learned the term PAPR, and am now wondering why they're so expensive and whether that's a technology ripe for DIY.

Been a while since I protested

Jun. 13th, 2025 07:20 pm
nosrednayduj: pink hair (Default)
[personal profile] nosrednayduj
This will be #9 it appears.

I'm going to Boston Pride/No Kings, wearing rainbow and carrying protest signs. I re-dyed my hair for the event.

Not really sure how the thing is going to play out, or how long I'll end up staying in a train arrives at 11 AM at Back Bay (I will go out the Clarendon exit). This will put me right on the parade route, where I will watch for a while and then wander over to the Common and see what's up in the protest division. In theory I'm meeting Jocelyn at Back Bay. "Rain mostly before 10 AM", so perhaps we won't even get rained on, or not much.

There are a whole ton of smaller events focusing on the "no kings" aspect closer to the house, and the rest of my family is deciding which of those to go to, if any. I think it's useful to have some smaller events, but there seem to be too many.

Profile

hyperlaze

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Style Credit

Expand Cut Tags

No cut tags