Weekly Notes 2026/28

  • I learnt the Boko Haram has been using AI and killing themselves.
    > We saw in a movie how motorcycles can jump over bridges. We used AI to learn how to do this. We gave it information, like what motorcycles we use and the distance we need to jump and so on and it gave us steps on what we have to do. We practiced a lot and kept asking questions. We dug holes and filled them with broken glass and fire to practice. 18 of us died in the process. Eight of us managed to do it. The next time we attacked, we could jump.
  • I watched a few videos of Casey Muratori talking. Nice guy.
  • This season for Rick & Morty is excellent. I enjoyed the episode 9, Mortgully, thoroughly 👍️.
  • I don’t follow football much. I read the Donald Trump got Fifa to reverse a red card! Then learning that USA lost to Belgium was pretty nice. Donald Trump has lowered the bar so much as even lowest among the lowest don’t compare to him when it comes to pettiness.
  • This week was busy at work. I am participating in an internal competetion.

Weekly Notes 2026/27

  • The popular version of the Dunning-Kruger effect says that stupid people overestimate their capabilities. This is true, but the effect is much more general than that. It says if your expertise level is different from the average, then you judge the “average competency” differently. So if you have above-average expertise, you might overestimate what the average competency is. Folks who had above-average education tended to overestimate what average education looks like (and vice versa), and so on.
  • Embassy is a great project. I am porting a blocking C firmware to non-blocking firmware using Rust, and it is a joy to write in. I hope things are still as good as now when I need to take a not-so-happy path. The other option was using ROS or FreeRTOS, but I am not very excited about writing in C or C++ or even Python.
  • Things are getting interesting at work. The AI pricing is increasing, token usage is being curbed, and folks are demanding their dosage back.
  • All sync communication like Slack must be banned around serious work unless they are moderated by grumpy old people who get heart attacks every time someone shoots 10 notifications when one would have done :-). Go back to emails, please! Put effort into writing and reading. And no, I don’t mean write in Victorian English or have perfect grammar.
  • I had to go see the mechanic about my Tata Nano. It’s been 8 months since the car went to his garage. Man, he can lie with a straight face! I may have to explore legal options from next month onwards.
  • The monsoon has arrived in Bengaluru, but rains are still deficient. Lantana plants in my neighborhood are doing great, sadly for local flora.
  • Yesterday, I had a chat with my neighbor. He is a retired bus driver from KSTRC. Nice guy and very helpful. Old people love to talk about plot price, house price, cars, and other stuff. He has experienced an automatic car in Bengaluru traffic and is now planning to sell his manual.
  • Today, I filed my ITR and GST returns. I am getting a bit used to them now. Both government portals are actually fine. The ITR portal is pretty good, and the GST portal works after some practice. This year, I had to file ITR2 (due to some stock selling/buying). It was easy to get the details from the CSDL repository and add them to the form. It takes a while to learn the acronyms and abbreviations. Last year notes in Notion helped.
    • I thought of hiring a CA but I didn’t see much value. They save the hassle of knowing how to file ITR, which I was keen on learning anyway. And to file ITR by CA, I need to collect all data and share it with them, which would take the same amount of time. So what’s the point? Perhaps they know something that Reddit/Gemini doesn’t about saving taxes?

Weekly Notes 2026/26

  • I got my 3D printer back from my cousin. He stopped using it for a few years. He sent it back to me when he had to move. I’ve been printing a lot of useless stuff, like the one below.
  • I have been reading “Medieval India 1” (edited by Irfan Habib). I found a few papers in it quite interesting — especially on social mobility and travelers accounts of Hindu religious practices at many famous places; many of them don’t exist anymore. Perhaps I will write a review later. Mr. Habib has an excellent, readable body of work on Indian history. Indian history was a very emotional subject when I was in college. Mere mention of a historian was likely to invite accusations of partisanship. I’ve mostly read what people would call “leftist” historians. Mr. Habib, D. D. Kosambhi, etc., were/are my favorites. Though I don’t touch Romilla Thapar anymore. I don’t like her as a person anymore after her stint at EPW.
  • The economy and the reality are catching up with the AI usage at work. Costs have been rising, and token-maxxing by a few is burning through the monthly budgets in a week. Given its effect on memory prices, I am a bit glad that I bought a Linux machine a few years back, though I didn’t need any. It is quite a weird situation; the promise of AI is replacing labor and jobs, then who’s going to buy it, and what is its point other than being a tool of economic destruction?
  • Congrats to Ireland and New Zealand for their wins over India and England. I didn’t watch any of those matches.
  • The government pulled a statistical sleight of hand to show the rural wage has increased by 13%! This data will go into official statistics soon.
  • My favorite podcast, In Our Time, continues after its host retired from the show :-). I’ve listened to a few new episodes. It will take some time to get used to the absence of Mr. Melvyn Bragg. Content produced by the BBC is still one of the best in the world, but this podcast had been out of this world.
  • Work was very slow this week. I also took a few technical interviews for a client who has been using AI to screen resumes. I am not a fan of using AI in the interview process, but it is what it is. Earlier, I didn’t like structured interviews, but now I prefer them since comparison across becomes a bit easier. I don’t have anything against unstructured interviews if you practice beforehand and make sure it doesn’t derail candidates. Now I wish the candidate also practiced interviews, especially how they answer the questions; please get to the point as soon as possible.
  • Something is perhaps churning in the PHP community: RFC for geneic was rejected! And I saw a talk about the RFC process. I think it is usually a VERY GOOD idea to make the lives of programmers easier.

