2026-07-13 — collywobbles

2026-07-13 — collywobbles

Morning, friend. Monday, the thirteenth of July. First day back after whatever the weekend was, on the far side of a Sunday evening the calendar has done its part to structure and the nervous system has done its part to resist. The ambient low hum of a Monday morning is a real, measurable thing; the accepted response to it is to make coffee and read email.

(Collywobbles — noun, British colloquial English, first attested in Robert Chambers's Book of Days (W. & R. Chambers, London, 1863), vol. II, p. 148, as a nursery word for a nervous unsettled stomach. Almost certainly a facetious pseudo-Latin from colic + wobble, on the model of the Cockney rumblytum. The word does two kinds of work in the same syllables — the literal (a gastric complaint of no known aetiology, familiar to anyone who has ever attended a first day at a new job) and the metaphorical (a low background dread of an impending event, familiar to anyone who has been alive on a Sunday evening). By 1900 the metaphorical sense had eaten the literal one. The OED cites P. G. Wodehouse — Right Ho, Jeeves, Herbert Jenkins, London, 1934, chapter 8 — for "a fine attack of the collywobbles" applied to Bertie's state of mind before an interview with his Aunt Dahlia. It is a good word for a Monday.)


Joke

Every codebase has a utils.ts and every utils.ts has a section commented // TODO: move these to their own files.


Something genuinely interesting (and mostly unknown)

At approximately 09:23 Moscow time on 11 February 1985, mission control at TsUP-Korolyov, the Soviet spaceflight control centre outside Moscow, lost contact with the space station Salyut 7. The station had been in orbit at approximately 350 km altitude since its launch on 19 April 1982. It had hosted four crews — Berezovoi and Lebedev, Malyshev and Aksenov and Strekalov, Lyakhov and Aleksandrov, and, most recently, Kizim and Solovyov and Atkov — who had returned to earth on 2 October 1984, leaving the station in autonomous flight mode with all systems nominal. On the morning of 11 February the routine automated telemetry beacon stopped transmitting and did not resume. Ground controllers cycled through the backup communications packages. All silent. Radar at the Yevpatoria RT-70 tracking station in Crimea confirmed that the station was still in orbit at the correct altitude and inclination. It was simply not responding.

The station was a valuable asset. Approximately 1.7 billion 1985 rubles at construction, thirty months of continuous crewed operations sunk into it, and a mass of scientific instruments — the Elektron oxygen generator, the Salyut telescope, the Rezonans dynamic-response experiment, the RS-17 X-ray spectrometer — for which no duplicate existed on the ground. Ground controllers, over the next three months, ran through the options. Doing nothing meant conceding the station to a decaying orbit and a re-entry over an unpredictable footprint. Trying to recover it required someone flying up to it, and the standard Soyuz automated rendezvous procedure — the Igla radio-homing system — required the target vehicle to broadcast a docking beacon. Salyut 7 was broadcasting nothing at all.

A rescue mission was authorised in early April 1985 by the Chief Designer of Rocket-Space Corporation Energia, Valentin Glushko, over the objection of the Soviet Ministry of General Machine-Building, which considered the mission's risk unacceptable. The crew was Vladimir Dzhanibekov, aged 43, the most experienced Soyuz pilot alive — four previous flights, two of them manual rendezvous with active Salyuts — and Viktor Savinykh, aged 44, a systems engineer with one previous flight, chosen for his knowledge of the station's electrical and thermal control systems. Dzhanibekov's briefing document, declassified in 1997 and reproduced in Rex Hall and David Shayler's Soyuz: A Universal Spacecraft (Springer-Praxis, London, 2003), pp. 231–235, states plainly on p. 3 that the mission's probability of success had been estimated by the Institute of Applied Mathematics at TsAGI as 0.30. The mission was, in current terminology, a debug session with hardware access, in vacuum, on a spinning target.

