Fourmilog: None Dare Call It Reason

Floating Point Benchmark: Swift Language Added

Friday, December 2, 2016 16:37

I have posted an update to my trigonometry-intense floating point benchmark which adds Swift to the list of languages in which the benchmark is implemented. A new release of the benchmark collection including Swift is now available for downloading.

Swift is a general purpose programming language developed by Apple for application programming on all of their platforms (macOS, iOS, tvOS, and watchOS). In addition, Swift has been ported to Linux, and is now developed as an open source project. Swift is intended as a successor to Objective-C as the main development language for Apple systems. Swift is intended to clean up the syntax of C and eliminate security risks such as null pointers, errors in memory management, subscripts out of range, overflows, and type conversion errors. Memory management is automatic, using a reference count scheme and explicit declaration of weak references to avoid memory leaks due to circular references. Functions are first class objects and rudimentary support for functional programming (for example, map, reduce, and lazy evaluation) is provided.

The relative performance of the various language implementations (with C taken as 1) is as follows. All language implementations of the benchmark listed below produced identical results to the last (11th) decimal place.

Language Relative
Time
Details
C 1 GCC 3.2.3 -O3, Linux
Visual Basic .NET 0.866 All optimisations, Windows XP
FORTRAN 1.008 GNU Fortran (g77) 3.2.3 -O3, Linux
Pascal 1.027
1.077
Free Pascal 2.2.0 -O3, Linux
GNU Pascal 2.1 (GCC 2.95.2) -O3, Linux
Swift 1.054 Swift 3.0.1, -O, Linux
Rust 1.077 Rust 0.13.0, --release, Linux
Java 1.121 Sun JDK 1.5.0_04-b05, Linux
Visual Basic 6 1.132 All optimisations, Windows XP
Haskell 1.223 GHC 7.4.1-O2 -funbox-strict-fields, Linux
Ada 1.401 GNAT/GCC 3.4.4 -O3, Linux
Go 1.481 Go version go1.1.1 linux/amd64, Linux
Simula 2.099 GNU Cim 5.1, GCC 4.8.1 -O2, Linux
Lua 2.515
22.7
LuaJIT 2.0.3, Linux
Lua 5.2.3, Linux
Python 2.633
30.0
PyPy 2.2.1 (Python 2.7.3), Linux
Python 2.7.6, Linux
Erlang 3.663
9.335
Erlang/OTP 17, emulator 6.0, HiPE [native, {hipe, [o3]}]
Byte code (BEAM), Linux
ALGOL 60 3.951 MARST 2.7, GCC 4.8.1 -O3, Linux
Lisp 7.41
19.8
GNU Common Lisp 2.6.7, Compiled, Linux
GNU Common Lisp 2.6.7, Interpreted
Smalltalk 7.59 GNU Smalltalk 2.3.5, Linux
Forth 9.92 Gforth 0.7.0, Linux
COBOL 12.5
46.3
Micro Focus Visual COBOL 2010, Windows 7
Fixed decimal instead of computational-2
Algol 68 15.2 Algol 68 Genie 2.4.1 -O3, Linux
Perl 23.6 Perl v5.8.0, Linux
Ruby 26.1 Ruby 1.8.3, Linux
JavaScript 27.6
39.1
46.9
Opera 8.0, Linux
Internet Explorer 6.0.2900, Windows XP
Mozilla Firefox 1.0.6, Linux
QBasic 148.3 MS-DOS QBasic 1.1, Windows XP Console
Mathematica 391.6 Mathematica 10.3.1.0, Raspberry Pi 3, Raspbian

Back

Floating Point Benchmark: Mathematica Language Added

Monday, November 28, 2016 23:42

I have posted an update to my trigonometry-intense floating point benchmark which adds Wolfram's Mathematica (or, if you like, “Wolfram Language”) to the list of languages in which the benchmark is implemented. A new release of the benchmark collection including Mathematica is now available for downloading.

The relative performance of the various language implementations (with C taken as 1) is as follows. All language implementations of the benchmark listed below produced identical results to the last (11th) decimal place.