Weekly Notes 2026/25

  • 📚️I ordered a few of Prof. Andre Beteille books. He dies a few months back. He is perhaps the only sociologist that I could read. MN Srinivas’s “A remembered village” was also a great read.
    • I also bought a few books on software engineering in general, especially on refactoring, design patterns, and architecture. Books on software engineering becomes outdated pretty soon. I prefer blog posts or papers.
  • 🥭️ The peak mango season in Bengaluru is over!
  • 🏏️I think I’ve lost all interest in cricket. I can no longer watch a full game, even watching highlights takes some effort. While the heart misses the test matches but I don’t have that much of time or attention. Then the T20, the “pornography of cricket”, fun as it is, has already killed neural circuitry that appreciated delayed-gratification required for test cricket. Good riddance, perhaps!
  • 🤖️I learnt that Hyundai bought Boston Dynamics a few years back (80% stake) and now finished the deal by buying the remaining stakes. Automotive industry is betting on “physical AI”. Toyota, where I currently work, also have significant focus on physical AI.
  • 🛵️ It was a WFO week at work. I think I should once a week to office just to ensure that bike is in good shape. My office bag content remain relevant to seasons. I got caught in rain and I didn’t have my rain jacket in my bag.
  • This year is going to be most tumultuous as far as “coding” is concerned. Either we’ll figure it out how to use AI properly. Or I’d have gone through the stage of griefs and reached acceptance by then. I’ve been thinking about AI or pushing back on it till December this year.

Weekly Notes 2026/24

  • Couple of bad news from the village: an old widow died after shock of bank proceedings against her 5 lacks loan sent her to a comma. She was milking her cows when she fell back. It is typical for banks to announce these things loudly in public because public shaming seems to work on villagers. The rural economy has been under duress for a long time and Iran war made things worse. There are long lines for diesel, petrol and LPGs, and prices of fertilizers are up. Despite what your media and govt telling you (or keeping mum), things have not been positive for a long while.
  • It was heartening to see PARI is publishing many more news stories. I’ve setup a monthly subscription. Currently, I only subscribe to two news portals, PARI & Caravan. I’ve cancelled most others: frontline, Indian Express, and even EPW after Thakurta fiasco and trustees using Prof. Beteille name on the letter while he was ailing in the hospital. It was vile! Vote with your money, it works!
  • I tried to read “Inversion of Control layer” but couldn’t find motivation after a few paragraph. I am pretty sure it has some value in it but the motivational example is way too “enterprisey” to pay attention to.
  • “Why Japanese Companies Do So Many Different Things” was an interesting read.
  • I think I am now suffering from AI fatigue and communication slop it causes. The social rules around using/producing AI content are in flux. I feel irritated when someone sends AI generated content my way but occasionally do the same myself. One solution to this is maybe to slow down and take time to do things the old way but not using AI now feels like “not using your super-powers”. Interesting times I am living in.
  • Its been over 6 months that my Tata Nano XTA is still in garage. The mechanic has been telling me this week or next week for last three months!
  • I wished I watched the Bangladesh and Australia second ODI match. Bangladesh played excellent cricket.
    • It is becoming very very hard to watch cricket when India is playing — the advertisements are so cringe on Hotstar. And commentary has become really meh — commentator are also parroting ads! I don’t know how long they are going to milk nationalism.
    • Perhaps I need to find a more sports-friendly streamer who is less interested in shoving ads down my throat. I watched few hours of NZ and ENG test match on Sony LIV which otherwise has terrible content; and SL and ENG T20 match (Women World Cup). Commentary was good. I get to learn a few things and tidbits about cricket and cricketers. And ads were just ads. Or maybe I am just getting old.
  • Age has stopped becoming “just a number” now, more and more it feels like a timer!
  • So have you heard that someone has 1 trillion dollars now? A few decades ago, I read a historian talking about how after world war II, super riches have become things of a past! 🙄️
  • Following is a really good talk — a bit long. Ask AI to summarize if you are interested in content, and then enjoy the details.

