Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
SplitDuck.com Use A/B testing to increase revenue
1

One page of async Rust

from Tony Finch's blog [alt+shift+b] in programming

I’m writing a simulation, or rather, I’m procrastinating, and this blog post is the result of me going off on a side-track from the main quest. The simulation involves a bunch of tasks that go through a series of steps with delays in between, and each step can affect some shared state. I want it to run in fake virtual time so that the delays are just administrative updates to variables without any real sleep()ing, and I want to ensure that the mutations happen in the right order. I thought about doing this by representing each task as an enum State with a big match state to handle each step. But then I thought, isn’t async supposed to be able to write the enum State and match state for me? And then I wondered how much the simulation would be overwhelmed by boilerplate if I wrote it using async. Rather than digging around for a crate that solves my problem, I thought I would use this as an opportunity to learn a little about lower-level async Rust. Turns out, if I strip away as much as possible, the boilerplate can fit on one side of a sheet of paper if it is printed at a normal font size. Not too bad! But I have questions… async fn-damentals pin a task noop context primops, generally primops, minimally contexts and wakers primops, commandingly primops, yieldingly fake sleep in action questions async fn-damentals My starting point was to write: async fn deep_thought() -> u32 { 42 } fn main() { deep_thought(); } playground When I call deep_thought() I immediately get a Future<Output = u32>. As the compiler warns, none of the code in deep_thought() runs, it just constructs a value of an ineffable type which contains the initial state of deep_thought()’s state machine. To actually run it, I need to poll() it. The Future::poll() method has a signature that immediately presents a number of obstacles: fn poll( self: Pin<&mut Self>, ctx: &mut Context<'_>, ) -> Poll<Self::Output> pin a task Unlike normal Rust data...
17th Feb 2026

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from Tony Finch's blog

counting large numbers of events in small floating point registers

In 1978, the ACM published an algorithm by Robert Morris for counting large numbers of events in small registers. It uses one byte to keep track of the approximate logarithm of the count, and randomly increments the logarithm with a probability that scales with the value of the count. You can tune the range and precision of the counter by adjusting the base of the logarithm. Morris suggests pre-calculating a table of probabilities so that no difficult calculations are needed at runtime. Recently I learned from emsenn about a 2009 paper by Miklós Csűrös titled approximate counting with a floating-point counter. It changes Morris’s algorithm to use a binary log-linear counter instead of a pure logarithm. It reminded me of my hg64 log-linear histograms, so I thought it would be fun to implement, especially since the algorithm can be made shorter and faster. representing a counter We need to choose the number of bits to use for the exponent and mantissa of each approximate floating point counter. Typically the exponent will be 5 or 6 bits, corresponding to an unpacked exact counter of 32 or 64 bits. The mantissa will typically be the rest of an 8 or 16 bit integer (though languages such as Zig and C23 allow more adventurous integer sizes). I’ll call the approximate counter type usmol and the unpacked counter type ubig. #define EXPBITS 5 #define SIGBITS 3 typedef unsigned _BitInt(EXPBITS+SIGBITS) usmol; typedef uint32_t ubig; static_assert(sizeof(ubig) * 8 == 1 << EXPBITS, "ubig must match EXPBITS"); It’s straightforward to extract the exponent and mantissa from a usmol counter. Unpacking a usmol into a ubig is slightly tricky. Like hg64 and IEEE754, normal numbers (with a nonzero exponent) have an implicit leading bit, and denormal numbers (exponent is zero) do not. The effect is that small counts are represented exactly in a usmol (up to 2*MANTISSA, covering denormal numbers and exponent == 1), and larger counts are shifted by the exponent. (I don’t need the inverse conversion here, but it is used by hg64 to map a sample to a histogram bucket, truncating the value by shifting right.) #define MANTISSA (1 << SIGBITS) static inline ubig exponent(usmol approx) { return(ubig)(approx / MANTISSA); } static inline ubig mantissa(usmol approx) { return(ubig)(approx % MANTISSA); } static inline ubig unpack(usmol approx) { ubig e = exponent(approx) - 1; ubig m = mantissa(approx) | MANTISSA; return(approx < MANTISSA ? approx : m << e); } bumping a counter Because binary floating point uses logarithms in base 2, we need the probability of incrementing the counter to scale with 2^-e. Specifically, we want the probability of increasing the counter to be 100% when its exponent is 0 or 1, 50% when the exponent is 2, 25% when it is 3, etc. Csűrös does this by getting a random bit e times in a loop and incrementing the counter if they are all zero. A more efficient way to do this on a computer is to get a ubig word full of random bits and count the leading or trailing zeroes. There are a variety of bit scan functions that differ in how they number bits and what they do when the word is entirely zero. The POSIX ffs() family has the advantage of no undefined behaviour, but it weirdly counts from one. However this oddity turns out to match the way denormal numbers give our exponent an off-by-one bias. So for instance, when our exponent is 2 and we want a 50% probability, we want ffs() to return 2 or more. OK, that determines when to increment the mantissa given a particular exponent. But how does the exponent get incremented? Like Csűrös, we put the exponent immediately to the left of the mantissa; when the mantissa overflows, it rolls over to zero and the exponent ticks up. No special cases are needed. The resulting code is short: usmol bump(rng_t *rng, usmol approx) { ubig r = ubig_random(rng); ubig z = (ubig)ffsll((long long)r); ubig e = exponent(approx); return(approx + (z >= e)); } considerations Morris allows you to smoothly tune the allowable range and precision of a counter by adjusting the base of the logarithm. By contrast, Csűrös has very lumpy 2^2^n choice of ranges; that isn’t necessarily bad because it’s normal for programmers to have to choose between uint32_t and uint64_t. Morris uses a lookup table to determine the probability of incrementing, which is tolerable for an 8 bit counter, but it can get large for wider counters. Csűrös just uses a few instructions and bigger counters don’t need much more. So I don’t think either algorithm is clearly better than the other, except that Csűrös has the winning fun factor of bithacking a bespoke floating point format.

4 days ago • 1 votes
fibre broadband anticlimax

How can something that “just works” be so annoying? situation We live in Cambridge off a little road down a drive in shared ownership between us and our neighbouring houses. All the utilities are buried under this drive, including the phone line. anticipation Over the last few years we have been canvassed repeatedly by CityFibre saying that they can deliver fibre all way to our house. I saw them digging trenches and leaving tails of purple fibre cladding along nearby roads, ready to hook up all the houses. I thought they would need to do something similar to deliver fibre to us. So when they turned up and knocked on our door, I talked to their salesbods and walked them up and down the drive and pointed out where the existing BT line goes. Then they gave up trying to sell to us. This happened about three times. disaffection We were not eager enough for an upgrade to deal with these impediments. notification A few months ago we were told that CityFibre would soon come and do the upgrade, since there’s a nationwide deadline for turning off the copper phone network at the end of the year. We expected that this would force them to actually plan some digging works, so we talked to our neighbours about it. We were all ready for some huge faff to follow the next visit by the CityFibre bods. installation CityFibre turned up on the promised morning bright and early. To our enormous surprise, a brown fibre housing was already poking out of the ground next to our copper phone line. It had been fed through 50 metres of 5cm duct without us being aware they were even working on the street. Within a couple of hours, the technicians had drilled through our wall, installed the ONT, blown fibre through the unexpected pipe, plugged in the CPE (superficially identical to the old one), and left telling us to anticipate that it might not work properly until tomorrow. activation Around lunch time, the copper phone line stopped working completely. Some faff ensued, switching all our devices over to the new WiFi network. For a while we thought this was the death of our land line, but in the course of debugging other issues, I realised that the router has a built-in VoIP adapter (I don’t think we were told it has a built-in VoIP adapter) so I plugged the phone in and it Just Worked: they had ported our phone number across and everything. Flawless. I was seriously impressed. rumination It has been a few weeks since the switchover, and apart from a couple of horrible Clown-afflicted IoT devices, it has been fairly smooth. What prompted me to write this up was realising that we delayed this upgrade for years because the sales people were not given enough technical information about how the installation process works: the fact that houses typically have a 5cm duct containing the copper lines (probably standard for the last 40 years) and the fact that fibre can be shoved through a few tens of metres without difficulty. And worse, the sales people didn’t have an esclation path for difficult cases: they just gave up instead. From a technical point of view, the installation was impeccable. (I guess the loose 24 hour window for the cutover time was because OpenReach and CityFibre don’t have tight requirements on ISP reconfiguration schedules.) From the sales point of view, it was crap. Maybe it would have gone faster if we offered to switch early without asking if the drive would be a problem? But I guess the difference between “yes!” and “yes, but will this be a problem?” is too much to expect from a minimum-wage door-to-door salesbod whose employer didn’t give them enough information or any escalation path.

17th Sep 2026
Counting the days, revisited

Many years ago I wrote about how to convert Gregorian dates to Julian Day numbers or similar counts such as rata die as used in Calendrical Calculations. This algorithm is the core of C’s mktime() function that converts a broken-down date-time into linear time_t. I recently learned from Ben Joffe that I was missing a few tricks, and my old code wasn’t as good as it could have been. Here’s a better version (using conventional not C numbering): if m > 2 { m -= 2; } else { m += 10; y -= 1; } y*365 + y/4 - y/100 + y/400 + m*979/32 + d - 336 the main idea Julian years Gregorian correction the month pattern the epoch domains and ranges leap year test length of month the main idea There’s a helpful coincidence in the Gregorian calendar. Although the month lengths aren’t obviously regular, there’s a repeating 5 month pattern that becomes easier to see when you start from March, as illustrated by the table below. This pattern resets at the end of February, midway through its third repeat, coincidentally at the same point that leap days occur. Thus the first line of the code above adjusts the month and year numbers so that January and February are counted at the end of the previous year, and the coincidental alignment occurs at the boundary between the adjusted year numbers. I’ll explain the details of the adjustment as I discuss the relevant parts of the second line 31 days April 30 days May 31 days June 30 days July 31 days 31 days September 30 days October 31 days November 30 days December 31 days 31 days February 28 or 29 Julian years The first part of the main formula counts the number of days before the start of year y, in terms of normal years and leap days. y * 365 + y / 4 The adjustment subtracts one from the year in January and February. The effect is that the leap day in year 4 is counted as a day before the start of the adjusted beginning of year 4, i.e. before March, i.e. exactly the right place. I previously combined this part of the expression into a single term, y * 1461 / 4 Ben Joffe pointed out that when it is written this way the function is only able to make use of 25% of the range of its output data type, because the multiplication overflows for very large year numbers. And on modern CPUs it isn’t actually faster to eliminate the addition. Gregorian correction The next part corrects the number of leap years before the current year. - y/100 + y/400 It works in basically the same way as the Julian leap year calculation, but whereas y/4 trivially compiles to a simple shift operation, this needs a bit more cleverness. As Hacker’s Delight explains, a modern compiler will turn y/100 into a multiply-and-shift: y * (1<<N) * (1/25) >> (N+2) That is, the compiler uses a fixed-point representation of the reciprocal of the divisor. Then it uses common subexpression elimination to suppress the second multiplication by 1/25. So these two divisions are turned into a wide multiply and two shifts. Neat. the month pattern The next part counts the number of days in this (adjusted) year before the start of month m. m * 979 / 32 I previously wrote it using the number of days in the repeating pattern of 5 months, m * 153 / 5 But this is relatively difficult for compilers to optimize well (clang uses two multiplications instead of one), and they don’t know the range of m is limited, so we can do better by turning it into a multiply-and-shift by hand. 979/32 == 30.59375 which is close enough to the exact value 153/5 == 30.6 Either of these expressions produce the right 5 month long/short pattern, but the pattern doesn’t necessarily line up with the normal month numbering. (The two expressions above need different adjustments.) We move March to number 1, just before the start of the pattern. When counting the days before April, we get 31 more than the count for March; when counting the days before May, we get 30 more than the count for April, etc. January is adjusted to follow December to match the adjusted year numbering. m *979/32 diff -------------------- 1 30 March 2 61 31 April 3 91 30 May 4 122 31 5 152 30 6 183 31 7 214 31 8 244 30 9 275 31 10 305 30 December 11 336 31 January 12 367 31 13 397 30 the epoch Because calendars count from 1, the Gregorian date 0001-01-01 gets numbered rata die 1. The adjustments turn January into month 11, and so (as in the second column in the table above) we count 336 days in the adjusted year 0 before January. We need to subtract those extra days to compensate for the adjustment. We can change the offset to choose a different epoch, e.g. the MJD epoch 1858-11-17 is r.d. 678576, and the Unix epoch 1970-01-01 is r.d. 719163. domains and ranges In my old C code I casually used int, which misleadingly implied that it worked with proleptic Gregorian calendar dates before year 1. However signed division and modulus on common CPUs and low-level programming languages truncates towards zero, but this algorithm needs Euclidean or flooring division (which are equivalent for positive divisors). So it’s better to use u32 for these calculations. (Compilers also do a better job when this code uses unsigned integers.) To support negative years, a multiple of 400 years can be added to move year 0 to the middle of the u32 range, and subtracted from the return value to produce a signed count of days. leap year test Ben Joffe also examined fast leap year tests. My new favourite one is I think the neatest if not the fastest: if y % 25 == 0 { y % 16 == 0 } else { y % 4 == 0 } Note that 25 * 16 == 400, so it’s a leap year if it’s divisible by both 25 and by 16, else if it’s divisible by 4 but not by 25. The classic version of this check first tests divisibility by 100. CPUs that rely on branch prediction will correctly predict it 99% of the time: much better than the 75% you get from testing divisibilty by 4 first! But nowadays this if is compiled into a CMOV or CSEL (so branch prediction doesn’t matter), and divisibility by 25 is easier to compile than divisibility by 100. length of month What prompted me to revisit this code was the idea that it’s possible to work out a simpler multiply-and-shift optimization when the values have limited ranges (as in m*979/32 above) and/or when we don’t depend on the exact result of the multiplication. I previously wrote this code for calculating the length of a month: if m == 2 { 28 + is_leap_year(y) as u32 } else { 30 + (m * 275 % 9 > 3) as u32 } The multiply-and-shift idea led me to this replacement for months other than February: 30 + (m * 7 % 16 < 9) as u32 I found it by writing a brute force program that tries successive bitmask widths and multipliers, until it finds a case where all the long months produce results greater than all the short months, or vice versa (as in the winner). But there’s a neater expression, apparently due to Dr Matthias Kretz: 30 | (m ^ (m >> 3)) This uses two tricks: The 1 bit of the month number matches the odd/even long/short pattern in the months before August (month 8), when the phase flips. The flip is done by using the 8 bit to toggle the 1 bit. Bitwise or with 30 sets bits 2, 4, 8, 16 so the higher bits of the month number don’t matter. It compiles to just two ARM instructions: eor w0, w0, w0, lsr #3 orr w0, w0, #0x1e It’s so sweet I actually love how much better it is than my attempt!

9th Aug 2026 • 1 votes
poached eggs

A few weeks ago I was enjoying a couple of boiled eggs (in the shell, with plenty of salt and pepper, and buttery fingers of toast to dunk into the runny yolk) and pondering how fiddly it is to cut off one end of the shell after boiling compared to eating a poached egg. And I was annoyed because (I thought) I didn’t know how to poach eggs. misconceptions For decades I have been under the impression that poached eggs are difficult, because cheffy bods on the telly make such a fuss over cooking them. They led me to believe two falsehoods, both of which have a grain of truth, but it turns out they are not the overwhelming obstacles I thought. I decided to see what happens if I just don’t do any of the chef tricks. How bad could it be? If the poached eggs turned out to be a disaster, I would at least have confirmed what I believed. If not, I have added some delicious food to my repertoire. What did I believe? And what did I learn… If you just break an egg into boiling water, it’ll dissolve into a soupy mess? Yes the egg will spread out and the water will get messy, but almost all of the egg will hold together neatly by itself. If you don’t do the cheffy faff, your poached eggs will be inedible? In fact the fuss is mostly about levelling up from basic to restaurant-standard presentation. A no-fuss but frilly egg is still nice to eat. basic tricks The key trick for boiling an egg is to have plenty of boiling water in the pan before adding the eggs. That gives you a stable temperature and therefore predictable cooking times. To boil large hen eggs from room temperature, I aim for about 4 minutes for a runny yolk, or 8 minutes for a slightly fudgy hard-boiled yolk. For poached eggs, the water should be at a gentle simmer to avoid agitating the wispy white more than necessary. I add plenty of salt for seasoning. A cooking time of 3 minutes is about right. The key trick for poaching eggs is not to worry about the wispy whites in the water. It might be messy but it’ll be fine. Break the eggs near the surface of the water so they aren’t agitated too much from plunging in. When the surface of the white has started coagulating, give them a nudge to make sure they are moving enough to cook evenly and aren’t stuck to the bottom of the pan. Unlike a boiled egg, I can lift the poached egg out of the water with a slotted spoon and jiggle it to judge when it is ready, which is better than relying on my oven timer that can only be set in increments of a whole minute, and handy when I forget to set it… cheffy faff There are about half a dozen ways to improve the presentation of poached eggs. Use very fresh eggs, because they hold their shape better with less wispy white. I only have supermarket eggs, so egg age is not something I can control. Use a fine mesh strainer to separate the loose wispy white from the firm inner white. I think watching this trick taught me that raw eggs are a lot more cohesive and robust than I thought, and they don’t just dissolve into water. Get the water spinning like a vortex before adding the egg. Helen Rennie has a video on poaching eggs in which she discusses why this method is better in a restaurant (after about 6m10s). It requires a very large pot so it isn’t ideal for cooking a few portions at home. Break the egg into a small dish or ladle, so it can be introduced to the water more gently. This is worth doing but nevertheless I don’t bother :-) Add a little vinegar to the water. I don’t believe this has any effect on how the whites spread. It’s possible to use vinegar to coagulate the whites before poaching, but this requires a lot of vinegar and takes a long time, and harms the flavour of the eggs. Most of the spreading of a poached egg is due to turbulence when it plunges into the water, and it happens far too fast to be affected by a little vinegar. Wrap the egg in cling film. I don’t care enough about how neat my eggs are to fiddle with throwaway plastic and risk spilling egg in a clumsy mess. We have some reusable silicone things that cook eggs in a style somewhere between poached and coddled. We almost never use them because they are fiddly and tend to undercook the tops of the eggs even with a lid to keep the steam in. Trim the egg with a knife after cooking. Almost as wasteful as the strainer method! Or… don’t! thoughts In retrospect it’s curious that I was discouraged from even trying to poach eggs for such a long time, and that it took so little to discourage me. I suppose it illustrates how offputting extra steps can be to a beginner. It wasn’t clear to me which steps were optional and what were the consequences of omitting them. It’s something to keep in mind when writing documentation, I guess :-)