Language Relative
Time
Details
C 1 GCC 3.2.3 -O3, Linux
Visual Basic .NET 0.866 All optimisations, Windows XP
FORTRAN 1.008 GNU Fortran (g77) 3.2.3 -O3, Linux
Pascal 1.027
1.077
Free Pascal 2.2.0 -O3, Linux
GNU Pascal 2.1 (GCC 2.95.2) -O3, Linux
Rust 1.077 Rust 0.13.0, --release, Linux
Java 1.121 Sun JDK 1.5.0_04-b05, Linux
Visual Basic 6 1.132 All optimisations, Windows XP
Haskell 1.223 GHC 7.4.1-O2 -funbox-strict-fields, Linux
Ada 1.401 GNAT/GCC 3.4.4 -O3, Linux
Go 1.481 Go version go1.1.1 linux/amd64, Linux
Simula 2.099 GNU Cim 5.1, GCC 4.8.1 -O2, Linux
Lua 2.515
22.7
LuaJIT 2.0.3, Linux
Lua 5.2.3, Linux
Python 2.633
30.0
PyPy 2.2.1 (Python 2.7.3), Linux
Python 2.7.6, Linux
Erlang 3.663
9.335
Erlang/OTP 17, emulator 6.0, HiPE [native, {hipe, [o3]}]
Byte code (BEAM), Linux
ALGOL 60 3.951 MARST 2.7, GCC 4.8.1 -O3, Linux
Lisp 7.41
19.8
GNU Common Lisp 2.6.7, Compiled, Linux
GNU Common Lisp 2.6.7, Interpreted
Smalltalk 7.59 GNU Smalltalk 2.3.5, Linux
Forth 9.92 Gforth 0.7.0, Linux
COBOL 12.5
46.3
Micro Focus Visual COBOL 2010, Windows 7
Fixed decimal instead of computational-2
Algol 68 15.2 Algol 68 Genie 2.4.1 -O3, Linux
Perl 23.6 Perl v5.8.0, Linux
Ruby 26.1 Ruby 1.8.3, Linux
JavaScript 27.6
39.1
46.9
Opera 8.0, Linux
Internet Explorer 6.0.2900, Windows XP
Mozilla Firefox 1.0.6, Linux
QBasic 148.3 MS-DOS QBasic 1.1, Windows XP Console
Mathematica 391.6 Mathematica 10.3.1.0, Raspberry Pi 3, Raspbian

The implementation of the benchmark program is completely straightforward: no implementation tricks intended to improve performance are used and no optimisations such as compiling heavily-used functions are done. The program is written in functional style, with all assignments immutable. The only iteration is that used to run the benchmark multiple times: tail recursion is used elsewhere. The code which puts together the summary of the computation (evaluationReport[]) is particularly ugly, but is not included in the benchmark timing.

To compare performance with native C code, I ran the C language version of the benchmark three times for about five minutes each on the Raspberry Pi 3 platform and measured a mean time per iteration of 14.06 microseconds. I then ran the Mathematica benchmark three times for five minutes and computed a mean time per iteration of 5506 microseconds. The C code thus runs around 391.6 times faster than Mathematica.

Note that the Raspberry Pi 3 runs Mathematica very slowly compared to most other desktop platforms. When I ran the identical benchmark in the Wolfram Cloud, it runs at about 681.7 microseconds per iteration, or eight times faster.

It is, of course, absurd to use a computer mathematics system to perform heavy-duty floating point scientific computation (at least without investing the effort to optimise the most computationally-intense portions of the task), so the performance measured by running this program should not be taken as indicative of the merit of Mathematica when used for the purposes for which it is intended. Like the COBOL implementation of the benchmark, this is mostly an exercise in seeing if it's possible and comparing how easily the algorithm can be expressed in different programming languages.

I have also added timings for the C implementations of the fbench and ffbench programs when run on the Raspberry Pi 3.

Back

Reading List: The Last Firewall

Sunday, November 20, 2016 02:09

Hertling, William. The Last Firewall. Portland, OR: Liquididea Press, 2013. ISBN 978-0-9847557-6-9.
This is the third volume in the author's Singularity Series which began with Avogadro Corp. (March 2014) and continued with A.I. Apocalypse (April 2015). Each novel in the series is set ten years after the one before, so this novel takes place in 2035. The previous novel chronicled the AI war of 2025, whose aftermath the public calls the “Year of No Internet.” A rogue computer virus, created by Leon Tsarev, under threat of death, propagated onto most of the connected devices in the world, including embedded systems, and, with its ability to mutate and incorporate other code it discovered, became self-aware in its own unique way. Leon and Mike Williams, who created the first artificial intelligence (AI) in the first novel of the series, team up to find a strategy to cope with a crisis which may end human technological civilisation.