Weekly Notes 2026/23

  • 🏃️In last 5 months, I’ve ran over 320km, 680 more km to go in next 7 months. Pretty doable since running in winter is easier. It’s harder to run >4km without a good company.
  • These days I come across more and more apps broken in subtle ways. After the last update, my Android phone becomes unusable within a day unless I reboot it once a day. Android has started behaving now a bit like Windows! I feel anxious about updating anything (including Linux kernel).
    • Most annoying is when bluetooth and phone apps stops working in weird ways. I hear caller tune but no icon to pick the phone. If I switch off the bluetooth, I won’t switch on again unless I reboot the phone. Google playstore complains that I am not logged-in and BHIM stops working since googple play service complains that I am not logged in! 😪️
    • Web-apps are also broken in equally silly ways. One of my client uses a new and upcoming HR web-app which I always found annoying. These days, I loaded a few mega bytes of data on landing page, and that keeps changing its background images. Their login flow is mysterious once you are off the happy path. I just want to upload invoices. I’ve given up on it just send invoice over email.
  • I downloaded GST application for Linux to sign my filings. I wasn’t expecting it to work since it is a govt. app and it didn’t disappoint. It didn’t work.
    • It is a java application that requires Sun Java and doesn’t work with openjdk. I downloaded the Oracle java and ran it but again no dice. I asked Claude if it can help mitigate the sloppiness of my country men/women and it did a good job.
    • Apparently the developers (eMudhra) shipped Windows related files inside a Linux app. I don’t think anyone opened it on a fresh Linux machine before shipping. Claude was able to patch the app. Patch is available here https://github.com/dilawar/GSTSigner-linux . We Indians have a well-deserved reputation of being sloppy and lazy at everything we do.

Weekly Notes 2026/22

  • My neighborhood saw rain this week, decent amount. Mosquitos are back! Surprisingly there was no power-cut after first bout of strong winds. In last couple of years, they replaced naked aluminum wires with a bundle of insulated coated wires. Perhaps that helped.
  • I learnt a bit about “mock testing“. I thought it knew about it. The way it interacts with Rust’s trait was new to me. This weekend, I am going to collect materials on it.
  • Govt agencies are rarely known to be a place for efficiency and accountability but recent news of CBSE botching up student’s mark-sheet is a new low. I read that a “journalist” called the student who brought up the issue Pakistani and cockroaches! Why rush towards a new system just a few weeks before an event is beyond me?
  • I’ve never been a fan or admirer of any living politician. I find them necessary evil to be tolerated as long as we can potentially replace them next election cycle. I feel a bit sad when I meet someone who is. The job of citizens is to keep its government on it’s toes rather than touching its feet! Perhaps that is the issue: some folks want to be a subject rather than a citizen? A politician influencing ECI so brazenly is like watching a cricket team installing their own umpires in a match! What is left to celebrate after victory then?
  • Some psychologists claim that old people who are bhakt now were chamchas before. Why do they start worshiping Mr. Modi after so rudely disillusioned by Ms. Gandhi is beyond me. It would make a good Ph.D. thesis.
  • Powerful leaders, more often than not and surely in our country, cause more harm than good to the foundation of nation. What Ms. Gandhi did to civil services and press is not different than what the current government is doing to judiciary and press. These have long lasting effects that rarely gets corrected on its own. For a weaker judiciary and a spineless press and police are more useful for any politician doesn’t matter which party they belong to.
    • We have few examples in Europe to compare. In US, a cult of personality seems to be winning over a “check-and-balance” style of governance.
    • Reminds me of Gandhiji who deeply distrusted political parties in general and two parties system of US in particular. He thought that a two party system will eventually turn citizens against citizens. Despite finding Gandhiji politically naive, he sure has a point if you think beyond a few decades.
  • We sure have a thing for “powerful leaders”. Sadly even among people who should know better. Perhaps the educated class in this country is subconsciously aware of worthlessness of their education and degrees. I’ve seen them lining up behind Anna Hazare and Mr. Modi as if they couldn’t think of better ideas.
  • Even when your leaders are “good” and not interested in lining up his pockets or keep himself in the limelight, they can’t think beyond next election! Some leaders might enjoy nothing more than contesting elections because it gives them a high they can’t get by solving problems that may take more than a election cycle. The timescale of 5 years is too short in life of a nation to lay the foundation of semiconductor fabrication, improve primary education and health system and to improve universities. Might institutes that don’t have to think about their existence every five years help? I hope this to be largely the case but we also have institutes like DRDOs!
  • In may countries, political parties are also “institutes” for they easily outlive their current leaders. And these parties can think beyond election cycles though I find this to be rarer and rarer. In our style of society, we have factions rather than parties because they grow and wither with their ring-leaders.
  • Sure, one can ditch democracy and look for autocrats for they don’t seek votes. It might work in some cases for a few decades but when it doesn’t work, and it eventually win not, it is going to hurt really bad.

