In the beginning there was the internal combustion engine, and it was pretty good. Moved the world, gave us motorsport and ice-cream vans, and only the slight drawback that it depends on a finite resource which it burns inefficiently with poisonous and planet-harming consequences.

And so, with trust in diesel (unfairly) in the basement and the assumption that after a century of development, the petrol engine’s time was done, the world concentrated on digging up bits of the Periodic Table to make batteries for electric and hybrid cars. And banning combustion engines from future cities.

Most of the world, that is. Except Mazda.

Mazda has a history of breaking off from the herd, especially when it comes to engines. Wankel rotary, anyone? Stop sniggering. And then there was ‘rightsizing’. While the VW Group, Fiat, Ford – the whole industry, even Ferrari – chopped cylinders and shrunk capacity from their engines and turbocharged everything in sight, Mazda ignored the trend. Stuck with 2.0-litre petrol engines, zero turbos, and while its cars couldn’t play the NEDC exam for laughs, driving them in the real world did tend to score similar economy. Mazda is small and likes to be brave.

Those engines were called SkyActiv-G, and used a very high compression ratio to maintain efficiency. The next generation of petrol Mazda engines take that principle to a new extreme. They’re branded as SkyActiv-X (pic 2, above), and instead of being hybridised or turbocharged, they use a piece of diesel nous to accelerate the chase for ‘the perfect engine’.

To explain what it does, we’ll need to get a bit technical, but don’t worry. If I’ve been able to understand it, it’s not rocket science (sorry, Elon). The more interesting question is perhaps why Mazda has decided to plough on pouring vast quantities of money – they won’t admit how much – into the internal combustion engine. We’ll come back to that.

To all intents and purpsoes, a SkyActiv-X petrol engine is a naturally aspirated 2.0-litre four-cylinder petrol engine. Mazda says it could do smaller or larger engines in principle – the tech would be applicable – but there’s no need right now.

The innovation comes in how the fuel-air mixture is ignited. Normally, a mix of 14.7:1 petrol and air is compressed by the piston then ignited with a spark plug. This release of energy forces the piston down the cylinder, turns the crankshaft, and boom, you’re converting liquefied dead dinosaur into an overtake.

Problem is, not all of the fuel is ignited at once. The flame takes time to travel through the cylinder, combusting all the fuel. And by that time, the piston has continued to move, racing away from the explosion. So you’ve got fuel that isn’t being burnt in time to effectively push the piston and power the engine, and in some cases, fuel that isn’t burned at all.

When every joule of energy is precious, that’s a sin. It’s very inefficient. Plus, having a big messy explosion like that generates more heat, which takes more energy from the cooling system to handle, which increases strain on the engine, and adds weight to the car, which… well, you get the idea.

The holy grail that Mazda’s been working on is a petrol engine that ignites all of its fuel-air mixture in one instant. Big bang, big push on the piston. Mazda’s head of European powertrain R&D Heiko Strietzel describes it as the difference between blowing up a balloon and letting go (unspectacular flatulent deflation) or blowing up the same balloon and introducing it intimately to a needle.

When Mazda fitted a prototype with the ECU from the current SkyActiv-G engine, the processor went into meltdown. It simply couldn’t keep up

To do that, Mazda runs a lean fuel-air mix (saving petrol) and compresses it massively, until it’s just under the threshold for compression ignition – the spontaneous boom you get inside a diesel engine when the fuel is mercilessly squashed. Problem is, in a petrol engine, this can lead to knock, where the fuel ignites at the wrong point in the engine’s stroke and it bends lots of metal and pays for your mechanics’ holiday cruise.

The other problem is that compression ignition works best when the engine isn’t cold-starting, or being asked for maximum acceleration. So, Mazda had to come up with a way to keep the drivability but run its new mega compression. And they’ve cracked it, with an acronym: SPCCI.

That stands for Spark-Controlled Compression Ignition. Quite simply, there’s still a spark plug per cylinder, and the engine runs conventionally when the demands from the driver best suit it. But thanks to a new ECU and pressure sensors, the SkyActiv-X engine will also switch to a very lean fuel mixture and use its spark plug to ignite the compressed fuel-air mix at the nanosecond before it auto-ignites, getting maximum efficiency from each bang.

To give you an idea how much computing power that takes, when Mazda fitted a prototype with the ECU from the current SkyActiv-G engine, the processor went into meltdown. It simply couldn’t keep up with the changing spark strategy of the new engine. Mazda says only very recent advances in computing tech have made this SPCCI engine – which Mercedes and VW have also dabbled with in the past – a production possibility.

So, the advantages. First and foremost – you’re using less fuel. The SkyActiv-X is targeting a lean-burn mode for 80 per cent of the time it’s running. Mazda thinks this could make its engine between 20-30 per cent more efficient than its current petrols. It also says the engine on its test bed is currently producing similar if not better economy than its SkyActiv-D diesel engines.

From less fuel, it also generates more power. Mazda is aiming for a 10-30 per cent increase in torque. The 2.0-litre version should be good for 189bhp and 170lb ft. Mazda’s best 2.0-litre engine currently develops 163bhp and 155lb ft, in case you were wondering.

Plus, the combustion temperature is cooler. So, the engine wastes less of its own energy powering a cooling system. And the cooling system can be smaller. And lighter. So the car gets a bit lighter. And takes less fuel to power it. And there’s more.

Because the lean-burn mode operates throughout the rev range, Mazda says the ‘X’ engines are happy to run at higher revs without drinking fuel. So, they’re going to fit future cars with shorter gearing and a shorter final drive ratio, for nippier performance, instead of the overgeared snorefest set-up that blights so much turbocharged stuff these days. Imagine that, in say, an MX-5. It’ll be like a little hillclimb sprinter.

The first SkyActiv-X engine won’t be ready for production until 2019, but the principles – the science – is very exciting.

Why though? Why invest in new petrol engines when the world is making a headlong rush to electrify all cars?

It comes down to three little words: well-to-wheel. Mazda says the fact that two-thirds of global electricity production still comes from non-renewable fossil fuels hurts the EV case. Fair point, really. Mazda’s current petrol engines put out around 142g/km of CO2, officially. If you include the CO2 created by generating the electricity to power a similarly sized electric car, an EV - though producing no local emissions - is responsible for a 128g/km footprint. Mazda thinks it can match or beat that with its new engines. With no range anxiety…

Its odd to hear a brand talking up the future of petrol – and diesel – in 2018. But Mazda says its long-term view is this is the best way of protecting the planet without compromising what we demand from our vehicles.

There’ll be an EV from Mazda in 2019, and its first plug-in hybrid in 2021. The company’s straight-talking European boss Jeff Guyton admits that battery-powered cars “aren’t our favourite technology” citing their weight, cost and the environmental impact of producing the cells. “But we have to be seen to offer them”, he says. Meanwhile, Mazda’s chase for the perfect combustion engine continues.

Pictured above: Mazda Vision Coupe