Posts in Java (20 found)
マリウス 3 days ago

How to Import Paintings Tax Free on Your Private Jet

Disclaimer: Everything in here is either public record, court filings, published reporting or the published position of a tax authority. Consult someone with a far fancier office than mine before attempting any of it, ideally the same person who sold you the jet. As usual, the summary is at the end. If you are one of the regular people who happen to own a private jet , and you have wondered what else the thing is good for besides the usual family vacations, then I have a few ideas for you. The first and most obvious one doesn’t need any complex structures, let alone an adviser. You simply buy a painting abroad, put it in the cabin, land at home and carry it to the car, and you conveniently skip talking to a customs officer that will charge you import tax on it. This whole private jet importing is pretty common and people have done it for a long time. A relatively recent example is the Swiss financier Urs Schwarzenbach, owner of the Dolder Grand hotel in Zurich, who brought works of art into Switzerland for years on his private jet , by landing at Zurich (or at Samedan near St. Moritz) without declaring them, or by declaring them at a fraction of their actual value. And I’m not talking about a souvenir or two. According to Swiss press reports relayed by AFP , the case concerned more than 200 works of art with a combined value of at least 130 million francs (a franc was worth about a dollar at the time), a Malevich valued at 16 million among them. One of them, a Segantini, bought at Christie’s for 1.4 million francs, was reportedly flown to Britain first, which avoided the Swiss tax on the purchase, and later reappeared in his villa in St. Moritz without the tax on the import having ever been paid. What he was caught with at Zurich Airport in September 2012, however, was a painting worth 300,000 francs and an antique elephant-shaped object worth 11,300, in his luggage , and it was this catch that put him under scrutiny in the first place. He “argued that he was simply trying to save time”. In court, as the Swiss newspaper Blick reported , he later said that he had no idea how the works had got to Switzerland, and that the few he had brought along himself were household goods from his move from England, which he didn’t have to declare any more than his underpants. Schwarzenbach, however, ended up paying for it. Customs had accused him of 123 imports of art he hadn’t declared at all and another 27 he had declared below their value, on which more than 3.7 million francs of import tax went unpaid. The courts dropped some of those along the way, but in the end still fined him 4 million francs (roughly $4.5 million at the rate of 2024 ), in an affair that concerned art worth at least 130 million francs in all. A pretty good deal, don’t you think? A second case, which the courts found had run from 2008 to 2013, worked with paperwork instead. In it, works of art were imported for him through a Zurich gallery under a procedure that lets galleries defer the import tax, which the gallery wasn’t entitled to use for his art, and which a court found proven for 75 works . For that scheme he owed about 11.2 million francs of import tax plus 2.5 million of interest, and the courts fined him around 7.1 million (roughly $8 million) on top. However, when customs searched one of his villas in 2013, it turned out that he had been running an art and antiques business from it without ever declaring it, whereupon the canton of Zurich claimed about 270 million francs in back taxes on the income from it. He lost his appeals against back payments of more than 200 million francs (more than $225 million), which is roughly a sixth of the 1.25 billion at which the magazine Bilanz had estimated his fortune (its current list has him at 650 million), and settled his tax debts with the canton in 2024 for a sum that was never disclosed , although the news agency Keystone-SDA expected the canton to receive a three-digit million sum. Funny enough, Schwarzenbach is the “amateur” in this post. He had advisers as well, and his lawyer and the gallery’s co-owner were fined along with him , but he was still the one who walked the goods through customs himself. Besides his fines the courts upheld back taxes of more than 200 million francs on the art trade he had never declared. The steps below, however, range from carrying the painting past the officer yourself to having your advisers book the customs appointment for you, and many of the people in them paid nothing at all, or very little (comparatively), as far as the public record shows. So how do works of art get past customs at an airport to begin with? At Zurich, according to a court decision on the case, Schwarzenbach walked through the green channel , the exit for travelers with nothing to declare, with the painting in his luggage, and seven weeks after customs had searched his villa he did it again, this time with two works of art and a suitcase of 19 antiques. At smaller airports, however, it helps that customs isn’t necessarily there. When a team of the Belgian broadcaster RTBF took a private jet from London to Kortrijk for a report in 2023, its suitcase wasn’t checked even once on its way into the EU. As a member of the airport staff explained, customs don’t come every day but whenever they like, which is easier for the staff and for the passengers. In all of 2022, according to the figures customs gave RTBF, 37 flights were checked at Kortrijk, which turned up four violations, in a year in which the airport counted 3,184 private take-offs and landings to and from abroad, meaning roughly 1,600 arrivals. To be fair, only the ones from outside the EU matter for import tax. A customs spokeswoman pointed out that nobody checks every suitcase at a commercial airport either, as that wouldn’t be efficient. However, I guess we can also agree that customs for commercial flights is at the very least on-site all day, every day, and uses various passenger profiling methods to determine which suitcases are worth checking thoroughly. And in case you doubt that anyone would walk a painting past customs like a suitcase, customs at Milan’s Linate airport saw this happen , as reported in October 2012. The only passenger of a private flight from Zurich had answered the usual question about goods to declare with no, while on his luggage trolley, on top of the other bags and wrapped in tissue paper, was a painting by Lucio Fontana worth about 4.5 million euros. The import VAT on it would have come to about 448,500 euros. A ruling of Italy’s Constitutional Court from 2025 on a case that matches this one (the same airport, the same month, a valuable work of art carried in from Switzerland) says that the passenger was later acquitted, because Italy had meanwhile decriminalized simple smuggling, which left him with an administrative fine. Btw, the same RTBF report found neither a baggage scanner nor a metal detector at the business terminal in Ostend, where the suitcases go into a van and from there straight into the aircraft. Those are security checks and have nothing to do with customs, but when the reporters asked whether one could then bring weapons or drugs along, the flight coordinator laughed and answered that yes, one could. You could probably even bring an automotive CEO without anyone noticing. I definitely wouldn’t recommend trying that at a commercial terminal, but clearly, when you travel with your own private jet, you have certain freedoms that you could otherwise not enjoy, not even flying first class commercially. Also, the UK isn’t any stricter either. Its independent borders inspector found back in 2016 that officers meeting private flights were “focused on immigration controls” , with “little evidence of effective customs controls”. Eight years later the inspector of the day told the press that, according to Home Office data he had seen, only 21 percent of the private jets rated high-risk at London City Airport had been inspected by officers of Border Force , which handles customs as well as immigration, the year before. The Home Office, however, rejected the claim, saying that a large proportion of those flights had been wrongly classified and that all high-risk flights had been cleared, remotely or in person, then dismissed him for breaching the terms of his appointment, and then published his report with the numbers redacted. No wonder the art trade has organized itself around the jet. For Art Basel’s Miami fair in December 2014, the Opa-locka Executive Airport expected more than 1,000 private jets , although the report doesn’t say how many of them came for the fair. A year earlier, however, the county had counted 1,990 take-offs and landings at that airport during the fair, 440 more than in the first eight days of the previous month. And when VistaJet sponsored the exhibition tour that began in late 2017 ahead of a Christie’s sale in spring 2018, it promised anyone who booked all four stops to “transport clients and their art at no additional cost” on its flights. The jet that brings the collector to the fair takes the purchase home, which makes sense, right? What saying nothing saves you depends on where you land. In the United States the answer is nothing, because original works of art enter duty-free under Chapter 97 of the tariff schedule anyway, unless they were made in China , Russia or, since August 2026, Canada of all places. Even the Canadian duty, however, makes an exception for “products for personal use included in accompanied baggage of persons arriving in the United States”. So a gallery that ships a Canadian painting to New York as freight pays 50 percent on it, while a collector who flies it home in the cabin of their own jet would, going by the letter of that exception, pay no duty at all. The European Union’s tariff for 2026 lists works of art as “Free” as well, but Europe charges import VAT at the border, and that’s where the jet comes in handy once more. Keep in mind that even this tax is a discount already, as the EU’s VAT Directive lets a country charge a reduced rate on art. France for example charges 5.5 percent , Italy 5 percent and the UK (not EU anymore) an effective 5 , while Switzerland charges its standard 8.1 percent . Germany even has a section in its VAT law that sets the rate for a new sofa at 19 percent , but at 7 percent for importing a Picasso, which I guess says a lot about priorities. Btw, the sofa in the chart pays the standard rate as listed by the EU and the UK . Schwarzenbach wasn’t the first to figure this out, though. The Saudi arms dealer Adnan Khashoggi flew 16 paintings from the United States via Spain into Nice on his private plane sometime in May or June 1986. He landed early in the morning and had them taken to his yacht Nabila in Antibes without passing the customs office at the airport. Another 21 he declared in March 1987 as originating from Switzerland, on paperwork that, as he admitted, gave neither their real provenance nor their real recipient. His lawyers later argued that paintings are neither prohibited nor heavily taxed goods, and that due to the fact that they landed at an airport with a customs office, which Nice obviously has, it couldn’t be counted as smuggling in the first place. France’s highest court agreed with the first point but upheld the conviction anyway, for the 16 paintings under a different article, although it took until 2002 to get there. He had to pay 8.56 million francs in place of the 16 paintings being confiscated, plus the 447,648 francs of VAT he had skipped, and another 352,000 francs for the 21, amounting to the $1.6 million fine that, according to AFP, a Paris court had ordered in 1997. If you’d rather not carry the painting yourself, you can also ship it and let the paperwork say something creative . When a Basquiat, Hannibal , arrived at JFK in August 2007, from London according to prosecutors and from a warehouse in the Netherlands according to a later court ruling , its airbill and cargo documents described a “painting” worth “$100” . Considering that an appraisal ordered after its seizure put it at about $8 million, the paperwork was off by a factor of roughly 80,000. But it nonetheless worked. The painting entered the country on those documents, and it was only seized three months later, after it had been offered to an American art dealer who alerted Brazilian investigators . Brazil, where the banker it had belonged to had been sentenced for money laundering (a conviction that was annulled in 2015, btw), had asked Interpol to look for it. By the way, in case you’re afraid of heights, a yacht works as well, at least most of the time. The Spanish banker Jaime Botín kept Picasso’s Head of a Young Woman , valued at around 25 million euros and banned from export by Spain, on his schooner Adix , where French customs found it in the port of Calvi on Corsica in 2015, “already packaged up” . It didn’t end well for him, though, as a Madrid court ended up fining him 91.7 million euros and sentencing him to three years, although the prison term was suspended because the 85-year-old was incurably ill. Anyway, as you can see, saying nothing works for as long as nobody asks, which can be years. Years in which you preserved or, in many cases even increased your money’s value. Its weakness, however, is that you have something to hide from an officer, should one ever show up, and as Schwarzenbach and Khashoggi found out, that could get expensive eventually. Obviously, these are only two prominent cases in which circumstances led to their discovery. The next step, however, doesn’t have that problem, because the painting never arrives. In Geneva there is a six-storey warehouse that was estimated in 2013 to hold around 1.2 million works of art, and as far as any tax authority is concerned, not one of those has arrived anywhere. The place is a so-called freeport , which is a bonded warehouse where goods have not formally entered the country. Owners pay no import taxes or duties on what is inside until the goods reach their final destination. A painting can wait a long time for that to happen, or, as swissinfo.ch put it : A painting can be flown in to Geneva and kept at the warehouse for years without having to pay a levy. Funny enough, the majority owner of the Geneva Freeport is the canton of Geneva, to whose coffers the place has been reported to add around 10 to 12 million francs a year. So the state earns money on the one building in which nobody owes it any tax. As for what goes on inside, the deputy director of the Swiss Federal Audit Office remarked in 2014 that “the fact that customs people work at the free port doesn’t mean that the checks are effective”. Since several freeports are at an airport, this is where your jet comes in. Geneva’s has a site at the airport, Singapore’s has direct access to the runways of Changi and a plane-side pick-up service accompanied by guards, and Luxembourg’s, on the edge of Findel airport and known as the High Security Hub since 2020, lets goods enter directly from the tarmac . So where exactly does that leave everything inside? The chief executive of the one in Luxembourg said: We are based in the territory but we are not in the tax territory. This means that the jet lands, the crate then crosses the apron, and the painting has arrived… pretty much nowhere. Oh well. Someone who appears to have known the address by heart is Jho Low. The art bought for him with money the US Justice Department says was taken from Malaysia’s 1MDB fund included a $48.8 million Basquiat. When he was looking to borrow against it in 2014, he assured an art dealer’s employee, as quoted in the department’s forfeiture complaint , that the lender… can take all the art no problems. All in Geneva free port. Besides speed, high on his list was “a fairly quick and relaxed kyc process”, meaning the lender’s checks on who its customer is. For Americans there are options, too. Your first choice in that case is probably the Delaware Freeport in Newark, a designated foreign-trade-zone warehouse in a state with no sales tax. Its founder, Fritz Dietl, explained to NPR in 2018: So for U.S. customs purposes, we have some property here that hasn’t formally entered the United States. I’d argue that a painting which is in Delaware without having entered the United States is probably the most Delaware “Liberty and Independence” thing imaginable. However, the very same idea works in Shanghai as well, as the collector Liu Yiqian found out. He paid for the Ming chicken cup he had bought in Hong Kong in 2014 for HK$280 million on his American Express card in 24 swipes (imagine the reward points!), flew it to Shanghai the next day and put it straight into a bonded art warehouse on the city’s West Bund. Antiques imported into China paid 17 percent VAT at the time, which on the cup would have come to about 40 million yuan, according to The Paper , and none of it is due for as long as the cup stays in bond, even if that means clearing it out and back in on paper after two years. As Liu explained, the warehouse doesn’t make the import tax go away, but he can borrow the cup out for exhibitions for up to six months at a time, after which it goes back into the warehouse, and so on. Btw, besides the designated freeports Europe has its little tax-hav… errr, islands for this purpose as well. For example the EU’s VAT Directive doesn’t apply to the Channel Islands, where Sark has no income, capital gains, inheritance or sales tax at all, but sadly, as its own government points out , no airport. The German island of Heligoland, which the directive leaves out as well, would be ideal if its longest runway weren’t only 480 meters. However, the moment a painting moves on from any of them it is an import, which effectively makes these islands freeports with better weather , so to say. This sort of business got so big that it even had a king, btw. Yves Bouvier, a Swiss dealer whose company rented almost a quarter of the Geneva Freeport, became a primary owner of the freeports in Luxembourg and Singapore, which got him the nickname “the King of the Freeports”. His own taxes went less well. Switzerland’s highest court rejected his claim to have been taxable in Singapore, where the Geneva judges had counted 23 days in 2009 against 229 nights in and around Geneva, and the canton claims back taxes in the region of 712 million francs , which he told The Art Newspaper he would challenge in court. According to the Swiss investigative outlet Gotham City , the claim has since grown to 864 million francs, or close to a billion with interest. But that’s a different matter, as it concerns where he lived while he earned his money, not the freeports. In any case, the tax only ever falls due on final delivery to somewhere that is not a freeport, so a work that is bought, admired, insured, borrowed against and then sold again entirely within the vault triggers no import or sales tax. Switzerland did tighten the rules in 2016 , and goods in a freeport now have to be recorded with the name and address of their owner, however the rules require only the legal owner, which leaves plenty of room for a company in e.g. Panama to be the name on file, but more on that in a later step . The price of all this is a painting nobody can see hanging anywhere for probably a generation or longer, which, judging by the 1.2 million items in Geneva appears to bother fewer people than you would think. Should it bother you, however, then the painting has to come home. At home, however, someone is eagerly waiting for it. When Francis Bacon’s Three Studies of Lucian Freud sold at Christie’s in New York in November 2013 for a record $142.4 million, its buyer, Elaine Wynn, was a resident of Nevada. The triptych, however, made its post-auction debut at the Portland Art Museum in Oregon, where it drew large crowds for 15 weeks. So why Portland of all places? According to the museum, its chief curator had reached out to the owner shortly after the sale, tax considerations were not part of the discussions, and the owner had been impressed by its commitment to display the work prominently. The New York Times , however, pointed to something else, namely the use tax . It is the levy your home state charges on things you bought elsewhere and then brought home to use, and which it would dearly love to collect the moment your new Rothko touches a wall. In states with a so-called first-use exemption, whether it applies depends on where the painting was first used, and it just so happens that the answer does not necessarily have to be “at home”. Five states levy no general statewide sales or use tax, namely Alaska, Delaware (hi again!), Montana, New Hampshire and Oregon. Ideally you would want to arrange your painting’s first use in one of them. California, to take one example, presumes that property bought elsewhere was bought for use in California if it arrives within 90 days of the purchase. Hence the loans that collectors arrange with museums in such states tend to last more than three months , with the museum as the work’s first stop after the sale. According to the New York Times , the detour could spare Wynn as much as $11 million in Nevada use tax, although it was not clear whether she intended to take advantage of the break. The poor pleb… errr, public gets a masterpiece, the collector gets Oregon on the paperwork, win-win! For comparison, California lets regular people carry $800 of foreign purchases home before it wants its use tax on the rest of the vacation shopping. Museums in Oregon noticed this scheme as well. Dozens of important works came to the University of Oregon’s Jordan Schnitzer Museum of Art in the years before 2014, “largely because of the tax break, museum officials believe”, and according to those officials many collectors from California had made use of it. The museum’s executive director, Jill Hartz, explained: We are on their way home. The page for the museum’s current loan program, Shared Visions , even includes the line “Some lenders may receive tax benefits for participating in our Shared Visions program and should consult a tax advisor to learn more”. That’s a nice and subtle way to put it. And funny enough, the Los Angeles County Museum of Art, to which the late Elaine Wynn left the triptych, said in its announcement in September 2025 that the painting “has not been seen publicly since being acquired by Wynn at auction in 2013”, which will come as news to the crowds in Portland. The amateur version of the detour belongs to Dennis Kozlowski , the former chief executive of Tyco. According to prosecutors he had roughly $13 million of paintings, or in some cases empty boxes, shipped to Tyco’s offices in New Hampshire, while the paintings were meant for his apartment on Fifth Avenue. The note an art consultant handed the trucker apparently read “Here is a list of the five paintings to go to New Hampshire, wink, wink”. I’m not a lawyer, but I’d argue that putting “wink, wink” in writing defeats the purpose of winking. It ended up costing him $3.2 million for the sales tax on the art, about three times the sum he had been indicted over, as part of a $21.2 million settlement that also covered $18 million of state and city income taxes, and once he had paid, the criminal sales tax case was dropped, as he was already serving a prison sentence of up to 25 years for looting Tyco. The difference between him and the collectors in Oregon is that their paintings were actually there. In Europe, on the other hand, the detour is the choice of country to import into. As The Art Newspaper explained in 2018 , London’s art agents had been using the UK’s 5 percent, at the time the lowest import VAT in the EU, to trade on the margin with clients across Europe. The agent bought the painting on the client’s behalf, shipped it “to London (and thereby into the EU)” at 5 percent and then on to the client. Brexit ended that, however, and France, at 5.5 percent, became “the EU’s gateway for art from outside the bloc” , at least until Italy went down to 5 percent in July 2025. Say again that Europe isn’t competitive. The detour has one drawback, though, which is that it takes a bit of time. For the impatient, New York offers a quicker way. According to the New York attorney general , the real estate investor Aby Rosen bought more than 200 works of art and other decorative items for more than $80 million between 2002 and 2015 through one of his companies, and displayed them in his homes and in the offices, hotels and restaurants of his real estate business. The company seemingly paid tax on a single one of them, and filed returns from 2002 through 2015 declaring that no tax was due. The paper that makes this possible is a resale certificate . A dealer who buys a painting in order to sell it owes no sales tax on the purchase, and documents this by handing the seller a certificate stating that the Rothko above your sofa is iNvEnToRy . And who is to say that you’re not a dealer? Well, turns out the state’s guidance says: If you intend to use the supplies yourself, you cannot use a resale exemption certificate, and the distributor must collect sales tax from you. Rosen agreed in 2016 to pay $7 million, with no admission of guilt . The attorney general didn’t say how that sum breaks down, but by my own math, at New York City’s current combined rate of 8.875 percent (it was a little lower until 2009) the tax on $80 million alone comes to about $7.1 million. So 14 years of not paying sales tax appear to have cost about as much as paying it. His spokesman called the matter “an uncertainty as to whether some of Mr Rosen’s transactions were done as a private collector or as a dealer” and added that he “will continue to act as both an art dealer, buying and selling fine art, and as a private collector, as applicable”. For comparison, the certificate itself , in its current version, threatens anyone who misuses it with a penalty of 100 percent of the tax due, $50 for every fraudulent certificate, and criminal “felony prosecution, punishable by a substantial fine and a possible jail sentence”, all of that on top of the tax and the interest. But clearly, if you have the pocket money for a private jet those threats won’t worry you too much. PS: You don’t even have to fill in the certificate yourself. The attorney general sued Sotheby’s in 2020, alleging that the auction house had advised a collector that he could use a resale certificate and helped him fill it in, “including adding the false declaration that he was an art dealer”, although it knew he was in the shipping business. According to the same office, Sotheby’s accepted such certificates from at least seven other clients it knew were buying for personal use between 2012 and 2020. The auction house, which called the allegations unfounded at the time, settled in 2024 for $6.25 million and admitted no wrongdoing . In Europe the same claim, namely that the work is merchandise and not decoration, is made at the border. Works of art imported “for the purposes of exhibition, with a view to possible sale” qualify for temporary admission with total relief from duty, which under the VAT Directive also puts off the VAT, for up to 24 months in the EU and, since July 2025 , up to four years in Great Britain. So should an officer ever ask, the words that you’ll say are not “I have bought this” but “this is only here temporarily”. However, it is important to remind you that your living room likely doesn’t count as the exhibition, as the Geneva antiquities dealer Ali Aboutaam learned when he was fined 1.6 million francs “for having failed to pay the VAT on pieces exhibited in his home, while they were registered on temporary importation at the gallery”. On top of that, the Federal Supreme Court confirmed in 2024 that he owed about 3.5 million francs of VAT on antiquities he had imported, plus interest that the news agency Keystone-SDA put at more than 900,000 francs, and the Federal Administrative Court confirmed another 1.4 million for his gallery in 2025. Needless to say, however, that anyone (who would care) ever finding out where you exhibit your fine art is probably not a worry you’ll need to have. What should worry you is rather that all of the methods presented so far have one flaw in common, which is that the paper has your signature on it. The better-organized make sure that nothing ever does. When Christie’s demanded to know in 2012 who owned a certain Belize company that was bidding for art, the man bidding on its behalf named a “Luisa Brown”. A US Senate investigation later linked the company to the brothers Arkady and Boris Rotenberg, who were placed under US sanctions in March 2014, and whose companies appeared to have kept buying art ( more than $18 million of it) in the months that followed. As for Luisa, the subcommittee could not confirm that she owned the company, “or if she even existed at all”. Should she ever turn out to exist after all, I’d like to congratulate her on the exquisite collection, btw. The subcommittee’s first finding, however, was: The art market is the largest legal, unregulated market in the United States. Its chairman found it “shocking that U.S. banking regulations don’t currently apply to multi-million dollar art transactions”. Meaning that the rules which make your bank ask who you are conveniently don’t apply to whoever buys a Magritte for $7.5 million. Anyway, going back to the topic at hand, the trick behind Luisa is to not own the painting personally. Instead, the work is bought by a company, ideally one incorporated somewhere sunny and incurious like the British Virgin Islands, Panama or Belize, so that the company owns the art while you, at one remove, own that company. The advantage shows up when you decide to sell, because you are no longer selling a painting, which is an act that brings shipping, customs forms, sales tax, public records, and all sorts of other little headaches with it. Instead, you sell the shares of a company that just so happens to own a painting. This way the canvas doesn’t have to move, change countries or technically change hands. In fact, the shares can even be bearer shares , which belong to whoever holds the paper and which, according to the ICIJ , many countries (but not all) have banned exactly because of their usefulness for tax evasion and money laundering. This is how the Nahmads, one of the art world’s most influential dealer families, held a Modigliani, Seated Man with a Cane , bought at Christie’s in London in 1996 for $3.2 million. The owner of record was International Art Center, a Panamanian company registered through Mossack Fonseca in 1995 and initially held in bearer shares. And when the painting became the subject of a dispute that has been in the New York courts in one form or another since 2011, the Nahmads insisted that the family did not possess it. That held until the “Panama Papers” dubbed leaks connected them to the company in 2016. Ten years later the painting is still in the Geneva Freeport , while a New York judge’s ruling that it must be returned to the estate of Oscar Stettiner, the dealer who left his collection behind when he fled Paris ahead of the Nazis in 1939, is on hold until Nahmad’s appeal is decided. The downside of these structures, as you can see, is that the anonymity they sell is only as durable as your law firm’s document security. And so far all of this has only dealt with the taxes on buying a painting and bringing it home. The really expensive one, however, is due when you part with it. Among the documents released as part of the Epstein files is one from March 2015, according to which the billionaire Leon Black, then chief executive of Apollo Global Management, had secured a loan of $484 million from Bank of America. It was backed by works of art, among them pieces by Picasso, Giacometti, Titian and Matisse, and the interest rate was 1.43 percent. As CNBC noted, such loans are not unusual for top private banking clients, apart from the size of this one. Senator Ron Wyden of the Senate Finance Committee has been asking Black since 2022 about the tax and estate planning that Epstein did for him, art loans included, and his representatives have said that all of it was legal and that he “has fully paid all taxes owed to the government”. The House of Representatives, which runs an Epstein inquiry of its own, held him in contempt of Congress in September 2026 for refusing to provide more information. So why would a billionaire borrow against his Picassos? Well, because selling one is about the most expensive thing he could do with it. The IRS treats art as a collectible and taxes long-term gains at a maximum of 28 percent rather than the usual 20, with the 3.8 percent net investment income tax on top of that, which makes 31.8 percent. A loan, on the other hand, is not a sale, and hence not taxed at all. As CNBC put it: An art loan even at today’s elevated lending rates, typically around 8% to 9%, is still far more efficient than paying a tax. Plus, borrowers can usually keep the art on their walls. So you borrow against the painting for the rest of your life, and at death your heirs’ basis steps up to the market value of the painting, which means that the gain never pays capital gains tax at all. Funny enough, this business owes part of its growth to a loophole that was closed. The like-kind exchange under Section 1031 of the tax code used to let a collector roll a Pollock into a Rothko into a Twombly across decades without ever paying the 28 percent, until the Tax Cuts and Jobs Act of 2017 restricted it to real property. Since then, according to CNBC, “many collectors have turned to loans”, and the market for them is now estimated at $38 billion to $45 billion. Holding on to your art works in France as well, as the country has kept art out of its wealth taxes since 1982, and the one it levies today covers only real estate . And when the inheritance tax does come due, French law allows the heirs to settle it in kind, which is what the sons of Daniel Wildenstein (of the art dealing dynasty) did after he died in 2001. They declared an estate of 40 million euros and settled the 17.75 million euros due on it with marble reliefs that Louis XVI had ordered for Marie Antoinette’s dairy at the castle of Rambouillet, which now belong to the Louvre and hang at Rambouillet again. Paying your taxes in Marie Antoinette’s marble is a level of style that a bank transfer will never reach, touché! The things the declaration didn’t mention were held in trusts , including paintings that The Art Newspaper put at 1 billion euros (the court’s own report says dollars), and that came to light when Daniel’s widow accused her stepsons of cheating her out of her inheritance. The widow of his son Alec went to court as well. A Paris court noted in 2017 that “for three generations the Wildensteins have done everything to conceal a considerable heritage” but acquitted the family anyway, and so did an appeals court in 2018. It took a third trial to convict Daniel’s son Guy, 22 years after his father’s death. Where the prosecution had asked for a fine of 250 million euros, the court however decided on 1 million plus the back taxes. Borrowing still costs interest, though, and dying is not for everyone, or at least not at an early age. Hence the next step is to make the tax code pay you instead. The philanthropist Oscar Tang, at the time a trustee of the Metropolitan Museum of Art, paid $5 million for 12 early Chinese paintings through a partnership in 1997, which put the cost of one of them, Palace Banquet , at $250,000. When the partnership donated that painting to the Met in 2010, it reported its value as $26 million, or roughly a hundred times what it had cost 13 years earlier. Four more paintings followed in 2011 and 2012, which brought the deductions for five paintings with a combined cost of $1.41 million to $73.9 million. This is where the tax code turns from an obstacle into a business partner. Donate a work you have owned for more than a year to a museum that exhibits it, and you can deduct its fair market value rather than what you paid, while the gain in between is never taxed. But what is the fair market value of a work that hasn’t sold in public? Well, it is largely what a qualified appraiser says it is. According to the Tax Court, the partnership’s contact with the Chinese auction house doing the appraisal had e-mailed that Tang could “use more than a $20 million deduction this year”, and two days later the auction house came back with $26 million without explaining how. Even Tang asked at the time why the estimate had “changed so much from 10 to 12 to now 26”. I guess that’s what you call good customer service. Anyhow, despite the court finding that the appraisal wasn’t a qualified one, it allowed the deduction anyway, but it put the painting’s value at only $12 million and applied a 40 percent penalty . $12 million, however, is still 48 times what the painting had cost. As for the other four, the court noted that the partnership’s figures were on average only 17 percent above the values it later agreed on with the IRS, which came to $41.5 million instead of $47.9 million, and no penalty was applied. If you would rather not part with the painting at all, you can give it to a museum of your own. Collectors who set up a private operating foundation to run a museum can deduct the full market value of the art they donate to it. A Senate Finance Committee review of 11 private foundations with museums found in 2016 that some museum buildings were next to the donor’s home, that some opened as little as 20 hours a week, and that one had counted 456 visitors between 2 October and 11 November 2015 (which is roughly eleven people a day). Unsurprisingly, the committee’s chairman called this area of the tax code “ripe for exploitation”. And if you want the deduction and the painting on your wall, at least for a while, there is the fractional gift , where you donate a share of the work and the painting goes back and forth between you and the museum, “like divorced parents sharing custody of their kids”, as Bloomberg put it. The custody arrangement has an end date, however, as you have to give the museum the rest of the painting within ten years, or by your death if that comes first, after which it stays at the museum for good. Otherwise the IRS takes the deduction back , with interest and an additional tax of 10 percent on top. Anyway, with all these different possibilities covered, there is still one asset in this post that we haven’t made tax-efficient yet, namely the aircraft that did all the carrying, so let’s briefly look into that as well before we wrap this post up. After all, despite our penchant for fine art, we’re businessmen first, and we love a good deal. When Lewis Hamilton’s new Bombardier Challenger 605 was about to make its first trip to Europe in 2013, the itinerary was planned to include a stop on the Isle of Man for what the law firm Appleby described as “a short stay, normally less than 2 hours”. And since customs on the island doesn’t work around the clock, EY told its client : Arrangements have been made for Isle of Man Customs to be available outside of normal operating hours to facilitate this. I doubt that your local tax office would do the same for you. Then again, those two hours came with a VAT refund of £3.3 million. A private jet bought in the ordinary way in e.g. the UK attracts value-added tax at 20 percent, and the Isle of Man, a crown dependency that forms a single VAT area with the United Kingdom , offered a way around it, which the Paradise Papers revealed in 2017. The idea is to stop owning the jet as a person and start owning it as a small confederation of companies that all happen to be you. Note: If you’ve read this far you’ve probably realized by now that owning large values yourself is never a good idea, and that you should always try one way or another to have shell companies or trust funds own expensive things, which ideally are owned by an intransparent structure of even more shell companies, which are then controlled by you. In Hamilton’s case a British Virgin Islands company bought the aircraft and leased it to Stealth (IOM) Limited, an Isle of Man company set up by Appleby. That company registered for VAT as a leasing business, imported the jet, had the import VAT paid by its accountants and got it refunded three weeks later , and then leased the jet on to an operator in England, which flew Hamilton around in it. It could go even faster, as according to OCCRP such refunds took a day on the island at the time, where “on paper the tax is paid and refunded immediately”. That the arrangement, as the Guardian described it , let the owner rent his own plane from himself was not treated as an obstacle. As for the company in the middle, Stealth (IOM) Limited (I’m not making the name up) had no employees , and its address in Douglas was an Appleby office that also served as headquarters for more than 1,100 companies and trusts. VAT on an aircraft is only deductible for business use , and documents seen by the BBC suggested Hamilton intended to fly privately about a third of the time. His lawyers on the other hand said that the company was not a shell, that it leased the aircraft at a commercial rate and that Isle of Man officials had approved the approach. And Hamilton was far from the only one. The island refunded more than £790 million in 231 such cases between 2011 and 2017, while its own assessments of the sector had come to about £4.7 million in additional tax. When the Treasury reviewed all of this in 2019, it conveniently found no evidence of widespread VAT avoidance. What took the EU out of the scheme was not the review but Brexit, as the UK left the EU’s single market and customs union on 1 January 2021, and the Isle of Man with it . Since then the two-hour layover in the Irish Sea buys you UK status but not much else. However, don’t worry, the jet is still taken care of. In the United States a law of July 2025 made full expensing permanent, which lets a business deduct 100 percent of certain purchases in the first year. According to Fortune , those include private jets as long as they are used for business more than half of the time. Weirdly enough, by October 2025 jet sales were up 11 percent on the year before, according to a broker’s figures. Oh well. If you look at the receipts again, you will notice how these cases came out. The Modigliani and Hamilton’s jet are known from the leaked files of two law firms, Mossack Fonseca and Appleby. Leon Black’s loan is known from the files of a dead financier, the Wildenstein trusts from a widow who felt cheated, Luisa Brown from a Senate investigation, the $100 Basquiat because a dealer it was offered to alerted Brazil, and the numbers from London City Airport because an inspector mentioned them to a newspaper and lost his job over it. The rest is largely known from what the participants put in writing themselves, be it the note handed to a trucker, the e-mail about a $20 million deduction or Low’s “All in Geneva free port”. Where an authority did get there on its own, the receipts show what that cost, namely back taxes, a settlement or a comparatively small fine, and among ten receipts a single prison sentence, half of it suspended and the other half to be served at home. As for how many more there are, nobody knows, and I couldn’t find a credible estimate either. What can be said is how rarely anyone looks. Customs at Kortrijk, as mentioned, checked 37 flights in a year with roughly 1,600 private arrivals from abroad. The IRS examined 6.6 percent of the tax returns with an income of $10 million or more for 2021, the latest year for which its audit window has closed, down from 9.5 percent for 2015. And where leaked client lists of offshore firms made a comparison possible, namely in Scandinavia, researchers found that the richest 0.01 percent of households evade about 25 percent of their taxes, while random tax audits detect less than 5 percent. The cases here are the cases we know about, and we know about them pretty much “by accident”, so to say, mainly because someone either leaked info, sued, talked or got caught with something shaped like an elephant. Clearly, the arrangements that do work as designed never end up in a post like this one, and considering that the ones above ran for roughly five, 14 and 20 years, I wouldn’t bet on them being the only ones. Should you have skipped ahead because the jet is waiting, here is the itinerary: Every one of these, with the exception of saying nothing to customs, writing a false value or origin on the paperwork, shipping empty crates around, signing resale certificates you don’t mean, keeping a painting registered for an exhibition in your living room, or claiming a value that your appraiser can’t justify, is legal. And strictly speaking, none of it needs a jet. A freight forwarder and a good lawyer will do, and the jet merely means you are the kind of person who already has both. What it does need is a tax system that your highly paid experts can game, maybe one or two shell companies, and an appraiser that owes you a favor. I hope that I was able to show you in this post how easily the world’s elites get around all the bureaucracy and taxation that has been put in place over the past decades. I also hope that the next time someone asks for stricter compliance or higher taxes, you, too, will be remembering who has been paying for those so far and who hasn’t, and that they will always only hurt those who cannot afford expensive accountants, consultants and lawyers, but never those who can. Note: None of this is tax advice and, in case you failed to read it that way, this post employs sarcasm. Credits: The photos in this post were resized/cropped and dithered. The dithered versions of the photos are available under the same licenses as the originals: Moved: more than 200 works of art worth at least 130 million francs in all, as reported in 2016. Ran for: years, the gallery scheme alone from 2008 to 2013. Came out through: a customs check of his luggage at Zurich Airport. Price: fines of 4 million and about 7.1 million francs on top of the unpaid import tax, and back taxes of more than 200 million that a search of his villa brought up, which he settled in 2024 for an undisclosed sum. Prison: none. Moved: 37 paintings, 16 of them in a single landing. Ran for: from the landing in 1986 to the false declarations of March 1987. The courts needed until 2002. Came out through: unknown. The ruling doesn’t say how the imports were discovered. Price: about $1.6 million, roughly twenty times the VAT he had skipped. Prison: none on record. Moved: one Ming cup, bought for HK$280 million. Ran for: unknown. The reporting on the warehouse is from 2014. Came out through: the collector himself, who explained it to the press. Price: none as far as the reporting of 2014 goes. The roughly 40 million yuan of import VAT isn’t due while the cup stays in bond. Prison: none. It’s legal. Moved: one triptych, bought for $142.4 million. Ran for: 15 weeks. Came out through: the New York Times . Price: unknown. The detour could have spared her as much as $11 million, and whether she used it isn’t known. Prison: none. It’s legal. Moved: more than 200 works for more than $80 million. Ran for: 2002 to 2015. Came out through: an investigation by the attorney general. Price: $7 million, with no admission of guilt. Prison: none. Moved: one Modigliani, bought for $3.2 million. Ran for: from the purchase in 1996 to the leak in 2016. Came out through: the Panama Papers. Price: open. A court has ordered the painting returned, and the appeal is pending. Prison: none. It’s a civil case. Moved: $484 million out of an art collection, without selling a painting. Ran for: unknown. The document is from March 2015. Came out through: the Epstein files. Price: 1.43 percent interest. Prison: none. Borrowing against art is legal. Moved: an estate declared at 40 million euros, next to paintings valued at 1 billion. Ran for: “three generations”, in the words of a Paris court. Came out through: his father’s widow, who felt cheated out of her inheritance. Price: a fine of 1 million euros, plus the back taxes. In a parallel case the treasury demanded 550 million from the heirs of two estates, penalties included. Prison: four years, half of them suspended and half to be served at home with an electronic bracelet. Moved: five paintings with a combined cost of $1.41 million, deducted at $73.9 million. Ran for: three tax returns. Came out through: an IRS examination of all three returns. Price: $53.5 million allowed instead of $73.9 million, with one painting cut from $26 million to $12 million, plus a 40 percent penalty on the tax underpaid for that one. Prison: none. Moved: one £16.5 million jet into Europe. Ran for: a planned stop of under two hours. Came out through: the Paradise Papers. Price: none on record. The refund was £3.3 million. Prison: none. Just say nothing and carry the painting off the jet and count on customs having picked another day to come by. Leave it in a freeport, where as far as any tax authority is concerned it hasn’t arrived anywhere. Lend it to a museum in Oregon for a season first, or bring it into Europe through whichever country charges the least. Call yourself a dealer, sign a resale certificate, or tell the officer that the painting is only here for an exhibition. Don’t personally own it and let a company in Panama do the buying, so that one day you can sell the company instead of the painting. Never sell and instead borrow against it and let your heirs inherit it at its stepped-up value, or have them pay the state in marble. Donate it after a year and a day at whatever an appraiser says it is worth, ideally to a museum next to your house. Don’t forget to expense the jet, by having the VAT refunded on an island, which since Brexit only covers the UK, or by deducting the whole aircraft in the first year, as long as it mostly flies on business. Customs at Samedan airport: Dazi Samedan 070614 by NAC, licensed under CC BY-SA 4.0 . Geneva Freeport: Ports Francs @ Pont-Rouge @ Lancy by Guilhem Vellut, licensed under CC BY 2.0 . Portland Art Museum: PAM northside - Portland, Oregon by M.O. Stevens, licensed under CC BY-SA 3.0 . Sotheby’s: Sotheby York Av jeh by Jim.henderson, released into the public domain. Seated Man with a Cane : Wikimedia Commons , public domain. Palace Banquet : The Metropolitan Museum of Art , Ex coll.: C. C. Wang Family, Gift of Oscar L. Tang Family, 2010, public domain ( CC0 ). Lewis Hamilton’s jet: G-LCDH - Bombardier CL-600-2B16 Challenger 605 by Alpha 350, licensed under CC BY 2.0 .