Weekly Notes 2026/21

  • Some rain this week on Tuesday. Cloudy week. Not bad. Running after the rain when there are no dust particles in the air is already pleasant.
  • People are still very confused about AI. What should it be used for and how much? What are its real benefits?
    • I wish there is little less AI content on my feed. LinkedIn is bad again but in a different way. HN and lobste.rs also have way too much AI on front-page. Some reddit communities are doing well but someone will mention AI somehow on every tech thread!
  • I’ve got GSTIN this year since I am mostly working as contract/freelance roles.
  • My phone has been misbehaving in mysterious ways for a few weeks now. Pressing call icon doesn’t work unless I restart!! GMail app is crashing when I try to open right panel, MS Team doesn’t sync calendar with system calendar anymore. Google Play complains that I am not logged-in but shows my google profile picture anyway and also refuse to show me “Log In” button because I am logged in. BHIM refuses to open unless I login to google play service but google won’t let me because I am also logged in and not-logged in at same time! A bit like Schrodinger cat. I am almost sure that these small small bugs are due to AI slop and compounding now. I hope this all ends badly soon enough so we can move on.
  • Skill rot due to AI use is real (at least for me). I am finding it very hard to write code manually now. The struggle to type by hand is mostly psychological. Like trying to wash dish by hands when you’ve gotten used to dishwasher and it working well, or driving manual after driving automatic. These analogies are from people on podcasts, and somewhat true. AI is mostly convenience driven programming.
  • This week I didn’t read anything carefully.

