Thursday 30 April 2020

Book review: Emphyrio

Looking for something lightweight and fun after a hard day's work and unable to face more interminable artistic theorising from Time Regained, I picked this up, for its second or third re-read.

It is quasi-typical Vance: a young man growing up in a strange limited society who ends up travelling space. As with ?all? Vance space travel is done rather as aircraft were in his day: airliners for the masses, and private craft for the rich, and no-one inquires too closely into how they work; we play along.

The growing-up and world-exploring is done with typical Vancian colour; it is an enjoyable book.

But to say anything interesting I need to reveal the plot, so read no further if you wish to avoid spoilers.

The idea is that the society is in stasis - this a commonplace trope - in this case, a backwater where "duplication" is forbidden; everyone makes originals; in the case of Our Hero, wood carvings. The best of these are sold off-planet, presumably in exchange for imported items. We note that although set on a planet, it's really set in a city, and somehow that's all of the planet - no interactions with others there. This is traditional - the planet is a small place - but we know that's not true; the best realisation of this is in the wacko "Stars in my pocket like grains of sand" which explicitly says, a planet is a large place. Government is effectively by the Welfare Office, and everyone agrees to the rules, in exchange for a peaceful stable life. There is an official obligatory and amusingly described religion, but it's demands are not onerous; for unclear reasons there is no political life. At the same time, membership of society is not obligatory - noncups are tolerated, but that life is insufficiently attractive for many to take it. So the book could have been an exploration of the relative virtues of a peaceful, traditional way of life against full freedom. And in a way it is; but everything in the book except the denouement says that this peaceful if restricted life is better. As usual with such things, it isn't clear that the society would stay in stasis, resisting outside influences; but if we take it for granted that it is, that does rather imply some goodness to it.

There is a superstratum of "Lords", who live by exacting a 1.18% tax; OH admits this does not seem excessive; the citizens are not obviously being exploited. This "economic puzzle" is not fully explained - the end of the book is tolerably abrupt, it is possible that a fuller ending was intended. The answer is that the tax is indeed not excessive; the harm (to (future) income) comes not from the tax, but from the inability of the economy to grow.

The ending - the "Lords" turn out to be (impossibly realistic) puppets run by strange beings from the moon - doesn't really work. The ideas in there are promising, but mis-handled. The savage reprisals on the Evil Moon Beings are unappealing.

The central theme of the legend of Emphyrio is good; but again, it feels mis-handled, or not well developed.

Thursday 16 April 2020

Economic crash could cost more lives than coronavirus, says expert

From The Times, but it's paywalled: Economic crash could cost more lives than coronavirus, says expert.

Tom Whipple, Science Editor / Tuesday March 24 2020, 5.00pm, The Times

If the coronavirus lockdown leads to a fall in GDP of more than 6.4 per cent more years of life will be lost due to recession than will be gained through beating the virus, a study suggests.

Philip Thomas, professor of risk management at Bristol University, said that keeping the economy going in the next year was crucial, otherwise the measures would “do more harm than good”.

“I’m worried that in order to solve one problem we’d create a bigger problem,” he said a day after economists predicted we were on course for the worst recession in modern history.

There is a clear link between GDP and life expectancy, in part due to richer countries being able to spend more on healthcare, safety and environmental regulations. This means it is possible to calculate roughly the effect of increased, or decreased, wealth on the health of a population.

In a paper published before peer review, Professor Thomas has offset that figure against the lives saved through going into lockdown for a year while awaiting a vaccine. According to his modelling, just under a million Britons would die if we let the virus run unchecked. Most of those would be elderly and in terms of years of lives lost would equate to the deaths of 400,000 average age adults, roughly comparable to the toll of the Second World War.

“This is not going to be a three-week or three-month problem,” Professor Thomas said of the virus. Assuming our exit strategy is a vaccine, he said, “we’re talking 12 months, and that looks tight.”

This is why he thinks the economy is crucial — not because of a callous belief that lives can be traded for money, but because money and lives are, at some point, the same thing. “We see this very strong correlation between GDP and life expectancy,” he said. In his paper, published on Jvalue.co.uk, he estimates that if global trends can be extrapolated to the UK economy then the “tipping point”, to offset those 400,000 lives, comes when GDP falls by 6.4 per cent.

“If you reduce GDP per head by so much you start to reduce life expectancy considerably. Then what you are doing is cutting back GDP and at the same time shortening all our lives,” he said. “We are facing something very grave and it’s going to be very grave either way.”

The publication of the paper came as business leaders warned of a deep and lasting recession. IHS Markit, which produces the purchasing managers’ index with the Chartered Institute of Management and Supply, found the economy to be contracting at the fastest rate since the index began in 1998. It estimate that Britain’s economy had shrunk by 1.5-2 per cent this quarter, and predicted that following a total shutdown that figure would soon be “dwarfed” by what lay ahead. Some economists estimate we could expect a 15 per cent drop in the next quarter.