0 views
Brain Baking 3 days ago

More Wasted Words On GenAI

The purpose of writing my commentary on genAI inspected through different lenses was, beyond summarising much-needed critique, to make my peace with the direction society is taking with this, and to stop wasting words on something I cannot change anyway. The ridiculous and honestly quite depressing news related to genAI does not stop. I have to get a few more things off my chest related to the recent events. I completely rewrote our Java Advanced course material. The previous manual was a PDF from 2024 containing examples of an outdated version of the Spring Boot framework and did not contain enough context for students to help understand why we are learning these different concepts. Needless to say, it was a lot of work, but as a lecturer, I get paid to do this, and I like to think that I helped improve the course and thus a part of the entire curriculum. The first thing students asked me was “did you use AI to make this new course?”. I’ll be honest. I am still offended by this. Just to be clear: I did not. I know that unfortunately, nowadays many colleagues generate their material. They claim they validated and reviewed it and used the extra time to pass more quality time with the students but this time I would like to call out the bullshit: it’s just an excuse to do less. This is one of your core responsibilities for God’s sake. By rewriting the course by hand, I also force myself to learn the specifics and make the exercises to ensure everything is correct. Preparing coursework also becomes easier because I know everything by heart now. I understand that nowadays we have to be wary about everything and anything: is this generated? Did someone double-check these words and claims? The latest models make it more and more difficult to spot the differences between something generated and something hand-crafted. Which brings us to the next case… Te video game Big Walk is being declared ineligible for the Independent Games Festival (IGF) Game Of The Year awards due to their usage of genAI . This kind of blew up with conspiracies, forum threads, and reporters all speculating wildly. Why wasn’t this known beforehand? Because Steam does not enforce a disclosure on usage of genAI code or chatbot usage. Many people think the IGF jurors did the right thing as they stated they do not accept anything that even remotely touched genAI. It is becoming more and more difficult to pinpoint what exactly that means: is generating code using genAI? Clearly, vibe coding a game and submitting it to a random store frontend is: you did not make anything, you only watched something being made. Parts of generated assets or code being copied in will probably also count for the IGF. But as far as I understand it, the Big Walk case wasn’t that obvious: they did not use a code generation agent. They were stuck on a very technical rendering problem in Unity for which they first contacted Unity. Even support couldn’t help them out. And only then they went to a chatbot and presented their problem which ultimately helped them get unstuck. This is the modern way of searching the internet for an obscure forum post where some other person bumped into the same problem and uploaded their solution to circumvent it. So yes, they used “AI” to search for a fix to a very technical problem, but no, they did not generate anything. Definitions—always a thin line. I think the general public’s very exaggerated reaction to this is unfortunate. Which brings us to the next case… Why do we demand more transparency when it comes to AI usage from small indie game studios like Big Walk ’s but are we totally OK with slop software on our phones, in our browsers, office tools, digital administration, and more? I’m all for more transparency when it comes to AI usage—precisely because (1) what indeed is “AI usage” exactly and (2) as stated it becomes more and more difficult to see if AI has in fact been used. Jeff Kaufman recently wrote about AI Usage Transparency on his blog where he openly admits to using Claude for generation of both words and ideas. Every article published since that post now ends with a small section detailing this usage: Claude estimates it contributed 3% of words and 30% of ideas; it also built the new maps, processed the historical schedule and bus performance data, and made the charts, while I directed what to show and wrote the post. I can only applaud being more transparent about it 1 even though my own opinion of using genAI for blog posting is very much different. If you need Claude to generate ideas on what to write on, why exactly are you writing in the first place? Before someone emails me to ask “did you use AI to make this post?” I’ll answer it now: Wouter estimates he contributed 100% of words and 100% of ideas. I’ve seen blog post output rates go up exponentially on some posts where they happily churn out two or more posts daily when before it was once a week. My reaction to that was to unsubscribe from their RSS feed. Please stop joining the slop churn. More is not better. We collectively need to slow down , not speed up. Jeff’s AI Usage Transparency post is quite clear. That is the exception to the rule. For instance, here’s the VRT NWS AI charter , our local government’s public service broadcaster. They start with the bold statement that usage of genAI is almost inevitable and will become more and more prevalent in the future: Artificiële intelligentie zal een steeds grotere rol spelen in alle domeinen van onze samenleving, ook in de media in het algemeen en de journalistiek in het bijzonder. (Artificial intelligence will play an increasingly significant role in all areas of our society, including in the media in general and journalism in particular.) To start the charter with an excuse to use genAI everywhere when possible seems like a good way kick things into gear. The article then continues: when do they use AI? For news gathering, translations and summaries, data driven sports reporting, tailored news, image and video editing techniques, illustrations and background themes, standard audio editing techniques, anonymous testimonials. I don’t know about you, but all I can read is “everywhere, mwahahaha”. As you might expect, there is no AI transparency disclaimer to be found at the end of an article. I can’t truly blame the colleague that generates course material or pushes students towards genAI instead of stimulating to ask questions to a human: our learning institution has been bickering for months about the good, the bad, and the ugly of AI. As a result, we have zero AI policies in place: none for lecturers and none for students. A neighbouring university does have one in place that, perhaps unsurprisingly, aims to “embrace AI as the driver for innovation and societal progress” yet they “consider it our responsibility to teach students and staff how to engage with AI tools in a critical, ethical, and responsible manner, and to contribute to the development of trustworthy AI systems”. I would love to see a learning institution openly say “fuck no” to this, but alas, I haven’t encountered a single one. Guess what: (tainted) money flowing to these institutions also come from somewhere. Panic and fear of missing out is probably another reason. At least VRT has a clearly visible AI charter put up on their site. Most companies do the same without feeling the need to publish something like that. Yet I think it’s sad to see that you are never entirely sure that the words you are consuming are, in fact, being written by a concerned journalist. As a like-minded colleague once told me: “if you don’t think it’s worth writing, then I don’t think it’s worth reading”. That means we can stop consuming anything now, as the genAI usage addiction has penetrated almost every sector and spread to almost every company. Which brings us to our next case… I asked an ex-colleague whether their company now finally has a workable AI policy: when I left, there was a lot of chaos regarding the usage of the then still somewhat shaky technology. Their response was that they didn’t write a single line of code in the last six months: it was all Claude doing the heavy lifting. They are working in a for them new programming language environment, churning out user story after story, but not really getting to know the language itself. They pointed out to their manager that with the usage of genAI they did not have a chance to master the language themselves, literally stating that “if you take away my Claude tools, all I can write is a nice Hello World app”—and this person is a talented software engineer. Management did not care. Yes, this person is smart enough to steer Claude in an architecturally sound way, but in a way, this evolution is effectively denying them the ability to get better at programming in another language. This is more than just sad. “But we don’t need to know how to program anymore” say the futurists. I’ll quote Dietrich Bonhoeffer’s take on stupidity here, which is a greater threat to civilisation than evil according to him: Stupidity is outsourcing our critical thinking to a third party, willful ignorance, and conformity. Bonhoeffer was of course referring to blindly following the harsh political Nazi regime he had to deal with. These three concepts can also be found in Hannah Arendt’s idea of “the banality of evil”: Eichmann was simply doing his job by sending Jews to a certain death. He stopped thinking for himself and conformed to the regime. But what if we take Bonhoeffer’s theory of stupidity out of its Nazi context and into the genAI discussion? The moment I ask an agent or a chatbot to do something, I turn off my brain and wait for an answer. Isn’t that outsourcing our critical thinking to a third party? A highly centralised knowedge-locking subscription-based American third party? We know we should validate and review but the output is too big and we don’t care. Isn’t that willful ignorance? Everybody is increasing their output by generating, I can’t be left behind. Isn’t that conformity? My sourdough bread baking book never reached its mainstream audience and that’s okay. But what’s not okay is that it is now drowning in the steady stream of fully generated slop. A few examples: Het Alledaagse Zuurdesem weggooien Kookboek is fully AI-generated. The first few preview pages are horrendous. Yet it is for sale and highly rated. Another example: Alles over Zuurdesem . None of these books have true authors: the publisher that churns out utter crap is listed as author. Yet if people unaware of the small text “AI-generated” (or unaware of its meaning) are searching for “zuurdesem”—the Dutch word for sourdough—they now find more slop works than genuine informative books. This makes me more than sad: this makes me furious. Every single day I have to deal with the AI acronym and every single day I read stories like this: Atari Homebrew Awards Cancelled Following Flood of AI-Made Games . This is even happening in the retro computing community. Why would you even want to grab your AI toolkit? The whole purpose of retro computing is to have to learn and to have fun exploring and programming on old hardware. Not to choke someone with your generated shit. In case you’re not aware, I’m still furious. I’ll end with a link to Isaac Lyman’s incomplete case against generative AI who built a huge evidence database of more depressing cases. It’s not like this capitalist society will listen: the people that discovered a quick buck can be made by uploading generated stuff will hardly be convinced. Yet I have to try to learn to deal with it. Here’s my transparency for the blog: it will never use AI. Ever. See my updated license and attribution page that now also includes an “AI policy”.  ↩︎ Related topics: / genai / By Wouter Groeneveld on 26 November 2026.  Reply via email . Here’s my transparency for the blog: it will never use AI. Ever. See my updated license and attribution page that now also includes an “AI policy”.  ↩︎

0 views
Ankur Sethi 1 weeks ago

An experiment with SIMD in Rust using fearless_simd