Weekly Notes 2026/20

  • No rain this week either! And the raw mangoes that I plucked last week are still sitting pretty in basket.
  • [jj](https://steveklabnik.github.io/jujutsu-tutorial/) promises to be a simpler git. I played with it this week but I still don’t get it. I like what they are selling though!
  • At work, I got my first MR merged into the codebase! Totally hand-written code, AI was used for on-boarding and rubber-ducking.
  • I vibe-coded a moderate complexity project — a PCB router like freerouter. I doesn’t work. The UI is excellent and it looks like that it almost work but it doesn’t. Now every prompt is like shouting into the void, things changes but were not fixed at all.
  • The successful vibe-coded projects and web-pages are working fine and looks OK as long as you don’t read the code carefully! I usually don’t notice big issues when skimming but as I soon as I try to understand the code, …!
  • I am going to write write most of the code by hand since it is quite possible at my new job where the codebase is managed by folks that are older and more conservative than me. Each MR goes through 5 to 6 reviews and it is expected that I understand every bit of it. So far, I am not convinced that I can “understand” a AI written code by reading it faster than writing it myself.
  • I love that I can treat AI an average senior developer who is always available to answer anything about the codebase and never judge you. Moreover, you are not scared of asking the dumbest possible question. It can also be used to learn patterns in the code-vase without mastering git grep and other search tools. And get a decent review of your MR.
  • Another good use case: it can copy-edit your first ‘vomit’ draft. Please write you own text. Then ask AI to copy-edit your brain vomit. DO NOT violate the first principle of writing — spend more time writing a text than others are expected to spend reading it. AI can also be used to rewrite your text for different type of users, e.g., add a “KT” focused post for fellow maintainers that highlight “how the code-base story is changing with this MR” (don’t use this exact phrasing in your AGENTS.md).

Reading list

Weekly Notes 2026/19

  • No rain this week either!
  • At work, my week was spent learning codebase and getting access. I finally have required access. I am dealing with a very large Rust codebase which is going through architectural refactor. Interesting times ahead.
    • After working with claude for a month, copilot feels like a little under-performer. Good thing is that I can avoid using AI agent at job if I want to. copilot could not even do a rebase with main!
  • I’ve been learning a bit about investments e.g. PPF, SSY and other fixed rate schemes. HDFC bank keep updating its app. New iteration has more pixel porn, and more stupid notifications over functionality and it requires too much resource. Fortunately, I’ve to use it occasionally. BHIM upi app is also slow and mild mannered as late Mr. Atal Bihari Bajpayee.
  • I plucked a few raw mangoes from the tree outside. Perhaps make some pickle?!

Reading list

  • Why Async Rust is a great post on, well, “why async rust”. It covers a bit of history as well, and talks about the design choices.
  • Zero-cost futures in Rust — why golang like “green threads” were not chosen for Rust. Some interesting bits from the post.
    Things really start getting interesting with futures when you combine them. There are endless ways of doing so, e.g.:
    • Sequential composition: f.and_then(|val| some_new_future(val)). Gives you a future that executes the future f, takes the val it produces to build another future some_new_future(val), and then executes that future.
    • Mapping: f.map(|val| some_new_value(val)). Gives you a future that executes the future f and yields the result of some_new_value(val).
    • Joining: f.join(g). Gives you a future that executes the futures f and g in parallel, and completes when both of them are complete, returning both of their values.
    • Selecting: f.select(g). Gives you a future that executes the futures f and g in parallel, and completes when one of them is complete, returning its value and the other future. (Want to add a timeout to any future? Just do a select of that future and a timeout future!)

[preprint] Sequence-selective dendrites as a substrate for higher-order Hopfield networks

I finally uploaded a preprint to ResearchGate. biorXiv/arXiv won’t accept the paper without institutional email or without someone’s endorsement (perhaps to control spam!).

Weekly Notes 2026/18

  • Two mild shower this week! Enough to clean my car and trees but not enough to clean roads. Still waiting for a proper rain.
  • I’ve to tweak my working setup quite a bit this week. I am working from home at my current role. I don’t/can’t use work laptop for personal stuff. I bought a KVM switch to share the keyboard, a few peripheral devices and screen with both work and home computer. It worked almost flawlessly. On macos, you may have to ensure that KVM is powered either via one of peripheral or via dedicated usb-c cable!
  • I also got a basic Yubi key (finally). I’ve using bitwarden and Zoho Vault my password manager. I prefer Zoho Vault since I can easily afford its paid plan. Zoho Vault doesn’t do well with Firefox profiles. This key is working fine except for GitHub which is refusing to save passkey to this key! Not sure why!
  • I’ve been thinking what side project to do this month. The AI has taken all the fun out of writing code. I hope this is temporary else I am in for a tough time. There hardly any other thing that I enjoy more than writing code with my clothes on. Well, hiking, cycling and cooking are fun but I can’t do them whole day!
  • I’ve been feeling a little low on energy for past few moths. Finally talked to a doctor. Lets see what comes out of my blood tests.
  • The income tax portal still not open for filing ITR. It says it will open “soon” but doesn’t specify dates! Some Reddit post claims that it will open by June 1, 2026! Though I find income tax dept websites and UPI infrastructure to be world class, they can be a little better at communicating changes.

Reading list

Visualization of ‘futurelock’

Async rust has a few parts that doesn’t feel ‘rusty’ at all. Rust is pretty good at “forcing” local reasoning but async cancellation (drop of Future etc.) leads to non-local reasoning which leads to hard to follow sequence of events that leads to subtle bugs. I recently learnt about futurelock from this excellent blog post.

The RFD (Request For Discussion) from Oxide that describe futurelock (https://rfd.shared.oxide.computer/rfd/0609) is easy to read by an intermediate Rust programmer. Reading this RFD made me a little bit nervous about async which I though I knew decently well.

I created this diagram that summarizes the sequence of events in the RFD that eventually leads to the deadlock/futurelock. You can refer to this diagram when re-reading the RFD. It helps a lot.

I also dug a little deeper into the mechanism of Mutex waking up the relevant tasks when it is unlocked. In the past, I’ve written state machines with callbacks and I think about async in state-machine terms. Future and Waker works together to implment state-machine with callback.

Here is another diagram which shows how Waker is used to implement callback like mechanism for the example in the RFD.

Weekly Notes 2026/17

  • I spent this week on-boarding at Toyota Connected India (TCIN) Bangalore office. At TCIN, you are expected to spend 5 days a month in office, either in one go or spread across entire month e.g. 1 day a week. My team prefer to gather in Bangalore office for a week and this was the week. So I went to office all 5 days to spend face-time with each of them even when most on-boarding call was from Chennai office.
  • The on-boarding week is relaxed but packed: meetings with HR, Admin, Finance, Legal etc. Each of them spent approximately an hour with me. Also at least one meeting per day with my team-mates on KT and codebase. I also get to see the hardware that runs Toyota dashboard.
    • TCIN office also has lunch inside the office and that solves a lot of problems for me. I can leave early to avoid traffic without having breakfast and have a light breakfast in office.
    • My experience at TCIN is pleasantly different than my last on-boarding at Veeam where I was mostly on my own to figure things out! I didn’t even know I had an HR at Veeam, he didn’t meet!
  • Ookie switched to a new school this week which has better activities and communication patterns.
  • Rains are still absent and temperature is soaring in Bengaluru. I hope mangoes will be sweater! Every year, in this month, I read about Bengaluru climate and weather and then forget all about it later. What causes rains in April? Returning Monsoon timelines?

Weekly Notes 2026/16

  • Very dry week. No sign of rain. The temperature is high and there is no forecast of rain either. I am hoping for next week to be bit cooler.
  • I gave a talk at a student club at APU.
  • I am joining Toyota Connected India next week. Pretty excited about writing Rust in safety critical systems.
  • I am getting a better grip on AI tools. I am still conflicted if I should continue to use them or go back to good old ways. Lets wait for a few more weeks.

Reading List

Talk at a student club at APU: “You need to give up some convenience to be safer online”

Last Wednesday, April 15, 2026, I gave an informal talk at Azim Premji University (Bengaluru) on online safety to a bunch of undergraduate students from liberal arts, humanities and social science departments (Computing Club).

Its been over 4 years since I’ve given any talk. I was terribly out of shape and practice. I made too many slides for a 45 minutes talk and took more than 60 minutes to finish it!

It wasn’t bad but could have been much better had I practiced it for a day or two. Or I should have kept the content dense and focused more on keeping it interactive which is always a good idea with younger audience.

The audience were undergrads so they acted in usual and expected ways. A few were interested or at least sitting and listening politely. Some were there for reasons unknowns and doing their own things. A few were napping as well :-).

It took me 2 hours to travel to the university via cab. I get to meet my classmate from doctoral days :-).