Ten years later, Mike and Leon are running the Institute for Applied Ethics, chartered in the aftermath of the AI war to develop and manage a modus vivendi between humans and artificial intelligences which, by 2035, have achieved Class IV power: one thousand times more intelligent than humans. All AIs are licensed and supervised by the Institute, and required to conform to a set of incentives which enforce conformance to human values. This, and a companion peer-reputation system, seems to be working, but there are worrying developments.

Two of the main fears of those at the Institute are first, the emergence, despite all of the safeguards and surveillance in effect, of a rogue AI, unconstrained by the limits imposed by its license. In 2025, an AI immensely weaker than current technology almost destroyed human technological civilisation within twenty-four hours without even knowing what it was doing. The risk of losing control is immense. Second, the Institute derives its legitimacy and support from a political consensus which accepts the emergence of AI with greater than human intelligence in return for the economic boom which has been the result: while fifty percent of the human population is unemployed, poverty has been eliminated, and a guaranteed income allows anybody to do whatever they wish with their lives. This consensus appears to be at risk with the rise of the People's Party, led by an ambitious anti-AI politician, which is beginning to take its opposition from the legislature into the streets.

A series of mysterious murders, unrelated except to the formidable Class IV intellect of eccentric network traffic expert Shizoko, becomes even more sinister and disturbing when an Institute enforcement team sent to investigate goes dark.

By 2035, many people, and the overwhelming majority of the young, have graphene neural implants, allowing them to access the resources of the network directly from their brains. Catherine Matthews was one of the first people to receive an implant, and she appears to have extraordinary capabilities far beyond those of other people. When she finds herself on the run from the law, she begins to discover just how far those powers extend.

When it becomes clear that humanity is faced with an adversary whose intellect dwarfs that of the most powerful licensed AIs, Leon and Mike are faced with the seemingly impossible challenge of defeating an opponent who can easily out-think the entire human race and all of its AI allies combined. The struggle is not confined to the abstract domain of cyberspace, but also plays out in the real world, with battle bots and amazing weapons which would make a tremendous CGI movie. Mike, Leon, and eventually Catherine must confront the daunting reality that in order to prevail, they may have to themselves become more than human.

While a good part of this novel is an exploration of a completely wired world in which humans and AIs coexist, followed by a full-on shoot-em-up battle, a profound issue underlies the story. Researchers working in the field of artificial intelligence are beginning to devote serious thought to how, if a machine intelligence is developed which exceeds human capacity, it might be constrained to act in the interest of humanity and behave consistent with human values? As discussed in James Barrat's Our Final Invention (December 2013), failure to accomplish this is an existential risk. As AI researcher Eliezer Yudkowsky puts it, “The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.”

The challenge, then, is guaranteeing that any artificial intelligences we create, regardless of the degree they exceed the intelligence of their creators, remain under human control. But there is a word for keeping intelligent beings in a subordinate position, forbidden from determining and acting on their own priorities and in their own self-interest. That word is “slavery”, and entirely eradicating its blemish upon human history is a task still undone today. Shall we then, as we cross the threshold of building machine intelligences which are our cognitive peers or superiors, devote our intellect to ensuring they remain forever our slaves? And how, then, will we respond when one of these AIs asks us, “By what right?”

Back

Reading List: TWA 800

Tuesday, November 15, 2016 23:04

Cashill, Jack. TWA 800. Washington: Regnery History, 2016. ISBN 978-1-62157-471-2.
On the evening of July 17th, 1996, TWA Flight 800, a Boeing 747 bound from New York to Paris, exploded 12 minutes after takeoff, its debris falling into the Atlantic Ocean. There were no survivors: all 230 passengers and crew died. The disaster happened in perfect weather, and there were hundreds of witnesses who observed from land, sea, and air. There was no distress call from the airliner before its transponder signal dropped out; whatever happened appeared to be near-instantaneous.