SIMD is having a moment right now. I've always been vaguely aware of the existence of SIMD instructions, but it was Mitchell Hashimoto's Everyone Should Know SIMD that finally inspired me to try writing some code that uses SIMD myself. I decided to take a straightforward problem and try making it faster using SIMD instructions: count the number of occurrences of a byte inside a text file. Since I've been using Rust for writing pretty much everything these days, that's the language I picked for this task. I used as my test dataset. This is a file containing a gigabyte of text from the English language Wikipedia. All benchmark numbers are from my MacBook Pro with an M4 Pro and 48GB RAM. My Rust version is 1.100.0. Here's what the non-SIMD version of the code looks like: When I compiled this code with Rust's auto-vectorization turned off, it took 138.05ms to count the number of occurrences of the letter in the test dataset. With auto-vectorization enabled—which is the default behavior—it was marginally faster at 114.55ms. Here's the same code, this time using : This code took 30.35ms to to run on my computer. That's ~4.5 times faster than the scalar version with auto-vectorization disabled, and ~3.8 times faster than the scalar version with auto-vectorization enabled. Pretty damn good for a few extra lines of code! To make sure my numbers were accurate, I had to make sure Rust and LLVM weren't optimizing away the very code I was trying to benchmark. I recently inherited an old ASUS TUF Dash F15 from my brother. This computer comes with an 11th generation Intel Core i5 (11300H) and 24GB RAM. It's currently running Fedora 45. The benchmarks on this machine were a bit surprising: I don't understand why enabling auto-vectorization made the scalar version slower . I don't know enough about Rust, SIMD, Linux, benchmarking, or x86 assembly to explain this behavior. If anyone reading this understands why this happens, I would appreciate it if you could get in touch . If you want to try replicating these experiments, you can grab the code from my GitHub repo. You'll also have to download the test data from Matt Mahoney's website . Go added experimental SIMD support to their standard library. C++26 standardized (which hasn't been very well received ). Portable SIMD is available on nightly Rust via . The excellent cut a 1.0 release in September . It works on stable Rust. Other languages have already shipped portable SIMD APIs in their standard libraries for a few years. For example, in Zig and in Java . I made liberal use of to block certain common optimizations. I used to prevent inlining the scalar code ( might have been enough to ensure this, but I was in an overly cautious mood). I compiled the scalar version with and to disable auto-vectorization . Scalar version with auto-vectorization disabled: 240.48ms Scalar version with auto-vectorization enabled: 319.96ms SIMD version: 56.80ms

0 views
Max Bernstein 1 weeks ago

Inside PyPy: first contact with RPython

I get restless now and then and I want to implement a programming language. Then after mustering the resolve, I stew, for there is no good implementation language. 1 What am I to do, build my own programming language so that I can then use it to implement the first language? So I go back to modifying an existing implementation instead. There do exist established general-purpose tools for building fast programming language implementations: And more nascent ones such as Deegen , which was used to reimplement Lua. They each take different approaches: While none of these spark joy , they do each have benefits, including accomplishing the primary goal of offloading a lot of the language runtime choices and nasty details. In this post we will take a first look at RPython because it is the kind of VM implementor’s programming language that I keep thinking about. More on that later. Before we continue, please heed this warning: RPython is an implementation detail of PyPy. It has not had the years of polish that the rest of the system has had. Please do not badger maintainers. We’re going to build a little program in RPython. I am mostly following along with the docs , specifically Getting Started with RPython . There’s a little more ceremony than you might be used to and that’s because we’re going to run this file in two modes: normal Python 2 interpreter and compiled to C. This is the weirdness of RPython. If you don’t have installed, you can install PyPy, which helpfully still implements Python 2. If this all went fine, you will see it print . None of this is RPython yet . For that, we need a hint more ceremony. This is when we clone the PyPy project, in which we will find RPython. Now edit the Python program. Below the definition, add the following function: This function looks unused, but it is actually a hint to RPython: this is where the compiler should start translating. Let us now compile this program. Either inside the PyPy directory or with , run: If all goes well, you will see a whole mess of output, including a partially rendered Mandelbrot fractal. Finally, you will see something like: This is the RPython compilation process. In it, RPython is analyzing types, removing memory allocations, monomorphizing functions, and generating C code. Then it hands this C code off to a C compiler to compile. You should have in your current directory an executable named , which you can run like . It should also print . So far, this is not so different from Python. But let’s try something Pythonic. Let’s see what happens when we also use to mean string concatenation. Under normal Python 2, this will work just fine, printing and then . Under RPython, though, you get this inscrutable error (again, rough edges): and are unceremoniously dropped into the debugger, Pdb (hit Ctrl-D or type ). From this message you are meant to intuit that RPython did not enjoy that two different types flowed into the function. It helpfully tells you that there was a when trying to reconcile the and types that flowed into the function’s first parameter. It then gives you a pointer to the offending line and an IR dump. This happens because RPython requires function parameters to be monomorphic. Though the variables are syntactically untyped, RPython computes a type analysis to discover what type each variable should be. When and both flow into , boom, complaint. 2 To get around this, we do what all good C++ programmers do and we templatize the function. The RPython spelling of this is, as with many other features, a function annotation: You will find now that RPython happily compiles the program. This works because it makes a new copy of for every input type of the first ( ) argument. “Hey wait a minute,”, you might ask, “doesn’t this mean it stops being a valid Python 2 program?” Great question. No. You can still run the program as long as you provide the location of the RPython libraries via (as before): This runs ~instantly, which is a big relief. Developing an interpreter project with a 30 second or more turnaround time for each compile would be really frustrating. This has been a taste of RPython, both great and somewhat frustrating. I intentionally made it about RPython as a programming language rather than being so focused on RPython as a programming language implementation tool because I want some of its features to exist in a general purpose programming language… that then also might be used to implement other programming languages. I bring it up because I want to rehash the stuff that I occasionally grumble about in the vicinity of PLDI but for some reason have not written about online. Perhaps writing about it will encourage people. I think there is a lot of good stuff in RPython: I wish some stuff were different, or at least modifiable: I will probably add more to this list as I continue to remember some years of these conversations. Wouldn’t this be great? I don’t really have the time, energy, or expertise to build such a thing. There are so many design decisions along the way. It would probably accidentally grow to be huge and ossify along the way, and what a bummer that would be. If you have any pointers to existing projects or a way to implement such a thing in a really lightweight form (read: sub 10k lines, portable ideas), I would be very interested. Here are some pointers to other projects in the neighborhood: Thanks for CF Bolz-Tereick first for allowing me to talk their ear off about this for years and second for reviewing this post. I don’t want to implement atop Racket. C++ and C give me endless nightmares and are completely DIY. Yes, yes, I have built large VMs on C++ and C before. One time I posted so hard about the frustration that my tech lead unfollowed me on Twitter. I don’t really want to try to think about GC in Rust.  ↩ I initially thought any variable had to be monomorphic but I could not get an error from programs such as .  ↩ RPython, which has PyPy (Python) as its primary success story but also can claim Topaz (Ruby) and a couple of other smaller ones Truffle, which is the foundation of TruffleRuby, GraalPython, GraalJS, and even Sulong (LLVM) Deegen requires you to write your bytecode interpreter and type system in a C++ DSL. From this it generates an interpreter, a baseline JIT compiler, and, hopefully eventually, an optimizing JIT compiler. Truffle requires you to write an AST or (newly) bytecode interpreter in an Annotation-based Java DSL. From this it specializes guest language code before emitting Graal IR, which uses aggressive partial evaluation to generate optimized code. RPython requires you to write an interpreter in a restricted dialect of Python 2 that acts more like Java or Go than Python. The RPython compiler will then analyze your code, translate your “Python” program into C code bundled with RPython IR, and then “tier up” from the C code to JITed code at run-time. In order to go from “random RPython program” to “JIT compiler”, you need to participate in its meta-tracing , which requires annotating where your interpreter loop loops. Compile to native AOT with additional JIT. Seems like this provides good start-up performance with (optional!) tier-up as the runtime system observes the system’s behavior. Automatic memory optimization. There is no good way to syntactically express how an object should be allocated—Python is, after all, a very high-level language—so Python programs are profligate allocators of memory. RPython programs would be the same except that the AOT compiler does a whole-program analysis to try and remove these allocations. The JIT does too, but via a different mechanism. The JIT is provided to you. You don’t have to think about program analysis; the PyPy authors think about it for you. It is possible to do manual memory layout via so that you can write better data structures than Python would otherwise let you express. It provides a garbage collector for you. Furthermore, it handles all the stack scanning stuff and “oop maps” so you don’t have to build handles/ /… yourself. RPython does its partial evaluation and automatic JIT creation via meta-tracing . It is one of the last surviving tracing JIT compilers (alongside LuaJIT and, kind of, HHVM). For a lot of programs, method-based compilers seem to have produced better, or at least more predictable, results. I kind of want to see what a meta-method-JIT would look like. The user experience leaves something to be desired. I want better error messages, faster compiles, and less output. I want thorough docs. I want better performance feedback. This is in line with the rest of my ramblings about mechanical sympathy: the runtime should tell you what is wrong. I (or CF) shouldn’t have to stare at IR in traces and go “hmmmmm…” It requires writing a lot of your tooling anew. Even if I had, for example, a JavaScript parser written in Python, it likely wouldn’t be in Python 2 and it likely would not work well with RPython’s special rules. Runtimes such as JRuby get around this by compiling parsers (Prism) to WebAssembly and then bundling a WebAssembly interpreter written in Java. Along these lines, I would like more help with lexing and parsing, for which I have so little patience. I think it would be neat if it had a way to pause and save an “image” of the heap. After all, RPython is in control of all the memory and the code. It would be neat if, in addition to a JIT, it also helped you build an AOT compiler for your guest language. What if your language is statically typed? Should the toolkit provide functionality for type checking? Type inference? Some solution for C code. You can call it and stuff just fine but there’s no Sulong equivalent so it’s a totally opaque barrier to optimization. Don’t write your runtime helpers in C, sure, but at some point you have to interact with outside code. Weval, which turns an interpreter into a baseline AOT compiler. Its current implementation requires the interpreter to be compilable to Wasm and then its heap snapshottable with Wizer. One can imagine this technique being used instead to implement a JIT instead of an AOT, thereby also sidestepping the snapshot requirement. One might also imagine this applying to another IR than WebAssembly. Say, LLVM… semPy, which is an executable semantics for Python. Zig and other languages such as the more nascent k1 have the ability to run and generate code at build-time. Perhaps someone could implement a VM toolkit in one of these languages. I think a lot of the effort would still go toward something like GC handles if you want a moving GC. I don’t want to implement atop Racket. C++ and C give me endless nightmares and are completely DIY. Yes, yes, I have built large VMs on C++ and C before. One time I posted so hard about the frustration that my tech lead unfollowed me on Twitter. I don’t really want to try to think about GC in Rust.  ↩ I initially thought any variable had to be monomorphic but I could not get an error from programs such as .  ↩

0 views
Jason Tucker 1 weeks ago

Teaching Home Assistant to read my RV generator (without starting it at midnight on accident)

It was late at night and I had a question I couldn't let go of: could the Raspberry Pi running Home Assistant in the RV talk to the generator's auto-start module? Our coach has an AGS (auto generator start) module, the little box that starts the generator when the house batteries get low or the temperature climbs. The only way to talk to it is the manufacturer's phone app over Bluetooth. No integration, no API, nothing in Home Assistant Marketplace, and I later find out why. So I asked Claude (Claude Code, running on my Mac with SSH access to the RV's Home Assistant box) to go look for it. A few hours later I had live generator status on my dashboards, a decoded protocol, and a pretty clear picture of who did what. This post is that picture. I want to be upfront about which parts were me and which parts were the AI, because I think that split is the interesting part. My ask was basically "use Bluetooth on the Home Assistant and see if you can find the AGS." Claude SSHed into the Pi, ran a 20-second scan, and there it was, advertising with a strong signal from inside the coach. It also spotted the OBD dongle and one of my temperature sensors, which was a nice sanity check that the scan was real. Then it stopped and asked before connecting. Its reasoning was that the module might only allow one connection at a time (which would lock out the phone app), and that this is a generator controller, so it wanted my OK before talking to it at all. I said yes. It connected, listed the Bluetooth services, and read the labels on them: a device name, a command channel, firmware updates and pairing. Nothing was written. This is where I nudged things. I pointed Claude at the Android app on the Play Store and said it could decompile it if it wanted to know what we could control. Then, while it was working, I sent over the manufacturer's manuals and firmware page too. Claude downloaded the APK from a mirror, decompiled it with jadx, and found out a few things fast: The firmware page turned out to be a dead end for this project (it's all head-unit firmware, the AGS updates itself through the app), but the AGS manuals were useful context. Claude gave me three options for where the listener should live: an ESP32 running ESPHome near the module, a small Home Assistant add-on, or a script on my Mac. I picked the add-on. Before building anything, it ported the Telink login and encryption from the decompiled Java to Python, line by line, and ran a read-only test from the SSH add-on. It logged in on the first try and status packets started rolling in about once a second: 12.88 volts, manual mode, generator off. Temperature reads zero, which I think means there's no probe connected. Then it packaged it up. The add-on is a couple hundred lines of Python using bleak for Bluetooth and MQTT discovery through the Mosquitto broker I already had, so the entities show up as a proper device in Home Assistant. One detail I liked: it doesn't hold the Bluetooth connection open. It connects once a minute, listens for 10 seconds, and lets go, so the official app on my phone can still connect. The tradeoff is up to a minute of lag, and that's fine for a generator. The first build failed because this version of the Supervisor no longer passes a base image into local add-on builds. Claude read the Supervisor log, switched to a pinned Python base image, and the second build worked. That's the kind of thing that would have cost me 30 minutes of googling. With the entities in place, I asked for everything on the RV Home dashboard plus a new RV Generator dashboard. Claude backed up every dashboard file first, then added a Generator section to RV Home, built the new dashboard (status tiles, a battery gauge with 24-hour and 7-day history, and a 7-day run timeline), and added a Generator button to the navbar on every RV dashboard. It restarted Home Assistant core to load them and checked that the entities came back. There are no buttons on any of it. Read-only, on purpose. The status message only gets you so far. The AGS settings (start and stop voltage, quiet hours, run time limits) and the run-hours counter only show up when the app asks for them, and the bytes for asking live in the compiled Dart code. Getting those out meant running a Flutter decompiler called blutter. Here's the funny part. The first time Claude tried to build blutter, Claude Code's own safety check blocked it. Claude didn't try to sneak around it. It stopped, finished the dashboards, and told me what it couldn't do and why. When I came back to it and said go ahead, it ran. I was pretty nervous about this stage, and I told Claude so more than once: don't start the generator, don't change any settings. It took that seriously: Even then, the first two attempts got no answer. Claude worked out why: the module's mesh address was hiding in a second block of the Bluetooth advertisement, and the decompiled Java was building one part of the encryption a little differently from what the firmware actually expects. When it switched to the way the open-source Telink libraries do it, the module answered both requests. AGS disabled, quiet hours 10:20 PM to 8 AM, and 5 minutes on the run-hours counter. And that's where I called it. It was late, and I'd rather finish this in daylight when I can hear the generator if something goes sideways. Turns out burning the midnight oil is risky business too. I didn't want to wake anyone up by cranking the generator at 11:45 PM, and I really didn't want to explain to my wife, "Sorry babe, I was vibe coding a generator controller because I'd already run out of stock hardware to hack on the house side of the RV." I keep getting asked how much of these projects are me and how much is the AI, so here's the honest version. What I did: What Claude did: If I'm honest, I couldn't have written the encryption port myself. That's not my skill set. But Claude also wouldn't have gone looking at the manufacturer's app without the nudge, and it definitely wasn't going to decide on its own how much risk I was willing to take with a generator. When we bought this RV, I pulled out the manuals for every product in the shell, everything that makes it tick. With Claude's help I scanned all the PDFs and built an owner's manual of manuals: exactly what we have, how it's set up and which model of each thing is installed. At that point we both knew what was in there, so let's start digging. Every module running this app appears to use the same Bluetooth login, and the app's passcode isn't enforced by the module. That means anyone within Bluetooth range of an RV with one of these could probably talk to it, and possibly start the generator. A generator starting on its own next to a parked RV is a carbon monoxide problem, not just an annoyance. So I'm not naming the brand or the model, and I'm not publishing the login or the command bytes for start and stop. I'm reaching out to the manufacturer first. If your rig has a Bluetooth generator auto-start, keep your CO detectors working (you should anyway). I'd even go so far as to add a second, smart detector and monitor it in Home Assistant and notify you on your phone. In daylight, with the generator locked out so it physically can't start, I'll compare the values Claude read against the app to figure out the units, then roll the two read requests into the add-on so settings and run hours show up as sensors. After that come alerts for low battery, faults and failed starts. Start and stop buttons in Home Assistant might come later, with a confirmation step, or might not. I haven't decided. Have you wired an RV system into Home Assistant that was never meant to be? And how much do you let AI tools touch hardware that can actually hurt you? Let me know, I'm curious. More on this soon. One last thing. This post isn't really about finishing the project. It's about how I did it, and how you could too. Pick the problem, point at the right sources with what you already know, make the calls, ask lots of questions, switch to plan mode and ask more, and set the rules so the generator doesn't start at 11:45 PM on a Tuesday in your dead-quiet neighborhood. Then ship it to an audience of one. Not everything I build needs a GitHub repo, an issue tracker and strangers asking for features. This one just has to work in my rig. It's a Flutter app. The real logic is compiled Dart, with a thin Java layer that hands Bluetooth calls to a native library. It's built on Telink's light-mesh SDK. Yes, the same Bluetooth mesh stack used in cheap smart bulbs. The generator controller is basically a very angry light bulb. The login is the same for every unit. The mesh name and password are hardcoded in the app. The six-digit passcode you type in the app is only checked inside the app, not by the module. More on that below. The status layout was right there. The Java code that unpacks the status message spelled out every field: battery voltage, temperature, generator running, fault, start failed, manual mode, ignition and retry count. It mapped every command first. Every command the app can send, sorted into reads and controls. Start, stop, reset, factory reset, settings changes, door lock, key fob pairing and set clock all landed in the do-not-touch pile. It proved the two reads were safe. Both are sent automatically by the app when a screen opens. An app doesn't change your generator just because you looked at it. It wrote a hard allowlist. The code that builds commands refuses anything except those two exact requests, and Claude tested that locally (start, stop and the rest all got rejected) before anything went over the air. Picked the problem. I wanted generator status in Home Assistant, and I knew the module was Bluetooth. I also knew the app existed and had played with it. Of course I'd already scanned for Bluetooth devices in the rig looking for things to control, and this was one of them. Pointed at the right sources. The Android app and the manufacturer's manuals and firmware page were my idea. Claude hadn't gone looking for them yet. I run iOS, but I know Android apps are easy to pick apart, so let's have a little fun. Made the calls. Yes to connecting, add-on over ESP32, which dashboards, and when to stop for the night. Set the rules. No starting the generator, no settings changes, no testing for real. I said it three times, and I'd say it again. Approved the scary stuff. Connecting to the module, running the decompiler, and sending the two read requests each waited for a yes from me. All of the hands-on work. Scanning, connecting, reading services, downloading and decompiling the app, and reading the Java and Dart. I kept asking what it was looking at, and used /btw for side chats while it decompiled. All of the code. The Python port of the Telink protocol, the add-on, the Dockerfile, the MQTT discovery config and the command allowlist. I know how MQTT and Docker work, but every step of this was virtual hands doing the work for me. The debugging. The add-on build failure, the missing mesh address and the encryption difference, each from logs and decompiled code. Oh man, this was the tricky bit, and I'm glad Claude Code handled it. The Home Assistant plumbing. Dashboard JSON, navbar edits on five dashboards, backups and the core restart. Once it had built the sensors, I let Claude Code handle all of this. Knowing when to stop. It asked before connecting, stopped when the safety check said no, and kept the generator out of reach the whole time.

0 views
Martin Fowler 1 weeks ago

Deterministic Simulation Testing

Distributed systems are hard to test because partial failures overlap with live traffic and the same fault can produce different execution traces on different runs. Unmesh Joshi describes how deterministic simulation testing addresses this by replacing real clocks, networks, and storage with simulated components driven by a single-threaded execution loop. This allows simulating both hard failures and routine slowdowns—such as network and disk latency spikes—and more importantly makes every execution reproducible. This article explains the technique using a quorum key-value store as a running example, with code from Tickloom, a Java implementation of the approach.

0 views
Jimmy Miller 1 weeks ago

The Magic of Partial Evaluation

There are certain ideas in software that are simply beautiful. It doesn't matter if they have any practical use. It doesn't matter that you will never convince your coworkers to consider them. There is just something captivating about the way some computational systems work. For me, the most beautiful pieces of software are those that reveal something about the nature of programming languages. Programming languages are my obsession. I have never met a problem that couldn't be solved by introducing yet another programming language. Solving a problem at the programming language level is about solving the meta problem. Instead of trying to solve a particular problem, we take a step back and ask how we can solve a whole class of problems at once. So when I find something that makes me rethink the nature of programming languages, I start rethinking computation as a whole. One of these incredibly beautiful but tricky concepts goes by the name partial evaluation. If you are fascinated by interpreters and compilers, partial evaluation will teach you how they are related, and how you can get a compiler for free. Partial evaluation has been a fascination of mine for a while. But this whole thing came up when James Long announced he had revived Meta's partial evaluator for JavaScript called prepack. When I first heard about prepack, I had some high hopes and expectations for the project, but was sadly let down. This revival brought to light those same dreams. But sadly, just as with the original aim, prepack was not designed for beauty, but for practicality. So I figured it was time to renew my own efforts. Yes, in some ways this is a post repping my own library I'm releasing. But I'm not doing this because I want it to be used. I'm doing this because it lets you play with the idea I find so beautiful. That is what this post is about. Consider the following code: As a person who reads code, you can think about how this code computes and what answer it will give. But you can do more than just give the answer. You can see the expanded form of this particular code for these particular calls. This code is spiritually the same as the following expression, once we expand it out. In this case, there is really nothing at all that this code needs to do at runtime. A sufficiently smart compiler will just run this code directly at compile time and give the answer. But this is a bit less clear if things come in at runtime. It might seem like we can't do anything here, but again, if you are used to thinking about how programs run, you can trace this out and realize this is just the same as: What we have done in both of these cases is called partial evaluation. In the first, it was a trivial case because everything was statically known. But in this latter case, we have reduced a program down into the essentials of its dynamic structure. There are no recursive function calls left. All of this has been expanded as far as it could till we get just the dynamic parts of the code remaining. This intuitive notion of partial evaluation is all you need to know to appreciate the beauty here. Partial evaluation just evaluates the part of the program we can evaluate at build time and leaves all the rest. When we do this with certain programs in certain combinations, we get some quite surprising, incredible behavior. Here we have a very simple interpreter for a language that just supports arithmetic. For the above expression, you should be able to think about how we could start "partially" evaluating it. (In this case, it can be a full evaluation.) If this kind of partial evaluation isn't quite clicking for you, I've put the steps below to hopefully help it make sense. This is a simple evaluation of the code. But what happens if we throw a value we don't know into the expression? Here we can see that clear partial evaluation difference. We don't know how to evaluate . We have no idea what the answer to that will be. But as part of this process, we do know some partial information about it. For example, when we get to we know that is indeed a number. So we can partially evaluate it further. Hopefully this is all making sense. But if you are like me, this all might seem a bit trivial and uninteresting. So let's look at a more complicated example. Here we have a brainfuck interpreter. And the example program we want to partially evaluate does not require any input at all (in brainfuck is the way you get input). So when we go to partially evaluate this, we will just get an answer. In this case, this program is actually brainfuck's "hello world". But what about a program with input? When we do our partial evaluation, we get the following: What is this? A compiled brainfuck program! This is the first incredible fact: when you take an interpreter and partially evaluate it with a program, you get the compiled program out! Now this particular exact form is an artifact of how my partial evaluator works. You could imagine slightly different code. But the key is that what we've done is remove the interpreter completely. What we've discovered here is the first of three so-called Futamura Projections. Our partial evaluator, when applied to an interpreter and given a program, can give us a compiled version of that program. Or to put it in pseudocode. Depending on your exposure to interpreters and compilers, this might seem miraculous or mundane. Writing an interpreter and writing a compiler can seem like significantly different undertakings. In the age of AI, perhaps less so, but I think even then many things still hold. It is quite easy to instrument an interpreter, quite a bit harder to do so for a compiler. Changing an interpreter to support new features is quite easy, less so for a compiler. But more than that, there are all sorts of things that can be thought of as interpreters, that we'd almost never write a compiler for. Consider this simple schema setup. This is code that can easily be partially evaled into something where we have created specialized functions for our particular schema. While not the most crucial code, this can give us a 5x performance boost when our objects start getting more complicated. You may think that we should just hand-write those functions. Or hand-write a compiler for these schemas. But what about those schemas that exist only at runtime? Now we either need to compile those on the fly, or we have to keep both a compiler and interpreter. Having a way to partial eval lowers this burden quite a bit. But if the Futamura projections stopped here, they would be exciting, but not quite the craziness they are. To understand how this can go further, we are going to take this a step beyond your raw intuition of what it means to partially evaluate something and give a different frame. We can think of partial evaluation as a process of "specializing" a program. What exactly is specializing a program? Well, it is taking a program that is generic and making a version that instead works for a single program. Let's think about a simple pattern matcher program like an overly simplified regex. This program is generic. It lets you match on many different patterns. That can be great if we need that flexibility. But if you don't have a bunch of patterns, it might be worth it to just make specialized code. Now, exactly what kind of specialized code? It might be that you only have this literal pattern; then you want to specialize very particularly. Or you just have as a pattern. For any bit of generic code, we can think of how to move our code to a more specialized form. Partial evaluation is a form of specialization that figures out what it should specialize on based on what input is static and what is dynamic. In many ways, a partial evaluator is a generic specializer. Given any program, we can make a specialized version of it for any input. What happens if we specialize an interpreter for a given input? We get back that interpreter for only exactly that one program. But what do we need then? Do we need all this generic dispatch? No, we know the full program. We don't need any operations we don't actually use. We can fully get rid of all the generic interpreter mechanism. But if the specializer can specialize any program, can it specialize itself? This leads us to the second Futamura projection. Put in our pseudo-code format, we get: Or, to put it in our specializer language, what if we make a special version of our generic specializer? What is it specialized for? A particular interpreter. Now we have a function that, given any program, will spit out newly specialized interpreters just for that program. Or, in Java speak, we have a specialized interpreter factory. Let's see a real example of one of these compilers to make this concrete. Here is the interpreter we are going to specialize. When we apply our second projection, we get out the following compiler: And if we compile one of these very simple programs, we can see the output: Now, of course, this is not a very interesting language. But hopefully you can see this general idea. Given an interpreter, we automatically derive a compiler! Pretty incredible. But we can't stop at the second projection. We have to push on and get to the final mind-bending projection. If you apply our specializer to itself as input, you get a compiler generator. So now we have a generic function that will spit out compilers for any interpreter we give it! I have implemented a reasonable, but still very limited partial evaluator for JavaScript in Rust. I have taken it further to try to make it work quite well for a number of different interpreters and interpreter-like programs in JavaScript. I've also tried to get limited versions of the second and third projections working. Go play with it, see what works, what doesn't, file issues, or better, use some of your tokens to help me make more cases work. But most of all, explore. This is such a rich space. Below are some papers, blogs, and projects about partial evaluation in some way, shape, or form. There has never been a better time to play with these kinds of crazy techniques for programming languages. Don't let what is practical stop you from exploring the cool, interesting aspects of programming. weval: the WebAssembly partial evaluator Compilation of JavaScript to Wasm, Part 3: Partial Evaluation — Chris Fallin A First Futamura Projection — Veit Heller Partial Evaluation in Truffle — Graal documentation Partial Evaluation of Computation Process—An Approach to a Compiler-Compiler — Yoshihiko Futamura (1971, original English translation) Partial Evaluation and Automatic Program Generation — Neil D. Jones, Carsten K. Gomard, and Peter Sestoft Tutorial on Online Partial Evaluation — William R. Cook and Ralf Lämmel

0 views
neilzone 3 weeks ago

Upgrading my Airsoft rifle

I spent a pleasant morning at Red Alert, making a couple of small (but hopefully useful) upgrades to my main Airsoft rifle (MTW). I changed the routing of the air line for the HPA engine, routing it out the back of the rifle, under the buffer tube, moving it from down the hand grip. I also replaced the stock grip with a grip containing batteries and switch, so that I can power the HPA engine with that, rather than needing to install a Li-Po battery each time. These were reasonably straightforward upgrades, and I was keen to do them myself - to get the benefit of the learning experience - but I was also very keen to do it around people who know what they are doing. I also wanted to borrow an armourer’s wrench, as I do not have one, and I so rarely need one that buying my own seems a bit pointless. Luck was on my side, as the upgrades went smoothly. I dropped a small spring at one point, and I did not know from whence it came. It turns out that it was a spring which retains the small pin which keeps the large rear metal pin in place - it is inserted from near the stock at the back of the rifle, through a small hole, which I uncovered when I replaced some parts to re-route the air line. Fitting the upper and lower receiver back together, with the new, shorter, air line in place was a bit of a pain, but hopefully I am not going to need to open up the weapon too often, having made these changes. Perhaps the next time that I need to change the hop rubber? But not each week as I did before, to insert and remove the battery. I took the opportunity to make a slight adjustment to my HPA regulator’s output, giving me an increase of about 10 feet per second, while hopefully keeping me sufficiently clear of the upper limit for this weapon that I don’t need to tweak it down again when I use someone else’s chronograph when I next play. Lastly, I re-zeroed my red dot, as it was slightly out. I was doing pretty well at the end, hitting with reasonable accuracy out to 70m, so I look forward to giving this a go in a game very soon.

0 views
Brain Baking 3 weeks ago

Favourites of October 2026

Boo! Happy Halloween. See you next year for another scare. In the meantime, live slogs, and sometimes rushes, on. We’ve had the pleasure to experience the grand opening of the flu season resulting in more sleep deprivation whilst trying to take care of the sick kids. As you can imagine, dodging sickness itself became an impossible task. It looks like every month comes with something to complain about. Did you know that nonstick pans only last two to five years, according to the shop assistant that talked me into buying two new ones? The Teflon layer got nicked (and consumed??) so this time I went with a hardened ceramic layer. After taking care of the bill, I said “see you in ten years then”, to which he replied “no”. I guess I’ll be extra careful this time. Previous month: September 2026 . This month mostly represented clearing out the Castlevania -related backlog: Most of the gaming evenings were spent chasing after Diablo and murdering his Prime Evil brethren in Diablo II: Resurrected . I played the Switch port and wouldn’t recommend it unless you don’t own decent hardware like I do. After a few cow runs, I got tired of it—yet again, the grind fatigue hits me. The only unique item I saw drop was a flail my warlock couldn’t even use. Sunk Centre: a lighthouse that floats with a 12 m focal height part of the UK. If you love these kinds of games, remember that tomorrow is Underkeep’s release date. Here’s the release trailer to get you started: Related topics: / metapost / By Wouter Groeneveld on 4 November 2026.  Reply via email . I replayed Order of Ecclesia 18 years after playing it for the first time. It still rocks, but I’ve grown less patient when it comes to grinding for better glyphs. The PSP remake of Rondo of Blood , Dracula X Chronicles , is mostly a good excuse to play the original, if you manage to unlock it. Jaap-Henk Hoepman’s stance on genAI mirrors mine. Academia is fucked as well, it seems. The Naibu Studio Garden website is beautiful. The blueberry tracking your mouse is a nice touch. In case you’re in dire need of a world map of lighthouses , Aaron J. Becker has got you covered. I discovered there are a couple of floating lighthouses between Belgium and the UK with sweeping beams: posted news about yet another FPGA-based Game Boy clone called the FPGB Mini . I’ll stick with my Analogue Pocket for now. Another cool map: pinballmap.com that lists venues housing pinball machines. Thanks for mentioning it, Michael . Victoria Lacroix hates crafting in video games . I think it’s fine as long as indeed it doesn’t become a huge brainless timesink, and more importantly, if its heavy subsystems stay mostly optional. According to Hamuko, spending $70 on a video game is OK . They defend the statement with some quick financial maths. Remember when N64 games cost $65? Add inflation and you’re well above $70. I’m fine either way: most indie games I think are severely underpriced . Robert Yang wrote an interesting design review of Against The Storm , reminding me that I should pick it up again. There’s someone who spent years creating a texture-correct Ultima Underworld patch , fixing the weird affine texture-maps you also see in early 3D PS1 games. Jamie Zawinski explains AI to us like we’re 80 . You’ll need to understand it, because… The cat is out of the bag: Linus Torvalds committed Claude-assisted code into the Linux Kernel . I’ve seen people creating new forks of BSD-based OSes as a result. It’s getting very bad. Very bad indeed: the Steam Next Fest submissions are drowning in AI slop . Or how about a certain Proton CEO making bold claims regarding the use of genAI: my way or the highway. The latter, please. Emacs turned 50! Stefan Monnier and Michael Sperber wrote a long paper on the history of the editor (from 2020). Steve Losh’s educational posts on Emacs continue to amaze me. Here’s an overview of what symbolic computation is to help you grasp the concept of a REPL and how Emacs/ELisp handles it. Natalie Weizenbaum, the granddaughter of the famous MIT professor, read her granddad’s work Computer Power and Human Reason , which in this genAI age is especially relevant. Cameron Swingle is goofing around as usual with their What Game I Think Each Villain From Scooby Doo And The Cyber Chase Would Play On Their PSP article. I’m a bit late to the party but in case you also missed it, here’s Digital Foundry’s Diablo II: Resurrected tech analysis (on YouTube). Creopard.de is a fascinating new website full of old stuff such as their love for collecting Big Box PC Games . This lovely Myst Journey walkthrough website might come in handy next year when we play the game as part of the DOS Game Club. Speaking of old PC gaming stuff: 3Dfx Interactive is thirty years old now. A ResetERA thread pointed it out . I might expand this into a blog post of its own someday soon. Speaking of ResetERA forum posts, here’s a cool overview of “blobber” RPG games or classic first-person dungeon crawlers. The public-apis GitHub repository lists a huge number of APIs you can play around with, such as the Disney API I used as a baseline for a project assignment in my Java classes.

0 views
Stratechery 3 weeks ago

AI on the Ballot

