Deep below Mazda North America's research and development offices in Irvine, California, there is a basement. It is not so much a cellar, though, as a hallowed paddock for hard-charging thoroughbreds.

As the steel entrance door rolls upwards, lights turn on in sequence, revealing machines of various vintages, in varying states of undress. For fans of the rotary engine, it is nothing short of a treasure trove. Closest to the door is the RX-2 campaigned by Car & Driver magazine's Don Sherman in 1973. Modified for International Motorsports Association (IMSA) Racing Stock class, its 12a rotary unit produces 218 horsepower at a Ferrari-like 8,400rpm.

Without mufflers, it is easily the loudest thing down here. So ear-splitting is the racket that specialised sound-suppressors were fitted so mechanics would not go deaf when the engine idled in the garage. The RX-2 provided the first competition wins outside Japan for Mazda, establishing the brand's performance credentials right from the start.

The pinnacle of Mazda motorsport history is the orange and green-liveried 787B's win at the 1991 Le Mans 24 Hours endurance race. Mazda remains the only Japanese manufacturer to have won the premier prototype class, and while the race-winner currently sits at Mazda's factory museum in Hiroshima, its sister car is here, being fettled to race. While bodywork panels have been removed to facilitate a transmission service, the car itself looks essentially brand-new. It has also been modified.

“We call it the 'Davis Dimple,'” explains Jeremy Barnes, public relations director for Mazda North America (MNOA), gesturing towards a curious bump on the car’s canopy. “We had to custom-mould the door to make room, and pour a special seat.”

The roof bulge, or “dimple”, is reminiscent of the modification made to the Le Mans-winning Ford GT40 campaigned by Dan Gurney in the ‘60s, which required the change to accommodate its pilot’s long torso. Here, the tweaks were undertaken so Robert Davis, MNOA vice president of operations, could fit. Compared to the compact Japanese drivers who piloted this car to an eighth-place finish at Le Mans in 1991, Davis is a hulk, wearing the car like a 700hp, 1,800lb glove.

It doesn’t take long to suspect that nearly everyone at MNOA is involved with either racing or supporting these machines at heritage events. Barnes drives an IMSA RX-7 GTO at tracks such as Mazda Raceway Laguna Seca, on California’s Monterey peninsula. The RX-7 GTO is a 600hp beast that he says “is always trying to hurt you. That's why I like driving it so much.”

A more modern prototype racer is here as well, an RX-792P. Like the 787B, it is powered by a four-rotor, 700hp engine, and neither it nor any other machine here is driven gently on the track. “Our CEO Jim O'Sullivan told us, 'I want to have the cars run, and run up front,'” Barnes says.

They are also very well cared for. Randy Miller, a wiry young man with a megawatt grin and a rotary engine cutaway on his T-shirt, is charged with keeping the cars in fighting shape. “There's no Haynes manual for these things,” he quips, referencing a widely used series of mechanical guides. But he is clearly adept at his job; it doesn’t hurt that he is a certified master fabricator.

Tucked deeper in the basement is a vehicle the size of a CX-9 but with the aerodynamic properties of a lunchbox. Miller built this all-electric tool transporter from scratch, having tired of lugging tool chests back and forth to the race pits, and it includes a generator, car-lift and row upon row of sliding drawers.

Mazda works with several restoration companies to complete their cars, but also has considerable in-house resources. The mirrors on the 787B, for example, as well as the "Davis Dimple", were custom-made on premises. Miller doesn't always have to work alone either, as many staff members volunteer their time and talent to get things ready for race weekends.

This commitment to racing infuses many of the rare street cars tucked away among the competition vehicles. There are oddities such as a Japan-only three-rotor twin-turbo Cosmo from the 1990s, as well as a 1967 Luce coupe: the only front-wheel-drive rotary-powered car Mazda ever made.

More prosaically, an extremely low-mileage 1978 GLC hatchback stands as an example of the practical vehicles that helped foot the extravagant racing bills. Next to it, a turbocharged, all-wheel-drive 323 GTX demonstrates that Mazda could engineer fun into even their lowliest of econoboxes. A row of street-driven RX-7s includes a pace car, as well as the only left-hand-drive Spirit R – a special edition produced for the right-drive Japanese market – ever made.

Strictly speaking, this last one might not be considered part of the final run of RX-7s, as it was specially built at the factory for an MNOA executive. It has lightweight Recaros, upgraded brakes, specialised engine tuning and bespoke aerodynamic elements. It is also – at least during this visit – broken.

Next to the RX-7s are a few open spaces, evidence of some missing cars. These are currently upstairs, and are perhaps better loved than any other machines down below.

This year is the 25th anniversary for the Miata – also marketed as the MX-5 and Eunos Roadster – the best-selling sports car the world has ever seen. It conveys all the fierce joy of the racing cars down here, but in a tidier, admittedly more reliable little package suited to public roads. Cleaned up and drained of fuel, the cars are being readied for the 2014 New York auto show, where press previews begin 16 April. Among them are the original cars displayed at the model's 1989 Chicago auto show debut – one red, one blue – that are respectively the 14th and 15th Miatas ever produced. A supercharged concept called the Super20 has just returned from a trip to Alaska, where it cavorted with a local Miata owners club.

Further on, there are the concepts: a sleek third-generation Miata Spyder, a flared yellow first-generation car that sat alongside the stock originals at Chicago, and a one-off fastback coupe.

Southern California is the birthplace of the Miata, where the original design was carved in clay, and where the suspension and handling were refined. An original model touched by the hands of designer Tom Matano is down here, too.

Among the New York-bound Miatas is a white, slightly ratty, showroom-stock racing car. Reaching into the cockpit, Barnes pulls out the original Sports Car Association of America logbook and flips it to the first page, dated 23 September 1989. This car also shared the Chicago stage in 1989 with the red and blue cars, but would go on to podiums of another kind. Compared to the mighty beasts that sleep below, it is a simple thing, but no less battle-hardened. It makes, in fact, a nice spirit animal for Mazda as a whole: small, energetic, quietly obsessed with going fast.

Such traits do not lend themselves neatly to a museum format. But this is a paddock, remember, and its occupants were born to gallop – even right through retirement.