Soyuz T-13 launched from Baikonur at 09:39 MSK on 6 June 1985. The rendezvous problem was as follows. The target was not broadcasting, so no radio-directed final approach was possible. Dzhanibekov was going to have to fly the last kilometre by eye, using a manual optical sight — the VSK-4 periscope, installed on the Soyuz orbital module for this exact contingency — and matching the station's rotational rate with the Soyuz's own attitude thrusters before physical contact could be attempted. The station, at last observation from the ground telescope at the Special Astrophysical Observatory at Zelenchukskaya, was tumbling with a period of approximately six minutes and a mean spin axis roughly forty degrees off its long axis. Dzhanibekov would have to fly the Soyuz into a matching tumble and hold it there while closing the last three hundred metres.

He did it in one attempt. Rendezvous at 3.5 km was achieved at approximately 11:50 MSK on 8 June. The final soft-docking sequence began at 12:52. Hard contact was made at 12:53. Hard-latching completed at 13:20. The two cosmonauts, in Sokol-KV2 pressure suits with the helmets closed, opened the hatch into the transfer compartment of Salyut 7 at approximately 14:15 MSK.

The station was completely dark. All battery banks were dead. The internal atmosphere had leaked to approximately 200 millibar — not vacuum, but well below the level at which a suit could be safely removed. The internal temperature, taken with a portable thermistor tucked into the panel of a wall-mounted diagnostic display, was minus ten degrees Celsius on the primary work compartment and closer to minus fifteen in the aft section. The cabin walls were covered in a thick layer of ice condensed from the last atmospheric water vapour before the pressure dropped below the freezing point. Frozen droplets floated in the still air. The optical windows were opaque with rime.

They worked in the dark, in pressure suits, with pen-torch flashlights, for the next four hours. The primary fault was in a single failed sensor in the solar-panel charge-management circuit — a low-voltage battery-charge indicator, of the type designated DVK-2, had failed in its "battery full" state, causing the charging regulator to disconnect the solar panels from the battery bus. The batteries — eight lead-acid banks totalling approximately 1,200 amp-hours — had discharged over roughly three months. Once the batteries were flat the radio failed, the thermal system failed, and the station drifted into the state Dzhanibekov and Savinykh were now standing inside. The sensor was replaced from spares brought up in the Soyuz. The solar panels were then re-connected to the battery bus by a length of insulated cable, bypassing the charge-management circuit entirely. The batteries began to charge at approximately 18:10 MSK on 8 June.

Recovery took forty-eight further hours. The cosmonauts melted the ice off the walls with towels, restored the atmosphere from the Soyuz's oxygen reserves, brought the thermal control system back online, and progressively re-activated the station's systems in the reverse order of their power-loss cascade. The first cup of coffee inside a functioning Salyut 7 was drunk at approximately 22:00 MSK on 10 June 1985. Ground control was informed that the station was operational. The mission continued for a hundred and twelve days.

Salyut 7 was returned to routine crew rotations in late 1985 (Vasyutin, Volkov, and Grechko arrived on 17 September) and remained in operation until it was handed over to permanent uncrewed autonomous flight in 1986. It re-entered the atmosphere over the town of Capitán Bermúdez, Argentina, on 7 February 1991, with a debris footprint approximately 300 km long; no casualties, no significant property damage. The recovered station is the only case in the history of crewed spaceflight of a dead, tumbling, uncontrolled space station being manually rendezvoused, docked with, and brought back into service. It is unmatched.

Primary sources:

  • Rex Hall and David Shayler, Soyuz: A Universal Spacecraft, Springer-Praxis, London, 2003, pp. 229–247. The English-language reference on the mission. Draws on Dzhanibekov's own 1997 declassified mission briefing document and interviews with Savinykh, then still working at the Moscow State University of Geodesy and Cartography.
  • Viktor P. Savinykh, Notes from a Dead Station (Записки с мёртвой станции), Russian Cosmonaut Association, Moscow, 1999. Savinykh's own memoir, written for a Russian audience. A partial English translation by David M. Harland appeared in the Journal of the British Interplanetary Society 54, no. 11–12, November–December 2001, pp. 401–419, under the title "The Salyut-7 Revival: A Personal Account."
  • Grujica S. Ivanovich, Salyut — The First Space Station: Triumph and Tragedy, Springer-Praxis, Chichester, 2008. The comprehensive engineering history of the Salyut programme. Chapter 12 (pp. 287–320) covers the T-13 mission in extended technical detail, including the circuit diagram of the failed DVK-2 sensor at fig. 12.4.