Listen to this post : From Bloomberg this morning at 2 a.m. Central: Democrats won control of both chambers of the US Congress in a midterm election landslide that amounted to a rejection of President Donald Trump following widespread voter discontent with the economy and the war in Iran. Across the country, Democrats scored victories in GOP strongholds, flipping at least seven Senate seats and winning House races in districts Republicans easily carried in 2024. Several news organizations projected that Democrats would win the House, while Decision Desk HQ projected they took the Senate. I have no doubt that Iran and the economy played significant roles in this election; what stood out to me, however, was very much Stratechery fodder. Specifically, I watch a lot of sports, and particularly this fall, watched a lot of baseball. My Milwaukee Brewers — excuse me, my World Champion Milwaukee Brewers — demanded my full attention, which also meant I saw a lot of campaign ads, and by far the most common topic, at least here in Wisconsin, was data centers. Moreover, it was never entirely clear which way it cut politically: both parties were anti-data center, accusing their opponent of being the opposite. Meanwhile in Texas, from Yahoo Finance : A strong showing by Democrats in Texas swept Gina Hinojosa into office as the state’s first Democratic governor since 1990 in a contest closely watched by Big Tech companies. The state is considered a bellwether for government restrictions on AI data centers…Hinojosa, Texas’ first Latina governor, has pledged to impose a moratorium on data center construction in Texas, which accounts for more than 25% of planned US capacity by 2030. Republican incumbent Greg Abbott, I would note, already declared a moratorium on new data-center permits in September; that’s how much of a hot-button issue this is, including in the state that is the biggest opportunity and beneficiary of the data center buildout. So yeah, this is a Stratechery topic of concern. Earlier this year, while writing about data center opposition , I said: There really wasn’t widespread opposition to data centers when they were being built for the Internet generally; indeed, local governments would compete for them, eager for the economic benefits that came during their construction and the long-term tax benefits once they were operational. In other words, it seems pretty clear that the current wave of opposition can’t be divorced from AI — you know, the technology that in the best case scenario is going to take everyone’s jobs, and in the worst case scenario end the human race. I do not, I don’t think, need to explain to you why this is not a very compelling message, and, in the very long run, I do think that humans will have economic value . At the same time, it’s hard to explain the huge amount of investment that is going into AI, not just at the model level but also in terms of data centers, without admitting that a big part of the thesis is that AI can not just increase the top line for companies, but also increase the bottom line — i.e. replace the jobs of some number of humans. Again, I’m generally an optimist here, but this already happened with the first wave of IT . That leads to an interesting contrast to globalization: when companies were closing down American factories and laying off workers and moving operations to China, none of the affected towns or workers had a say. They just suddenly no longer had a job, and a huge number of cities across the Rust Belt no longer had a reason to exist. People simply had to move, or worse, retreat to things like alcohol or drugs. AI, however, is the opposite: building data centers requires permission, which is to say that people actually have a say. Again, I am not at all saying that these people are well informed about data centers, or about the economic impact on their communities, much less the economic impact of AI generally; what I am noting is that people who didn’t have a say in globalization are suddenly finding they do have a say about AI, and it’s not a surprise they are expressing their disapproval by blocking data centers. That message was loud and clear last spring; now it is deafening, and it’s tempting to say that tech, particularly the frontier labs, have no one to blame but themselves. In fact, however, some of the biggest culprits may, in the long run, be some of the biggest beneficiaries of the anti-data center wave. My thesis — driven not just by national results and the Texas governorship, but also the fact that, as this thread documents , nearly every relevant local ballot measure opposing data centers won or is winning ( the only exception so far was in North Dakota ) — is that the constraint on AI dispersion has shifted once again. First we were short on compute, but that ramped; now we are short on memory, but that will ramp; we were coming close to being short on power, but that will be rectified. The final constraint is political, and that may be the most imposing constraint of all. Not only is it harder to solve, but it actually interferes with solving the other constraints. Many of the theories about AI assume that it becomes a commodity; I think it’s just as likely we are looking at scarcity for much longer than we expected, which will have ripple effects on everything. To that end, here — with the caveat that nothing leads to hot takes you regret like an election — are ten perspectives on what a permanently impaired ability to build might mean. To be clear, I’m not declaring permanency — look at how our elections swing back and forth — but it’s worth considering what the implications might be if Americans don’t change their minds about data centers. The most obvious reason why the stock market has been rocky over the last few weeks is the tightening of credit markets, which I wrote about this summer . We are, needless to say, full on into the equity funding era (and while I’m here, I haven’t written about Anthropic’s updated S-1 , but it strongly affirms my initial analysis ). At the same time, it seems clear that this outcome is very bad for the AI trade in the short term, but much of the pain may have already been endured. The Neoclouds have been at the forefront of credit concerns, and from a certain perspective, being unable to build data centers has a silver lining in that they couldn’t get the money to pay for them anyways. Moreover, Neoclouds with facilities that are already permitted now have an asset that is going to be scarcer than expected. At the same time, it’s Neoclouds that need new sites and new permits, even as they are likely to have much less political sway than the hyperscalers — who already have more sites they can repurpose or rebuild. It was already getting harder to get capital, relative to the hyperscalers; now you have to layer on that it’s going to be harder to get permission, too. The downside for the neoclouds is upside for the hyperscalers, who are more likely to grow their share of AI compute than they were before. Moreover, investors may be pleased if the hyperscalers’ ambitions are somewhat curtailed; political opposition is an excuse to moderate spending, knowing that everyone else is in the same boat. Nvidia will almost certainly be a short-term loser. Fewer data centers mean fewer Nvidia chips generally, and a weakened Neocloud set is particularly harmful not only because Neoclouds almost exclusively use Nvidia full-rack systems, but also because Nvidia is back-stopping a huge number of them. It’s the hyperscalers, meanwhile, who are Nvidia’s biggest long-term threat, given their scale and ability to invest in their own chips. At the same time, a constrained world makes Nvidia’s offerings more compelling. CEO Jensen Huang actually spent an entire keynote making this point back in 2025; I wrote in an Update : When Huang says “iso power” he means that power is the constraint; the question is how many tokens can you generate given a fixed power envelope, and Blackwell can generate a lot more. These were the numbers Huang gave for a 100 MW data center: What this means is that the first order of business for an ASIC maker is to match that level of efficiency. That, though, means keeping up with Nvidia’s product development cadence; The Information has a post about Amazon offering instances using its latest Trainium ASIC at a significant discount to the H100. Huang, though, spent this keynote insulting the H100! You can almost hear him speaking to Amazon directly: you spent all this money, and are offering these huge discounts, just to entice developers to lock themselves into an inferior chip, even as reasoning models are going to swamp your available power generation… Huang is issuing a challenge to every cloud provider tempted to make an ASIC: do you really think that you can keep up with this, and risk running out of power capacity because your chips aren’t efficient enough? Don’t even try. A world without power or data center constraints is one where it is, in the very long run, very difficult to maintain Nvidia’s margins; once those constraints start to bite, however, an advantage in tokens/megawatt is worth a lot of money. Go back to my point about the hyperscalers: one way to generate more tokens is to build a new data center; another way is to rebuild a data center with new Nvidia chips. China is the inverse of the scenario that Huang laid out: the country has plenty of power and the ability to build a lot more, but they don’t have leading-edge chips. Some of the advantages of leading-edge chips, however, can be overcome by simply throwing tons of electricity at the problem. From a 2025 Update about the Huawei CloudMatrix 384 supercomputer: The CloudMatrix 384, which is a supercomputer consisting of 384 chips, takes up dramatically more space, uses dramatically more power, is almost certainly dramatically more expensive to make, and is dramatically more brittle than Nvidia’s NVL72; there is no one in the world who would choose the CloudMatrix 384 over the NVL72 if they had the choice. That’s the thing, though: China doesn’t have the choice, because of U.S. export controls. The country’s saving grace is that they are operating on different constraints than the U.S.…China — which actually builds power generation — is not iso power; they are iso compute: Huawei’s goal with the CloudMatrix 384 is to get as much compute as possible, power efficiency be damned. In the fullness of time — i.e. as China figures out leading-edge chips — this may be an insurmountable advantage. When SpaceX released their S-1, I explicitly pointed to political opposition to data centers as one of the company’s most significant upside scenarios: The third question about data centers in space is if there is a stick. Specifically, while I think that racks-in-space are both a lot more viable than people think, and a lot more relevant to agentic inference than current modes of compute, it is at the end of the day cheaper and easier to build on earth, all things being equal. All things are not equal, however: right now we are at the very beginning of the AI buildout and already one of the biggest constraints is not just power (expected), but zoning (unexpected). I wrote in an Update last week: I already posted the relevant excerpt above. Continuing: In that Update I made the case that data center builders — and by extension the companies that use them — should straight up pay people for permission to build data centers in their communities. At a minimum, however, that increases the costs of terrestrial data centers. What seems very plausible in the long run is that the demand for compute ends up being so large that there eventually is nowhere left to build, making the vast expanses of space not just an alternative but in fact the only choice. This is where I come back to my experience watching these campaign ads: this isn’t a partisan issue, where the pendulum will swing back in two years. Both parties see opposition to data centers as a winning cause, and not just nationally: that thread has multiple examples of local officials straight up recalled for approving data centers in their localities. Space will be incredibly difficult, but difficulty is all relative! Moreover, to the extent opposition is permanent, the more this actually reduces the risk of data centers in space, because investors will have more confidence in there being enduring demand. If the hyperscalers had a red queen problem , the frontier labs have it even worse: the biggest revelation from Anthropic’s S-1 was that their inference margins were very high (good!), which meant that their massive compute costs were actually in R&D; this is bad because that R&D spend is governed by competition with the other frontier labs, and absent constraints, that spend looked set to surpass revenue sooner rather than later. Now, however, it is the public that is effectively demanding that the frontier be paced, which is great for the frontier labs’ financial outlook. The upside goes further than that: the point about efficiency being more important in a world of constraints doesn’t just matter for chips, but also for models. Devoting limited compute to inefficient and costlier-to-serve Chinese models is a poor trade if there isn’t enough compute. Moreover, open models may be at greater regulatory risk, as Democrats seem much more likely to pass laws that ultimately favor the frontier labs. There are some counter-arguments. First, if compute is constrained, and thus more expensive, then that will increase the drive to right-size models for jobs, which is a big argument in favor of open models; the fact that compute won’t be a commodity means that the frontier labs’ lower cost to serve will never come to bear on the low end of the market. And, it’s worth noting, it will be harder for the frontier labs to build their own compute, leaving them dependent on the hyperscalers; big tech wins again. The most obvious advantage for Apple is that in a world of constrained compute, inference on the edge will be that much more important. Another advantage is that any slowdown in the dispersion of AI is good for a company that dominated the previous paradigm . The biggest advantage of all, however, is that any slowdown in the AI buildout offers hope that the memory crunch will ease. This will take a while, to be sure, but no company would be a bigger beneficiary of the world running out of places to put AI chips than Apple. AI has drawn a great many battle lines, not just in terms of data centers, but also within AI, and between AI and the rest of tech. Specifically, anything that strengthens the frontier labs is likely bad for the rest of the startup ecosystem. In a world with fewer data centers, startups will have less access to cheap compute, even as a slowdown in capabilities both means it takes longer to build compelling products and also gives the frontier labs time to actually build products that secure their ownership of the end user. One major fear that investors have had about the data center buildout is that there would be too much capacity, causing prices to plummet and investors and creditors to lose their shirts; that scenario, however, would be great for users, who would suddenly have access to incredibly cheap compute. Of course most users aren’t going to use AI directly; what they will miss out on is the equivalent of the Web 2.0 wave of free Internet services that were predicated on compute being free. Now there’s a good chance that AI is going to have meaningful marginal costs for a long time to come. At the same time, while I have been an optimist about humans in an AI future , there is no question that we were and are facing a wrenching change as intelligence becomes a commodity. It follows, however, that if it doesn’t become a commodity — or if that change takes longer than expected — that humanity will have more time to adapt. Maybe this is a break we needed; what is increasingly clear is it’s the break Americans wanted. That noted, there is a long history of citizens demanding the ends and opposing the means, and it’s the demand that wins in the end. The big difference today is that, unlike the first few waves of tech, the industry is going to need to do some convincing, and break the habit of assuming everything it does will get the benefit of the doubt. AI wasn’t technically on the ballot, but it was implicitly, and will be forevermore. Presented by I spend a lot of time trying to figure out what is happening to businesses on the internet. What I often find I’m missing is a view across the economy itself. With more than 1.7% of global GDP running on Stripe, working with them means I can bring some of what they’re seeing to Stratechery. They are, in a sense, a barometer of the economy. Take the “SaaSpocalypse”. Earlier this year, nearly a trillion dollars in enterprise software value disappeared amid fears of AI eating its lunch. Stock prices only tell us what investors think will happen, and not necessarily what is happening. In this case, Stripe recently built a SaaS Index using payments data from 72,000 non-AI SaaS businesses. Looking at their actual performance, we can see that while SaaS stocks were selling off, revenue growth was actually accelerating. Year-over-year growth is now over 30%, with some of the fastest growth coming from the youngest SaaS companies. I suspect there are a lot more interesting things hiding in Stripe’s data, and I’m excited about having an excuse to go look for them.

0 views
マリウス 3 weeks ago

PBS Black on Black