14th Mar 2026 • 1 votes

More in programming

Atria Snowflakes

In honor of the upcoming winter season, I designed a set of five crochet snowflakes that hold their shape fairly well without stiffening, as I don't like to stiffen my crochet objects.1 I originally designed these five snowflakes for fingering weight linen yarn, but I decided later to also ensure they worked well with lace weight yarn and size 10 crochet thread. Please do not claim this pattern as your own or sell, copy, or distribute it outside of linking to the pattern on my site or its Ravelry pattern page. You may sell items made from this pattern if you name the pattern and credit me as the designer: Atria Snowflakes by Liz Denys. Thank you so much for respecting my work! This pattern is also available as a pdf. Materials & tools *Note that estimates for the amount of yarn needed are included later in the pattern for each of the snowflakes. Lace weight snowflakes: Lace weight linen yarn or size 10 cotton crochet thread, some suggestions, including twist direction2 information: Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/2 (lace)3 (s-twist) Maiwa Honest Yarn Organic Linen in lace weight (s-twist) Euroflax linen lace weight (s-twist) Aunt Lydia's Classic 10 crochet thread4 (z-twist) Scheepjes Maxi Sweet Treat/Maxi Sugar Rush/Maxi5 (z-twist) Laughing Hens Daisy Crochet Cotton, (s-twist) 1.75 mm hook Fingering weight snowflakes: Fingering weight linen yarn, some linen yarn suggestions: Quince Sparrow (s-twist) Flax and Twine Daytime Linen in fingering weight (s-twist) Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/4 fingering weight (s-twist) Maiwa Honest Yarn Organic Linen in fingering weight (s-twist) 2.5 mm hook Other materials & tools: scissors yarn needle for weaving in ends blocking mats and pins a bit of metallic embroidery or sewing thread for adding a hanging loop, optional Stitches & abbreviations I use US crochet terminology. ch - chain: yarn over and pull through the loop on the hook slst - slip stitch: place hook in stitch and pull through both stitch and the loop on the hook sc - single crochet: place hook in stitch and pull through (2 loops on the hook), yarn over and pull through the loops inc - single crochet increase: 2 sc in the same stitch hdc - half double crochet: yarn over, place hook in stitch and pull through (3 loops on the hook), yarn over and pull through all 3 loops dc - double crochet: yarn over, place hook in stitch and pull through (3 loops on the hook), yarn over and pull through 2 loops (2 loops left on the hook), yarn over and draw through the last 2 loops tr - treble crochet: yarn over twice, place hook in stitch and pull through (4 loops on the hook), yarn over and pull through 2 loops (3 loops left on the hook), yarn over and pull through 2 loops (2 loops left on the hook), yarn over and draw through the last 2 loops ch-2-sc-cluster - ch 2, sc in the front of the 2nd chain from your hook. Note: this stitch will twist the hook around the front of the work as the yarn is pulled through the 2nd chain from the hook during the sc. This is intentional! I've also seen this "cluster" type stitch called a "group" stitch sometimes.6 (...) x $num and * (...) * x $num - repeat instructions in the parenthesis $num times (the asterisks are included in long/split lines for increased legibility) {...} - enclosed stitches are all done in the same stitch in the chain space - work stitches around the entire chain instead of in the loops of the chain; this may involve more or fewer stitches than the number of stitches in the chain in the single-chain space - work stitches around the entire chain stitch instead of inside the loops of the chain (yes, even though it's just a single chain stitch) Atria Snowflake I Lace weight Atria Snowflake I: Roughly 4 yards/3.7 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 1 ⅝ inches by 1 ½ inches/4.1 cm by 3.8 cm7 Fingering weight Atria Snowflake I: Roughly 4.3 yards/4 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ⅛ inches by 1 ⅞ inches/5.4 cm by 4.8 cm Instructions for Atria Snowflake I Foundation & round 1: In magic ring8, ch 8 (first 3 chains count as the 1st dc9), dc, (dc, ch 5, dc) x 5. slst into the 3rd chain of 1st dc to join the round10. (12 dc + 6 chain spaces) Round 2: sk the stitch you slipped into to join the last round, {slst, sc, hdc, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, hdc, sc, slst} in the chain space, ch-2-sc-cluster, sk, * ( sk, {slst, sc, hdc, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, hdc, sc, slst} in the chain space, ch-2-sc-cluster, sk ) * x 5. slst into the 1st slst in the first chain space to join the round. (48 stitches + 24 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake II Lace weight Atria Snowflake II: Roughly 4.7 yards/4.3 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 1 ¾ inches by 1 ½ inches/4.5 cm by 3.8 cm Fingering weight Atria Snowflake II: Roughly 5.5 yards/4.8 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ⅝ inches by 2 ¼ inches/6.7 cm by 5.7 cm Instructions for Atria Snowflake II Foundation & round 1: In a magic ring, ch 2 (this counts as the 1st dc11), 11 dc. slst into the second ch of 1st dc. (12 dc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, sk, ({dc, ch 5, dc}, sk) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch-2-sc-cluster, tr, dc, hdc} in the chain space, sc in the next dc, ch-2-sc-cluster, * ( sc in the next dc, {hdc, dc, tr, ch-2-sc-cluster, tr, dc, hdc} in the chain space, sc in the next dc, ch-2-sc-cluster ) * x 5. slst into the 1st sc to join the round. (48 stitches + 12 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake III Lace weight Atria Snowflake III: Roughly 6 yards/5.5 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 2 ¼ inches by 2 inches/5.7 cm by 5.1 cm Fingering weight Atria Snowflake III: Roughly 6.9 yards/6.3 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ¾ inches by 2 ⅜ inches/7.0 cm by 6.0 cm Instructions for Atria Snowflake III Foundation & round 1: In a magic ring, 6 sc. slst into the 1st sc. (6 sc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, ({dc, ch 5, dc}) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, sc in the next dc, * ( sc in the next dc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, sc in the next dc ) * x 5. slst into the 1st sc to join the round. (48 stitches + 6 single-chain spaces) Round 4: sk the stitch you slipped into to join the last round, slst into the next stitch (this is an hdc), 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space12, 3 slst, ch-2-sc-cluster, sk, * ( sk, 3 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space13, 3 slst, ch-2-sc-cluster, sk ) * x 5. slst into the slst14 you made to join the past round (the first stitch that was skipped this round). (60 stitches + 24 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake IV Lace weight Atria Snowflake IV: Roughly 9.3 yards/8.5 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 3 inches by 2 ½ inches/7.6 cm by 6.4 cm Fingering weight Atria Snowflake IV: Roughly 11.5 yards/10.5 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 3 ¾ inches by 3 ⅛ inches/9.5 cm by 7.9 cm Instructions for Atria Snowflake IV Foundation & round 1: In a magic ring, 6 sc. slst into the 1st sc. (6 sc) Round 2: ch 2 (this counts as the 1st sc), sc into the same stitch joined in last round, 5 inc. slst into the 2nd chain of 1st sc to join the round. (12 sc) Round 3: ch 6 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, sk, ({dc, ch 3, dc}, sk) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 4: sc into the same stitch as you slipped into to join the last round, {hdc, dc, ch 3, dc, hdc} in the chain space, sc in the next dc, ch 3, * ( sc in the next dc, {hdc, dc, ch 3, dc, hdc} in the chain space, sc in the next dc, ch 3 ) * x 5. slst into the 1st sc to join the round. (36 stitches + 12 chain spaces) Round 5: sk the stitch as you slipped into to join the last round, sc, hdc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, hdc, sc, sk, {hdc, ch 1, hdc} in the chain space, * ( sk, sc, hdc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, hdc, sc, sk, {hdc, ch 1, hdc} in the chain space ) * x 5. slst into the 1st sc of this round (second stitch) to join the round. (72 stitches + 12 single-chain spaces) Round 6: sk the stitch you slipped into to join the last round15, slst into the next stitch (this was the 1st hdc in the previous round), slst, ch-2-sc-cluster, sk, slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space16, slst, ch-2-sc-cluster, sk, 4 slst, {slst, ch-2-sc-cluster, slst} the single-chain space17, slst, * ( 3 slst, ch-2-sc-cluster, sk, slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space18, slst, ch-2-sc-cluster, sk, 4 slst, {slst, ch-2-sc-cluster, slst} in the single-chain space19, slst ) * x 5. slst into the slst20 you made to join the past round (the first stitch that was skipped this round). (96 stitches + 36 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block. Atria Snowflake V Lace weight Atria Snowflake V: Roughly 13.9 yards/12.7 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 3 ¾ inches by 3 ⅛ inches/9.5 cm by 7.9 cm Fingering weight Atria Snowflake V: Roughly 16.8 yards/15.4 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 4 ½ inches by 3 ⅞ inches/11.4 cm by 9.8 cm Instructions for Atria Snowflake V Foundation & round 1: In a magic ring, ch 2 (this counts as the 1st dc21), 11 dc. slst into the second ch of 1st dc. (12 dc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc, (dc, ch 5, dc) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch 3, tr, dc, hdc} in the chain space, sc in the next dc, * ( sc in the next dc, {hdc, dc, tr, ch 3, tr, dc, hdc} in the chain space, sc in the next dc ) * x 5. slst into the 1st sc to join the round. (48 stitches + 6 chain spaces) Round 4: sc into the same stitch as you slipped into to join the last round, 3 sc, {sc, ch 3, 3 tr, ch 1, 3 tr, ch 3, sc} in the chain space, 4 sc, ch 3, * ( 4 sc, {sc, ch 3, 3 tr, ch 1, 3 tr, ch 3, sc} in the chain space, 4 sc, ch 3 ) * x 5. slst into the 1st sc to join the round. (96 stitches + 18 chain spaces + 6 single-chain spaces) Round 5: sk the stitch you slipped into to join the last round22, slst into the next stitch (this was an sc last round and an hdc the round before that), 3 slst, {slst, ch-2-sc-cluster, slst} in the chain space, ch-2-sc-cluster, sk, 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space23, 2 slst, ch-2-sc-cluster, sk, {slst, ch-2-sc-cluster, slst} in the chain space, 5 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the chain space, * ( 5 slst, {slst, ch-2-sc-cluster, slst} in the chain space, ch-2-sc-cluster, sk, 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space24, 2 slst, ch-2-sc-cluster, sk, {slst, ch-2-sc-cluster, slst} in the chain space, 5 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the chain space ) * x 5. slst into the slst25 you made to join the past round (the first stitch that was skipped this round). (156 stitches + 60 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block. Blocking In my experiences, Atria Snowflakes I, II, and III don't necessarily need traditional blocking - you may be able to just pull on opposite corners of the snowflakes to pop the stitches into place. Atria Snowflakes IV and V will need to be blocked to pop into the right shape. To block, run snowflakes under cold water and lightly shake off excess water. With pins at the points, stretch snowflakes into shape and affix to blocking mats. Linen and cotton are both cellulose fibers and become stronger when wet, so it's hard to block too aggressively! Let the snowflakes dry completely before removing them from the mats and pins. Adding a hanging loop (optional) To add a loop for hanging, cut a piece of metallic embroidery thread or a yarn you like that's about 7 inches/17.8 cm. Thread it onto a yarn needle, and pull it through the loop atop any of the ch-2-sc-clusters at the end of one of the 6 main points of the snowflake. Hold both ends of the thread and tie a simple overhand knot. To be clear, there's nothing wrong with stiffening crochet designs - it opens up many additional design possibilities! Unfortunately, the downsides of stiffening are too great for me. Starching or sugaring attracts the kinds of unwanted critters that are already all too common in Brooklyn. Stiffening with diluted PVA or wood glue yellows over time, and yellow snowflakes remind me of the kind of snow I'm not nostalgic for. ↩ s-twist yarn will untwist if you are a right-handed crocheter and stay twisted (actually twist a bit more) if you're left-handed; z-twist will untwist if you are a left-handed crocheter and stay twisted (actually twist a bit more) if you're right-handed. Yarn that untwists as you crochet may be harder to hook due to splitting and results in decreased stitch definition like the linen snowflakes in my examples; yarn that stays twisted is easier to hook and results in increased stitch definition. I love linen yarn for its sheen, durability, and stiffness, and I learned to knit over a decade before I learned to crochet, so I am biased towards using linen yarn - even though I am right-handed and almost all linen yarn is s-twist. It's much more common for crochet thread to be z-twist than plant-based yarns, but not all crochet thread is z-twist. ↩ If you get this in a quantity that doesn't come on a cone, I highly recommend rewinding this yarn onto a cone or, at the very least, inserting a cone-like core like the tube from an empty paper towel or toilet paper roll into the center of the ball. Otherwise, you likely will suffer the same frustrating fate I did until I rewound it onto a toilet paper tube - yarn constantly unraveling from both ends while working. ↩ I use Aunt Lydia's primarily because it's very easy for me to find and because it makes sense for me to pick a z-twist crochet thread as a right-handed crocheter. ↩ From Scheepjes: "Did you know that Scheepjes Maxi, Maxi Sweet Treat and Maxi Sugar Rush are identical yarns? The only difference is the meterage supplied per ball." ↩ In my head, I've come to refer to this particular "cluster" stitch as a "triangle" stitch, since it takes up the same space as a ch 3 picot but in a flatter, more defined triangle shape. My mentally calling it a "triangle" stitch inspired the name of this snowflake since one of the design decisions I kept constant across this set was choosing this stitch for all the points. I briefly considered calling this stitch "triangle" in this pattern, but I figured I'd rather keep the name more descriptive of how it's made to be consistent with my larger internal library of stitches that may or may not appear in future patterns. :) ↩ Aunt Lydia's Classic 10 crochet thread is a little thicker than Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/2, so my crochet thread snowflakes were a little larger than these sizes, and my lace weight linen yarn snowflakes were a little smaller than these sizes. ↩ I actually do a double magic ring every time because it pre-weaves in more of this end (the tradeoff is that it wastes more yarn to do so). Once Upon a Cheerio's tutorial explains double magic ring fairly well, especially how to tighten it, but I start my double magic rings more similarly to how Sarah Stearns's tutorial depicts it. If you really hate magic ring, you could instead ch 4 then slst in 1st ch to create a ring, but I promise that magic ring is not as hard as some people make it out to be. I am not usually a video person, but I learned how to make a magic ring from MJ Carlos's video tutorial. ↩ You could do standing double crochet for first double crochets instead of chains if you really want, but I don't think the difference between chains and double crochets is noticeable enough to bother. While I usually do ch 2 as the 1st dc in magic ring, I prefer the look of ch 3 next to the chain spaces. ↩ You could do an invisible join instead of slip stitches to join rounds if you really wanted to, but while I think it's worth the effort in a simpler fabric, making slightly subtler joins isn't worth the hassle in designs with varied stitches and shaping like these snowflakes. ↩ While I usually do ch 3 for the 1st dc in a round, I find ch 2 works better for me when it's the first stitch in a magic ring of just double crochets. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ See footnote 12. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩ In this round, this would be a slst if it weren't already slipped into to join the round, and here, the slip to join counts as a stitch. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the half double crochet from the previous round will ensure the point is secured in place. ↩ See footnote 16. ↩ See footnote 17. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩ While I usually do ch 3 for the 1st dc in a round, I find ch 2 works better for me when it's the first stitch in a magic ring of just double crochets. ↩ In this round, this would be a slst if it weren't already slipped into to join the round, and here, the slip to join counts as a stitch. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ See footnote 23. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩

8 hours ago • 1 votes
SumatraPDF new features: July 10, 2026

SumatraPDF is a PDF reader for Windows and Mac. New in the pre-release builds: Floating selection toolbar After you select text, a small toolbar appears next to the selection with Copy, Read Aloud, Highlight, Underline, Squiggly and Strike Out. The annotation buttons only appear for documents that support annotations. Turn it off with the SelectionToolbar advanced setting. It was ported from the SumatraPDF Plus fork. Clearer CAD / engineering drawings PDFs of CAD and engineering drawings are easier to read, especially when zoomed out. Very thin lines get a minimum width that depends on zoom, and pale gray lines are darkened. Turn it on with the EngineeringDrawingEnhance advanced setting: auto enhances drawings it detects, on enhances every PDF and off is the default. You can also turn it on or off per document with Toggle Engineering Drawing Enhancement (CmdToggleEngineeringDrawingEnhance) in the command palette. More: changes from July 10, 2026 and the full changelog.

16 hours ago • 1 votes
AI is making capital & labor interchangeable

For the first time in human history, capital and labor are becoming directly fungible for more tasks

2 days ago • 1 votes
What’s fixed in RestAssured.Net 5.2.0

Last week, I released version 5.2.0 of RestAssured.Net. It contains fixes for no less than 23 issues, the largest number of bug fixes in a single release by a long margin. All 23 bugs were found and fixed by Claude, under my strict supervision. I will describe the process I used to find and fix the issues in more detail in an upcoming newsletter issue, but I think it could be useful to give a short overview of all the fixes in 5.2.0 beyond what’s in the CHANGELOG, so here goes. Sending requests Requests without a body no longer send a JSON content type (#161) GET, DELETE and HEAD requests (and any other request without a body) used to be sent with Content-Type: application/json and an empty body, which some servers, gateways and firewalls reject. Requests without a body are now sent without one, so what goes over the wire is what you wrote in your test. Values in the request now take precedence over the request specification (#153, #179) When a header, content type or other setting was set both in a RequestSpecification and in the request itself, the specification won. It’s now the other way around: a specification provides defaults, and the request can always override them. The path in a base URI is no longer dropped (#160) WithBaseUri("http://host/api") silently ignored the /api part, so requests went to the wrong path. The path is now included, and the BaseUri property of the specification shows the URI you configured. Relative endpoints with a query string are sent to the right path (#159) With a request specification, Get("/users?id=1") was sent to /users%3Fid=1, because the question mark was encoded as part of the path. The query string is now sent as a query string. Trailing slashes in endpoints are kept (#172) With a request specification, Get("/users/") was sent to /users. Some APIs treat these as different resources, so the slash is now kept. Collections in query parameters send their values (#167) Passing a list as a query parameter value sent the name of the collection type (System.Collections.Generic.List...) instead of its contents. Each value is now sent as a separate parameter, for example ?id=1&id=2. Square brackets that aren’t path parameters are left alone (#154) Any text between square brackets in an endpoint, such as filter[name]=x, was treated as a path parameter placeholder. Only placeholders for path parameters you actually supplied are replaced now, and their values are no longer HTML-encoded. Basic authentication supports non-ASCII characters (#168) Credentials were encoded as ASCII, so characters like ü or € were sent as ? and authentication failed. Credentials are now encoded as UTF-8. Your own cookies are no longer modified (#175, #183) A Cookie object passed to a request was changed while the request was sent: its domain was set to the request host. A cookie reused for another host then silently wasn’t sent. RestAssured.Net now works on a copy, and request cookies are logged with the domain they’re actually sent for. Using your own HttpClient Timeouts, cookies and other settings now work with your own HttpClient (#156) When you passed your own HttpClient, timeouts and cookies were silently ignored, and setting a timeout could even crash on a client that had already been used. Timeouts and cookies now work without changing your client. Proxy, SSL and NTLM settings can’t be applied to a client you created yourself, so setting them on the request now throws a clear exception instead of being ignored; settings from a specification or the global configuration log a warning. Verifying and extracting responses Cookie checks only pass for cookies the server actually set (#155) The cookies you sent with the request were mixed with the cookies in the response, so verifying or extracting a cookie could pass even when the server never set it. Only cookies set by the server are seen as response cookies now. All response headers can be verified and extracted (#162) Headers that describe the body, such as Content-Disposition, Content-Type and Last-Modified, couldn’t be found with Header(), because .NET stores them separately. Header() now finds every header in the response. XML and HTML assertions work the same on every machine (#163) A value like 1.5 in an XML or HTML body was read using the language settings of the machine, so on a Dutch or German machine it became 15 and assertions failed. Values are now always read the same way, regardless of the machine’s culture. Response body length is measured in bytes (#169) ResponseBodyLength() was documented as counting bytes, but counted characters, which differs for bodies with non-ASCII characters. It now counts bytes, so the value matches the Content-Length header. Square brackets in custom error messages are kept (#170) Custom error messages treated any text in square brackets as a template tag, so a message like [TICKET-123] status was [actual] lost its ticket reference. Only [expected] and [actual] are replaced now; all other text stays as you wrote it. Errors keep their original cause (#165) When a request failed, for example because the connection was refused or the certificate was invalid, the original exception was thrown away and every error was reported as “Unhandled exception”. The original exception is now kept as the inner exception, which makes failures in CI much easier to diagnose. Logging Masking sensitive data can no longer be bypassed (#158) Headers and cookies configured as sensitive could still end up in the logs, for example when the casing of the header name differed, or as part of a Cookie or Set-Cookie header. Sensitive values are now masked in all of these cases. Logging no longer crashes on invalid JSON or XML (#157) With body logging enabled, a response labeled as JSON or XML that wasn’t valid (an HTML error page from a gateway, for example) made the request fail. Bodies that can’t be parsed are now logged as they are. All content headers are logged (#185) Only Content-Type and Content-Length were logged from the headers that describe the body, so headers like Content-Disposition and Content-Encoding were missing from the log. All of them are logged now, and they can be masked like any other header. Response times are logged the same way everywhere (#182) The response time in the log used the decimal separator of the machine’s culture, for example 3,75 ms on a Dutch machine. It’s now always logged with a period, so logs look the same on every machine. The logger is only called when there’s something to log (#174) With logging switched off, a custom logger was still called twice per request, with empty messages. It’s now only called when there is actually something to log. As you can see from the list above, RestAssured.Net just got a lot better and/or more consistent and/or more compliant with documented HTTP behaviour with version 5.2.0. There are still quite a few open issues, but I decided to leave those for the next release, which hopefully sees the light of day in the next few weeks.

2 days ago • 1 votes
Jenni joins Digital Science: a four-year retrospective

In October 2026 Jenni was acquired by Digital Science. A personal reflection on four years as founding designer, from $4k to $730k in monthly revenue.

3 days ago • 1 votes
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in