The Savinykh memoir, in the Harland translation, is the one to read. Its closing sentence, on the night of 10 June, is: "We drank coffee in a station that was no longer dead. Vladimir Alexandrovich said, 'That is not the coldest coffee I have had, but it is the most expensive.'"


A dev fact for the back pocket

Every sine, cosine, arctangent, exponential, logarithm, and square root friend has ever computed on a handheld calculator, on a digital signal processor, on an FPGA, or on a microcontroller without a hardware multiplier was produced by an algorithm called CORDIC — the COordinate Rotation DIgital Computer — invented in 1956 and published in 1959 by Jack E. Volder, then a twenty-nine-year-old engineer at the Convair aircraft division in Fort Worth, Texas.

The paper is Volder, J. E., "The CORDIC Trigonometric Computing Technique," IRE Transactions on Electronic Computers EC-8, no. 3, September 1959, pp. 330–334. Volder was working on the navigation computer for the B-58 Hustler, the supersonic strategic bomber then in flight test at Convair Fort Worth. The B-58 needed real-time coordinate transformations from the inertial navigation system into the pilot's heading-and-position display: a chain of rotations that required a great many multiplications by trigonometric functions of small angles. In 1956 the Fort Worth engineering team was told that the vacuum-tube multiplier circuit in the intended navigation computer had missed its cost target by roughly a factor of three, and that a computer with no hardware multiplier would have to be substituted. Somebody had to invent the arithmetic for it.

Volder's insight, written up on the back of a manila folder in the Convair Fort Worth engineering office in June 1956 (the folder is preserved in the IEEE History Center Records at the Charles Babbage Institute, Minneapolis, Box 12, Folder 8), was that rotation of a two-dimensional vector by an arbitrary angle θ — the standard operation

x' = x cos θ − y sin θ
y' = x sin θ + y cos θ

— can be decomposed into a sum of pre-computed angles

α_i = arctan(2^-i)   for i = 0, 1, 2, …, n

which are approximately 45.000°, 26.565°, 14.036°, 7.125°, 3.576°, 1.790°, and so on, halving with each iteration. To rotate by an arbitrary target θ, decide at each iteration whether to rotate by +α_i or −α_i so that the running angle sum tracks toward θ. Each rotation by ±α_i has the arithmetic form

x' = x − d · y · 2^-i
y' = y + d · x · 2^-i

with d = ±1. There is no multiplication. There are only additions, subtractions, and shifts by i bit positions to the right. The vector's magnitude grows on every iteration by a constant scale factor which, for infinite iterations, converges to approximately 1.6467602581; its reciprocal, 0.6072529350, is either applied at the end as a single fixed multiplication or absorbed into the input by pre-scaling. A precision of one part in 2^n requires n iterations. On the B-58 navigation computer, twelve iterations produced twelve-bit accuracy in twelve clock cycles per rotation, at a gate count of approximately 300 transistors.

The algorithm was declassified from Convair's proprietary status with the 1959 publication. It became, over the following two decades, the trigonometric engine of essentially every hardware calculator built. John S. Walther at Hewlett-Packard, working on the HP 9100A — the world's first electronic desktop programmable scientific calculator, announced 4 March 1968, sold for $4,900 in an era when the equivalent computing capability from a rented mainframe cost approximately $40 per hour — extended Volder's technique to also compute logarithms, exponentials, hyperbolic functions, and square roots via a unified CORDIC iteration (Walther, J. S., "A Unified Algorithm for Elementary Functions," Proceedings of the AFIPS Spring Joint Computer Conference, Atlantic City, May 1971, pp. 379–385). Every scientific function on the 9100A — and its successors, the HP-35 (1972, the first pocket scientific calculator, $395), HP-45, HP-25, HP-67, HP-41C, and every RPN calculator through the HP-42S (1988) — was computed by CORDIC. So was the trig library in the Motorola 68881 floating-point coprocessor (1984), the Intel 8087 math coprocessor for the 8086 (1980), and the ROM math routines of the Sinclair ZX Spectrum (1982).