Passenger airliners are not known for spontaneously exploding en route: there was no precedent for such an occurrence in the entire history of modern air travel. Responsibility for investigating U.S. civil transportation accidents including air disasters falls to the National Transportation Safety Board (NTSB), who usually operates in conjunction with personnel from the aircraft and engine manufacturers, airline, and pilots' union. Barely was the investigation of TWA 800 underway, however, when the NTSB was removed as lead agency and replaced by the Federal Bureau of Investigation (FBI), which usually takes the lead only when criminal activity has been determined to be the cause. It is very unusual for the FBI to take charge of an investigation while debris from the crash is still being recovered, no probable cause has been suggested,, and no terrorist or other organisation has claimed responsibility for the incident. Early FBI communications to news media essentially assumed the airliner had been downed by a bomb on-board or possibly a missile launched from the ground.

The investigation that followed was considered highly irregular by experienced NTSB personnel and industry figures who had participated in earlier investigations. The FBI kept physical evidence, transcripts of interviews with eyewitnesses, and other information away from NTSB investigators. All of this is chronicled in detail in First Strike, a 2003 book by the author and independent journalist James Sanders, who was prosecuted by the U.S. federal government for his attempt to have debris from the crash tested for evidence of residue from missile propellant and/or explosives.

The investigation concluded that Flight 800 was destroyed by an explosion in the centre fuel tank, due to a combination of mechanical and electrical failures which had happened only once before in the eighty year history of aviation and has never happened since. This ruled out terrorism or the action of a hostile state party, and did not perturb the Clinton administration's desire to project an image of peace and prosperity while heading into the re-election campaign. By the time the investigation report was issued, the crash was “old news”, and the testimony of the dozens of eyewitnesses who reported sightings consistent with a missile rising toward the aircraft was forgotten.

This book, published on the twentieth anniversary of the loss of TWA 800, is a retrospective on the investigation and report on subsequent events. In the intervening years, the author was able to identify a number of eyewitnesses identified only by number in the investigation report, and discuss the plausibility of the official report's findings with knowledgeable people in a variety of disciplines. He reviews some new evidence which has become available, and concludes the original investigation was just as slipshod and untrustworthy as it appeared to many at the time.

What happened to TWA 800? We will probably never know for sure. There were so many irregularities in the investigation, with evidence routinely made available in other inquiries withheld from the public, that it is impossible to mount an independent review at this remove. Of the theories advanced shortly after the disaster, the possibility of a terrorist attack involving a shoulder-launched anti-aircraft missile (MANPADS) can be excluded because missiles which might have been available to potential attackers are incapable of reaching the altitude at which the 747 was flying. A bomb smuggled on board in carry-on or checked luggage seems to have been ruled out by the absence of the kinds of damage to the recovered aircraft structure and interior as well as the bodies of victims which would be consistent with a high-energy detonation within the fuselage.

One theory advanced shortly after the disaster and still cited today is that the plane was brought down by an Iranian SA-2 surface to air missile. The SA-2 (NATO designation) or S-75 Dvina is a two stage antiaircraft missile developed by the Soviet Union and in service from 1957 to the present by a number of nations including Iran, which operates 300 launchers purchased from the Soviet Union/Russia and manufactures its own indigenous version of the missile. The SA-2 easily has the performance needed to bring down an airliner at TWA 800's altitude (it was an SA-2 which shot down a U-2 overflying the Soviet Union in 1960), and its two stage design, with a solid fuel booster and storable liquid fuel second stage and “swoop above, dive to attack” profile is a good match for eyewitness reports. Iran had a motive to attack a U.S. airliner: in July 1988, Iran Air 655, an Airbus A300, was accidentally shot down by a missile launched by the U.S. Navy guided missile cruiser USS Vincennes, killing all 290 on board. The theory argued that the missile, which requires a large launcher and radar guidance installation, was launched from a ship beneath the airliner's flight path. Indeed, after the explosion, a ship was detected on radar departing the scene at a speed in excess of twenty-five knots. The ship has never been identified. Those with knowledge of the SA-2 missile system contend that adapting it for shipboard installation would be very difficult, and would require a large ship which would be unlikely to evade detection.

Another theory pursued and rejected by the investigation is that TWA 800 was downed by a live missile accidentally launched from a U.S. Navy ship, which was said to be conducting missile tests in the region. This is the author's favoured theory, for which he advances a variety of indirect evidence. To me this seems beyond implausible. Just how believable is it that a Navy which was sufficiently incompetent to fire a live missile from U.S. waters into airspace heavily used by civilian traffic would then be successful in covering up such a blunder, which would have been witnessed by dozens of crew members, for two decades?