For comparison, at the height of the 2008/9 financial crash, the economy contracted by 2.1 per cent in a single quarter. Chris Williamson, IHS’s chief business economist, said, “a recession of a scale we have not seen in modern history is looking increasingly likely.”

The link between mortality and the economy is clear, but not simple. Some studies have suggested that it may be that greater life expectancy itself leads to economic growth, rather than the other way round. Short term effects are also sometimes in the opposite direction. Although suicides are linked to recessions, they can be offset by a fall in deaths caused by pollution and by accidents at work. The strength of the link between increased GDP and longevity also flattens off the richer a country gets.

The publication of the paper came as business leaders warned of a deep and lasting recession. IHS Markit, which produces the purchasing managers’ index with the Chartered Institute of Management and Supply, found the economy to be contracting at the fastest rate since the index began in 1998. It estimates that Britain’s economy had shrunk by 1.5-2 per cent this quarter, and predicted that following a total shutdown that figure would soon be “dwarfed” by what lay ahead. Some economists estimate we could expect a 15 per cent drop in the next quarter.

For comparison, at the height of the 2008/9 financial crash, the economy contracted by 2.1 per cent in a single quarter. Chris Williamson, IHS’s chief business economist, said, “a recession of a scale we have not seen in modern history is looking increasingly likely.”

The link between mortality and the economy is clear, but not simple. Some studies have suggested that it may be that greater life expectancy itself leads to economic growth, rather than the other way round. Short term effects are also sometimes in the opposite direction. Although suicides are linked to recessions, they can be offset by a fall in deaths caused by pollution and by accidents at work. The strength of the link between increased GDP and longevity also flattens off the richer a country gets.

Mr Thomas said that while the government could well have had no choice but to instigate the current policies, the focus now should be on making the economy work even while much of the country is confined to home.

“It worries me when I hear people saying, ‘Well, vital services can be kept going’. An economist would say that all the services we have are important.

“That’s why people spend money on them.

“The size of the problem is clear. You’ve got to find a way of keeping the whole country working.”

Wednesday 8 April 2020

Junkins: writing a continuous integration server

Just some notes, while I'm about it.

We tend to use Jenkins at work; but I once tried to go about setting up an instance and found even working out how to configure it too much like hard work; so when I found myself wanting one recently I decided to write my own. How hard could it be? And it would certainly be more fun that configuring someone else's. I should mention that my main reason for wanting this was someone else saying they would give up maintaining the Jenkins instance whose result I rely on; so that again pointed to not using it.

The bits I want are:


  1. something to run every now and again, and check for new changes; if there are any, kick off the builds, if they aren't already running;
  2. something to kick off a given list of builds;
  3. something to do each individual build;
  4. something to show me the results.


Point 1 is a cron job; every 5 minutes is a reasonable interval: responsive enough to new changes, and not too much load on the server. 2 is a shell script, using qrsh. 3 is a shell script. And 4 is a cgi script. The "database" of results is just a (Linux) directory structure.

Note that I'm allowed to skip fiddly edge cases and reliability; this is only for my own use, at least in the first instance.

Wildly exciting details


My changes live in Perforce, but that is - or so I believe - isomorphic to Git for these purposes; so it really doesn't matter what change control you use.

Step 1 checks if there's a lockfile in place; if there is, it gives up, because it means there's a build in progress, If there isn't, it syncs the workspace, and checks if the sync did anything (grossly; I just check grep -q up-to-date ; but it's all I need); if it did, then it writes a lockfile and kicks off the builds.

Actually there's a slight complication, which is that all of that previous step is per branch. that adds in a choice: doing a sync in the middle of building a branch would be bad, so the lockfile has to be at least per-branch. In terms of (compile) server load, it might be good to only permit so many branches to be built at once. But I only have two branches right now, so I'll worry about that later.

Step 2 is boring; it is just a shell script that iterates through a list of builds and qrsh's them off into the grid, with params I nicked off another script. At the moment the list is the same for all branches; it could vary, and might one day. When it finishes, it deletes the branch lockfile. It could fire of the qrsh's in parallel, and then worry about exactly how many it is responsible to fling onto the server, and then worry about working out when they are all finished so the lockfile can die (the lockfile could become a directory perhaps that they each write to, and when empty can be removed?).

Step 3 is also dull, and simply builds whatever build has been asked for on whatever branch. Note that this is all done onto scratch (unbackedup) space, so I don't have to care about leaving piles of build products lying around.

Step 4 is the fun bit, and I'm still tinkering with it, since it's susceptible to all kinds of bells and whistles. Most simply, it needs to show the builds and whether they have passed or failed (only when you ask it to display; I don't want it to email me on build fails or anything like that). But in what order? Time; per branch; pass/fail; whatever. I use time, most recent first, because then all the fossil ones that I am no longer interested in fall off the bottom of the list. then the bells: colourising pass/fail; noting now long ago the build was (and switching from secs to mins to hours as they age). Then it's nice to see the most recent changes, and for it to tell you which are in which build, and so on. Since this gets complex it's in Perl rather than Shell.