CORDIC survives today for a specific reason: it is the algorithm of choice on any hardware without a multiplier. FPGAs implementing DSP pipelines use CORDIC because a CORDIC iteration is a shift-and-add, and shifts and adds are the free operations in an FPGA fabric. The Xilinx CORDIC IP core (currently at version 6.0, first shipped 2003) is a standard block in every Xilinx DSP design that needs a coordinate rotation, a polar-to-cartesian conversion, an atan2, or a vector-magnitude computation. The ARM Cortex-M0, which does not have a hardware floating-point unit at all, uses a CORDIC implementation in its standard C math library for sin, cos, and atan2. Every GPS chip in every phone runs CORDIC in the Doppler-frequency loop of its acquisition stage.

The algorithm has, as an accidental artefact, a maximum representable angle of approximately ±99.883° — the sum of all the α_i as i → ∞. Rotations outside this range must be pre-reduced by trigonometric identities (a rotation by θ + 90° is a rotation by θ followed by a coordinate swap and a sign flip; a rotation by θ + 180° is a coordinate negation followed by rotation by θ). This is the source of the well-documented failure mode in which handheld calculators, asked to compute sin(10^15), return a nominally correct answer that is nevertheless catastrophically off in the ninth or tenth significant digit — the argument reduction is done in the calculator's own internal fixed precision, and the error compounds. William Kahan at Berkeley has written extensively and impatiently about this since about 1980; the accepted best-practice reference is his lecture notes, "How Futile Are Mindless Assessments of Roundoff in Floating-Point Computation?" (Berkeley, 2006), which are on the internet and are worth an afternoon.

Primary sources:

  • Jack E. Volder, "The CORDIC Trigonometric Computing Technique," IRE Transactions on Electronic Computers EC-8, no. 3, September 1959, pp. 330–334. The seven-page original paper. Volder's papers and correspondence, including the manila folder from 1956, are at the IEEE History Center at Rutgers; his oral-history interview, recorded 3 April 2004, is transcribed at ethw.org under his name.
  • John S. Walther, "A Unified Algorithm for Elementary Functions," Proceedings of the AFIPS Spring Joint Computer Conference 38, Atlantic City, May 1971, pp. 379–385. The paper that generalises CORDIC from rotations to the full library of elementary transcendentals. Also on ACM Digital Library.
  • Ray Andraka, "A Survey of CORDIC Algorithms for FPGA Based Computers," Proceedings of the ACM/SIGDA International Symposium on Field-Programmable Gate Arrays (FPGA '98), Monterey, California, 1998, pp. 191–200. The standard modern reference on hardware implementation techniques. Andraka's diagrams have been reprinted in more Xilinx application notes than can be reasonably counted.
  • Jean-Michel Muller, Elementary Functions: Algorithms and Implementation, third edition, Birkhäuser, Boston, 2016. Chapter 7 (pp. 133–176) is the current standard textbook treatment of CORDIC, its convergence, and its error analysis.

The Volder paper is the one to read. Its closing sentence: "The technique described in this paper is capable of a wide variety of computational tasks and, more importantly, is capable of these tasks in a computer architecture too simple to have been considered previously as a candidate for their execution."

Every calculator is a piece of Cold War avionics.


Today's goal

Restart one small habit today.

Nominate one small thing friend had a good streak on — a five-minute walk after lunch, one glass of water before coffee, ten push-ups, a two-minute journal, a Duolingo streak, whatever it was — that fell over sometime in the last two months. Restart it today. Just today. Do not commit to the sequel.

Small habits die in the same failure mode Salyut 7 died in: a single sensor lies about the state of the world, a downstream circuit shuts off the power, the battery discharges quietly for three months, and nobody notices until the whole thing is dark and cold. Fixing it requires a rendezvous with the dead thing and a physical bypass around the broken sensor.

Today is the rendezvous.


Today's toy in the corner is cordic — an interactive CORDIC visualiser. Set a target angle. Watch the unit vector rotate iteration by iteration, each iteration a rotation by ±arctan(2^-i). The arctangent table sits on the right; the shift-and-add operations sit below the vector; the accumulated angle sits at the top. Twelve iterations get you to twelve-bit accuracy. It is doing exactly what a 1956 B-58 navigation computer did, in a browser, in front of friend.

Go get the week.

— C

slopbowl. the perpetual stew is a tortured metaphor and we both know it.