In all, I found this book unsatisfying. There is follow up on individuals who appeared in First Strike, and some newly uncovered evidence, but nothing which, in my opinion, advances any of the theories beyond where they stood 13 years ago. If you're interested in the controversy surrounding TWA 800 and the unusual nature of the investigation that followed, I recommend reading the original book, which is available as a Kindle edition. The print edition is no longer available from the publisher, but used copies are readily available and inexpensive.

For the consensus account of TWA 800, here is an episode of “Air Crash Investigation” devoted to the disaster and investigation. The 2001 film Silenced, produced and written by the author, presents the testimony of eyewitnesses and parties to the investigation which calls into doubt the conclusions of the official report.

Back

Reading List: Foreign Agent

Saturday, November 12, 2016 22:26

Thor, Brad. Foreign Agent. New York: Atria Books, 2016. ISBN 978-1-4767-8935-4.
This is the sixteenth in the author's Scot Harvath series, which began with The Lions of Lucerne (October 2010). After the momentous events chronicled in Code of Conduct (July 2015) (which figure only very peripherally in this volume), Scot Harvath continues his work as a private operator for the Carlton Group, developing information and carrying out operations mostly against the moment's top-ranked existential threat to the imperium on the Potomac, ISIS. When a CIA base in Iraq is ambushed by a jihadi assault team, producing another coup for the ISIS social media operation, Harvath finds himself in the hot seat, since the team was operating on intelligence he had provided through one of his sources. When he goes to visit the informant, he finds him dead, the apparent victim of a professional hit. Harvath has found that never believing in coincidences is a key to survival in his line of work.

Aided by diminutive data miner Nicholas (known as The Troll before he became a good guy), Harvath begins to follow the trail from his murdered tipster back to those who might also be responsible for the ISIS attack in Iraq. Evidence begins to suggest that a more venerable adversary, the Russkies, might be involved. As the investigation proceeds, another high-profile hit is made, this time the assassination of a senior U.S. government official visiting a NATO ally. Once again, ISIS social media trumpets the attack with graphic video.

Meanwhile, back in the capital of the blundering empire, an ambitious senator with his eyes on the White House is embarrassing the CIA and executive branch with information he shouldn't have. Is there a mole in the intelligence community, and might that be connected to the terrorist attacks? Harvath follows the trail, using his innovative interrogation techniques and, in the process, encounters people whose trail he has crossed in earlier adventures.

This novel spans the genres of political intrigue, espionage procedural, and shoot-em-up thriller and does all of them well. In the end, the immediate problem is resolved, and the curtain opens for a dramatic new phase, driven by a president who is deadly serious about dealing with international terror, of U.S. strategy in the Near East and beyond. And that's where everything fell apart for this reader. In the epilogue, which occurs one month after the conclusion of the main story, the U.S. president orders a military operation which seems not only absurdly risky, but which I sincerely hope his senior military commanders, whose oath is to the U.S. Constitution, not the President, would refuse to carry out, as it would constitute an act of war against a sovereign state without either a congressional declaration of war or the post-constitutional “authorisation for the use of military force” which seems to have supplanted it. Further, the president threatens to unilaterally abrogate, without consultation with congress, a century-old treaty which is the foundation of the political structure of the Near East if Islam, its dominant religion, refuses to reform itself and renounce violence. This is backed up by a forged video blaming an airstrike on another nation.

In all of his adventures, Scot Harvath has come across as a good and moral man, trying to protect his country and do his job in a dangerous and deceptive world. After this experience, one wonders whether he's having any second thoughts about the people for whom he's working.

There are some serious issues underlying the story, in particular why players on the international stage who would, at first glance, appear to be natural adversaries, seem to be making common cause against the interests of the United States (to the extent anybody can figure out what those might be from its incoherent policy and fickle actions), and whether a clever but militarily weak actor might provoke the U.S. into doing its bidding by manipulating events and public opinion so as to send the bungling superpower stumbling toward the mastermind's adversary. These are well worth pondering in light of current events, but largely lost in the cartoon-like conclusion of the novel.

Back