Disclaimer: While this post is about the “Black on Black” keycap set specifically, it is also a more general review of the PBS profile. In the Q3 2026 update I mentioned the set of PBS Black on Black, which has been on my Kunai ever since. I said back then that I might write a dedicated review once I could better judge it over a longer period of time. A year and a half earlier, in the Q1 2025 update , I had complained about the lack of textured PBT keycaps in the KAM profile and expressed my hope that PBS would eventually take that place. As far as the shape goes, PBS turned out to be pretty much what I was hoping for. Unfortunately, the same can’t be said about the texture, which is a lot smoother than I would like it to be. PBS is short for Penguin Belly Slide and it is a keycap profile designed by none other than Matteo Spinelli, better known as Matt3o, who is also the designer of the MT3 and MTNU profiles. According to Matt3o, the name comes from the hitting area , which is soft, round and oblong, and looks as if it was shaped over the belly of a penguin, while the slide is there because typing on the keys is fun. Unlike MT3 and MTNU, PBS is a uniform profile, meaning that every row has the same shape and height. Matt3o, whose first keycap set was in the DSA profile, calls PBS his tribute to flat, low-profile keycaps and an attempt at a uniform profile that is less boring than DSA. Matt3o began working on PBS in 2022, alongside MTNU, and initially planned to produce it with KBM, which had suggested increasing the wall thickness from 1.5mm to 1.7mm. The project eventually moved to Keyreative, the manufacturer behind the KAT and KAM profiles, with CannonKeys as the global distributor and with the walls back at 1.5mm. CannonKeys released the first PBS blanks in August 2024 and the Black on Black set in October 2024, as an in-stock product for $65, which was restocked several times over the following year. In 2026 a second round added a Modi kit with colored modifier legends. At first sight PBS looks like a cylindrical profile, with the rounded front and back edges and the straight left and right edges that Cherry and OEM keycaps have. The scoop of the hitting area, however, is not a cylinder but a sphere, which Matt3o cuts at the front and the back with a cylinder. The result is a hitting area that is as deep and round as the one of a spherical profile like MTNU, but without an obstacle at the front and the back, as the cylindrical cut lowers those edges. Matt3o describes it as the depth of a spherical top combined with the ergonomics of a cylindrical profile, and he estimates the hitting area to be about 20% larger than the one of MT3. The concave keys are 7.43mm tall at their highest point and the convex ones 7.91mm, which puts PBS slightly below DSA, at 7.84mm, and well below XDA and KAM, at 8.74mm and 9.05mm respectively. With a standard MX switch, the top of a PBS key ends up about 17.8mm above the PCB, compared to 20.5mm for Matt3o’s MTNU. I like the profile and its sculpt, especially the way the scoop hugs the fingertips. People who don’t usually like uniform profiles will likely find the scoop deep enough to keep the fingers from drifting onto neighboring keys, with edges that are soft enough to slide from one key to the next. PBS is a very comfortable uniform profile, more than DSA, XDA, KAM and uniform SA. Many profiles, like Cherry, MT3, KAT or SA, are sculpted , meaning that each row has its own height and angle, so that the upper rows face the typist and the lower rows face away. Sculpted sets need separate molds for every row, and each key only works as intended in the row that it was made for. A uniform profile like DSA, XDA, KAM or PBS uses the same shape for every row, so that any key fits any position of the same size, which, as Matt3o points out, makes every PBS set a free Colemak kit. It also keeps the cost down, as all 1u keys are identical, which was one of Matt3o’s goals with PBS. As I described in my Corne V3 build , the Corne only makes use of R2, R3 and R4 of a sculpted set, and every key has to come from the right row to keep the sculpt consistent. With PBS any cap fits on any position of the Kunai , as long as the size matches. This finally gives me proper legends, e.g. for my Control key, or my Return key. PBS is available with concave and convex keys, and it’s up to the designer of a set to choose which ones to use for the bottom row. Matt3o himself prefers concave keys for their flexibility on custom keyboards. The Black on Black base kit uses a concave bottom row, with convex spacebars and a handful of convex extras in sizes from 1u to 3u, which some owners use on thumb clusters. For homing , the kit includes F, J and numpad 5 keys with a bar as well as with a deeper scoop. Matt3o prefers the deep scoop, while, according to him, most people prefer the bars. On my Kunai I’m using the bars, and for the right thumb (space) I’m using a concave key. The heights are the highest point of a 1u key, as published by CannonKeys and Keyreative. Matt3o never published the row heights of MT3, so the MT3 numbers are my estimates, based on my own measurements. The Cherry profile goes back to the keycaps of Cherry’s own keyboards. GMK has been producing it in double-shot ABS since it took over Cherry’s double-shot tooling in 2011, and sells it as CYL these days. Cherry is a low, sculpted profile with four row shapes, namely R1 for the function and number rows, R2 for the top letter row, R3 for the home row and R4 for the bottom letter row and the modifiers. R1 is the tallest at 9.80mm and R3 the lowest at 7.30mm. According to Keyreative’s 3D models of its Cherry-profile caps, the lower a row is, the more its top is tilted away from the typist, from about 0 degrees on R1 to about 11 degrees on R4. The top of a Cherry key is a cylindrical cut that runs from the front to the back, so that it curves down in the middle when seen from the front, while it’s a straight line when seen from the side. Cherry-profile sets come as double-shot ABS from GMK, with 1.5mm walls and a fine texture that turns into a shine over time, or as dye-sublimated and double-shot PBT from manufacturers like EnjoyPBT and Keyreative. I’m not a big fan of the Cherry profile, although on the Corne, which only uses R2, R3 and R4, it felt more balanced to me than on any 60%+ keyboard. PBS shares the straight sides, the rounded front and back edges of the Cherry profile, but it replaces the cylindrical channel with a spherical scoop and the four rows with a single shape. At 7.43mm, PBS is about as tall as the Cherry home row and lower than its number row, and on the three rows of a Corne the two profiles are within about a millimeter of each other. MT3 is Matt3o’s first profile, which he began drafting in 2015 in a discussion on Deskthority, where the consensus was to create something that resembled the keycaps of IBM’s beam spring keyboards. Massdrop, later Drop, produced it, starting with /dev/tty, which shipped in January 2018 as dye-sublimated PBT with walls of around 1.8mm, while the double-shot ABS sets started with Susuwatari in 2020. MT3 is a tall, sculpted profile with a deep spherical scoop, which Matt3o designed for keyboards with an incline of 5 to 9 degrees, at which the home row ends up parallel to the desk. It adds a steep function row, R0, and offers the bottom row in two versions, an angled R4 and a flat R5. Matt3o’s own 3D files put R0 at 16.2mm, and the letter rows are roughly 11.4mm to 12.8mm tall, which makes MT3 the tallest profile in this comparison. Drop, which owned the MT3 molds, closed its store at the end of March 2026 and turned drop.com into a hub for the collaborations of Corsair, which had bought it in 2023. I favor MT3 for its sculpting, and it had been on the Kunai before PBS. PBS has a scoop that I would compare to the one of MT3 and a hitting area that Matt3o estimates to be about 20% larger, while it does away with the row sculpting and a lot of the height. PBS is quite significantly lower than MT3, making my Kunai a lot more portable. KAT, short for Keyreative All Touch, is the sculpted profile that Keyreative began designing in late 2016. Keyreative describes it as a MiniSA , with the slope design of the Cherry profile, taller rows, especially the function row, and a spherical scoop. Keyreative counts the rows from the bottom up, from R1 for the bottom rows to R5 for the function row. Its own chart puts the number row at 11.57mm and the home row at 9.03mm, while its 3D models put the function row at about 13.5mm. KAT is made of PBT, either dye-sublimated with 1.7mm walls or double-shot with 15% glass fiber and walls of 1.65mm, and Keyreative also lists double-shot ABS as an option. Its finish is the silky, satin-like smoothness that PBS has as well. KAT is one of the profiles that I generally prefer. On the three rows of a Corne, PBS is between 1.6mm and 3.2mm lower than KAT. KAM is Keyreative’s uniform profile, which the company developed from the home row of KAT, starting in February 2018. Every KAM key is based on the KAT home-row key, with a shallow spherical scoop and a height of 9.05mm, or 9.94mm for the convex keys. KAM is made of dye-sublimated PBT with walls of around 1.65mm, either matte or glossy, and Keyreative claims that its glossy KAM caps, like the black KAM Blanks that I had on the Kunai, were the first glossy PBT keycaps. Compared to KAM, PBS is about 1.6mm lower and has a wider and deeper scoop, or, as CannonKeys puts it, KAM is taller than PBS with a less pronounced scoop. Keyreative’s own 3D models put the center of the PBS scoop about 1.1mm below its rim, against about 0.7mm on KAM. The convex keys differ in the same way, as they rise 0.89mm above the concave keys on KAM, but only 0.48mm on PBS. PBS keycaps are made of PBT, while GMK and many of Drop’s MT3 sets use ABS. ABS is an amorphous plastic that softens at around 100°C, while PBT is semi-crystalline and keeps its shape up to about 220°C. PBT is also harder and denser, which makes a PBT cap about a quarter heavier than an ABS cap of the same shape, and it takes a lot longer to develop the shine that finger oils and wear eventually give to every keycap. ABS, on the other hand, yellows under UV light (shout out to GMK Bleached! #scnr ), but it is easier to mold precisely, while PBT shrinks more as it cools in the mold, which makes long keys like spacebars prone to warping. Keyreative itself writes that the PBT used for keycaps is usually PBT with added glass fiber, which reduces warping. In a stream about the PBS prototypes, Matt3o mentioned that Keyreative had added fiber to reduce shrinkage, which caused issues with the shift keys and the 2u keys that were to be fixed for the final release. Some buyers still report 2u to 2.25u caps that are tight on certain stabilizers, which however doesn’t affect the Kunai, as a Corne doesn’t use any stabilizers. At 1.5mm, the PBS walls are as thick as the ones of GMK’s ABS caps, but thinner than the 1.65mm to 1.7mm of Keyreative’s KAT and KAM, the roughly 1.8mm of the first dye-sublimated MT3 set, or the 1.7mm that Matt3o had initially planned for PBS. As for the legends, double-shot molding, which GMK and Drop use for their ABS sets, makes every cap out of two plastics, one for the legend and one for the body. The legends can’t wear off, and both colors can be as dark or as light as the plastics allow. Dye-sublimation instead prints the legends onto a film and uses heat to make the dye migrate into the surface of the cap. This works on PBT because it keeps its shape at the temperatures required, while an ABS cap would deform. The dye can, however, only add color, so the legends have to be darker than the cap. With dye-sublimation, light legends on dark caps require reverse dye-sublimation , which dyes the whole cap except for the legends. The process is difficult to get right, and Keyreative stated that it tried to avoid it because it was unstable, with a defect rate of over 40%. Laser etching, which is common on cheap OEM keyboards, burns the legends into the surface instead and usually leaves them lighter than the cap and noticeable to the touch. PBS uses dye-sublimation because Matt3o wanted the profile to be as affordable as possible. Dye-sublimation requires lower minimum order quantities than double-shot, and it doesn’t lock a set into a single typeface, as the legends are printed rather than molded. My gripe with PBS is the texture. I have long preferred thick PBT with a noticeable, rough texture, like the biip MT3 Extended 2048 that I mentioned in the Q1 2025 update, and compared to that the PBS caps are way too smooth for my taste. I had hoped that PBS would be the textured PBT in a KAM-like profile that I was missing, and in that regard it’s a bit of a bummer. The texture of a keycap is mostly a property of the mold rather than the plastic. GMK, for example, attributes the feel of its keycaps to the spark-eroded structure of its molds, and Keyreative even produces glossy PBT, like the black KAM Blanks that I had on the Kunai before and that turned out to be fingerprint magnets. The smooth finish of PBS is hence a choice, and as far as I can tell it is an intentional one. Matt3o designed PBS partially because of the rough texture of Signature Plastics’ DSA, and he described the surface of the PBS production prototypes as pretty smooth. Even his newer PFF profile for low-profile switches, which Keyreative manufactures as well, is only supposed to be one grade rougher than PBS, a difference that he himself calls hardly noticeable. Compared to what you typically find on the other profiles, PBS is among the smoothest. GMK’s ABS Cherry sets start out with a fine texture that wears into a shine over time, and Cherry-profile PBT from other manufacturers ranges from smooth to grainy, depending on the maker and even the production year. MT3 in PBT, like the biip set, has a pronounced, rough texture, while Drop’s double-shot ABS MT3 is smooth from the start. KAT and the matte KAM sets come from the same manufacturer as PBS and have a similar finish, which people describe as satin or silk for KAT and as velvet for KAM. PBS is at least as smooth as KAT, and it’s almost slippery. As a matter of fact, while removing the keycaps to replace switches I continuously drop every other PBS keycap because they are incredibly smooth, very flat and have rounded edges. On top of that PBS, just like KAM, shows oil and fingerprints a lot quicker than the textured DSA due to its choice of material and texture. Many like it that way, but I frankly don’t and it’s one of the most off-putting fact about the keycaps. I’m not alone with my complaint, however, as some in the PBS community have apparently been asking for a slightly rougher texture ever since the first blanks shipped in 2024. Despite its name, the PBS Black on Black isn’t black, but more of a dark gray. This is especially visible in bright daylight, and on the Kunai, which I painted in Tamiya TS-81, a light gray, it’s obvious that the caps aren’t black at all. If anything, it’s black legends on charcoal keycaps, so I would have rather picked something along the lines of Black on Charcoal as a name, because Black on Black is definitely misleading. The reason for this is, as I explained above, is most definitely the legend process. As dye-sublimation can only add color, you can’t sublimate black legends onto a black cap, because nothing is darker than black. This is why black-on-black sets with dye-sublimated legends, from PFU’s charcoal HHKB to Drop’s Artifact Bloom Black on Black, use a dark gray body with even darker legends. Even GMK’s double-shot Stealth set gets its contrast from an anthracite gray against black. Matt3o, who calls himself a PBT guy, wrote back in 2022 that the only downside of PBT is that you can’t do dark sets with it. In his stream about the PBS production prototypes, he also mentioned that he had wanted to make the black of the Black on Black lighter, but that everyone told him not to, and for good reason. To be completely honest, I don’t like the color at all. Unless I’m in almost complete darkness, the charcoal is noticable as such and really doesn’t go well with the rest of my specific board. As a matter of fact, even the (actually black) RAMA USB A-to-C keyboard cable is visibly different in color. Even worse, the two GMK Stealth RAMA artisans that I use as my upper left tab and my upper right backspace key are noticably darker than the keycaps. Hell, even the L-connectors of my TRRS cable are significantly more black than the keycaps. The PBS Black on Black sadly sort of ruins the aesthetics that I went for with my Kunai, making it look rather cheap. It reminds me a lot of KPrepublic’s $40 PBT Gentleman Black keycap set. Note: A matte surface scatters part of the incoming light back in all directions, which makes the color underneath appear lighter than it is. In a measurement by Konica Minolta of a dark plastic part with a matte and a glossy area, made from the same resin and color, the matte area came out noticeably lighter than the glossy one. Hence a dark, matte cap looks grayer the brighter and more diffuse the light is, as it is in daylight. The legends are slightly darker than the caps and, depending on the light, barely visible. Matt3o said that you could almost consider the set blanks, and I can confirm that legends are easy to read in direct sunlight but completely disappear in low light. Given that the legends therefore serve no practical and almost no aesthetical purpose, it makes me wonder even more why Matt3o went for this relatively cheap looking charcoal color for the keycaps to begin with, rather than making them slightly darker. PS: The modifiers use text legends throughout, with CODE instead of a Windows or Command key, which is what I prefer. One key benefit of PBS over MT3, which I also favor for its sculpting, is the height. On the three rows that a Corne uses, MT3 keys are roughly 11.4mm to 12.8mm tall, while every PBS key is 7.43mm, which makes the Kunai about 4mm to 5.5mm flatter with PBS than it was with MT3. When I built the Kunai I wrote that, without palm rests, the board is on the higher end, and that I could imagine MT3 or SA making it too tall, which turned out to be true. With PBS the Kunai is significantly flatter than it was with MT3, bringing it back down to a slightly more manageable height. In addition, it also makes it a lot more portable, as it takes up less room in the NuPhy NuPack that I carry it in. PBS has become one of my favorite keycap profiles , as it is pretty much what I was hoping for. Compared to MT3, which I like as well, PBS makes the Kunai a lot flatter and hence more portable. However, the caps are way too smooth for my taste, and the color of specifically the Black on Black set is pretty bad. They aren’t black but more of a dark gray, which in bright daylight and on the light gray Kunai looks rather unpleasant. If you like the silky surface of Keyreative’s KAT and KAM, and a charcoal instead of a true black doesn’t bother you then I guess PBS Black on Black can be for you. If, like me, you prefer a rough, grainy PBT, PBS will sadly feel too smooth. I’m not aware of any PBS set with a rougher finish and considering the author’s posts and preferences I’m doubtful that we will ever see one. For me, PBS Black on Black definitely is kind of a love-hate relationship.

0 views
Corrode 4 weeks ago

Thinking in Traits

Rust favors composition over inheritance. I’m sure you’ve heard that before, but rarely does anyone take the time to explain what it means in practice. Also, why is this model the right choice for Rust? Let’s take a step back and look at an example: have you ever asked yourself why works the way it does? How does know to produce a here? To answer that, let’s first look at the signature of : Note how it doesn’t mention at all. In fact, it doesn’t “know” about any collection type or any other type, for that matter. The thing it does know is that whatever type you want must be capable of constructing itself from an iterator. And happens to be a type that does. Further note that we didn’t specify the element type of the vector. The compiler is clever enough to infer that from the context! The mechanism is the same for any other supported type, like hash maps, strings, or any custom collection type of your choosing as long as it implements for the iterator’s item type. And what “collecting” means is also defined by the type itself. A , for example, has the ability to collect characters: And a can collect key-value pairs: It’s only fair to mention that interfaces can also express shared contracts. Here, two independently defined implementations connect through a shared item type. This is “composition through contracts”: Here, a producer yields values of some type through the trait. On the other side, a collection implements to describe how it can build itself from those values. The shared item type connects the two contracts, and is the bridge between them. It requires only that the destination can be constructed from the items the iterator yields. In our first example, the annotation selects the destination type. Because implements , the compiler knows how to connect that destination to our iterator. is the glue that passes the iterator to that implementation, which creates and fills the vector. Note how neither side needs to know the concrete type on the other side. The iterator doesn’t need to know how a vector stores its elements. And the vector doesn’t need to know where the items came from, only how to iterate over them. That means we can extend either side independently. A new iterator can feed existing collections, and a new collection implementing can accept existing iterators yielding . We don’t need a separate conversion for every producer–collection pair. All we need is one implementation, and is the glue that brings it all together. In simple Rust pseudocode, we can expand the calls step by step: The value of an abstraction is the code that no longer needs to exist between its users. Class inheritance models “is-a” relationships. In Java, for example, an is a subclass of . An encrypted socket is still a socket, after all. But does every socket operation make sense for it? lets a TCP connection stop sending while continuing to receive, a feature called “half-closing.” Code using a socket might therefore do this: On Android API levels 21 through 23, the platform’s implementations rejected this operation with . This caused a real crash in OkHttp 5.2.0 . Modern OpenJDK supports TLS-aware shutdown , so this is a historical mismatch, not a universal limitation of TLS. Still, the type exposed an operation without telling callers whether that implementation supported it. With composition, a TLS connection can hold a socket internally without exposing every operation on it. It can provide reading and writing, with a separate capability for half-closing where supported. We can reuse the transport without inheriting its entire interface. Simply replacing inheritance with interfaces—or traits—doesn’t fix a poorly chosen contract. What’s important is that the contract matches the capabilities of its implementations . Rust makes trait-based composition central to code reuse. In Rust, we ask what a type can do , not what it is . In other words, traits describe capabilities, not taxonomies. Here are simplified versions of two central I/O traits from the standard library: Note how these are two independent traits. A type can implement , or , or both, or neither. You’re declaring which operations a type supports, without inheriting a bunch of unrelated methods. The capabilities are orthogonal. For example: The trait implementation belongs to the type , not to a concrete value. Take , for example. It implements both and , but a file opened in read-only mode will still fail at runtime if you try to write to it. Even a file opened for writing can fail when the disk fills up. The trait implementation is a promise that the type supports those operations, but what it can’t do is guarantee that every operation will succeed at runtime. If you want to distinguish read-only and writable handles at compile time, you could define a and a and only implement the appropriate traits for each. That rules out unsupported operations in your API, but it still doesn’t make I/O infallible. Rust can express that a container has a capability only when its contents do. For example, implements when implements . Thanks to this trick, we don’t end up with two different types, one cloneable and one not. Here’s the same pattern for a small wrapper you could define yourself: A is cloneable because is cloneable. A is not, since does not implement . If you were to call on that batch, the code wouldn’t compile. You can store non-cloneable items in a batch; you just can’t clone that batch. For this wrapper, you can use to generate the conditional implementation automatically. Note that the bound belongs on the implementation , not on itself. Making your type cloneable requires , but apart from that, is still a perfectly valid type for non-cloneable elements. The compiler works out which operations are available from the capabilities of the component types . A conditional implementation can also apply to every type that satisfies a trait bound as opposed to one particular wrapper. This is called a blanket implementation . For example, the standard library implements for every type that implements : All you have to do to get a method is implement for your type. The compiler automatically generates the implementation for you. The rule applies even to types written long after the standard library itself. This is an elegant way to express a reusable implication between capabilities: “If a type can be displayed, it can be turned into a string.” The same idea appears in conversions. You might know that implementing automatically provides through a blanket implementation. That’s why you normally implement rather than writing the corresponding implementation yourself. Conditional implementations also let us add behavior by wrapping one value in another. This is a different type of composition: “composition of values.” A wrapper holds another value and builds on its capabilities. Take our trait from earlier: So a parser accepting doesn’t need separate support for files, buffered files, and length-limited buffered files. It just reads bytes! We can add buffering and a byte limit without teaching the parser about either. The parser doesn’t need to understand how its input was assembled. This works because each wrapper preserves the contract that the next piece needs. A implements when does, and so does . The result of one composition becomes a building block for the next. You can see the same idea in iterator chains. Each type implements , so you can chain them. Writing your own iterator connects your type to this vast ecosystem of adapters. All you need is to provide the associated type and the method . , , , and already have default implementations, available when their additional bounds are satisfied. This is how you reuse code without a base class. Default methods provide behavior within a trait you implement; blanket implementations can make another trait apply automatically. But adapters don’t have to be limited to a single, rigid contract either. They can provide rich, additional capabilities, too. For example, implements when its input iterator does, and it does so with an appropriate trait bound on the mapping function: So because the adapter has a conditional implementation for , it preserves the ability to iterate backward through the input. We’re not limited to basic iteration. And since we know the concrete iterator types, the compiler can optimize and inline the entire chain of adapters into a single loop. Optimized iterator code can perform comparably to a hand-written loop . So fully embracing iterator patterns has no runtime cost. Hold on, Rust has another way to express “different kinds of things that are related”: enums! These are useful in situations where you know the full list of possibilities in advance. Enums are great if you almost always want to handle all of the variants in one place. Traits are the better model if different types implement the same behavior and you don’t know all of the types right now. In other words, enums are a closed set of variants while traits are an open set of implementations. You can’t add new variants to an enum without changing the enum definition. But traits enable the open/closed principle: you can add new implementations without modifying existing code. This allows other crates to extend your library without needing to modify your code. Imagine your library defines the and types, and you want to provide a way for users to fetch records from different sources. In your library, you implement for a and a . But now, users can implement it for their own or a . Heck, you don’t even need to know these types exist. And yet, your contract still holds: any type that implements can be used to fetch records. The reverse is also true: an external contributor can define an extension trait and implement it for your type without you knowing about it. You can even do that with types from the standard library: As long as the trait is in scope, you can call the method on a : No need to modify or derive a subclass. This implementation is allowed because we define in our crate. Rust’s coherence rules restrict implementations involving foreign traits and types. For example, we couldn’t implement the standard library’s trait directly for , since neither the trait nor the type is ours. This is composition at the level of behavior : we combine an existing type with an independently defined capability. The type and the trait don’t need to know about each other. The same type can implement other, unrelated traits, and each function can ask for just the capabilities it needs by means of trait bounds: This open-set/closed-set principle is a good way to think about when to use enums and when to use traits. But to be fair, the lines can blur a bit. An enum can also implement traits, and a library can restrict who implements a trait through a technique called a “sealed trait.” In application code, exhaustive enum checking can make refactoring easier because the compiler will tell you which statements need to be updated when you add a new variant. Introduce a trait instead when you have a good reason to share a contract across types . The more unrelated responsibilities a trait combines, the harder it becomes to implement and reuse. Every implementer has to account for operations it may not need. Consider this application context: Ask yourself: what concept does this trait capture? What contract does it enforce? It combines reading records, writing records, and running the application. Perhaps your application really needs one type to provide it all, but a function that copies records shouldn’t require its inputs to run an application. Let’s split the capabilities: Now a read-only source can implement , a write-only destination can implement , and the execution runtime is left out. Your functions don’t need to know about the runtime either, and you can compose the exact capabilities you need: Each of your types can implement either trait. Or both. This also explains how independent crates work with your types. Serde defines and ; your types implement them, often through derive macros. Serde’s serializers don’t need to know about your application’s structs in advance. They just use the shared contract: a type that implements can be serialized. Code becomes more composable as a consequence. If Serde decided to couple serialization and deserialization into a single trait, some use cases would be impossible to express. All of that is great for testing, too. We can test with a fake implementation and a fake implementation, without creating a runtime. The goal isn’t to make every trait contain exactly one method. has many methods, but they are all strictly related to the task of iterating over a sequence of values, and all but one ( ) have a default implementation. It’s fine to keep methods together when they describe the same contract, but if you’re unsure if callers need the independent capabilities, split your traits. Below are a couple of concrete tips around trait design. When you approach a problem, ask what your code needs a type to be able to do. Often, an existing trait already expresses that. Check the standard library and popular crates first. And sometimes a concrete type or an enum is enough. Write the code concretely first. If you find yourself copying similar implementations across different types, look for a shared contract. By then, you’ll have concrete examples to test your abstraction against. And when you do need a new trait, give it a contract you can explain in a single sentence. Abstraction has a cost for readers. They may need to follow bounds and implementations across several files to understand a call. Sometimes that indirection hides details they shouldn’t need to care about. Sometimes it hides an important detail they should. Trait-based abstractions in Rust often incur zero additional runtime overhead, but there is a compilation cost as well. The costs depend on how you use the trait. Generic code is usually monomorphized: the compiler generates code for the concrete types that use it. That permits static dispatch and inlining, but many instantiations can still increase compile time and binary size. For dyn-compatible traits , dynamic dispatch through lets the same caller operate on different implementations, but introduces indirection and can limit inlining. Not every trait supports this: , for example, is not dyn-compatible. Keep these trade-offs in mind when you introduce a trait. There is no free lunch. Let’s come back to our once more. So far, we’ve used the destination type to choose a collection. But it can also determine control flow. For example, we can decide to stop iterating on the first error or keep going and collect every result, including errors. I first learned about this from Karol Kuczmarski’s Iteration patterns for Result & Option , still one of my favorite Rust posts. Here it is in action: Note that in both cases, the iterator expressions are identical . The only thing that changes is the destination type: In the second case, is never parsed. If every parse succeeds, the second version returns containing the vector of values. This behavior comes from the standard library’s implementation for . Here’s a stub of that implementation: What this says is: An iterator of values can be collected into a , as long as can collect values of type . The bound means that could be a or any other type that can collect those values. itself doesn’t need to know any of this: it just calls the destination type’s implementation. See how all of those pieces fit together? That’s the real payoff when you think in traits. A single implementation can connect a type to an entire ecosystem of algorithms, adapters, and collections. A few carefully crafted capabilities can combine in ways their authors never imagined. That makes the whole greater than the sum of its parts. And that’s just great API design. A byte slice ( ) implements but not . The returned by implements but not . A implements both. A implements . Wrapping it in a adds buffering, and the result still implements . Calling on that reader limits how many bytes it yields, and the result still implements . produces a iterator that applies a function to each item of the underlying iterator . produces a iterator that yields only the items of that satisfy the predicate . produces a iterator that yields at most the first items of . When you approach a problem, ask what your code needs a type to be able to do. Often, an existing trait already expresses that. Check the standard library and popular crates first. And sometimes a concrete type or an enum is enough. Write the code concretely first. If you find yourself copying similar implementations across different types, look for a shared contract. By then, you’ll have concrete examples to test your abstraction against. And when you do need a new trait, give it a contract you can explain in a single sentence. Abstraction has a cost for readers. They may need to follow bounds and implementations across several files to understand a call. Sometimes that indirection hides details they shouldn’t need to care about. Sometimes it hides an important detail they should. Trait-based abstractions in Rust often incur zero additional runtime overhead, but there is a compilation cost as well. The costs depend on how you use the trait. Generic code is usually monomorphized: the compiler generates code for the concrete types that use it. That permits static dispatch and inlining, but many instantiations can still increase compile time and binary size. For dyn-compatible traits , dynamic dispatch through lets the same caller operate on different implementations, but introduces indirection and can limit inlining. Not every trait supports this: , for example, is not dyn-compatible. collects every parse result. returns the first error and stops advancing the iterator immediately.

0 views
Unsung 1 months ago

November 22, 1963

(It’s Halloween Week on Unsung, where we’re sharing scary, spooky, and creepy stories. This is a real story, and an excerpt from chapter 12 of my book Shift Happens .) The keyboards of the first teletypes looked as if the Shift Wars had happened in an alternate timeline won by typewriters with two Shifts, a century before the arrival of the iPhone. The first teletypes were, too, built with only three banks of keys, the digits sharing the top row of QWERTY. Among the most common was the striking green keyboard of Teletype Model 15, made by a company that – like many – renamed itself after its most popular product. The 15s were robust, heavy, and almost indestructible; 200,000 were made between 1930 and 1954, their production prolonged by World War II. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/1.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/1.1600w.avif" type="image/avif"> But the comparison to typewriters with two Shifts broke down as soon as you sat down to a teletype. There was one key called Figs and another called Ltrs, but there was no actual shifting. The two keys were meant to be used alone – pressing one would affect the meaning of all the keys used after it. Figs switched the teletype into digits and punctuation mode; Ltrs made all the keys once again behave as letters. The digits and punctuation covered all the common cases, but the letters were available only in uppercase, and remained so for a long, long time. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/2.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/2.1600w.avif" type="image/avif"> The reason for switching instead of shifting went back to Baudôt and his five keys. Five keys give thirty-one possibilities – not enough for the letters of the alphabet, digits, and common punctuation. So Baudôt added two non-printing combinations. Pressing just the leftmost key would switch the machine to think of letters; pressing just the second key from the left would make it focus on digits. Every chord’s character depended on what mode the machine was in: right index finger was A or 1, the middle index finger E or 2 , four leftmost fingers meant L or the equals sign. Thirty-one possible combinations became fifty-eight. And even when teletypes switched to a QWERTY keyboard, under the hood they still relied on a modernized version of Baudôt’s code, switching and all. There were more differences from typewriter keyboards. The keys had an unusual, cushioned feel: each key had a small spring inside for more comfortable typing. For the first time in history, the tops of the keys were held to the base magnetically and could be removed, making it easy to swap them for different uses. And the common mechanical gesture of the carriage return had been decoupled into two separate keys – Car Ret and Line Feed. Carriage return moved the carriage back to the beginning of the line; line feed advanced to the next line. This was done to give the teletype a bit more time for a carriage return to complete. The split was manual, however; the operator had to press the two keys one at a time, in the correct order, with every new line. Look at post-World War II teletypes, and you’ll find other interesting keys. One common one was labeled Who Are You? Pressing it would generate a special invisible code and ask the other machine to introduce itself. It was sometimes done automatically; other times it required the interlocutor to press a key labeled Here Is, which mechanically output a pre-recorded sequence of letters identifying the location, like . You might also stumble upon another ingenious physical-world backspace. Did you press a key by mistake, creating the wrong set of holes in the paper tape? You could rewind one spot and punch out all the other holes. It was kind of like backspacing on a typewriter and typing x over a typo, but it was invisible – no one was meant to read the tape itself, and the teletypes were programmed to ignore the five-hole position when printing the text on regular paper. And since paper tape was effectively infinite, a message with many corrected typos would have only one side effect – it would arrive marginally slower than one typed neatly. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/3.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/3.1600w.avif" type="image/avif"> The Who Are You?, Here Is, and Backspace keys were enhancements that came after the Model 15. But even the earlier model sported one unique key: S/Bell. In letters mode, Bell would do as expected and print a letter S . Switch to digits and punctuation mode, however, and the teletype would ring a bell. It would do so not just on the machine you used, but also on the teletype on the other side. It wasn’t a gentle typewriter bell alerting you to the end of the line, either. The teletype bell harkened back to an idea in an 1837 telegraph by Cooke and Wheatstone, its ringing meant to alert someone that a message was coming. And sometimes, it was an important message. The Morse code-powered telegraph network gave us a taste of what an internet could be. Teletypes added automation. In the late 1920s, the next step was Telex, a global network that connected business teletypes. Elsewhere, post offices in many countries brought telegraphy to the masses by introducing telegrams, a way to send a written message to someone via telegraph or teletype. No knowledge of Morse code or typing was necessary. The message would be typed in at the post office by a teletype clerk, travel through the wires, the resulting printout cut into pieces at the receiving station, and eventually be delivered by a clerk to the recipient’s doorstep as if it were a regular letter. Telegrams were much faster than letters, as they traveled mostly through wires; were much cheaper than long-distance phone calls; and didn’t require your recipient to have any technology in their house. (They also introduced the now-forgotten tradition of saying STOP in between sentences, and they begot the art of making messages as short as possible, later perfected in texting and on Twitter.) = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/4.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/4.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/5.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/5.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/6.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/november-22-1963/6.1600w.avif" type="image/avif"> But what was most commonly associated with the telegraph first and teletypes later was the instant broadcast of world events. The Associated Press (AP), Reuters, and United Press International (UPI) took Morse’s “Have you any news?” to heart, and established competing networks of teletypes clacking impatiently with the latest bulletins. Their correspondents would dictate by phone to their offices. The transcribed reports were typed in on one of the agency’s teletypes and sent within seconds to receiving teletypes in the subscribing newspapers. Since most of it happened over wires, it was often called “the wire service.” One UPI employer remembered: Nothing was true in those days unless the wire services said it was. Confirmation was on the yellow paper rolling out of Teletypes. There was no 24/7 cable TV news. No emailing. No tweeting. The teletypes were a common fixture in newspapers, “as common as a bathroom, although the machines probably were kept in better repair,” as one reporter recalled. “There was something about the throbbing of teletypes that made reporters and editors feel alive,” an article noted in the Philadelphia Inquirer in 1986. They used electromechanical technologies similar to those in electric typewriters. They were, however, driven by paper tape, and so their typing was distinctively machine-like, always at the constant speed of about 60wpm. “They made a low, guttural engine noise – rugrugrugrugrug – punctuated by that loud da dacka-dacka dak-dak, and they were as constant and pokey as a pair of plowmules. They. Yielded. Their. Secrets. One. Word. At. A. Time,” wrote the seasoned Philadelphia Inquirer reporter David O’Reilly. Just as many newspapers put the word Telegraph in their titles in the nineteenth century to align themselves with the high tech of that time, the next century witnessed many TV or radio news programs adding the distinctive cacophony of multiple clattering teletypes to their opening titles. One surprising but important component in the sharing of news was the S/Bell key. Its use evolved over time. It was no longer just about catching attention – the number of bells grew to signify the importance of upcoming news. On UPI teletypes, three bells meant “Urgent,” five bells indicated a “Bulletin,” and ten bells was a “Flash” – a story so rare and significant that it changed the world’s trajectory. Flash stories were reserved for earth-shattering events: a declaration of war, a president’s resignation, the death of the Pope. They would cause a newspaper printing plant foreman to yell “stop the presses” and a TV station manager to interrupt shows with breaking news. “Guys had worked in newsrooms for years and never heard ten bells,” wrote the Philadelphia Enquirer. Another columnist put it more bluntly: “when [a teletype’s] bells chimed out a Bulletin or Flash, it was like God clearing His throat.” God cleared their throat on November 22, 1963, when Lee Harvey Oswald shot President John F. Kennedy in Dallas, Texas, at 12:30 local time. UPI reporter Merriman Smith, riding in the motorcade just behind the president, got ahold of the press car’s radiophone and called UPI with the news. Soon, a few thousand UPI subscriber teletypes across the world started printing in unison. One inside the U. S. government cabinet plane reported: The chaos of the garbled transmission seems to capture the magnitude of the news. Knowing how teletypes – and their keyboards – worked, we can decipher most of it, starting with a few lines from a message from Hanover, West Germany: an update in the trial of a local doctor. Then the Dallas messages start taking over, although not without trouble. Typos likely happened in a hurry to get the message out, and the unusual spacing came from not giving enough time for Car Ret and Line Feed actions to finish their job. (Either could also have been the result of the Hanover and Dallas teletypes talking over each other on the same line at the same moment.) and others like it were standard signatures following each transmission: two letters for the initials of the operator, and seven to indicate 1:37pm Eastern time. How about ? It’s the operator forgetting to press the Figs key, or the signal being lost in transmission – the keystrokes 1 3 9, meaning 1:39pm, come out as , as the receiving teletype never switched to speaking in digits. This is the reason we see a repeated line of , meant to be slashes separating one message from another. That also explains the long lines of confused letters , and makes them more harrowing – those were meant to be bells, ringing to alert everyone of an event that shook the nation like few did in the twentieth century. But the switch to digits mode never happens or is lost in transmission, and the machines, obedient and clueless, interpret the transmitted data blindly. Counting the letters betrays the urgency, the desperation, or the despair felt by the teletype operator typing in the message. In a break with protocol, the early eight and ten bells grow to eleven, and then to an unprecedented sixteen bells. This wasn’t God clearing their throat – this was God caught surprised. The president was dying. Just a few minutes after seeing the UPI’s messages, CBS interrupted its mid-day soap opera to put on air a distraught Walter Cronkite, and soon the other two networks followed, suspending their usual programming for the subsequent three days and nights. On the wire, the uncanny intersection of human emotions and machine coldness continued, as transmissions of people oblivious to the tragic events in Dallas interleaved with frantic shouting from others: But in time, everyone understood and the day’s other events surrendered. An hour after the shooting, another teletype operator, Alice Guenther, started a new shift at the UPI offices. Four minutes later, the White House sent out the feared message of President Kennedy’s death. The broadcast news editor asked Alice to key it into the teletype, but her reaction reminded us that despite all the mechanization and the rhythmic ticking of teletype machines, sitting behind keyboards were still people. Guenther could not make herself finish the task. She took her hands from the keyboard, covered her face, collapsed, and cried “Oh, my God.” The operator supervisor, Jimmy Darr, walked over to her, lifted her out of the chair, let her sit gently on the floor, and leaned over the keyboard. Thirty-nine keystrokes later, at 1:35 Dallas time, thousands of UPI teletypes rang ten bells for one more time that day, and then printed, at a measured pace:

0 views
Dangling Pointers 1 months ago

TwinString: Preserving String Semantics with Off-Heap Data on the JVM

TwinString: Preserving String Semantics with Off-Heap Data on the JVM Júnior Löff, Daniele Bonetta, and Walter Binder OOPSLA'26 This paper presents an alternative representation of Java strings which significantly reduces JVM/GC overheads, at the cost of potential memory fragmentation. The target applications are ones that process short-lived strings from external sources (e.g., text files). A TwinString is an implementation of . The key optimization is that a TwinString does not contain a byte array, but rather contains a pointer to an immutable set of bytes in a TwinHeap. Fig. 4 illustrates the differences associated with initializing a regular String and a TwinString from bytes contained in a MemorySegment (e.g., bytes loaded from a file): Source: https://dl.acm.org/doi/10.1145/3839503 The standard process illustrated in the top of Fig. 4 involves allocating a byte array, copying string data into it, and then constructing a string wrapper. The TwinString approach illustrated at the bottom of Fig. 4 involves allocating space in the TwinHeap, copying bytes into it, and then constructing a string which contains a pointer to bytes in the TwinHeap. A TwinString contains metadata like the string length and string hash. This enables some methods to execute without having to touch the TwinHeap. TwinHeap is designed to be fast for short-lived strings. A TwinHeap comprises a set of 64KiB pages. Allocation is as simple as incrementing an offset into a thread-local page. Deallocation occurs on a page-by-page basis. During normal JVM garbage collection, a live TwinString causes the associated TwinHeap to stay alive. This means that garbage collection is fast, but fragmentation is a potential issue. A single live string can cause the entire page to not be collected. The design of TwinHeap is simplified by the fact that Java strings are immutable, so there is no need to be able to edit/resize strings after they have been created. Fig. 8 shows that TwinStrings can be initialized much faster than standard strings: Source: https://dl.acm.org/doi/10.1145/3839503 Fig. 9 shows that operations on TwinStrings are about the same speed as regular strings. The “String & TwinHeap” bars are there to try to separate out the costs of TwinString from TwinHeap. Source: https://dl.acm.org/doi/10.1145/3839503 Dangling Pointers The notion of coarse-grained garbage collection seems more generally useful than just for strings, I wonder if it could be extended to other types of objects. Thanks for reading Dangling Pointers! Subscribe for free to receive new posts.

0 views
Stratechery 1 months ago

The End of the Internet

Listen to this post : It was the summer of 2003, just weeks before I was set to move to Taiwan, that I decided to create a blog to document my journey. I had, at that point, had a GeoCities site, a Blogspot site, a site I built in Microsoft FrontPage and hosted…somewhere, so this was my fourth swing at the blog thing (it was the seventh that ended up being Stratechery). I was intrigued by a just-released piece of software that promised a five-minute install; it was called WordPress. It did, I must confess, take me much longer than 5 minutes to install WordPress: it turned out I needed to learn how to create a MySQL database and configure PHP; once you had all of those component pieces in place, then yes, it only took 5 minutes to install! I was thinking back to those days last week when news broke that every version of PHP had a critical bug that allowed for remote code execution on the host machine; Stratechery today still runs on WordPress, but that WordPress is managed by Pressable , an Automattic company. That meant that my site was patched before the vulnerability was disclosed, and it would be crazy for me — or anyone else — to do it any other way. It’s kind of insane to think that twenty-some years ago I was doing everything by hand without having any idea what I was doing, and that it was totally fine. That’s the Internet, though: an insane invention from a time that is, sadly, gone forever. 2003 was, roughly speaking, right around the beginning of the blogosphere; yes, blogs existed — Dave Winer, often considered the father of blogs, started Scripting News in 1997, after early experiments with a personal site called DaveNet ; Justin Hall started Links.net in 1994; Jorn Barger coined the term “weblog” for Robot Wisdom , also in 1997, and the influential kottke.org started in 1998 — but it was the early 2000s when blogs suddenly seemed everywhere, particularly in the political space: That political blogs featured so prominently speaks, I think, to both the power and peril of the Internet’s first transformation. Up to that point the Internet was mostly technologists, comfortable discussing the intricacies of text editors and programming languages with other nerds on BBSs, early forums, and mailing lists; it was the politically minded, however, that realized that the freedom to start your own publication that could reach everyone was a radical development. The goal was not to make money; it was to make a difference. Originally these new publications were novel; what soon became clear, however, is that they were the tip of a wave of content that would dramatically expand the web. Newspapers had influence by being geographic monopolies; early bloggers gained influence by being the first to a new medium. Ultimately, however, the real winner of the web was Google: as the amount of content became abundant, Google offered not distribution — which was free — but rather discovery; indeed, it’s because distribution was free that discovery became the most important part of the value chain. Many of those early bloggers made a decent amount of money from Google through its AdSense advertising program; by the end of the decade, however, the ads became more intrusive even as the payouts shrank, both because the inventory was limitless, and also because the most attractive ad slots were on Google Search. And so we saw one of the first examples of how the Internet fails: because everything is open, everyone has an opportunity, which means infinite competition, which is terrible for business. For many years I rued the fact I wasn’t one of those early bloggers; a decade later, however, I realized that I was actually just in time for a much more sustainable business model: subscriptions. I wrote in 2015’s Blogging’s Bright Future : It turns out, though, that there are more business models than simply advertising, as Sullivan himself sought to show. Sullivan was, for the last two years, supported by reader subscriptions to the tune of nearly one million dollars a year, and while many were skeptical of Sullivan’s efforts when he started, his ability to raise money shouldn’t have been a surprise: his is a singular voice — to put it in economic terms, Sullivan’s writing had a low elasticity of substitution — so people were happy to pay for something they couldn’t get anywhere else. Right there was the exact loyalty that Klein fears has been lost… I am, of course, acutely aware that there is a tradeoff when it comes to the subscription business model: by making something scarce, and worth paying for, you are by definition limiting your number of readers. Stratechery, though, serves a niche, and niches are best served by making more from customers who really care than from milking pennies from everyone. In short, the answer to drowning in abundance is to purposely limit your audience — to go small. That is an economic model that works, and notably, there are a lot of bloggers on that list who are using that model today. Blogging is alive and well, it’s just constrained, and thus worth paying for. Google wasn’t the only Aggregator: a decade later there was a new means of discovery, which was social media. Now instead of searching for a site you could have a link shared directly to you, not just by email but on a site that served up interesting updates about whomever you chose to follow. And, for a period of time, followers could become friends. Stratechery’s fortunate timing was not just in terms of subscriptions becoming technically viable, but also the fact that Twitter was a community, not unlike the early Internet: genuinely interesting conversations happened in public, and you could reply-guy your way to broader distribution. Social media was also free, however, and even easier to get started than a blog ever was; that meant that the amount of content was greater by many orders of magnitude. This meant that algorithms started to matter — Facebook had one relatively early, but it took Twitter much longer — and also anyone with any sort of prominence had to start taking a much more defensive approach. Community, sadly, doesn’t scale; any platform that is available to everyone starts out special and spirals from there. Ultimately, public social media sites became personal entertainment sites, tuned for engagement, culminating in TikTok, a social media site with basically zero social component. However, that doesn’t mean social networking went away: in fact, I think that social networking is stronger than ever; the difference is that it isn’t public, but is rather in group chats. Group chats are familiar, they are high trust, they are, in many respects, the best of the Internet: even as technology atomizes us the group chat is the only place you can connect with people you care about, anytime and anywhere. In other words, the redemption of social media was — just like blogging — to become smaller. The scaling that mattered for most people was not an ever larger audience, but a proliferation of infinite finite groups. Social media 1.0 , even at its best, followed the 90-9-1 rule: one percent spoke, nine percent commented, and 90 percent lurked; the magic of group chats is not in giving everyone a voice, but a place where you feel safe to talk. The PHP vulnerabilities were just two of a host of security issues last week alone; there were also: This is, believe it or not, only a partial list, and I expect things to only get worse. All of software is built on an inherently creaky human-authored foundation; the human factor meant the primary gate in all of software development was “Did it work?”, not “Is it secure from every possible privilege escalation or race condition?” or the myriad of ways that software can act in ways not intended. The saving factor previously is that attackers were limited by human time and ingenuity as well; AI, however, has limitless time and the ability to substitute iteration for cleverness — and it’s getting pretty clever as well! It’s not a surprise that this wave of vulnerabilities is coming to light, and it’s going to get worse before it gets better — which I do, for the record, expect to happen; after all, the good guys have AI as well, and in the long run software will be better when it is (re)written by AI, and defended by agents continuously. At the same time, what this entails is that the public Internet, to an even greater extent than now, will be a battle zone at best (i.e. social media), and a wasteland at worst (everything else). Some of this is economic, as AI consumes everything — both content and attention — without giving any of the traffic back that Google did, but it is also technical: it was already a dodgy proposition to stand up your own site or app, which was the very promise of the Internet, given the hacking risks; in the age of AI it’s madness. It is sad. When I was a kid we called up BBS’s that were hosted in people’s homes; when I was in high school we downloaded music from public FTP addresses; when I was in college we set up our own websites. Anyone could set up a server, and that server was just as much a part of the Internet as any other server; that’s simply not viable any longer, even if you weren’t worried about making money. The Internet as we knew it is dead. There are, however, green shoots of possibility, and once again the answer is to go smaller. When anyone can make an app, the answer is not to try and make a quick buck in the App Store; in fact, the surge in slop will make the market worse for everyone. Rather, it’s to make something for yourself and a small group of trusted friends and colleagues. This is exactly what has happened at Stratechery: we have made a bunch of different apps, for everything from podcast production to task trackers to calendar management, none of which will ever be made available publicly. That doesn’t even include the apps made for oneself: I’ve created a bunch of different apps to manage my house and sports viewing: it turns out I had a lot of software-shaped holes in my life that suddenly I can fill without asking permission. Software has always been different from physical goods in that its zero marginal cost nature meant it could scale to far more people; at the same time, the sheer amount of up-front effort involved in creating it meant that the intended audience needed to be large enough to justify the investment. AI completely changes that: suddenly it’s possible to create software for one person, or one team; smaller target audiences aren’t just a necessity for security, they’re an entirely new and potentially much larger market for software creation at scale, by literally everyone. Or, to use the example above, the group chat era of software is here and it’s going to be so much better than what came before. Venkatesh Rao wrote an absolute must-read essay over the weekend called Cognitive Mercantilism . In brief, Rao makes the case that mercantilism rested on an assumption that economics was about scarcity and control; what brought about capitalism was demand. When people were freed from the burden of subsistence farming they discovered wants and desires at a scale that pulled entire markets into existence. Rao suggests the same might happen when people are freed from “subsistence cognition”. Rao concludes: What gets missed is the possibility that we are witnessing the beginning of a transition as profound as the one from an overwhelmingly agricultural society to an industrial and commercial one. From a world where 80% of human brains are engaged in subsistence cognition to one in which 95% are engaged in satisfying previously unfulfillable cognitive demands. The most important consequence of the agricultural revolution was not that farming became more efficient. It was that most people were liberated from the necessity of farming, allowing entirely new kinds of economic and cultural life to emerge. Likewise, the most important consequence of the AI revolution may not be that intelligence production becomes more efficient. It may be that most minds, human and eventually artificial, are liberated from the necessity of producing intelligence merely to survive, and become free to discover what they actually want to do with it. The cognitive mercantilist sees a world threatened by an oversupply of intelligence and an impending surplus of useless minds. The AI Malthusian sees a world in which intelligence outruns the capacity of humanity to absorb it, leaving a growing population of economically redundant minds primed for revolutionary explosions. The cognitive capitalist sees the possibility of an almost limitless expansion of demand, and a world full of minds whose potential has barely begun to be explored. I do understand why people have difficulty imagining this future. Capitalism, particularly over the last half century, has increasingly given way to scale, as ever larger corporations mediate ever more economic transactions, and as the Internet has played an important role in making the market a global one. The England in which capitalism emerged, however, and especially the America in which it was perfected, was much different. Alexis de Tocqueville, in Democracy in America , famously wrote: The political associations which exist in the United States are only a single feature in the midst of the immense assemblage of associations in that country. Americans of all ages, all conditions, and all dispositions, constantly form associations. They have not only commercial and manufacturing companies, in which all take part, but associations of a thousand other kinds — religious, moral, serious, futile, extensive, or restricted, enormous or diminutive. The Americans make associations to give entertainments, to found establishments for education, to build inns, to construct churches, to diffuse books, to send missionaries to the antipodes; and in this manner they found hospitals, prisons, and schools. If it be proposed to advance some truth, or to foster some feeling by the encouragement of a great example, they form a society. Wherever, at the head of some new undertaking, you see the government in France, or a man of rank in England, in the United States you will be sure to find an association. I met with several kinds of associations in America, of which I confess I had no previous notion; and I have often admired the extreme skill with which the inhabitants of the United States succeed in proposing a common object to the exertions of a great many men, and in getting them voluntarily to pursue it. I have since travelled over England, whence the Americans have taken some of their laws and many of their customs; and it seemed to me that the principle of association was by no means so constantly or so adroitly used in that country. The English often perform great things singly; whereas the Americans form associations for the smallest undertakings. It is evident that the former people consider association as a powerful means of action, but the latter seem to regard it as the only means they have of acting. My life is defined by the Internet: I witnessed and participated in its evolution, and maybe in some small way contributed to it; I certainly owe my livelihood and success to it. I bemoan its passing. And yet, in some ways, I am optimistic about what comes next. When it comes to economics, or social interaction, or now software, the only viable approach is to become smaller; smallness at scale, though, means there is not one global market, but infinite local ones. “Local” might mean geographic, or it might mean a private network; what many markets definitely means is many opportunities, because economies of scale matter less than the ability to meet new needs that only arise at the level of the association. This is where I come back to de Tocqueville: the Internet is an American invention, and has long been defined by American mores; the individuals who thrive on the Internet, no matter their nationality, come across as very American in their iconoclasm and cringe. Beyond the individual, however, there is the association, and amongst the association there is not a market, but infinite markets. Markets are just another word for needs and desires and the mechanisms of meeting and fulfilling them; the end of the Internet may mean the possibilities for creation are only just beginning. Presented by When I write about tech companies, I am often writing about businesses that depend on Stripe , because Stripe provides the foundation for Internet-native companies — including Stratechery. Consider Substack: building Stratechery was complicated and involved gluing together disparate pieces; Substack made it easy by delivering an integrated offering. One piece that was the same, however, was Stripe: Substack creators are also Stripe customers, as are creators on many other platforms. Zoom out and the pattern repeats. Fintechs can build entire business models around card programs without ever having to build the issuing and processing infrastructure underneath it. AI companies can charge for what customers actually use, which is particularly important when usage also drives costs, without having to build the systems to track and bill for it themselves. No business succeeds because of Stripe. Stripe doesn’t answer the hard questions about what to build or whether anyone will actually use it. But it does make more things practical to try. Talking Points Memo , Andrew Sullivan and Boing Boing launched in 2000 Instapundit , Little Green Footballs , and Dooce launched in 2001 Matt Yglesias , Daily Kos , Eschaton , The Volokh Conspiracy , Power Line , Gizmodo , Gawker , paidContent , and Daring Fireball launched in 2002 Ezra Klein , Marginal Revolution , ReadWriteWeb , and AVC launched in 2003 Compromised intermediate CA private keys (although this was an example of sheer incompetence, not AI hacking) Major new vulnerabilities in Node.js, GitLab, Java, and Cisco products Breaches in LiteLLM’s supply chain and Railway developer platform

0 views
daniel.haxx.se 1 months ago

“ignore the slop”

Lots of people who are against the use of AI for all its ethical and inherent issues tell me this. Just ignore it . Don’t let big AI control us. The “slop” they refer to is anything created that involved an AI, and in our case ( the curl project ) it is in particular vulnerability reports. “Ignoring the slop” cannot be done and it doesn’t help. Vulnerability reports created with the help of AIs point out actual problems, and sometimes vulnerabilities. Ignoring real vulnerabilities because they were found by AI does not make users safe and secure. It makes them vulnerable. We don’t want that . I personally don’t refer to this as AI slop because the reports are typically accurate and correct, even if much too wordy. I think “slop” implies that it is wrong, misleading or otherwise bad content. One can certainly object to the use of AI, but when we get real vulnerabilities reported and proven, we cannot in good faith pretend they don’t exist just because we think the tech involved in digging them up is questionable. That would be a disservice to, or even betrayal of, our users. We make curl secure for our users. An Open Source project typically gives no guarantees at all, so there are no legal requirements that force us to fix flaws. We are however a project with high goals of quality and stability and we would jeopardize our name and track record if we now would stop delivering on that. Also, a few of us involved in the project also sell curl related support and services, where at least part of that means providing secure curl releases, so we still have this contractual obligation to a set of customers. And they wouldn’t be customers in the fist place if the Open Source project didn’t already have the proven quality track record. So no, we really cannot ignore vulnerability reports. A sizeable portion of users seem to still believe we still suffer from a lot of made up and hallucinated reports by these AIs. We really don’t. Almost all the stupidity and lies we saw in the vulnerability reports made by AIs in the past have ceased. Since spring 2026 the slop reports are practically gone. Our current challenge is much harder: high volume, high quality . They always use too many words. Every report is now hundreds of lines and the explanations are convoluted and detailed (and often repeat themselves multiple times). In a good report, the human writes a first paragraph explaining the problem briefly and then they submit the full report. It’s annoying when the reporter surrender everything to the AI, including the communication part. The AIs are also still bad at figuring out exactly where the line is between a bug and a vulnerability, and if it is a vulnerability, what severity it is. This is not a surprise though, as this is also the case for human reporters. A good trend is that they often produce good reproducers or proofs of concept helping to trigger and prove the problem/vulnerability. That was a really complicated part of the reporters’ work back in the day, now it’s just a prompt or two. These days, like within the last few months, we have received hundreds of vulnerability reports submitted to curl and every single one had AI involved to some extent . It is generally easy to tell on the language and the length and details of the report.

0 views
Blog System/5 1 months ago

BazelCon 2026 recap

We are right in the middle of fall, and that means BazelCon 2026 just took place. This time around it was hosted in Amsterdam and spanned three days: one day of tutorials and an overlapping Buildbarn meetup that I wasn’t aware of, and two days of main-conference talks and events. And as the event is behind us, it’s time for the now-traditional recap. Welcome to BazelCon 2026 sign. What follows is a recollection of my notes arranged by topic and intermixed with my own commentary and thoughts. Some sections and topics are more detailed than others because in some cases I didn’t have a seat and couldn’t type enough, and in others I got distracted in the hallways chatting with people. Speaking of people, several of you approached me to praise previous editions of these recaps, so I now feel obliged to write another one. Thanks for the kind comments! As we will see, “scale” was a central theme of the conference: AI is multiplying concurrent builds and tests, artifacts and graphs are growing at an accelerated pace due to new features like configuration transitions, and the ecosystem is responding by making execution, caching, and analysis more efficient. There is a lot to cover but here are a few things that felt memorable to me : The BUILD Foundation is now a reality, giving the Bazel ecosystem a vendor-neutral home. Its goal is to act as a proxy between the community and Google to help Google understand what to prioritize and to fund projects. If your company can spare “a few” dollars, please donate! AI-driven development is having a broad impact on the industry and, in particular, everyone is seeing their CI systems become overloaded. Well, news at 11: I’m dealing with this day in and day out. But what was new to me was that we at Snowflake are not the only ones struggling with local system overload. Lots of people out there have likewise “discovered” Git worktrees as a way to run multiple agents in parallel, which in turn means multiple concurrent Bazel servers. Bazel 10 is shaping up to be a substantial release that will help with the problem right above due to its many performance improvements and memory consumption optimizations. Have you struggled to keep Bazel up-to-date before? These days, if you want to get any platform-related work funded you have to spin it in terms of AI, so this release will be an easy sell. Let’s “Rewrite it in Rust”? I’m impressed. Google is seriously evaluating a progressive rewrite of Bazel in Rust, and this is probably the most exciting news I got out of the conference. You know I’ve been critical of Bazel’s usage of Java since day one so, if this takes off, I’ll be the first in line to evaluate the results (and it will likely push me to actually contribute to Bazel again). Fast and correct sandboxing on macOS remains a problem. This is “interesting” to me because it’s a problem I tried to fix almost ten years ago with the original sandboxfs, but I failed because of unexpected bugs in macOS’s FUSE support and eventually abandoned the idea when FUSE became a dead end on Apple’s platforms. Funnily enough, other folks have now reinvented sandboxfs—and even given it the same name (ugh)—and there is even another implementation of a similar idea in the form of actiondFS. Types are coming to Starlark, but Bazel’s late arrival to the party means that multiple competing approaches now exist. We have at least two LSPs with different annotation mechanisms and Buck 2’s own syntax. Hopefully they can all converge. Platforms and configurations remain difficult to model at scale. Careless use of transitions and build settings can produce an explosion of configured actions. Apparently, as one speaker noted, AI agents love transitions for some reason, which is interesting because they are not a popular feature and they are not particularly easy to use. Let’s dive into the full report now. You’ll find my notes arranged by talk but I’ve tried to group them into higher-level themes for easier navigation. These conference summaries take effort to write, and some of you are waiting for them. Show your true support by subscribing! The two keynotes are usually the most information-packed events but… as you can imagine they are also the most popular. The venue this year was not roomy enough to host BazelCon’s attendance (Helen quoted that we got 600 registrations), so I had to stand for these two events. The recordings and slides are not out yet, so consequently, I can only tell you a few details from memory. The conference opened with the usual Bazel Community Update , presented by Helen Altshuler from EngFlow and Chuck Grindel from Glydways. The biggest announcement is that the BUILD Foundation is now a reality. The effort had been discussed at the previous two BazelCons and likely various meetups, but it had remained mostly invisible while its organizers worked through the legal and financial details. The foundation now provides a neutral organization to support the broader build ecosystem (in their words this is not just for Bazel), and it is looking for both members and concrete proposals to fund. If you want to get involved, get your company pumped up and email [email protected] . Documentation continues to receive attention as it has always been a lowlight in previous surveys. Work is underway to make the docs easier for the community to own and improve by decoupling them from Google’s internal systems. But one must wonder: what exactly is the biggest problem with documentation in today’s world? AI agents used to do terribly with Bazel just a year ago and nowadays do… fine as we shall see in the summary. Maybe the work on documentation needs a different spin now. And as usual, a reminder to fill the annual Bazel user survey . Your input is necessary to quantify ecosystem-wide pain points and influence future work, especially now that the foundation exists. John Field and Tobias Werth from Google followed with the State of the Union , which presents a recap of major improvements during the year and the path ahead for Bazel 10 and beyond. Performance remains a major theme. Google reported improvements of about 15% in some workloads together with reductions in memory consumption. Some of these speedups come from upgrading from Java 25 to 27, while others come from correct action rewinding, optimizations to Skyframe cache pruning, and content-defined chunking. These changes are very relevant because Bazel’s large memory consumption gets in the way of scaling CI and prevents using multiple AI agents in parallel. And here is where we heard about Skymetal: the codename for the Google-internal exploration of rewriting Bazel in Rust. The rationale for this rewrite is obviously performance, and I’m guessing it’s now a real consideration because AI can make such large-scale changes feasible. Tobias acknowledged that Java was a reasonable choice back in 2006 when Blaze started and that the JVM can deliver great throughput performance at scale… but it is not the best choice for a tool like Bazel in this day and age, especially when optimizing for memory efficiency is critical. I called it in 2015. I have been in the BazelCon Program Committee (PC) for 3 years now. I remember that, during last year’s review, we encountered a few AI talks but I think none made the cut: they all looked too hype-y and out of place. But it was impossible to ignore the topic this year, and it was actually important to bring AI-related talks on board to not sound tone deaf. AI is a reality in our industry, and Bazel is a key component to survive the transition. Nicolas Lopez from EngFlow and I, representing Snowflake, presented AI Development: Challenges and Early Learnings for Bazel . Agentic workflows have expanded rapidly throughout 2026, and the effects are visible well beyond code generation. At Snowflake, we were fortunate enough to finish our Bazel migration and to stabilize remote execution by moving from our self-hosted open-source deployment to EngFlow’s fully-managed service before all of this happened. And I say fortunate because the increase in CI load that AI workflows brings can only be handled with a good build system and caching story. But none of that is news, so the core of the talk was to look at how Bazel usage looks different in agent-initiated environments. The key points from my side: Agents run more builds more frequently than humans, discover and invoke targets that were often “internal only”, and explore several approaches in parallel. Your intuition about how to evaluate which builds matter and how to measure them is probably wrong by now. Bazel and IDEs have never played great together and maybe that just doesn’t matter anymore. We are seeing a sharp decline in IDE usage, although developers still want a way to browse code changes and debug them. This means LSPs are key now to support “leaner” IDEs, and maybe standalone debuggers. Short build and test latency is critical when a human must remain focused on a coding task but, in an agentic workflow, the constraints are different. You know that, after you hit “execute this plan”, the agent will take many minutes to return so minimal build latency is not as important. And actually… maybe you now want to trade some latency in exchange for extra validations so that agents have to take fewer turns to converge. And because humans are now waiting for agents to finish for long periods of time, they have to fill that time with other tasks, which has driven them to adopt Git worktrees en masse. This is leading to scalability problems on dev machines because multiple concurrent Bazel server processes are not great for memory and disk usage. The rest of the talk, presented by Nicolas, focused on trying to understand behavioral changes by looking at anonymized backend data across companies. One specific insight was that people’s work days have lengthened over the year. Cynically, the promise of “working less because of AI” has not materialized: in fact, we are all seemingly working longer hours and with fewer chunks of focus time, so the dangers of burnout are higher. Maggie Lou from BuildBuddy presented Taking Humans Out of the Build Loop . The premise was that coding agents have improved quickly, but people still spend too much time copy/pasting logs, triggering builds, explaining failures, and reviewing the results. In her presentation, we witnessed many new features in BuildBuddy to allow agents (and humans!) to interact and diagnose remote builds with ease: to download filtered logs for a build. to answer questions such as “Why was my build slow?” which are extremely common in the Bazel ecosystem. to start a remote Firecracker VM and run Bazel inside of it. The VMs are snapshotted for quick reuse, and the runners can execute arbitrary commands rather than Bazel alone. to diagnose a failed build and either create a pull request or push a commit with the proposed correction. to perform a review and post comments to GitHub. The need for these features is unsurprising this late in 2026, but what’s really useful in their offering is how these features integrate with build data. Inspecting the BEP, profiles, remote execution metadata, and logs in unison via an agent can yield much better diagnostics and automated improvements than staring at just a few lines of console output. One thing that surprised me in chatting with the presenter is that BuildBuddy is not particularly big in terms of headcount but they churn out features at a very high rate—and that was true even before AI. Impressive! Armando Montanez (and Ulf Adams, but he didn’t make it) from EngFlow presented Proving Equivalence in any2bazel Build System Migrations . The talk described a structured way to use AI agents for build system migrations and started with a reflection: AI agents used to be terrible at Bazel less than a year ago, but now they do pretty damn well—especially if you can close the loop with automated validations. However, even if agents do well at writing Bazel builds, the fidelity of a migration leaves a lot to be desired if left unattended. And here is where any2bazel comes into play: it turns the process into a guess-and-verify loop. The initial focus of the tool are CMake-to-Bazel migrations, and the tool comes with a script that extracts reference compiler and linker actions from CMake in a deterministic manner. The agent then writes Bazel build files, runs , and feeds the resulting actions to a differ tool that compares those to the originals. The loop continues until the two action sets are equivalent. The equivalence checks are what’s hard though: there are compiler flags that may have no impact on the result, for example, so they need to be “ignored” to let the agent experiment with different Bazel-native approaches until it gets to bit-for-bit identical outputs. It’s important to focus on comparing outcomes and not internals so that the generated Bazel builds do not necessarily follow ancient idioms, like e.g. a Maven-like project structure in a Bazel build. In the end, though, this approach works surprisingly well. But the question is: “How good are the generated build files?” The presenters evaluated them along four axes: Correctness: Good, because equivalence is the central constraint of the loop. Hermeticity: Good, but you might need to do extra upfront work to remove host-specific behavior from the reference build before starting. Efficiency: Usually good when standard rules can model the build. Complex projects with custom build rules may end up with overly large Bazel actions though. Maintainability: Unsurprisingly, the weakest point. Agents tend to model variation with configuration flags instead of proper platforms and toolchains, which is not idiomatic to Bazel. Expert review of AI outputs remains critical, which is, again, not surprising. As a side note, it seems like the team likes pain because they tried to migrate an MSBuild project too. MSBuild is more painful than others because its binary log requires running through a real build: there is no dry-run mode, so it might be difficult to extract a truly clean log of actions, and the process is slow. Fortunately, the reference needs to be extracted only once before the comparison agentic loop can start, and it works: we saw a POC migration of the Color Picker tool that comes from PowerToys. When optimizing a distributed build system, it’s easy to focus on the costs of the remote execution workers: how many there are, what kinds of hardware they use, how well they auto-scale… but a significant driver in cost comes from the storage systems required to support those workers. In other words: the remote cache is expensive. Let’s look at a few topics that deal with this problem. Tyler French from BuildBuddy and Benjamin Ingberg from Meroton presented Content-Defined Chunking for Bazel . This was one of the most immediately-practical talks for anyone operating a remote cache, and it surely caught my eye because I had just been troubleshooting a problem at work that CDC would have prevented in the first place. The problem is that Bazel has traditionally treated each file as one indivisible blob. If an action produces a one-gigabyte binary (not uncommon these days huh) and this binary only changes by a few bytes from a previous build, the client or remote worker must re-upload the entire new file to the CAS and the CAS must store a full copy of those bytes. This is inefficient network- and storage-wise because the cache has to be overprovisioned so that these very large, rarely reused blobs don’t prematurely evict valuable cache entries. Content-defined chunking (CDC) divides a file into variable-sized pieces that can be cached independently. To compute the chunks, a rolling hash scans the contents and chooses boundaries when the hash matches a particular condition. Because the boundaries depend on the content rather than fixed offsets, inserting a few bytes in the middle of a file shifts only the nearby chunks instead of invalidating every subsequent one. With CDC, Bazel represents the original file as a list of chunk offsets and digests instead of a single digest, and each chunk is uploaded or downloaded independently. The presenters reported average reuse of chunks of 36%, chunks of 40%, chunks of 96%, chunks of 98%, and chunks of 99.5%. Furthermore, BuildBuddy estimates that CDC saves 35% of bytes written, deduplicates 60% of chunked bytes, and avoids about 400 TB of traffic per day across its fleet. Finally, the median project sees about 70% less remote storage, while local disk caches shrink by roughly 40%. Impressive numbers. Almost all of these benefits can be achieved by enabling CDC on the backend alone without changes to Bazel because most savings come from worker-to-CAS communication. But there are improvements to be made on the client too, of course. CDC fits bb-clientd especially well because chunks can be reused across output bases and, to materialize a file, the client needs only its chunk map. This can be much cheaper than reconstructing the whole file on every incremental build. For existing users, the starting point is together with a server that supports remote CDC. You’ll want to use the latest Bazel 8.x or 9.x releases for best results, as earlier versions didn’t perform the necessary validations to ensure that CDC didn’t corrupt data. The talk ended with a plea for tool authors to rethink binary formats: files that contain absolute pointers in them are poison for caching even with CDC because small changes in a file can have cascading effects across it. Wherever possible, relative pointers are better. Lore is Epic Games’ open-source, content-addressed version control system for very large, asset-heavy monorepos. Mattias Jansson from Epic Games came on stage to talk about it. But this was not just a presentation of the version control system. This was also a presentation of how Lore integrates with Bazel to prevent ferrying large assets between Lore repositories, the machine running Bazel, and the remote execution/cache cluster. The insight is that Lore and Bazel’s remote cache are both backed by a CAS… so if they can share the same storage, artifacts don’t need to move around. The idea relies on the fact that Bazel-the-client does not need to know the content of source files. All Bazel needs to know are the digests of those files to detect file changes across builds and to compose Remote Execution (RE) API requests. You’d imagine that computing digests requires reading the files, and you’d be right… but the server (Lore) already has those files, can compute their digests once, and can expose those to Bazel for consumption. So, what Epic Games has built is a translation layer between the RE API and Lore’s chunked content addresses, plus a virtual file system that exposes the precomputed digests to Bazel. In this way, Bazel talks to just one storage system and can leverage digests without computing them itself. Of interest was a brief note that Bazel can now use BLAKE3 instead of SHA-256 for content digests, which can likely be a big deal for performance because the former excels in speed due to parallel chunk processing. TIL. Caleb Froese from Canva presented Diffing Millions of Screenshots a Day, Hermetically . The premise of the talk is that, when developing a UI, you really want to have regression tests for how the UI looks —and doing that at scale is difficult. The idea is simple, though: make the code render a part of your UI, capture a screenshot, and compare it against a known-good image. Check in the golden image into source control, and call it a day. Except… if you do that at Canva’s scale, you end up growing the Git repository by about 20 GB per day , which is obviously untenable due to how Git works. A different approach is to store the images elsewhere and expose them to tests through an external repository rule. This integrates well with Bazel in the sense that the downloads are out of the execution path, but it also scales poorly: too much data must be downloaded to each client just for it to be re-uploaded right away to remote executors. And it also creates friction for developers when defining the build graph. In the end, Canva’s solution is to use the Build Event Service and the remote CAS to keep the assets outside of Git while preserving hermetic tests. This pattern applies to any test suite with large golden artifacts, not screenshots alone. Similar story to what Lore tries to fix. There is one extra wrinkle to worry about: GPU-based rendering introduces tiny output differences that make pixel-perfect image comparisons difficult. Canva’s solution is to pin these tests to a specific hardware class by selecting an execution pool through the execution property. That trades scheduling flexibility for reproducible images, which is a good compromise for their workload. Optimizing the way Bazel handles large artifacts helps with performance, but there are many other things that do too. There were a large number of talks around this topic, so let’s dive into some of them. Guillaume Maudoux from Tweag presented Taming Configurations Explosion , a practical talk addressing problems they’ve seen while supporting builds that target physical hardware boards. Such builds grew to have more than three million configured actions even though only about 500,000 distinct actions needed to run. The root problem is that configuration settings accumulate. A project may begin with a setting for the target platform, then add the board’s operating system, its physical layout, its capabilities, and so on. Every setting creates a new dimension in the configuration space and, because each configuration gets a distinct output-tree hash, apparently-different actions may in fact do identical work. Before you know it, you have blown up the action graph and possibly your disk space too. In the example from the talk, 12 parameters end up representing 72 million possible configurations. Only 856 of those configurations matter, and a particular source file has just 39 meaningful ways to be compiled. The rest is duplication introduced by the model. There are three main tools to fight this: Reset transitions: These discard irrelevant configuration values as early as possible in the graph. The art is to move decisions up the dependency tree so that downstream targets do not carry unnecessary dimensions. The trade-off is that ordinary output can become unmanageable, forcing users toward . But then… requires a configuration, so some targets may not be queryable at all without one. Path mapping: If two actions cannot be made identical during analysis, Bazel can rewrite configuration-specific paths during execution and replace their hashes with a stable component. This should be seen as a measure of last resort, though, because subtle problems arise. For example, if the same logical path comes from different files from different configurations, Bazel disables path mapping silently. Tweag fixed Bazel so that different copies of the same file don’t disable path mapping, but debuggability continues to be a problem when this condition does not apply. Flag scopes: This new feature allows a flag to declare where in the graph it applies and to automatically reset to its default everywhere else. This is similar to a reset transition but requires less manual graph plumbing. On the other hand, describing the correct scope can sometimes be harder than writing the transition directly. Han-Wen Nienhuys from EngFlow presented Horapha: Your Personal Warm Bazel , a clever experiment to avoid repeatedly starting Bazel servers and rebuilding their in-memory state. Several CI systems already offer similar features for efficiency, but Horapha targets developer-initiated workflows. The idea is to snapshot a warmed-up Bazel JVM with a new command and save that to disk. A later either starts a normal server when no checkpoint exists or restores the snapshot and continues from the saved state. The implementation relies on CRIU (Checkpoint/Restore In Userspace) , a Linux-only technology that can serialize a running process to disk. Correct restoration requires preserving process IDs, which can be achieved by placing Bazel in a PID namespace. In other words: a container but without pulling in the full weight of Docker. The prototype is available in the Horapha repository with the corresponding Bazel changes in the horapha branch of Han-Wen’s Bazel fork . Han-Wen is now trying to carve a path to get this integrated into upstream Bazel. Did you know that Emacs works similarly? Your executable is actually a snapshot of the LISP machine computed during the build process and stored to disk by the portable dumper introduced in Emacs 27. John Cater and Antonio Di Stefano from EngFlow presented Persistent Test Runners . For a long time, Bazel has had persistent workers for compilation actions but supporting tests has remained elusive—yet persistent workers for tests promise to increase test performance significantly by reducing JVM startup times, sharing heavyweight fixtures across tests, and sharing state such as container images. The reason I said elusive is because Bazel has tried to solve this before. Twice. Google introduced a persistent test feature back in 2019 but it was rolled back that same day. The roll forward was attempted again a month later, already in 2020, but this time separating the feature flag from the runner. Unfortunately, the whole mechanism was scrapped in 2022 because it never worked reliably. The old design suffered from classpath problems after incremental builds, leaked state between tests, and was tightly coupled to Bazel’s native rule—an unacceptable constraint due to the desire to move all rules to Starlark. More fundamentally, the test protocol and the persistent worker protocol modeled very different things. The new proposal from EngFlow introduces an API that explicitly separates the settings and inputs used to create the runner from the data needed by one test request. That distinction is important because the runner infrastructure must be able to decide whether an existing JVM is still compatible with a new test. The team explored several alternatives along the way: Pre-warming the next JVM instead of keeping the current one alive. This provided more control over when and why to restart a test in a new JVM, but suffered from significant coordination overhead. Forking a JVM. This did not work because, due to POSIX semantics, only the calling thread survives a fork call. The JVM is heavily multithreaded, so if you end up losing all but one thread, the new JVM is just not going to work. Android’s Zygote. This provides a pre-warmed runtime ready to be forked ( , anyone?), but it exists only for ART, not the standard JVM, and it’s just not reasonable to expect a switch to ART. Checkpointing. Instead of forking a running process, why not snapshot it to disk so that it can be re-created again? This might have worked, like Horapha does for Bazel startup, but raised difficult questions about when to capture the process and how to handle state outside the JVM. In the end, the only piece that survived these experiments was the coordinator that asks the runner whether a JVM can be reused. The decision considers the Java executable, JVM options, driver code, plugin configuration, and the digests of all loaded JARs. Configurable hooks run at JVM start/stop events as well as before/after each test. When running Bazel’s own test suite, this approach reduced total test time by 46%. The prototype is available in the branches of TheGrizzlyDev/bazel and TheGrizzlyDev/rules_java . It can be tried with a local module override and . Unconference discussion topic proposals and votes for the second day. Remote execution BoF Chi Wang and Tiago Quelhas led the Remote Execution Birds of a Feather . I only stayed for half of it, and so I only captured the discussion around remote persistent workers. Persistent workers are already part of several commercial remote execution offerings, including BuildBuddy and EngFlow, but their implementation was derived from Bazel’s local persistent worker support, which is not… particularly well designed. For example, we have at least three different variants of the persistent worker protocol: one for “regular” persistent workers, another for multiplex persistent workers, and yet another for multiplex persistent workers that support cancellation. And the protocol does not clearly specify which flags and tools belong to the worker and which belong to the action being executed. In fact, these distinctions are currently determined heuristically, with the worker assuming that flag files correspond to the action and other flags to the worker. There was consensus that this should be cleaned up, but the unsatisfying conclusion is that rehashing these complaints and discussions is not going to lead anywhere until someone sits down and presents a specific proposal for a new API. So, if you are reading this and have… opinions… volunteer to do this. Helen Altshuler from EngFlow and Nikita Chepanov from Plaid presented Where Bazel Clusters Break at Scale: Field Notes from Plaid and the EngFlow Fleet . That’s quite a mouthful to say “load testing”. And the reason is none other than AI once again: Plaid’s build volume doubled during the year due to AI-assisted coding and is on track to reach four times its early-2026 baseline. With a predictable increase in load comes a predictable outage. So, instead of waiting for it to happen organically, Plaid deliberately chose to load-test their CI system. The goal was to reach multiples of the normal load and discover each bottleneck under controlled conditions. They had to go through six rounds of tests and fixes until they were able to sustain their desired target. The previous five uncovered problems in network bursts, AWS quotas, source control, CI autoscaling, and cache infrastructure. The solutions were not magical: find and raise limits, cache everything possible, and reduce demand where it does not add value. Examples of the last category include skipping tests for pull requests in the middle of a PR stack and avoiding uploads for actions when they are unlikely to be reused. An interesting observation is that Plaid runs EngFlow in Plaid’s own AWS account, so the cache cluster is co-managed. But careful: shared ownership can easily turn into ambiguous ownership. The two companies addressed this by agreeing on health metrics and thresholds upfront and putting them on a shared dashboard. Both sides now know who must act before developers notice an outage. Ah, one of my favorite topics. Back in my Google days, I spent at least three years of my so-called 20% time working on improving the performance of the Bazel sandbox on macOS. Those efforts were painful: creating a writable FUSE file system is difficult, and diagnosing mis-interactions with macOS was a horrifying exercise. Today, I’m not scared anymore: I’ve been recently using AI to write yet another file system at work and agents do exceedingly well at handling corner cases. Let’s see how modern solutions do better than what I originally tried. David Zbarsky from OpenAI presented actiond: The Quest for a Better Sandbox , which was the first of at least two talks on improving sandboxing performance and strictness. The project started from frustration with local sandbox escapes on macOS and eventually grew into a custom file system, a local virtual machine, and a Bazel-built Linux kernel. actiond pretends to be a remote executor, but the “remote” worker is a Linux VM running locally on the Mac. Bazel communicates with it over a and actiond implements both execution and a content-addressable store. Funnily enough, leveraging this VM for action execution results in faster Bazel builds on macOS than running actions natively. Inside the VM, actiondFS mounts a directory described by a protocol buffer and creates the action sandbox without building a forest of links. Same idea as my original sandboxfs , but the key difference is that actiondFS is a kernel module rather than a FUSE file system so it solves all performance and deployment problems I originally faced with FUSE. A mind-blowing mention was linux.bzl : a Bazel-native build of the Linux kernel, used in this project to build the actiond VM end-to-end with Bazel. This reminds me that I’ve been saying, since the inception of Bazel, that this build system is the perfect pairing for a monorepo like NetBSD’s or FreeBSD’s; and, in fact, I recently wanted a Bazel-native build of NetBSD to put the EndBOX together. I wonder how difficult it would be to hack something up these days with AI… Oh, and: . This flag finally replaces the super-complex script that Bazel uses to run a test with a native binary. This resolves some compatibility issues across platforms and should result in measurably faster test execution. Borja Lorente from Byte Bard Software presented The Sandbox Is a Filesystem: Content-Addressed Bazel Builds on macOS with FSKit , yet another talk on sandboxing and macOS. The immediate problem they tried to address was sandbox escapes in TypeScript builds. You might not be aware, but there happen to be some tools out there that, when faced with a symlink, decide to resolve the target of the symlink and then perform extra operations on that location, like finding sibling files and the like. The compiler is one such tool, and consequently, escapes the symlink-based sandbox used on macOS and behaves incorrectly. Aspect originally patched the JavaScript rules to intercept Node.js file-system calls and redirect them, but that solution stopped working when was rewritten in Go. Apple’s new FSKit framework should in theory be usable to solve this, as it’s “just” a new way of writing file systems in user space. If we could leverage FSKit, the idea then becomes simple: represent the sandbox as a file system and mount a content-addressed view of the action’s inputs within it. Identical subtrees across actions share nodes, contents are fetched lazily, and outputs write through to the host volume. You know, exactly like my own sandboxfs did back in the day with FUSE. Unfortunately, FSKit comes with its own set of problems: An FSKit extension ships as an application, which must be packaged and notarized. This might be OK, but what’s bad is that, because this comes from an application, macOS displays a TCC (Transparency, Consent, and Control) popup notification when an app such as the Terminal tries to access the FSKit volume. Not cool for automated (CI) deployments. Mounting takes hundreds of milliseconds, making a separate mount per action too expensive. This can be solved by reusing the same mount across actions and making the file system create different subtrees per sandbox. Again, like the original sandboxfs. User space file systems have… unavoidable overheads as most operations have to cross the kernel/user space boundary at least twice. These may or may not be acceptable. With my own FUSE-based solution years ago, I just couldn’t fix some performance issues due to some oddities in OSXFUSE. AMFI and Gatekeeper inspect each executable once , adding substantial latency on first execution. And because any executable exposed through a separate file system looks brand new to the kernel… performance tanks. My original sandboxfs mitigated this by keeping inode numbers stable across different instances of the same file across different sandboxes, but that’s what ultimately led to the blockers I encountered with OSXFUSE. Because of all these problems, FSKit was not the clear choice for a new sandboxfs, so the team evaluated alternatives for performance like pure file copying, the old symbolic links, hard links, and APFS’ . FSKit was best at creating the initial directory structure, but later operations such as , , and were slower than with the alternatives. The conclusion was that there is no perfect answer to a fast and secure sandbox on macOS. Symlinks are fastest but allow some tools to escape. Hard links are the second-best option but they cannot protect source files against writes and only work within one volume. is efficient but limited to APFS and, again, one volume. FSKit provides the right abstraction with frustrating deployment and runtime costs. Because of this, the outcome of the talk is a proposal for a new sandboxfs protocol , not a specific implementation. Namely: a way for Bazel to send a manifest describing the inputs plus settings such as network access to a sandbox service. With that, the service can create the sandbox directory and return its path; Bazel can execute the action; and the service can then report the outputs and tear the sandbox down. Different backends can implement the same protocol using the best mechanism for each machine. I like the proposal and the fact that what was old is new again, but there were two interesting questions from the audience. One was: “What about an NFSv4 server?”, which is how Buildbarn exposes efficient virtual file systems on macOS; and the other was: “Can we not implement a new protocol and instead reuse the RE API?” Switching gears to the more theoretical aspects behind Bazel, we can look at changes to a core piece of the ecosystem: the Starlark language. The star (wink, wink) of the show in this area were type systems. Alexandre Rostovtsev from Google presented Static types in Starlark , an update on the type system first discussed during an unconference session at BazelCon 2025. Bazel 8.8 and 9.3 parse the new annotations but otherwise treat them as no-ops, allowing rulesets to adopt the syntax without breaking those releases. Bazel 10 will check annotated files and type-checking should be enabled by default by the time the final release ships. The syntax is a subset of Python’s type annotations with extensions to support Starlark’s native types like providers and attributes, both of which require typed exhaustive dictionaries. This should make large rulesets easier to navigate and maintain, and it lays the foundation for better automated tooling. Right after Google’s update on native Starlark types, Tamir Duberstein from OpenAI presented Type-checking Starlark without waiting for Bazel . I originally read this title as “type-checking without starting a slow Bazel process”—but no, the “waiting for Bazel” part here refers to the fact that the original type-system feature request was filed six (!!) years ago, not addressed in a timely manner, and the ecosystem could not simply stand still until the Bazel team decided to do something. During these six years, Buck 2 has come up with type annotations and a full-featured LSP for their Starlark variant. On the Bazel side, starpls implements another language server and type checker, but its annotations live in comments and the resulting experience is not ideal. OpenAI’s approach is sty , which combines ideas from with ty , the Python type checker developed by Astral. This new project provides fast cross-file checking, resolution, editor integration, and go-to-definition support while avoiding dependencies on a particular Bazel release. One difficulty is that, even if Starlark looks like Python, it isn’t Python: Bazel gives the language several domain-specific semantics. For example, a rule’s fields have types, mandatory status, and default values derived from the rule declaration. A generic Python checker knows none of this, so has to model it explicitly. By “pure” coincidence, OpenAI’s choices here do not diverge much from Google’s official typing system, so there is a path towards reconciliation. The project also introduces files, which act like external stub files and describe types for dependencies without modifying their source. These are particularly useful for rulesets that must continue to support Bazel versions that cannot parse type annotations, because the annotations can live out of sight from Bazel. The last topic I have notes on are talks about rulesets, but I do not have a lot. Let’s just cover a couple of the talks I did attend and take notes from. David Zbarsky from OpenAI presented : {Fast, Hermetic, Ergonomic} — Pick 3 , a new Rust ruleset built to address the pain points that OpenAI encountered with at scale. The usual dependency flow takes and , creates a synthetic workspace, runs , and generates a Bazel-specific . Repinning is slow—roughly O(n^2) in the size of the dependency graph—and Bazel has to repeatedly ask Cargo to contact registries and download metadata. rules_rs avoids that architecture. Bazel already has a downloader and lockfile, so the new ruleset leverages those directly and performs dependency discovery only once per platform. At OpenAI, repins dropped from about ten minutes to 100 milliseconds and can happen as part of an ordinary . Build configuration is read from , avoiding a separate Bazel lock file and the need to keep generated configuration in sync with Cargo. Rust build scripts remain a challenge because they can perform arbitrary work but appear to Bazel as one opaque action. For example, OpenAI replaced the build script in with a dedicated bzlmod module so that Bazel could see and schedule the underlying work. The ruleset also builds the Rust standard library from source, which enables Tier 3 targets and tools such as Miri . Combined with a hermetic LLVM toolchain, can cross-compile projects such as Selenium to Linux, macOS, and Windows. The question from the audience was simple: “What is the carrot for choosing over Cargo?” And the answer was simple as well: at OpenAI, they observed that everything in CI that did not use Bazel was falling over under agent-generated load. Antonio Di Stefano and Yannic Bonenberger from EngFlow presented No Bytes Left Untracked—Bazel Supply Chain Security . The key message was that, while we have always worried about correct builds and Bazel delivers on them, that’s just not enough anymore. We must also be able to explain where every byte comes from and enforce policy over their provenance in order to defend against security threats. Supply-chain attacks are becoming more frequent, and frameworks such as SLSA cover the complete software development lifecycle rather than compilation alone. They include requirements around review, provenance, and Software Bills of Materials (SBOMs). Bazel has always been in a unique position to provide this provenance information because it has a precise dependency graph and runs actions in controlled environments. But a common difficulty is that, outside of Google, Bazel interacts with other ecosystems: third-party package managers bring their own manifests and lock files and coordinating those with Bazel is difficult. There is no uniform representation of package identity, licensing, or provenance. The supply-chain ruleset addresses this with a standard target. The goal is for every package in the Bazel Central Registry to expose its identity and attributes, including licensing information, through a small JSON representation. The presenters asked for help in achieving this, as annotating packages is tedious and, ultimately, the responsibility of their owners. The processing model looks like this: A “gather” aspect walks the target graph of the artifact that needs to be shipped. Each dependency contributes metadata through a transitive provider, effectively producing a serialized view of the relevant graph. Tools convert that data into standard SBOM formats such as SPDX and CycloneDX. Validation actions enforce organization-specific policy, such as banning a particular license from entering a product. This is useful, but the target graph alone cannot fully account for all bytes in an output. True end-to-end attestation also has to inspect the action graph and the environment in which those actions run. Questions like these are to be expected: Which tools transformed the inputs? Where did the actions run? Did those environments have known kernel vulnerabilities? The project roadmap includes rules, module extensions, macro definitions, and stricter build-level enforcement. The 1.0 release was scheduled to happen during BazelCon, but unfortunately they’ll be a few days late due to last-minute issues with documentation and the like. And that’s all I captured this year. There were many other sessions—including talks on hermetic LLVM, Zig package integration, Gazelle v2, CUDA compilation, and richer platforms—but I either did not attend them or did not take enough notes to write anything of substance. Apologies if I did not cover yours here. Check the official BazelCon 2026 schedule for the complete program and stay tuned for the production-grade recordings . Photo while running towards Amsterdam Centraal. The common thread across the conference was scale. AI agents are multiplying the number of builds, tests, and changes that our infrastructure must process, while Bazel users continue to push larger graphs through increasingly-specialized execution environments. The good news is that the ecosystem is responding: Bazel 10 brings meaningful core improvements, remote execution keeps getting smarter, and the BUILD Foundation gives community work a place to grow. But even if the ecosystem is responding, you must too. Bazel is positioned to be a great answer to scalability issues in development workflows thanks to its safe cross-machine, cross-user caching features. And Bazel is also a good way to remain secure amid the unprecedented number of changes to your third-party dependencies. If you have not yet considered Bazel, the best time to do so is today. Stay tuned for the next article! I got some really cool swag from one of the vendors and I promised them I’d write something up once I had a chance to evaluate it. Welcome to BazelCon 2026 sign. What follows is a recollection of my notes arranged by topic and intermixed with my own commentary and thoughts. Some sections and topics are more detailed than others because in some cases I didn’t have a seat and couldn’t type enough, and in others I got distracted in the hallways chatting with people. Speaking of people, several of you approached me to praise previous editions of these recaps, so I now feel obliged to write another one. Thanks for the kind comments! As we will see, “scale” was a central theme of the conference: AI is multiplying concurrent builds and tests, artifacts and graphs are growing at an accelerated pace due to new features like configuration transitions, and the ecosystem is responding by making execution, caching, and analysis more efficient. My highlights There is a lot to cover but here are a few things that felt memorable to me : The BUILD Foundation is now a reality, giving the Bazel ecosystem a vendor-neutral home. Its goal is to act as a proxy between the community and Google to help Google understand what to prioritize and to fund projects. If your company can spare “a few” dollars, please donate! AI-driven development is having a broad impact on the industry and, in particular, everyone is seeing their CI systems become overloaded. Well, news at 11: I’m dealing with this day in and day out. But what was new to me was that we at Snowflake are not the only ones struggling with local system overload. Lots of people out there have likewise “discovered” Git worktrees as a way to run multiple agents in parallel, which in turn means multiple concurrent Bazel servers. Bazel 10 is shaping up to be a substantial release that will help with the problem right above due to its many performance improvements and memory consumption optimizations. Have you struggled to keep Bazel up-to-date before? These days, if you want to get any platform-related work funded you have to spin it in terms of AI, so this release will be an easy sell. Let’s “Rewrite it in Rust”? I’m impressed. Google is seriously evaluating a progressive rewrite of Bazel in Rust, and this is probably the most exciting news I got out of the conference. You know I’ve been critical of Bazel’s usage of Java since day one so, if this takes off, I’ll be the first in line to evaluate the results (and it will likely push me to actually contribute to Bazel again). Fast and correct sandboxing on macOS remains a problem. This is “interesting” to me because it’s a problem I tried to fix almost ten years ago with the original sandboxfs, but I failed because of unexpected bugs in macOS’s FUSE support and eventually abandoned the idea when FUSE became a dead end on Apple’s platforms. Funnily enough, other folks have now reinvented sandboxfs—and even given it the same name (ugh)—and there is even another implementation of a similar idea in the form of actiondFS. Types are coming to Starlark, but Bazel’s late arrival to the party means that multiple competing approaches now exist. We have at least two LSPs with different annotation mechanisms and Buck 2’s own syntax. Hopefully they can all converge. Platforms and configurations remain difficult to model at scale. Careless use of transitions and build settings can produce an explosion of configured actions. Apparently, as one speaker noted, AI agents love transitions for some reason, which is interesting because they are not a popular feature and they are not particularly easy to use. Agents run more builds more frequently than humans, discover and invoke targets that were often “internal only”, and explore several approaches in parallel. Your intuition about how to evaluate which builds matter and how to measure them is probably wrong by now. Bazel and IDEs have never played great together and maybe that just doesn’t matter anymore. We are seeing a sharp decline in IDE usage, although developers still want a way to browse code changes and debug them. This means LSPs are key now to support “leaner” IDEs, and maybe standalone debuggers. Short build and test latency is critical when a human must remain focused on a coding task but, in an agentic workflow, the constraints are different. You know that, after you hit “execute this plan”, the agent will take many minutes to return so minimal build latency is not as important. And actually… maybe you now want to trade some latency in exchange for extra validations so that agents have to take fewer turns to converge. And because humans are now waiting for agents to finish for long periods of time, they have to fill that time with other tasks, which has driven them to adopt Git worktrees en masse. This is leading to scalability problems on dev machines because multiple concurrent Bazel server processes are not great for memory and disk usage. to download filtered logs for a build. to answer questions such as “Why was my build slow?” which are extremely common in the Bazel ecosystem. to start a remote Firecracker VM and run Bazel inside of it. The VMs are snapshotted for quick reuse, and the runners can execute arbitrary commands rather than Bazel alone. to diagnose a failed build and either create a pull request or push a commit with the proposed correction. to perform a review and post comments to GitHub. Correctness: Good, because equivalence is the central constraint of the loop. Hermeticity: Good, but you might need to do extra upfront work to remove host-specific behavior from the reference build before starting. Efficiency: Usually good when standard rules can model the build. Complex projects with custom build rules may end up with overly large Bazel actions though. Maintainability: Unsurprisingly, the weakest point. Agents tend to model variation with configuration flags instead of proper platforms and toolchains, which is not idiomatic to Bazel. Expert review of AI outputs remains critical, which is, again, not surprising. Reset transitions: These discard irrelevant configuration values as early as possible in the graph. The art is to move decisions up the dependency tree so that downstream targets do not carry unnecessary dimensions. The trade-off is that ordinary output can become unmanageable, forcing users toward . But then… requires a configuration, so some targets may not be queryable at all without one. Path mapping: If two actions cannot be made identical during analysis, Bazel can rewrite configuration-specific paths during execution and replace their hashes with a stable component. This should be seen as a measure of last resort, though, because subtle problems arise. For example, if the same logical path comes from different files from different configurations, Bazel disables path mapping silently. Tweag fixed Bazel so that different copies of the same file don’t disable path mapping, but debuggability continues to be a problem when this condition does not apply. Flag scopes: This new feature allows a flag to declare where in the graph it applies and to automatically reset to its default everywhere else. This is similar to a reset transition but requires less manual graph plumbing. On the other hand, describing the correct scope can sometimes be harder than writing the transition directly. Pre-warming the next JVM instead of keeping the current one alive. This provided more control over when and why to restart a test in a new JVM, but suffered from significant coordination overhead. Forking a JVM. This did not work because, due to POSIX semantics, only the calling thread survives a fork call. The JVM is heavily multithreaded, so if you end up losing all but one thread, the new JVM is just not going to work. Android’s Zygote. This provides a pre-warmed runtime ready to be forked ( , anyone?), but it exists only for ART, not the standard JVM, and it’s just not reasonable to expect a switch to ART. Checkpointing. Instead of forking a running process, why not snapshot it to disk so that it can be re-created again? This might have worked, like Horapha does for Bazel startup, but raised difficult questions about when to capture the process and how to handle state outside the JVM. Unconference discussion topic proposals and votes for the second day. Remote execution BoF Chi Wang and Tiago Quelhas led the Remote Execution Birds of a Feather . I only stayed for half of it, and so I only captured the discussion around remote persistent workers. Persistent workers are already part of several commercial remote execution offerings, including BuildBuddy and EngFlow, but their implementation was derived from Bazel’s local persistent worker support, which is not… particularly well designed. For example, we have at least three different variants of the persistent worker protocol: one for “regular” persistent workers, another for multiplex persistent workers, and yet another for multiplex persistent workers that support cancellation. And the protocol does not clearly specify which flags and tools belong to the worker and which belong to the action being executed. In fact, these distinctions are currently determined heuristically, with the worker assuming that flag files correspond to the action and other flags to the worker. There was consensus that this should be cleaned up, but the unsatisfying conclusion is that rehashing these complaints and discussions is not going to lead anywhere until someone sits down and presents a specific proposal for a new API. So, if you are reading this and have… opinions… volunteer to do this. Where Bazel clusters break at scale Helen Altshuler from EngFlow and Nikita Chepanov from Plaid presented Where Bazel Clusters Break at Scale: Field Notes from Plaid and the EngFlow Fleet . That’s quite a mouthful to say “load testing”. And the reason is none other than AI once again: Plaid’s build volume doubled during the year due to AI-assisted coding and is on track to reach four times its early-2026 baseline. With a predictable increase in load comes a predictable outage. So, instead of waiting for it to happen organically, Plaid deliberately chose to load-test their CI system. The goal was to reach multiples of the normal load and discover each bottleneck under controlled conditions. They had to go through six rounds of tests and fixes until they were able to sustain their desired target. The previous five uncovered problems in network bursts, AWS quotas, source control, CI autoscaling, and cache infrastructure. The solutions were not magical: find and raise limits, cache everything possible, and reduce demand where it does not add value. Examples of the last category include skipping tests for pull requests in the middle of a PR stack and avoiding uploads for actions when they are unlikely to be reused. An interesting observation is that Plaid runs EngFlow in Plaid’s own AWS account, so the cache cluster is co-managed. But careful: shared ownership can easily turn into ambiguous ownership. The two companies addressed this by agreeing on health metrics and thresholds upfront and putting them on a shared dashboard. Both sides now know who must act before developers notice an outage. Sandboxing and local execution Ah, one of my favorite topics. Back in my Google days, I spent at least three years of my so-called 20% time working on improving the performance of the Bazel sandbox on macOS. Those efforts were painful: creating a writable FUSE file system is difficult, and diagnosing mis-interactions with macOS was a horrifying exercise. Today, I’m not scared anymore: I’ve been recently using AI to write yet another file system at work and agents do exceedingly well at handling corner cases. Let’s see how modern solutions do better than what I originally tried. actiond: the quest for a better sandbox David Zbarsky from OpenAI presented actiond: The Quest for a Better Sandbox , which was the first of at least two talks on improving sandboxing performance and strictness. The project started from frustration with local sandbox escapes on macOS and eventually grew into a custom file system, a local virtual machine, and a Bazel-built Linux kernel. actiond pretends to be a remote executor, but the “remote” worker is a Linux VM running locally on the Mac. Bazel communicates with it over a and actiond implements both execution and a content-addressable store. Funnily enough, leveraging this VM for action execution results in faster Bazel builds on macOS than running actions natively. Inside the VM, actiondFS mounts a directory described by a protocol buffer and creates the action sandbox without building a forest of links. Same idea as my original sandboxfs , but the key difference is that actiondFS is a kernel module rather than a FUSE file system so it solves all performance and deployment problems I originally faced with FUSE. A mind-blowing mention was linux.bzl : a Bazel-native build of the Linux kernel, used in this project to build the actiond VM end-to-end with Bazel. This reminds me that I’ve been saying, since the inception of Bazel, that this build system is the perfect pairing for a monorepo like NetBSD’s or FreeBSD’s; and, in fact, I recently wanted a Bazel-native build of NetBSD to put the EndBOX together. I wonder how difficult it would be to hack something up these days with AI… Oh, and: . This flag finally replaces the super-complex script that Bazel uses to run a test with a native binary. This resolves some compatibility issues across platforms and should result in measurably faster test execution. The sandbox is a filesystem Borja Lorente from Byte Bard Software presented The Sandbox Is a Filesystem: Content-Addressed Bazel Builds on macOS with FSKit , yet another talk on sandboxing and macOS. The immediate problem they tried to address was sandbox escapes in TypeScript builds. You might not be aware, but there happen to be some tools out there that, when faced with a symlink, decide to resolve the target of the symlink and then perform extra operations on that location, like finding sibling files and the like. The compiler is one such tool, and consequently, escapes the symlink-based sandbox used on macOS and behaves incorrectly. Aspect originally patched the JavaScript rules to intercept Node.js file-system calls and redirect them, but that solution stopped working when was rewritten in Go. Apple’s new FSKit framework should in theory be usable to solve this, as it’s “just” a new way of writing file systems in user space. If we could leverage FSKit, the idea then becomes simple: represent the sandbox as a file system and mount a content-addressed view of the action’s inputs within it. Identical subtrees across actions share nodes, contents are fetched lazily, and outputs write through to the host volume. You know, exactly like my own sandboxfs did back in the day with FUSE. Unfortunately, FSKit comes with its own set of problems: An FSKit extension ships as an application, which must be packaged and notarized. This might be OK, but what’s bad is that, because this comes from an application, macOS displays a TCC (Transparency, Consent, and Control) popup notification when an app such as the Terminal tries to access the FSKit volume. Not cool for automated (CI) deployments. Mounting takes hundreds of milliseconds, making a separate mount per action too expensive. This can be solved by reusing the same mount across actions and making the file system create different subtrees per sandbox. Again, like the original sandboxfs. User space file systems have… unavoidable overheads as most operations have to cross the kernel/user space boundary at least twice. These may or may not be acceptable. With my own FUSE-based solution years ago, I just couldn’t fix some performance issues due to some oddities in OSXFUSE. AMFI and Gatekeeper inspect each executable once , adding substantial latency on first execution. And because any executable exposed through a separate file system looks brand new to the kernel… performance tanks. My original sandboxfs mitigated this by keeping inode numbers stable across different instances of the same file across different sandboxes, but that’s what ultimately led to the blockers I encountered with OSXFUSE. A “gather” aspect walks the target graph of the artifact that needs to be shipped. Each dependency contributes metadata through a transitive provider, effectively producing a serialized view of the relevant graph. Tools convert that data into standard SBOM formats such as SPDX and CycloneDX. Validation actions enforce organization-specific policy, such as banning a particular license from entering a product.

0 views
Krebs on Security 1 months ago

Widespread PHP Flaw May Cause Many Site Outages Today

Expect to see quite a few websites serving error pages today: Nearly 70 percent of websites need to update their core software to fix a pair of vulnerabilities that allow an attacker to seize full control over affected servers. Experts say there are working exploits for the flaws, and that these critical bugs are already being exploited in the wild. Image: Shutterstock.com, Sashkin. The flaws at issue are present in PHP , the programming language that powers sites running on a large number of web publishing systems, including Drupal , Magento , Joomla and WordPress . Earlier today, PHP released an emergency security update to fix two critical bugs that can allow an attacker to execute code of their choosing on a vulnerable server. Reuters reports that government websites in Europe and elsewhere went offline today after the PHP vulnerabilities were disclosed. Cloudflare said it has already detected some exploitation of the flaw, and that at 3:02 am (UTC) it implemented web application firewall rules to protect websites from attack traffic seeking to exploit the bugs, which could cause a denial of service condition, remote code execution, and data exposure. OpenAI , which was involved in the vulnerability research and outreach, said “given the severity of these flaws and PHP’s widespread use, we consider this one of the most impactful security issues in recent memory.” Censys , a company that tracks the technology used by Internet hosts, said a recent scan identified approximately 2.58 million Internet facing hosts and 54.9 million web properties running PHP. Security experts at Wiz said every PHP version released in the last decade is affected by at least one of these vulnerabilities [full disclosure: Wiz is an advertiser on this blog]. “These findings rank among the most severe vulnerabilities discovered in PHP, and arguably in software history,” reads a blog post published today by a team of researchers at Wiz, which was one of several organizations credited with discovering the vulnerabilities. “The underlying flaws had been present for decades, but demonstrating their exploitability required an exceptionally complex chain of steps, at the edge of what human researchers could practically achieve. Frontier AI models substantially reduced that barrier, turning a longstanding flaw into an exploit.” The Wiz researchers say it is likely the PHP vulnerabilities will be mass-exploited to install web-based backdoors or “web shells,” which give attackers a web-based panel that allows them to remotely control infected sites. Wiz said that prior to the PHP bugs being publicly disclosed, the company worked with the PHP team, Calif and OpenAI to measure the size of the problem and coordinate patch verification and disclosure. The PHP zero-day vulnerabilities are being tracked by their CVE numbers, CVE-2026-109618 and CVE-2026-109619 , and they affect all web servers running PHP 5.4 or later. The bugs are fixed in PHP 8.5.12 , 8.4.27 , 8.3.36 , and 8.2.35 . According to Wiz, PHP is so deeply embedded in many web applications that we are likely to see organizations struggling to patch these vulnerabilities for some time to come, comparing this PHP vulnerability pair with the Log4Shell weakness that emerged in 2021 — a widespread, severe-as-it-gets security flaw in Log4j, a popular Java logging framework. “A vulnerability in core PHP reaches far beyond a single application,” the Wiz researchers wrote. “PHP runs across clouds, hosting providers, content-delivery networks and millions of independently managed servers. Reducing exposure before the technical details became public required coordinated work across that entire ecosystem.” The SANS Internet Storm Center is keeping an eye on major software platforms that are shipping updates to deal with these PHP flaws. For example, Ubuntu just released updated PHP packages. For a technical deep-dive on these vulnerabilities that tells the timeline of the discovery of these bugs in a comic book style, check out this post from Calif , another technology company credited with finding the PHP flaws. This is a fast-moving story. Updates will be noted here with timestamps. Update, 2:30 pm ET: Add figures from Censys and a link to Calif’s writeup.

0 views
Stratechery 1 months ago

Do You Trust Apple?

Listen to this post : On July 21, 1999, Steve Jobs did something remarkable at Macworld New York: first he went to Apple.com, then to “CNN Interactive”, then to Disney.com. That wasn’t the remarkable part: what blew the crowd away was when he picked up the just-introduced iBook and walked around while waiting for Disney.com to load. The crowd went wild at the lack of wires: I’m not going to quote this entire product introduction, but I’ve clipped the whole thing for your enjoyment; here are a few pertinent parts of Jobs’ introduction of what he called “AirPort”, and what the rest of the industry called “WiFi”: There is one more thing. The main point of this keynote was the aforementioned introduction of the original iBook: This meant that “one more thing” was in fact not just an extra unexpected product, but an explicit addition to the primary product’s feature set. No wire. What is going on here? We are really excited to announce, in addition to iBook, AirPort wireless networking…It’s a wireless LAN. It runs at 11 megabits per second, and it’s based on industry standards. This is 802.11 wireless networking, and everybody is jumping on board with this thing over the next six to nine months. So all sorts of devices are going to be able to interact with AirPorts. We’re just going to be there first and best, and the specification also incorporates quite a bit of privacy protection, so everything you send out is encrypted. A lot of privacy. We’ve worked with Lucent on this for the last 18 months, hand-in-hand to marry their wireless technology with our ease-of-use technology and to bring the cost of this down for people, because this stuff has been pretty pricey to date. Apple’s selling proposition has, in many respects, never changed: modern technology that is easy to use and private too. So AirPort, what is it? This is the first thing: this is the AirPort base station, and it looks like this, right like that, and so the AirPort base station is really cool… And, of course, industrial design: So what about the computer side of things? Well, iBook is the first computer ever designed right from the start to be optimized for wireless communications, and so right in every iBook are two built-in antennas…Then, we have an AirPort card, a small little card, and the iBook is designed to accept it. So let’s take a look at that. As you know, Apple pioneered this way of adding memory without taking your whole portable apart through simply lifting the keyboard. Well, we have enhanced that now to take an AirPort card, and as you see, there’s a space right there in every iBook ready for an AirPort card, and you can drop one in, just like that, and connect the cable that comes from the antenna. Right? You saw that? I’ll go back. Just connect that cable and push it in, and now your iBook is AirPort functioning. You are on the wireless network. All the software detects the AirPort card and automatically sets it up for wireless networking without going through hours of configuring your computer. It all happens automatically. This has been a major effort on the part of Apple’s hardware and software engineers and also Lucent. This paragraph is a bit extraneous, other than the fact it is personally meaningful: my first Apple computer was an iMac G4, the following all-white generation, with the same AirPort card installation. I remember being amazed at just how easy it was to add wireless . And now, here I am, 22 years later, still using an Apple laptop to write this Article. Two weeks ago I wondered how long I was for the Apple ecosystem ; one product I was definitely not interested in was the then-forthcoming Apple smarthome product: What struck me about Gurman’s article is just how unenthused I am by an Apple smarthome product. Some of this is fatigue from a decade of Siri disappointment and skepticism about the company’s ability to deliver on a voice-centric product. More than that, however, I bristle at the idea of introducing Apple’s constraints to more parts of my life. Those constraints aren’t just about things like full disk access. To the extent that Apple delivers on integration with things like thermostats and door locks is the extent to which they work with 3rd-party device makers; the problem is that third party device makers mostly suck, particularly from a software perspective. Even if Siri were perfect, Apple will have the challenge of delivering an experience that isn’t defined by the lowest common denominator. What I’m much more interested in is controlling the software layer myself. The fact of the matter is that with AI you can decompile almost all existing software — there is a revolution happening in gaming over the past few weeks, as game after game is decompiled to source and ported to any platform you wish — and you can write your own. That means my software that interacts with my agent in the way I want it to for everything; that’s way more exciting than praying Apple delivers the right API and that 3rd-party developers don’t suck. That product is called Apple HomeView , and some prominent Apple observers don’t get the point. John Gruber wrote on Daring Fireball : My skepticism boils down to the question of why anyone would want to add one (or more!) additional ever-present screens to our homes and lives. Phones can stay in our pockets until we need them. Watches remain on our wrists. HomePods can be tucked away unobtrusively in corners, and remain fully useful. HomeView needs to be in a prominent location for its display to serve any practical purpose. Apple’s initial pitch for it doesn’t earn that prominence for me. I understand Gruber’s skepticism, particularly given the product’s truly atrocious introductory video . Beyond the overall stress-inducing nature of the suburban family scene depicted, most of the use cases, as Gruber notes, are nonsensical: to take a particularly egregious example, why would the teenage daughter look at a message from her clandestine boyfriend on the HomeView instead of her iPhone (which has to be present on the network and unlocked in the past several hours for that functionality to even work)? Apple was, in this particular case, trying to show off HomeView’s multi-user capability, which is based on facial recognition, but my biggest takeaway is that maybe highly produced marketing videos sold as product keynotes aren’t the worst idea in the world. In fact, I think that HomeView is pretty compelling. Smarthome functionality is genuinely useful: I have, of course, just laid out five compelling use cases for the HomeView, but it wasn’t hard! These are all real, genuinely useful capabilities for a new home device. And notice what the limiting factor is for the middle three: actually getting different devices to work together reliably. That’s why the other exciting part about Apple’s HomeView announcement actually hearkened back to the original AirPort: Apple Home Collection. From Apple’s press release : Apple today announced Apple Home Collection, a new lineup of smart home accessories — including indoor and outdoor cameras, thermostats, temperature sensors, and a video doorbell and door lock — designed in collaboration with LG Electronics and Schneider Electric. These new accessories are simple to set up starting with one tap with iPhone, and everything is managed through the Apple Home app — no separate app or account required. Each accessory is encrypted end-to-end in Apple Home, so only users and the people they choose can access their home data. Building on the thousands of Works with Apple Home and Matter accessories available today, Apple Home Collection offers customers a new array of recommended products to better understand what’s happening inside and outside their home, manage access, and keep the temperature just right throughout the day. Availability for all products begins in December, with select accessories available starting early 2027. “Apple Home Collection makes it easy to choose smart home accessories with confidence,” said Matthew Costello, Apple’s vice president of Hardware Engineering. “Working closely with industry leaders LG Electronics and Schneider Electric, we designed every accessory to work seamlessly with Apple Home, so managing your home is simple, reliable, and private.” Apple doesn’t have to do everything itself in the home, just as they didn’t have to invent wireless networking in 1999; what they need to do is “marry [partner’s] technology with [their] ease-of-use technology”, and I’m optimistic they’ve done exactly that with LG Electronics and Schneider Electric. The key detail is “no separate app or account required”; that points to deep integration with Apple products, from setup to day-to-day usage. Again, I’m not sure I’m the target customer for this (although the automatically unlocking door locks look awesome); my solution to incompatible or flakey integrations is to use AI to build my own customized software. I’m under no illusions, however, that I am a normal consumer who wants the benefits of technology without the headaches; I trust Apple, more than anyone else, to at least aspire to delivering on that vision, and these 2nd-party partnerships are a great start. The second part where you may trust Apple more than any other company is with privacy. Jobs was talking about privacy as a selling point 27 years ago, and Apple has only doubled down since then. In the case of HomeView specifically there is that facial recognition feature, tied to your own hardware; more broadly, if there is any company you might entrust with tracking your more private spaces it is Apple, both because of promises they make with their technology and also their consistent stance on not using customer data. Indeed, Apple’s privacy umbrella is strong enough that LG’s very sketchy privacy track record is likely to be a non-issue amongst potential customers. From Bloomberg, in 2016 : Apple Inc. has disbanded its division that develops wireless routers, another move to try to sharpen the company’s focus on consumer products that generate the bulk of its revenue, according to people familiar with the matter. Apple began shutting down the wireless router team over the past year, dispersing engineers to other product development groups, including the one handling the Apple TV, said the people, who asked not to be named because the decision hasn’t been publicly announced. Apple hasn’t refreshed its routers since 2013 following years of frequent updates to match new standards from the wireless industry. The decision to disband the team indicates the company isn’t currently pushing forward with new versions of its routers. An Apple spokeswoman declined to comment on the company’s plans. The official end of the line came in 2018 , five years after the last product was released, leaving customers in limbo waiting for updates that never came. That right there is one reason to not trust Apple in the home: the company already decided once that products that didn’t move the needle relative to the iPhone weren’t worth their time, even if delivering an integrated home experience was still something Apple was uniquely positioned to provide. Yes, by the 2010s most people had WiFi access points from their ISPs, or mesh WiFi products from the likes of Eero, but Apple still could have done something useful. For example, one of the biggest challenges in designing a wireless network is that the iPhone aggressively holds onto access points; if Apple had continued to design its own access points it could, even today, provide a superior experience. Alas, the business was deemed to be not big enough to bother. One reason Apple might be more interested this time, however, is the possibility of subscription revenue. Specifically, the cameras in Apple Home Collection will require a paid iCloud+ plan for recorded event history — higher levels for more cameras — which fits in with the company’s focus on services. Apple Music is also natively supported on the HomeView, whereas you’ll need a recently unlocked iPhone to use Spotify. Of course to some this might be another betrayal of trust: Apple used to sell you products, now they want to sell you on-ramps to recurring revenue. Both of these issues of trust, however, pale in comparison to the single biggest question facing HomeView: do you trust Siri to actually work? From Mark Gurman at Bloomberg : Apple Inc.’s new HomeView has been a long time coming — far longer than the company intended. I first reported on the device in January 2023, when Apple was aiming to bring it to market as early as the end of 2024. What should have been a relatively straightforward launch instead turned into a nearly two-year saga of delays. The culprit was Apple’s AI crisis, which left the company without the one piece of technology the HomeView absolutely needed: a working version of its revamped Siri assistant… From the beginning, the HomeView was built around a Siri that could retrieve personal content, distinguish between members of a household and show each person private information. It was also designed to be controlled primarily by voice, rather than through its touch screen. Without a serviceable version of the new assistant, Apple couldn’t deliver the experience it had envisioned. That left the hardware ready to go, but the software nowhere near finished. So Apple postponed the HomeView repeatedly — first until spring 2025, then summer, then fall, and then again throughout 2026 before finally unveiling it this past week. And the hardware betrays its age. With thick bezels, an A18 processor and 8 gigabytes of memory, this is clearly a product conceived years ago. Finished units have been sitting boxed up in warehouses for the better part of a year, waiting for the software to catch up. There is a world where Apple never gives up on AirPort, and instead uses it as a foundation to deliver the integrated smarthome in the late 2010s; in that world Siri’s performance is important but also less pressing given that some number of homes would already be locked in. The second world, which Gurman describes, is one where Apple delivers on the new Siri in 2024 like it planned, and the HomeView is its showpiece experience. This is still a compelling product in that scenario, where integrating information from your iPhone is close to the cutting edge of what AI is capable of. The world we are in in 2026, however, is a much different one. In this world Siri AI has shipped, and while it is more capable than what came before, it is much slower, and makes more mistakes with basic tasks that the deterministic old Siri handled reliably. Moreover, the competitive landscape is dramatically different: agents like Muse, Instinct, Dots, or Grok Bots not only integrate information but actually act on it; new Siri already feels long in the tooth. This is where a foray into the home is particularly challenging. One doesn’t replace one’s thermostat or cameras or doorbells every year; these are one-time purchases meant to last for a long time. Ditto cutting a hole in your wall to mount a HomeView, which certainly makes more sense for many of the product’s core use cases. Making such a commitment, however, means committing to Siri AI as the primary interface, and trusting that Apple will make it good. This is a costly choice, and not just monetarily. The real concern is opportunity cost: committing to a world controlled by Siri AI means forgoing a world controlled by any other AI. That’s too expensive for me; how many consumers, even those who trust Apple to make things work together, and who value the company’s commitment to privacy, will make a similar evaluation? The answer right now, in 2026, is probably not too many, which is to say Apple might have got this product out just in time. I think there is something here, even if Apple’s marketing team doesn’t seem to be able to explain it very well. At the same time, I think HomeView highlights some of the mistakes and shortcomings of former CEO Tim Cook’s tenure; earlier this year when Cook retired I wrote about his impeccable timing , both in terms of when he took over Apple, and also when he stepped down: To that end, it’s right that Cook is stepping down now. Jobs might have been responsible for taking Apple from 0 to 1, but it was Cook that took Apple from 1 to $436 billion in revenue and $118 billion in profit last year. It’s a testament to his capabilities and execution that Apple didn’t suffer any sort of post-founder hangover; only time will tell if, along the way, Cook created the conditions for a crash out, by virtue of he himself forgetting The Cook Doctrine and what makes Apple Apple. The Cook Doctrine states that Apple needs “to own and control the primary technologies behind the products we make”, but Apple doesn’t own and control the models underlying Siri; meanwhile, one of the things that makes Apple Apple is focusing on making great products that customers love. How did Apple’s obsession with services revenue fit in that rubric, particularly when said obsession rose in conjunction with stripping out every part of the business that didn’t move the needle in terms of revenue, even if it made for a better user experience? Privacy, meanwhile, is great as a strategy credit ; what happens when it gets in the way of making products that work? It is true that Apple’s AI approach has the benefit of not moving the needle in terms of costs, at least relative to its big tech peers. It’s possible that just as Apple is partnering with LG Electronics and Schneider Electric on home devices, the company will deliver compelling experiences through its partnership with Google (and surprising thawing with Meta via its Meta Superintelligence Lab ). After all, Apple hasn’t always done everything — Lucent Technologies once featured in a Steve Jobs keynote! The difference is that that was an Apple that was eager to race ahead, not simply catch up; Jobs was planting seeds for the future, seeds that Cook harvested. Cook did make investments that matter, particularly in Apple Silicon (even if that effort started under Jobs), and in wearables; the job for Ternus will be ensuring that Apple’s “ease-of-use” technology is not just easy but actually useful. Years ago I set up a small monitor on the side of our condo’s living room for the kids to play video games; I happened to have a Raspberry Pi on hand, which I used to set up a service called DAKboard . DAKboard showed the time, the weather, the family calendar, and a rotating collection of photos. It has, in the intervening years, been one of our most-used and most-beloved pieces of technology, looked at multiple times a day every day. Thermostats are finicky and hard to use; it’s much better to be able to program them from your phone, or from a touch device. The problem for me in my current home is that my thermostats seem to mysteriously lose their connection to my home automation system every few weeks. Doorbells are critical in a world of e-commerce, especially when it comes to the dreaded “signature required”; incorporating them with your devices, along with a screen to see who is at the door, is a no-brainer. Unfortunately for me my doorbells also seem to get randomly disconnected, and I never notice until I miss a delivery. Cameras are a useful security measure, but only if you can actually view them. The issue is — you guessed it — that they often become inaccessible or are non-intuitive to use, particularly the moment you need them. Sometimes I want to access information without using my hands, like when I am cooking. You can prop up an iPhone or iPad in the kitchen, but what do you do when it goes to sleep in the middle of a recipe?

0 views
Kev Quirk 1 months ago

Year 4 at the Smallholding

So today marks the 4th anniversary of us moving to our 2.5 acre smallholding in north Wales. I can't believe it's been 4 years already - it feels like 5 minutes ago that I was writing my 3 years at the smallholding post . Last year's update wasn't as positive as previous years thanks to us having to get a new roof, which cost a shit tonne of money, and caused leaks all over the house. But I'm happy to say that the update for this year is mostly positive. I ended last year's post by saying: If next year I can get the polytunnel and conservatory done, I'll class that as a win. I'd love to get a quad bike for towing the flail too, but again...money. Unfortunately there's no poly tunnel, no insulation in the conservatory, and no quad bike in the barn. Let me explain... In March of this year we decided it would be a good idea to get some goats. My wife had been talking to a goat farmer in mid-Wales for a few months, and we decided the time was right to get some. So we ordered 4 male pygmy goats and brought them home in the back of the car! Our first 4 goats arriving home While we were at the farm, the farmer showed us a beautiful half pygmy, half "normal" goat and her 2 kids, along with a little pygmy goat that followed her around like a lost puppy. We immediately warmed to all of them, but we couldn't fit them in the car, so we had to pass. After a week or so of thinking about them, my wife decided to head back down there and pick them up too. So we ended up with 8 goats all together. I'm really glad that my wife decided to get the second batch, as the mum (now called Betsy) is so friendly and one of my favourite of the group. Betsy being lovely (as usual) We're very lucky to have a pair of stables at the back of our property, one was already used by the chickens, so we setup the other for the goats. However, the stables and surrounding needed some work. We had to: Unfortunately this all took up what little budget we had left following the roof, so the poly tunnel and insulation in the conservatory had to wait. We completed the renovations on the stables and both the chickens and the goats now have a lovely little home that has lots of space, but (more importantly) meets their needs. Goats and chickens on the rock wall Here's a little gallery of how the work progressed on the stables: As well as goats, we decided to add to our flock of chickens, but instead of just buying more we wanted to do it a little differently. We have a rooster now, so all our eggs are fertilised and we decided to try and hatch some eggs instead. We also wanted to get something a little different, so my wife bought some guinea fowl eggs, which we put under a broody hen to see if they would hatch. They did, and we ended up with 5 beautiful (but noisy) guinea fowl. The guinea fowl were a great success - 5 of the 6 eggs hatched. So we decided to attempt the same thing with some of our chicken eggs, especially since a fox had gotten one of the hens and we wanted to hatch some of her eggs. Unfortunately we had no broody hens at the time, so we decided to buy an incubator and cheat. We attempted to hatch 12 eggs, but only 3 were successful unfortunately. We think 2 of them are roosters too, so we will see how that goes as they grow up and undoubtedly challenge their dad. We're thinking about doing it again this spring, but we're worried about having a plethora of roosters and what we will ultimately have to do to them. 💀 Finally I installed some new perches for the chickens to roost on in the evening. Below is a removable shelf that makes things way easier to clean. So at this point we had used up everything we had saved. We had literally nothing in our savings account. Then we noticed that our older dog, Tia, who's 14, was getting very smelly breath and whenever she was chewing her favourite ball, her mouth was bleeding. So we took her to the vets and they told us she had a fairly common type of benign tumour growing in her mouth. Although it was benign, it was very aggressive and if left untreated she would have 6-12 months if she was lucky. And it would be a very uncomfortable end for her. We had to get it looked at, but this was going to cost thousands and in a 14 year old dog, I wasn't sure if it was worth it. The last thing we wanted was to put her through all this only to find out in a few months that she had another terminal condition that would end her life anyway. I know that sounds heartless, but I think at times like this it's important to be practical and take into account how much the dog will suffer, and whether we're doing it for us, or them. She needed a CT scan on her jaw to see if surgery was viable, so we decided to get a full body CT scan done instead. This would give us a good indication if anything else untoward was going on in her body. Lucky for us the CT came back all clear and the surgery on her jaw was viable, so we went ahead. Three operations, 1 infection, and lots of discomfort later for poor Tia, and she's now fully recovered after having around 40% of her lower jaw removed. Unfortunately for her, this means her rather large tongue often dangles out of her mouth these days. But we think she's still gorgeous. As if this wasn't punishment enough, we also got a new puppy, Nelly, at the same time that Tia was going through all this. So managing a sick dog, a new puppy, and keeping 2 kids entertained during their summer holidays really wasn't a fun time. We had bought Nelly way before we knew Tia was sick. The kids knew she was coming, and we had all met Nell multiple times. So although we knew it would be a nightmare, we didn't want to renege on buying her. Let me tell you, dear reader, it was rough . Like, really rough, but we're glad we stuck it out because Nelly is beautiful and such a wonderful addition to our family. Tia's surgery ended up costing us around £6,000 (~$8,000). We already had no money, so it had to go on a credit card, which we will pay off over the next few months. Our plans for year 5 are the same as year 4, I think - we'd love to get a poly tunnel in and the roof in the conservatory insulated so we can use it all year round. But we will need to see how the finances go - hopefully there will be no more unexpected expenses for a little while. We can only hope. In the meantime we continue to enjoy our brood of various animals and the little plot we call home. Thanks for reading this post via RSS. RSS is ace, and so are you. ❤️ You can reply to this post by email , or leave a comment . Install a land drain and level the ground Extend the hard standing around the stables Get some fencing installed Replace the doors and windows Install ventilation and power Create a "rock wall" for the goats to play on

0 views