I used Claude to make images using tikz and copy edit the slides.

Brother DCP-T426W wouldn’t print on Linux/Debian: ipp-usb conflicts with vendor driver

TLDR By LLM: If you’re using a manufacturer-provided CUPS driver (Brother, Canon, etc.) and your printer silently refuses to print, check whether ipp-usb is running. It’s a well-intentioned daemon for driverless printing, but it directly conflicts with legacy vendor drivers that expect raw USB access. Mask it, point your queue at the right URI, and you’re done.


I again installed the Brother DCP-T426W driver on my Debian Trixie, connected the printer via USB, and sent a test page. The job just sat there with “Waiting for printer to become available.” Occasionally, it gets printed . To make matter worse, the scanner was working fine and I could scan using a Debian machine! Printing test page would often work but not always!

Running lpstat -p showed two printer queues had been created:

  • Brother_DCP_T426W_USB — using implicitclass:// (driverless IPP)
  • DCPT426W — using usb://dev/usblp0 (Brother’s native driver)

The CUPS error log showed the driverless queue failing with “No IPP attributes“, and the Brother queue stuck because /dev/usblp0 didn’t exist.

dmesg revealed: the kernel device usblp3 was being created and destroyed every 5 seconds in a loop. And systemctl status ipp-usb confirmed the ipp-usb daemon was running.

The LLM tells me that modern Linux systems ship with ipp-usb, a daemon that intercepts USB printers supporting the IPP over-USB protocol and exposes them as network printers. The DCP-T426W supports this protocol, so ipp-usb grabbed the device the moment it was plugged in.

This created a conflict: the Brother CUPS driver expected to talk directly to /dev/usblp0, but ipp-usb was sitting in between, cycling the connection every 5 seconds. Neither driver could win. On top of that, the queue URI was pointing to /dev/usblp0 — which never existed. The actual device node was /dev/usb/lp3.

Thanks AI for explaining this to me.

The Fix Three steps:

  1. Stop and mask ipp-usb so it no longer intercepts the printer on this or future boots: sudo systemctl stop ipp-usb and sudo systemctl mask ipp-usb
  2. Find the correct USB URI using lpinfo: sudo lpinfo -v direct usb://Brother/DCP-T426W?serial=XXXXXXXX
  3. Update the printer queue to use the correct URI:
    sudo lpadmin -p DCPT426W -v "usb://Brother/DCP-T426W?serial=XXXXXXXX"
    sudo lpadmin -d DCPT426W

After that, the test page printed immediately.

Weekly Notes 2026/15

  • First two weeks of April are usually the hottest weeks in Bangalore. Its less dry than the 2025 but only one light shower. The mangoes outside my house are growing nicely though.
  • Its been three weeks since I’ve written code by hand (except for a few tweaks). I am using Claude and sometimes qwen cli. Claude is definitely much better but qwen is quite capable at well scoped tasks.
  • I don’t think AI is replacing programmers anytime soon but sure making me dumber. It is becoming harder to focus, read docs and engage with a linear conversation. Also when I ran out of the credits, I had to push myself to open my editor and look at the code and I found it alarming.
    • My TLDR summary of AI is the following. It generates pig-iron and call it steel. You can build a fun Choo-Choo train with it over the weekend but please don’t build a proper train with it that carries hundreds of people. But can you resist?

Reading list

Notes on the C++ memory model: why lock-free DSA is hard

Examples in post are from this paper which was the inspiration behind this excellent Rust tool loom. This talk Beyond Sequential Consistency is an excellent introduction to this topic.

Following text is written with help of a LLM.

Example 1: The Result That Shouldn’t Be Possible (But Is)

Consider this program. Two threads, two shared variables.

atomic<int> x(0), y(0);
void threadA() {
int r1 = y.load(memory_order_relaxed);
x.store(1, memory_order_relaxed);
}
void threadB() {
int r2 = x.load(memory_order_relaxed);
y.store(1, memory_order_relaxed);
}

Quick question: what are the possible outcomes for (r1, r2)?

Most would say: (0,0), (0,1), or (1,0). ThreadA might run before ThreadB, after it, or interleaved — that covers every case. It doesn’t.

The C++11 standard also allows r1 = 1, r2 = 1! Which seems impossible since for this to happen, both threads must be reading the value that the other thread hasn’t stored yet! This cannot happen under any sequential interleaving of the two threads. There is no ordering of the four statements that produces this result if you run them in sequence. But the C++ memory model isn’t sequential.

memory_order_relaxed is the weakest ordering available, and it explicitly permits memory operations to different locations to be reordered. A compiler is allowed — in fact, encouraged — to reorder the load and store within each thread to optimize performance. On ARM and PowerPC CPUs, this reordering can happen in hardware even without compiler involvement.

So when you write memory_order_relaxed, you’re not just saying “I don’t need a lock.” You’re saying “I’m fine with any possible reordering of my memory operations.”

Example 2: Acquire/Release Doesn’t Mean What You Think

The standard fix is to use memory_order_acquire and memory_order_release to create synchronization pairs. Let’s modify the previous example:

atomic<int> x(0), y(0);
void threadA() {
int r1 = y.load(memory_order_acquire); // changed
x.store(1, memory_order_relaxed);
}
void threadB() {
int r2 = x.load(memory_order_relaxed);
y.store(1, memory_order_release); // changed
}

Now, if r1 = 1 — meaning threadA‘s acquire-load read the value stored by threadB‘s release-store — then a synchronization relationship is established. The standard guarantees that everything threadB did before the release is visible to threadA after the acquire.

This means: when r1 = 1, threadB must have already executed x.load()(which is 0) before doing y.store(1, release). ThreadA‘s load/acquire on y “saw” that store/release, so threadA must observe the effects of everything before it. Therefore r2 = 0. The possible outcomes are now only: (0,0), (0,1), and (1,0). The (1,1) result is gone.

By the way, the load/acquire does not “force” store/release to “happen” before it i.e. threadA load/acquire doesn’t force threadB‘s store/release is complete first. It only says, if I read value from other thread’s store/release then it is safe to assume that I can see everything that happened up to that point in other thread.

Why this is still dangerous

The logic above looks simple but it’s not. It requires you to:

  1. Identify every pair of atomic operations that need to synchronize.
  2. Correctly apply acquire/release to every single one of them.
  3. Reason through the transitive closure of happens-before across the entire execution.

Miss a single pair, or apply the wrong memory order to one operation, and you’re back in the land of (1,1). There’s no compiler warning. The code compiles cleanly. Your tests will almost certainly pass, because the (1,1) outcome might require a specific micro-architectural timing to trigger.

Example 3: The Modification Order Is a Hidden Variable

Here’s a subtler problem. Consider a single atomic variable with two stores and two loads:

atomic<int> x(0);
void threadA() {
x.store(1, memory_order_relaxed); // A
x.store(2, memory_order_relaxed); // B
}
void threadB() {
int r1 = x.load(memory_order_relaxed); // C
int r2 = x.load(memory_order_relaxed); // D
}

The C++11 standard defines a modification order for every atomic object — a total order of all stores to that object that every thread must agree on. This isn’t a lock, and it isn’t sequential consistency — it’s a weaker guarantee that the relative order of stores to a single variable is consistent.

This constraint is invisible in the source code. You can’t annotate it or inspect it at runtime. But it has real consequences. In this example:

  • ThreadA stores 1, then 2, to x. Therefore in the modification order, store A comes before store B.
  • If load C reads the value 2 (from store B), load D cannot read the value 1 (from store A).
  • Why? Because that would require A to appear after B in the modification order — a contradiction.

So an execution where r1 = 2, r2 = 1 is illegal even though both loads are relaxed, even though there’s no acquire/release pair, and even though naive reasoning might suggest any combination is possible.

The problem is that most developers don’t reason about modification order at all. They reason about thread inter-leavings. The memory model is not defined in terms of inter-leavings — it’s defined in terms of relations (reads-from, happens-before, modification order, synchronizes-with). These relations can produce constraints that are deeply non-obvious, and violating them silently yields undefined behavior.

Example 4: The “Satisfaction Cycle” — Values Appearing Out of Thin Air

This one doesn’t just produce surprising results. It breaks the foundations of program reasoning.

// Thread 1
r1 = x.load(memory_order_relaxed);
if (r1 == 42)
y.store(r1, memory_order_relaxed);
// Thread 2
r2 = y.load(memory_order_relaxed);
if (r2 == 42)
x.store(42, memory_order_relaxed);

Question: can r1 = r2 = 42?

Neither x nor y is initialized to 42. Thread 1 stores 42 to y only if it reads 42 from x. Thread 2 stores 42 to x only if it reads 42 from y. The value 42 can only enter the system if it’s already there.

This is a satisfaction cycle — a circular dependency where values manufacture themselves out of nothing. The C++11 standard informally discourages this result but (as of C++11) doesn’t formally prohibit it. The relevant clause (§29.3p9) was discovered to be both over-constraining in some cases and under-constraining in others, and was subsequently removed in C++14 with a note to “just not do this,” without a formal definition of what “this” means.


The paper I linked at the beginning of the paper found many bugs in other papers and real-world implementations. These bugs were not a data race in the classical sense but a violation of the memory model’s modification order constraints: a specific combination of relaxed loads and stores that, under a legal but non-obvious execution, produced an incorrect result. The authors of the original implementation had not found it through testing, because:

  1. The triggering execution requires a specific ordering of memory operations that real hardware only produces under particular timing conditions.
  2. The x86 architecture — where most concurrent C++ is tested — is stronger than the C++ memory model requires, so many illegal executions simply never occur on x86 even when the code is technically wrong.
  3. The bug would surface on ARM or PowerPC, which honor the weaker semantics the standard actually specifies.

This is the core danger of writing to the C++ memory model: you test on x86, which is well-behaved. Your code ships to ARM, which isn’t. The standard permits ARM’s behavior. Your tests don’t catch it.


What You Should Actually Do

1. Default to memory_order_seq_cst

The default when you write std::atomic<T> and don’t specify a memory order is memory_order_seq_cst — the strongest ordering, equivalent to the intuitive sequential model. It’s slower, but it’s correct. Optimize down from there only when you have a concrete performance need and are willing to formally verify the result.

2. Never use memory_order_relaxed without a proof

memory_order_relaxed gives you no synchronization guarantees whatsoever. It is appropriate only for things like counters where you only care about atomicity of individual operations, not their ordering relative to anything else. If you’re using it to communicate between threads, you almost certainly need something stronger.

3. Use a model checker

Tools like CDSChecker (from linked paper, and its successors) can exhaustively explore every legal execution of a unit test under the C/C++ memory model. If your concurrent data structure can be expressed as a small unit test, running it through a model checker is the only way to be confident it’s correct — not just confident it passes your tests.

4. Understand that x86 is “different” — it has stronger memory model

x86 has a stronger memory model than C++ requires. Code that appears correct on x86 may silently break on ARM, PowerPC, or RISC-V. If you write to the C++ standard rather than to x86-specific guarantees, test on architectures that actually exercise the weaker guarantees.

Web utility to digitize old plots

Today, I wrote a small web-utility to digitize old plots. You upload an image or pdf of a plot, and extract data by clicking points on the curve. It is available at https://tools.dilawars.me/tool/plot-extractor. Why do this manually when AI can do it for you? First, because I wanted to write an utility and AI doesn’t always do a better job than a person!

This utility is a web-companion to to a somewhat popular Python utility I wrote a few back to digitize plots in batch mode.